When I was trying to run iperf3 tests for an indefinite amount of time, I tried the client parameter -t -1 instead of the supported and documented -t 0. Because the tests "ran" and the CLI tool didn't complain about the input, I assumed this was "ok". Furthermore, the test indeed seemed to run "indefinitely" instead of the standard 10. However, the application quits with failure after precisely 38 seconds on my test hardware.
Version of iperf3:
iperf 3.9 (cJSON 1.7.13)
from apt package version 3.9-1+deb11u1build0.22.04.1 for Ubuntu 22.04
Hardware:
Custom hardware device, using i226-V NICs and an Intel Celeron.
Operating system (and distribution, if any):
Ubuntu 22.04 Desktop
Other relevant information (for example, non-default compilers,
libraries, cross-compiling, etc.):
Installed from apt repo on a vanilla Ubuntu install.
Bug Report
Expected Behavior
The test would either run indefinitely, or the application would reject the -t -1 parameter.
Actual Behavior
The test initiates, but will eventually crash.
Steps to Reproduce
I simply connect together two NICs (enp1s0 and enp2s0) on the device with an ethernet cable (not going through a switch)
Namespace the NICs so that the data actually flows over the cable and not shortcutting through the kernel:
# In one terminal for the iperf server:
ip net add iperfserver
ip link set enp1s0 netns iperfserver
ip netns exec iperfserver ip address add 169.254.1.1/20 dev enp1s0
ip netns exec iperfserver ip link set enp1s0 up
ip netns exec iperfserver iperf3 -s -B 169.254.1.1
In another terminal for the iperf client:
ip net add iperfclient
ip link set enp2s0 netns iperfclient
ip netns exec iperfclient ip address add 169.254.1.2/20 dev enp2s0
ip netns exec iperfclient ip link set enp2s0 up
3. On the client terminal, run the iperf3 command like so, using `-t -1` or `-t=-1` or `--time -1` or `--time=-1`:
ip netns exec iperfclient iperf3 -c 169.254.1.1 -t -1
4. Observe the results in the server terminal after (in my case) 38 seconds
6. Re-run the same test but substitute `-t -1` with either `-t 0` or `-t 40` (since mine fails at 38 seconds) and the test will properly conduct without error.
* Possible Solution
Reject clients trying to use `-t -1` or treat it the same as `-t 0`
Context
When I was trying to run iperf3 tests for an indefinite amount of time, I tried the client parameter
-t -1
instead of the supported and documented-t 0
. Because the tests "ran" and the CLI tool didn't complain about the input, I assumed this was "ok". Furthermore, the test indeed seemed to run "indefinitely" instead of the standard 10. However, the application quits with failure after precisely 38 seconds on my test hardware.Version of iperf3: iperf 3.9 (cJSON 1.7.13) from apt package version 3.9-1+deb11u1build0.22.04.1 for Ubuntu 22.04
Hardware: Custom hardware device, using i226-V NICs and an Intel Celeron.
Operating system (and distribution, if any): Ubuntu 22.04 Desktop
Other relevant information (for example, non-default compilers, libraries, cross-compiling, etc.): Installed from apt repo on a vanilla Ubuntu install.
Bug Report
The test would either run indefinitely, or the application would reject the
-t -1
parameter.The test initiates, but will eventually crash.
In another terminal for the iperf client:
ip net add iperfclient ip link set enp2s0 netns iperfclient ip netns exec iperfclient ip address add 169.254.1.2/20 dev enp2s0 ip netns exec iperfclient ip link set enp2s0 up
ip netns exec iperfclient iperf3 -c 169.254.1.1 -t -1
[ 5] 37.00-38.00 sec 235 Mbytes 1.97 Gbits/sec iperf3: error - select failed: Bad file descriptor
Server listening on 5201
[ 5] 37.00-38.00 sec 235 Mbytes 1.97 Gbits/sec 0 1008 KBytes iperf3: error - unable to write to stream socket: Broken pipe root@localhost:~#