iperf icon indicating copy to clipboard operation
iperf copied to clipboard

iperf3: error - unable to receive control message: Connection timed out

Open bobbyrussell opened this issue 11 years ago • 5 comments

Problem

I am having an issue with iperf3, where at the end of a timed test session, the connection between the iperf3 server and client does not close correctly.

The test bed looks like this:

  • Command Server (128.0.0.2) - Connected to a dumb switch. This is used to issue commands to the clients
  • Switch
  • Client (128.0.1.9) - A Raspberry Pi with the latest version of iperf3. One interface is connected to the dumb switch, the other is connected to a gateway
  • Gateway (192.168.0.1) - Gateway for traffic to and from the server
  • Server (10.123.126.2) - A Debian machine running an iperf3 server

Expected behaviour

The iperf3 client should open a session with the iperf3 server, report some data to stdout every ith second, close the session, and report some more data

What is Actually Happening

The iperf3 client opens a session with the iperf3 server, reports some data to standard out every ith second up until the last few seconds of the run, then hangs for about 15 minutes before reporting this message:

iperf3: error - unable to receive control message: Connection timed out

This bug occurs whenever the run lasts for more than 10 minutes or so (i.e., whenever the -t >= 600).

Recreating the bug

command@server ~ $ /usr/bin/ssh -t -t [email protected] "/bin/bash -O huponexit -c '/usr/local/bin/iperf3 -c 10.123.126.2 -p 1309 -b 1M -t 3600 -i 60'"

Output:

Logging STDOUT and STDERR beginning on Fri Oct 30 11:26:27 2015
Connecting to host 10.123.126.2, port 1309
[ 4] local 192.168.0.11 port 51042 connected to 10.123.126.2 port 1309
[ ID] Interval Transfer Bandwidth Retr Cwnd
[ 4] 0.00-60.00 sec 7.16 MBytes 1.00 Mbits/sec 0 29.7 KBytes
[ 4] 60.00-120.00 sec 7.13 MBytes 997 Kbits/sec 0 31.1 KBytes
[ 4] 120.00-180.00 sec 7.19 MBytes 1.01 Mbits/sec 0 29.7 KBytes
[ 4] 180.00-240.00 sec 7.13 MBytes 997 Kbits/sec 0 26.9 KBytes
[ 4] 240.00-300.00 sec 7.13 MBytes 997 Kbits/sec 0 31.1 KBytes
[ 4] 300.00-360.00 sec 7.19 MBytes 1.01 Mbits/sec 0 31.1 KBytes
[ 4] 360.00-420.00 sec 7.13 MBytes 997 Kbits/sec 0 32.5 KBytes
[ 4] 420.00-480.00 sec 7.13 MBytes 997 Kbits/sec 0 29.7 KBytes
[ 4] 480.00-540.00 sec 7.19 MBytes 1.01 Mbits/sec 0 32.5 KBytes
[ 4] 540.00-600.00 sec 7.13 MBytes 997 Kbits/sec 0 29.7 KBytes
[ 4] 600.00-660.00 sec 7.13 MBytes 997 Kbits/sec 0 29.7 KBytes
[ 4] 660.00-720.00 sec 7.19 MBytes 1.01 Mbits/sec 0 32.5 KBytes
[ 4] 720.00-780.00 sec 7.13 MBytes 997 Kbits/sec 0 31.1 KBytes
[ 4] 780.00-840.00 sec 7.13 MBytes 997 Kbits/sec 0 29.7 KBytes
[ 4] 840.00-900.00 sec 7.19 MBytes 1.01 Mbits/sec 0 31.1 KBytes
[ 4] 900.00-960.00 sec 7.13 MBytes 997 Kbits/sec 0 31.1 KBytes
[ 4] 960.00-1020.00 sec 7.13 MBytes 997 Kbits/sec 0 31.1 KBytes
[ 4] 1020.00-1080.00 sec 7.19 MBytes 1.01 Mbits/sec 0 31.1 KBytes
[ 4] 1080.00-1140.00 sec 7.13 MBytes 997 Kbits/sec 0 29.7 KBytes
[ 4] 1140.00-1200.00 sec 7.13 MBytes 997 Kbits/sec 0 31.1 KBytes
[ 4] 1200.00-1260.00 sec 7.19 MBytes 1.01 Mbits/sec 0 32.5 KBytes
[ 4] 1260.00-1320.00 sec 7.13 MBytes 997 Kbits/sec 0 29.7 KBytes
[ 4] 1320.00-1380.00 sec 7.13 MBytes 997 Kbits/sec 0 31.1 KBytes
[ 4] 1380.00-1440.00 sec 7.19 MBytes 1.01 Mbits/sec 0 31.1 KBytes
[ 4] 1440.00-1500.00 sec 7.13 MBytes 997 Kbits/sec 0 31.1 KBytes
[ 4] 1500.00-1560.00 sec 7.13 MBytes 997 Kbits/sec 0 32.5 KBytes
[ 4] 1560.00-1620.00 sec 7.19 MBytes 1.01 Mbits/sec 0 32.5 KBytes
[ 4] 1620.00-1680.00 sec 7.13 MBytes 997 Kbits/sec 0 31.1 KBytes
[ 4] 1680.00-1740.00 sec 7.13 MBytes 997 Kbits/sec 0 32.5 KBytes
[ 4] 1740.00-1800.00 sec 7.19 MBytes 1.01 Mbits/sec 0 32.5 KBytes
[ 4] 1800.00-1860.00 sec 7.13 MBytes 997 Kbits/sec 0 32.5 KBytes
[ 4] 1860.00-1920.00 sec 7.13 MBytes 997 Kbits/sec 0 31.1 KBytes
[ 4] 1920.00-1980.00 sec 7.19 MBytes 1.01 Mbits/sec 0 29.7 KBytes
[ 4] 1980.00-2040.00 sec 7.13 MBytes 997 Kbits/sec 0 29.7 KBytes
[ 4] 2040.00-2100.00 sec 7.13 MBytes 997 Kbits/sec 0 33.9 KBytes
[ 4] 2100.00-2160.00 sec 7.19 MBytes 1.01 Mbits/sec 0 29.7 KBytes
[ 4] 2160.00-2220.00 sec 7.13 MBytes 997 Kbits/sec 0 31.1 KBytes
[ 4] 2220.00-2280.00 sec 7.13 MBytes 997 Kbits/sec 0 32.5 KBytes
[ 4] 2280.00-2340.00 sec 7.19 MBytes 1.01 Mbits/sec 0 31.1 KBytes
[ 4] 2340.00-2400.00 sec 7.13 MBytes 997 Kbits/sec 0 29.7 KBytes
[ 4] 2400.00-2460.00 sec 7.13 MBytes 997 Kbits/sec 0 28.3 KBytes
[ 4] 2460.00-2520.00 sec 7.19 MBytes 1.01 Mbits/sec 0 31.1 KBytes
[ 4] 2520.00-2580.00 sec 7.13 MBytes 997 Kbits/sec 0 31.1 KBytes
[ 4] 2580.00-2640.00 sec 7.13 MBytes 997 Kbits/sec 0 29.7 KBytes
[ 4] 2640.00-2700.00 sec 7.19 MBytes 1.01 Mbits/sec 0 31.1 KBytes
[ 4] 2700.00-2760.00 sec 7.13 MBytes 997 Kbits/sec 0 31.1 KBytes
[ 4] 2760.00-2820.00 sec 7.13 MBytes 997 Kbits/sec 0 31.1 KBytes
[ 4] 2820.00-2880.00 sec 7.19 MBytes 1.01 Mbits/sec 0 29.7 KBytes
[ 4] 2880.00-2940.00 sec 7.13 MBytes 997 Kbits/sec 0 31.1 KBytes
[ 4] 2940.00-3000.00 sec 7.13 MBytes 997 Kbits/sec 0 31.1 KBytes
[ 4] 3000.00-3060.00 sec 7.19 MBytes 1.01 Mbits/sec 0 32.5 KBytes
[ 4] 3060.00-3120.00 sec 7.13 MBytes 997 Kbits/sec 0 28.3 KBytes
[ 4] 3120.00-3180.00 sec 7.13 MBytes 997 Kbits/sec 0 31.1 KBytes
[ 4] 3180.00-3240.00 sec 7.19 MBytes 1.01 Mbits/sec 0 31.1 KBytes
[ 4] 3240.00-3300.00 sec 7.13 MBytes 997 Kbits/sec 0 31.1 KBytes
[ 4] 3300.00-3360.00 sec 7.13 MBytes 997 Kbits/sec 0 29.7 KBytes
[ 4] 3360.00-3420.00 sec 7.19 MBytes 1.01 Mbits/sec 0 31.1 KBytes
[ 4] 3420.00-3480.00 sec 7.13 MBytes 997 Kbits/sec 0 31.1 KBytes
[ 4] 3480.00-3540.00 sec 7.13 MBytes 997 Kbits/sec 0 31.1 KBytes
iperf3: error - unable to receive control message: Connection timed out
Connection to 128.0.1.9 closed.
Logging STDOUT and STDERR ending on Fri Oct 30 12:42:05 2015

