Timestamps for TCP packets?

T

Thomas Johnson

Is there any way to get kernel-level timestamps for TCP packets while
still using the standard python sockets library for communication? I
need to communicate over a TCP connection as easily as possible, but
also record the timestamps of the incoming and outgoing timestamps at
microsecond or nanosecond resolution.

The sockets library is of course great for the communication, and I've
seen some python libraries that do packet sniffing and record
timestamps, but it's not clear that I can do both at the same time.
 
M

Miles Kaufmann

Is there any way to get kernel-level timestamps for TCP packets while
still using the standard python sockets library for communication? I
need to communicate over a TCP connection as easily as possible, but
also record the timestamps of the incoming and outgoing timestamps at
microsecond or nanosecond resolution.

The sockets library is of course great for the communication, and I've
seen some python libraries that do packet sniffing and record
timestamps, but it's not clear that I can do both at the same time.

Have you tried it? I don't know of any reason that using sockets and
doing a packet capture would interfere with each other. What are you
trying to accomplish with the packet sniffing, though?

-Miles
 
G

Grant Edwards

Is there any way to get kernel-level timestamps for TCP packets while
still using the standard python sockets library for communication?
libpcap

http://sourceforge.net/projects/pylibpcap/

I need to communicate over a TCP connection as easily as
possible, but also record the timestamps of the incoming and
outgoing timestamps at microsecond or nanosecond resolution.

That shouldn't be a problem, except for the communication API
and the capture-packets-with-timestamp API are separate.
Remember that there's no guarantee that send() recv() calls
correspond in any way to the actual packets sent/recevied.
The sockets library is of course great for the communication,
and I've seen some python libraries that do packet sniffing
and record timestamps, but it's not clear that I can do both
at the same time.

Yes, you can do both at the same time. But you have to use
separate APIs.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,731
Messages
2,569,432
Members
44,832
Latest member
GlennSmall

Latest Threads

Top