Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Packets slowly drift further and further randomly when played or sent using tcpreplay #829

Closed
anoopcc99 opened this issue Nov 9, 2023 · 2 comments

Comments

@anoopcc99
Copy link

Describe the bug
take a time sensitive pcap file and send it interface using tcpreplay, the captured packets at the other end of interface seen does not honor the packet interval time difference, instead varies randomly.
transmit pcap file:
image

Captured pcap file:
image

Time Drift:
Picture1

To Reproduce
Steps to reproduce the behavior:

  1. take any timestamp based pcap file
  2. send the pcap file using tcpreplay to the interface
  3. capture the incoming packets on other end on interface
  4. note the time drift

Expected behavior
I would expect the time drift to be constant or minimum.

System (please complete the following information):

  • OS: "Ubuntu 22.04 LTS"
  • OS version: "22.04 LTS (Jammy Jellyfish)"
  • TcpReplay Version: 4.3.4
@Weissle
Copy link

Weissle commented Dec 5, 2023

Met this issue before.
When we replay with the origin speed, tcpreplay sleeps according to the time gap between two package.
However, the overhead like sending package and waking up thread are ignored. These overheads are accumulated little by little which lead to the drift.
relative code is here. https://github.com/appneta/tcpreplay/blob/43693c4a92dda227a5134ae5e71a7247ae345323/src/send_packets.c#L468C23-L468C23

@fklassen
Copy link
Member

fklassen commented Jun 8, 2024

I think the graph is pretty good. Much of what you are seeing is the delay from when the packet was sent until it was copied and recorded for packet capture. Usually I expect around 200-400 usec before it leaves a NIC card, so I am pretty happy with this. I am especially impressed by the fact that it levels off after a just a few packets.

What hardware are you using? Is this a VM or docker? I expect that this is pretty good hardware if the results are this good.

I will close as not-a-bug.

@fklassen fklassen closed this as completed Jun 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants