Skip to content

[Bug] --pps rate limit ignored in 4.6.1 -- replays at ~150k pps instead of 1 pps (regression vs 4.4.4) #1150

Description

@gbritoda

Tcpreplay version

4.6.1

Operating system

Linux

OS version / distro

Ubuntu 22.04.5 LTS

Exact command line

sudo /opt/tcpreplay-4.6.1/bin/tcpreplay  --intf1=lo -q -T select --loop=0 --pps=1 --preload-pcap  --duration=10 /home/gbritoda/repos/test-single.pcap

Expected behavior

>>> sudo /opt/tcpreplay-4.4.4/bin/tcpreplay  --intf1=lo -q -T select --loop=0 --pps=1 --preload-pcap  --duration=10 /home/gbritoda/repos/test-single.pcap
Warning: Unsupported physical layer type 0x0304 on lo.  Maybe it works, maybe it won't.  See tickets #123/318
Actual: 11 packets (4576 bytes) sent in 10.00 seconds
Rated: 457.5 Bps, 0.003 Mbps, 1.09 pps
Flows: 1 flows, 0.09 fps, 1 unique flow packets, 0 unique non-flow packets
Statistics for network device: lo
        Successful packets:        11
        Failed packets:            0
        Truncated packets:         0
        Retried packets (ENOBUFS): 0
        Retried packets (EAGAIN):  0

Actual behavior

>>> sudo /opt/tcpreplay-4.6.1/bin/tcpreplay  --intf1=lo -q -T select --loop=0 --pps=1 --preload-pcap  --duration=10 /home/gbritoda/repos/test-single.pcap
Warning: Unsupported physical layer type 0x0304 on lo.  Maybe it works, maybe it won't.  See tickets #123/318
Actual: 1530241 packets (636580256 bytes) sent in 10.00 seconds
Rated: 63616274.2 Bps, 508.93 Mbps, 152923.73 pps
Flows: 1 flows, 0.09 fps, 1 unique flow packets, 0 unique non-flow packets
Statistics for network device: lo
        Successful packets:        1530241
        Failed packets:            0
        Truncated packets:         0
        Retried packets (ENOBUFS): 0
        Retried packets (EAGAIN):  0

How to reproduce it

tcpreplay 4.4.4 seems to be the last one that actually respects the --pps parameter, anything above that seems to silently ignore it. I have seen this issue back when I updated to tcpreplay 4.5.1 but I assumed that one of the open issues at the time was going to fix it. So it definitely seems to be something between the two versions.

Steps:

  1. Capture a single packet so it can be reproduced sudo tcpdump -i lo -c 1 -w test-single.pcap
  2. On tcpreplay latest run tcpreplay --intf1=lo -q -T select --loop=0 --pps=1 --preload-pcap --duration=10 /home/gbritoda/repos/test-single.pcap
  3. You'd expect --duration=10 x --pps=1 to be around 10 Packets successfully sent, we get a lot more (in the example above, 1530241 packets)
  4. Run the same command for tcpreplay 4.4.4 and you won't see this. You will see 10 packets (or close)

See below confirming the versions I have used for the examples above:

>>> /opt/tcpreplay-4.6.1/bin/tcpreplay --version
Warning: May need to run as root to get access to all network interfaces.
tcpreplay version: 4.6.1 (build git:v4.6.1)
Copyright 2013-2026 by Fred Klassen <tcpreplay.dev at gmail dot com> - AppNeta by Broadcom
Copyright 2000-2012 by Aaron Turner <aturner at synfin dot net>
The entire Tcpreplay Suite is licensed under the GPLv3
Cache file supported: 04
Not compiled with libdnet.
Compiled against libpcap: 1.10.1
64 bit packet counters: enabled
Verbose printing via tcpdump: enabled
Packet editing: disabled
Fragroute engine: disabled
Injection method: PF_PACKET / TX_RING
Not compiled with netmap
Not compiled with AF_XDP
Not compiled with io_uring
>>> /opt/tcpreplay-4.4.4/bin/tcpreplay --version
Warning: May need to run as root to get access to all network interfaces.
tcpreplay version: 4.4.4 (build git:v4.4.4)
Copyright 2013-2022 by Fred Klassen <tcpreplay at appneta dot com> - AppNeta
Copyright 2000-2012 by Aaron Turner <aturner at synfin dot net>
The entire Tcpreplay Suite is licensed under the GPLv3
Cache file supported: 04
Not compiled with libdnet.
Compiled against libpcap: 1.10.1
64 bit packet counters: enabled
Verbose printing via tcpdump: enabled
Packet editing: disabled
Fragroute engine: disabled
Injection method: PF_PACKET send()
Not compiled with netmap

Before submitting

  • I searched existing issues and didn't find this already reported.
  • I reproduced this on the latest release (or master, if intentionally testing an unreleased fix).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions