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: [email protected] [[email protected]] on 
behalf of Sašo Piskar [[email protected]]
Sent: Monday, October 08, 2012 5:20 AM
To: [email protected]
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



_______________________________________________
Winpcap-users mailing list
[email protected]
https://www.winpcap.org/mailman/listinfo/winpcap-users

Reply via email to