Package: iperf
Version: 2.0.12+dfsg1-2
Severity: normal

Dear Maintainer,

 iperf package on Buster persistently fails at rate higher around 2.2Gbps. This
 was not a problem on version 2.0.9+dfsg1-1, and it now introduces problems for
 performance measuring on our 25GbE network. I found the root cause to
 be an overflow error:

yan@133m27:~$ iperf -c localhost -p 11113 -b 2147483647 -i 1 -t 5
------------------------------------------------------------
Client connecting to localhost, TCP port 11113
TCP window size: 3.76 MByte (default)
------------------------------------------------------------
[  3] local 127.0.0.1 port 48726 connected with 127.0.0.1 port 11113
[ ID] Interval       Transfer     Bandwidth
[  3]  0.0- 1.0 sec   256 MBytes  2.15 Gbits/sec
[  3]  1.0- 2.0 sec   256 MBytes  2.15 Gbits/sec
[  3]  2.0- 3.0 sec   256 MBytes  2.15 Gbits/sec
[  3]  3.0- 4.0 sec   256 MBytes  2.15 Gbits/sec
[  3]  4.0- 5.0 sec   256 MBytes  2.15 Gbits/sec
[  3]  0.0- 5.0 sec  1.25 GBytes  2.15 Gbits/sec

yan@133m27:~$ iperf -c localhost -p 11113 -b 2147483648 -i 1 -t 5
------------------------------------------------------------
Client connecting to localhost, TCP port 11113
TCP window size: 3.76 MByte (default)
------------------------------------------------------------
[  3] local 127.0.0.1 port 55514 connected with 127.0.0.1 port 11113
[ ID] Interval       Transfer     Bandwidth
[  3]  0.0- 5.0 sec   128 KBytes   210 Kbits/sec

yan@133m27:~$ iperf -c localhost -p 11113 -b 3g -i 1 -t 5
------------------------------------------------------------
Client connecting to localhost, TCP port 11113
TCP window size: 3.76 MByte (default)
------------------------------------------------------------
[  3] local 127.0.0.1 port 58056 connected with 127.0.0.1 port 11113
[ ID] Interval       Transfer     Bandwidth
[  3]  0.0- 5.0 sec   128 KBytes   210 Kbits/sec

I created a patch which fixed the problem. With the patch, the package
now works properly:

yan@133m27:~$ ./iperf -c localhost -p 11113 -b 3g -i 1 -t 5
------------------------------------------------------------
Client connecting to localhost, TCP port 11113
TCP window size: 3.76 MByte (default)
------------------------------------------------------------
[  3] local 127.0.0.1 port 50612 connected with 127.0.0.1 port 11113
[ ID] Interval       Transfer     Bandwidth
[  3]  0.0- 1.0 sec   358 MBytes  3.00 Gbits/sec
[  3]  1.0- 2.0 sec   358 MBytes  3.00 Gbits/sec
[  3]  2.0- 3.0 sec   358 MBytes  3.00 Gbits/sec
[  3]  3.0- 4.0 sec   358 MBytes  3.00 Gbits/sec
[  3]  4.0- 5.0 sec   358 MBytes  3.00 Gbits/sec
[  3]  0.0- 5.0 sec  1.75 GBytes  3.00 Gbits/sec


-- System Information: 
Debian Release: 10.4
Architecture: amd64 (x86_64)
Index: iperf2/src/Client.cpp
===================================================================
--- iperf2.orig/src/Client.cpp
+++ iperf2/src/Client.cpp
@@ -396,7 +396,7 @@ void Client::RunRateLimitedTCP ( void )
     double tokens = 0;
     Timestamp time1, time2;
 
-    int var_rate = mSettings->mUDPRate;
+    max_size_t var_rate = mSettings->mUDPRate;
     while (InProgress()) {
        // Add tokens per the loop time
        // clock_gettime is much cheaper than gettimeofday() so
@@ -504,7 +504,7 @@ void Client::RunUDP( void ) {
         if (isVaryLoad(mSettings) && mSettings->mUDPRateUnits == kRate_BW) {
            static Timestamp time3;
            if (now.subSec(time3) >= VARYLOAD_PERIOD) {
-               int var_rate = lognormal(mSettings->mUDPRate,variance);
+               max_size_t var_rate = lognormal(mSettings->mUDPRate,variance);
                if (var_rate < 0)
                    var_rate = 0;
 

Reply via email to