Hi,<br><br><div class="gmail_quote">2009/5/5 Gianluca Varenni <span dir="ltr"><<a href="mailto:gianluca.varenni@cacetech.com">gianluca.varenni@cacetech.com</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div bgcolor="#ffffff">
<div><font size="2"></font> </div>
<blockquote style="border-left: 2px solid rgb(0, 0, 0); padding-right: 0px; padding-left: 5px; margin-left: 5px; margin-right: 0px;"><div class="im">
<div style="font-family: arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">----- Original Message ----- </div>
<div style="background: rgb(228, 228, 228) none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; font-family: arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">
<b>From:</b>
<a title="locationdev@gmail.com" href="mailto:locationdev@gmail.com" target="_blank">John
Wang</a> </div>
<div style="font-family: arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"><b>To:</b> <a title="winpcap-users@winpcap.org" href="mailto:winpcap-users@winpcap.org" target="_blank">winpcap-users@winpcap.org</a> </div>
</div><div class="im"><div style="font-family: arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"><b>Sent:</b> Saturday, May 02, 2009 8:45
PM</div>
<div style="font-family: arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"><b>Subject:</b> Re: [Winpcap-users] Where does
the Winpcap timestamp come from?andothers</div>
<div><br></div>Hi ,<br><br><br>
<div class="gmail_quote">
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div bgcolor="#ffffff">
<div><font size="2"></font>
<div>>>2. Which function in the NPF or Packet.dll can be used
as a trigger to request CPU timer, like queryperformancecounter (), to
>>timestamp the arrival packet to obatin higher precision?</div></div>
<div><font size="2"></font> </div>
<div><font size="2">>>--GV--</font></div>
<div><font size="2">>>There is no way to obtain higher precision than we
are currently using in WinPcap, apart from using custom hardware that
>>timestamps the packets in the hardware itself.</font></div><font size="2"></font>
<div><font size="2">>>--GV--</font></div></div></blockquote><font size="2"></font>
<div><br><span style="color: rgb(51, 51, 255); background-color: rgb(255, 255, 255);">Is there any
possible to know that which function inside WinPcap is used to timestamp the
packets?</span><br></div></div></div></blockquote>
<div><font size="2">The functions used to timestamp packets are in the driver
code, in the file time_calls.h. Packets are timestamped in function "NPF_Tap",
look for "GET_TIME"</font></div><div class="im">
<blockquote style="border-left: 2px solid rgb(0, 0, 0); padding-right: 0px; padding-left: 5px; margin-left: 5px; margin-right: 0px;"><font size="2"></font>
<div class="gmail_quote"><font size="2"></font><br><br></div>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div bgcolor="#ffffff">
<div>
<div><br>>>4. Can I reduce the size of the user buffer inside
the NPF to set it small enough to triger the CPU timer to timestamp when
>>every packet is arrival?<br></div></div>
<div><font size="2">>>-GV--</font></div>
<div><font size="2">>>Timestamps are generated before the packet is
stored in the buffers. So changing the buffer size doesn't
help.</font></div>
<div><font size="2">>>--GV--</font></div>
<div>
<div><font size="2"></font> </div></div></div></blockquote>
<div class="gmail_quote"><span style="color: rgb(51, 51, 255); background-color: rgb(255, 255, 255);">Because I
try to timestamp the arrival packets again by using my timing functions, I'm
looking for a trigger. As I know, the frequency of NPF copying the arrival
packets from kernel space to user space depends on the size of user buffer. If
I can set the size of user buffer as same as the size of one arrival packet,
then, the NPF would copy every single packet from kernel space to user
space</span><br style="color: rgb(51, 51, 255);"><span style="color: rgb(51, 51, 255);">once the packet arrives. And I can use this
operation as a trigger to timestamp the arrival packet again with my timing
functions, am I right?</span><br style="background-color: rgb(51, 204, 255);"></div><font size="2"></font></blockquote>
</div><div><font size="2">You don't want to do that. Unless you want to kill your
application performance. What exactly are you trying to achieve with your timing
functions vs. the timestamps generated by WinPcap?</font></div>
<div><font size="2"></font> </div><font color="#888888"></font></div></blockquote><div><br><font color="#3333ff">I'm trying to record the packets arrival
timestamp in nanosecond precision. Then I will compare the arrival
timestamp with a microsecond precision transmitting timesamp from the
transmitter to explore the performance of wireless network. If my
method can't work, do you have any suggestion how can I get the nanosecond packets arrival timestamp from the wireless adapter or Winpcap?<br><br>Cheers<br><br>John<br></font></div></div><br>