[Winpcap-users] Timestamping
Black, Michael (IS)
Michael.Black2 at ngc.com
Mon Oct 8 05:46:36 PDT 2012
Somebody correct me if I'm wrong here....
But I do believe your statement "time when packet came to computer" is wrong. It's tagged with "time when packet came to winpcap".
Most OS's (all that I know of) have a TCP queue in the OS. Winpcap retrieves from that and then tags. So packets can queue up without being time tagged for a short while.
What time drift are you trying to fix? Does the computer you're running winpcap on have a problem? Can't you just run NTP to fix that? It automatically adjusts for drift on your computer clock.
http://www.meinberg.de/english/sw/ntp.htm#ntp_nt_stable
NTP can usually achieve 1ms accuracy so you'll be left with some jitter for "time to winpcap" which should be notably sub 1ms but at least that jitter will not be drifiting on you.
Michael D. Black
Senior Scientist
Advanced Analytics Directorate
Advanced GEOINT Solutions Operating Unit
Northrop Grumman Information Systems
________________________________
From: winpcap-users-bounces at winpcap.org [winpcap-users-bounces at winpcap.org] on behalf of Sašo Piskar [saso.piskar at dewesoft.si]
Sent: Monday, October 08, 2012 5:20 AM
To: winpcap-users at winpcap.org
Subject: EXT :[Winpcap-users] Timestamping
Hello,
I am writing program to sniff ethernet packets.
With "pcap_next_ex" I nomally get the timestamp of the packet.
As I understand, timestamps are calculated with queryperformancecounter in the winpcap driver.
I need to synchronize those packets to some other clock (external device) to fix time drift problem.
If I just use timestamp of received packet, this is actually time when packet came to computer. I would also need to get current time (as precise as possible) in order to be able to synchronize packet timestamp with external clock.
Is there any way to get current clock from winpcap driver?
Best Regards,
Sašo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.winpcap.org/pipermail/winpcap-users/attachments/20121008/57b441f0/attachment.html>
More information about the Winpcap-users
mailing list