Sys info

psvt@cmts ~ $ iperf3 --version
iperf 3.1
Linux cmts 3.2.0-4-amd64 #1 SMP Debian 3.2.65-1+deb7u2 x86_64
Optional features available: CPU affinity setting, IPv6 flow label, TCP congestion algorithm setting, sendfile / zerocopy

pi@ARe1 ~ $ iperf3 --version
iperf 3.1
Linux ARe1 3.12.26+ #707 PREEMPT Sat Aug 30 17:39:19 BST 2014 armv6l
Optional features available: CPU affinity setting, IPv6 flow label, TCP congestion algorithm setting, sendfile / zerocopy

No matter what the -t value is, as long as it is over 600 or so, the same behaviour is exhibited -- iperf3 runs until just a few seconds before the run is scheduled to end, waits for about 15 minutes, then complains about not receiving a control message because of a Connection timeout.

SSH TCPKeepAlive is on. I can confirm using tcpdump that there is network activity over that port right up until the end of the run is scheduled, and then nothing during the timeout period. I have tried to recreate the problem using pv and netcat, and am unable to, which leads me to believe that this is a iperf3 problem.

Not sure how to move forward. Could you suggest another setting to look at? Perhaps this is a bug with iperf3?

bobbyrussell avatar Oct 30 '15 22:10 bobbyrussell

unable to replicate. closing.

bltierney avatar Mar 30 '17 18:03 bltierney

I have the same problem setting high -t values. the full command is:

iperf3 -t 3600 --get-server-output -c X.X.X.X -R -J > dati_1h.json The iperf run for about 1h and 20 minutes and at the bottom of the json file the first level "end" field is empty and I have the following key-value at the same level:

"error": "error - unable to receive control message: Connection timed out"

Mellgood avatar Mar 20 '21 11:03 Mellgood

@Mellgood What iperf3 version you are using (from iperf -v)? Also, if you are running the same test without the --get-server-output parameter is it run o.k.?

davidBar-On avatar Mar 22 '21 11:03 davidBar-On

Thank you @davidBar-On . I have just noticed that on my server the output of iperf3 -v is: iperf 3.7 (cJSON 1.5.2) Linux server1 5.4.0-67-generic #75-Ubuntu SMP Fri Feb 19 18:03:38 UTC 2021 x86_64 Optional features available: CPU affinity setting, IPv6 flow label, SCTP, TCP congestion algorithm setting, sendfile / zerocopy, socket pacing, authentication

On my client it is: iperf 3.1.3 Linux client1 5.4.0-67-generic #75~18.04.1-Ubuntu SMP Tue Feb 23 19:17:50 UTC 2021 x86_64 Optional features available: CPU affinity setting, IPv6 flow label, TCP congestion algorithm setting, sendfile / zerocopy, socket pacing

Can it be a version related issue? How can I run the same version on those two systems? They are both updated with their respective repositories

P.S. Yes I have the same problem running without --get-server-output.

Mellgood avatar Mar 24 '21 14:03 Mellgood

Can it be a version related issue?

I am not familiar enough with the changes history of iperf3, but it would help to upgrade the client, as 3.1.3 was released almost 5 years ago.

How can I run the same version on those two systems? They are both updated with their respective repositories

You can try downloading a new client version from https://iperf.fr/iperf-download.php#ubuntu. As far as I know, the new client version 3.9 should work properly with 3.7 server.

davidBar-On avatar Mar 24 '21 14:03 davidBar-On