Packet Arrival time different in recieving endpoint

38 views Asked by At

I have two VM ubuntu connected to each other with 10G HP NIC card, now I want to play packets from a .pcap file on one vm and receive packets on another vm, but there is one condition that it has to honor timestamp present in the pcap file on the receiving side of vm.

Now just to verify the packet play based on the packet interval using the libpcap library in C code I sent the first packet and after 71.5us(vm1 system time) I sent the second packet now when I capture the RX packets using the tcpdump on the 2nd VM the 2nd packet is arriving at 495ns instead of being close to 71.5us why is this happening?

Timestamp honor is not met on the receiving side of the vm using tcpdump

1

There are 1 answers

1
John Bollinger On

As I understand it, you are replaying captured packets on the sending side. There is then no direct control there over when the replayed packets will be received on the other end.

Generally speaking, the kernel does not operate synchronously with userspace programs. When you hand off a packet to the kernel for it to send, the system call does not block until the packet is actually transmitted, much less until it is successfully received and acknowledged. There are multiple reasons why the outbound packets might be subject to inconsistent send delays, especially on the microsecond scale. There are also reasons why packets inbound on the other side might manifest inconsistent delays.

Timestamp honor is not met on the receiving side of the vm using tcpdump

I don't see any reason to expect that it would be. At least not at tens of microsecond resolution.