[Winpcap-users] Getting timestamp while waiting for packets

Gianluca Varenni gianluca.varenni at cacetech.com
Sun Dec 21 19:33:22 GMT 2008


In order to have max responsiveness you should put a very low timeout and 
set the mintocopy to a very low value (e.g. 30bytes) so that packets are 
delivered to you as soon as they are received by the WinPcap kernel driver.

Please consider that it's entirely possible that a buffering scheme (like 
the one used by WinPcap) can be in use by the CAN bus drivers as well (this 
is obviously just pure speculation).

Have a nice day
GV

----- Original Message ----- 
From: "Merello Andrea" <andrea.merello at iit.it>
To: <winpcap-users at winpcap.org>
Sent: Tuesday, December 16, 2008 12:55 AM
Subject: RE: [Winpcap-users] Getting timestamp while waiting for packets


Thank you for your reply!

So I realize that quite a lot of times I call pcap_next_ex I get nothing. No 
pakets, and also no timestamp.
This arise a new question: Is there any way to block the caller until a new 
packet arrives?

I am now in nonblocking mode, because it's critical for me to get a packet 
immediately when it arrives, avoiding to wait for other packets and for the 
timeout, but in this way the reader thread wastes system CPU..

What I'm trying to do is to create graphs in real time from information 
acquired at the same time from a serial bus, a CAN bus, and an ethernet 
card.. Just to give an idea of because we would like this behavior from 
winpcap :-)

Thanks
Andrea


-----Original Message-----
From: winpcap-users-bounces at winpcap.org on behalf of Merello Andrea
Sent: Fri 12/12/2008 9:20 AM
To: winpcap-users at winpcap.org
Subject: [Winpcap-users] Getting timestamp while waiting for packets


Hi,
We are developing an application (win32) that needs getting raw packets from 
ethernet NICs, and we thought immediately to winpcap, however reading the 
API documentation I couldn't solve a couple of doubt about winpcap...

We would like to have an accurate timestamp on each received packet, and we 
see winpcap tag effectively each packet with the timestamp, but we need also 
to know the value of the timestamp clock even when no packet is arriving (to 
keep in sync, and detect drift and latency, with other sources of packets on 
different medias, like CAN-BUS).

Is there any way to do this?

Also how the timestamping is done? Is it simply a software tagging from the 
system clock?


Thank you
Andrea

_______________________________________________
Winpcap-users mailing list
Winpcap-users at winpcap.org
https://www.winpcap.org/mailman/listinfo/winpcap-users




--------------------------------------------------------------------------------


> _______________________________________________
> Winpcap-users mailing list
> Winpcap-users at winpcap.org
> https://www.winpcap.org/mailman/listinfo/winpcap-users
> 



More information about the Winpcap-users mailing list