3

Been playing with iperf for the last 4 hours and I'm unable to understand why the results are different in client and server.

Consider the following iperf output on client :

iperf -c 91.121.112.163 -p 2222
------------------------------------------------------------
Client connecting to 91.121.112.163, TCP port 2222
TCP window size: 1.06 MByte (default)
------------------------------------------------------------
[  3] local 10.0.0.160 port 36726 connected with 91.121.112.163 port 2222
[ ID] Interval       Transfer     Bandwidth
[  3]  0.0-11.4 sec  1.88 MBytes  1.38 Mbits/sec

And here is the corresponding output on server :

iperf -V -s -p 2222
------------------------------------------------------------
Server listening on TCP port 2222
TCP window size: 85.3 KByte (default)
------------------------------------------------------------
[  4] local ::ffff:91.121.112.163 port 2222 connected with ::ffff:86.209.154.156 port 36726
[ ID] Interval       Transfer     Bandwidth
[  4]  0.0-19.1 sec  1.88 MBytes   823 Kbits/sec

So, the client is uploading at 1.38Mbits/sec but the server is receiving at 823kbits/sec ?

Do someone have an explanation about these confusing results ?

Eric MORAND
  • 293
  • 2
  • 8

2 Answers2

1

From the client: (emphasis mine)

[ ID] Interval       Transfer     Bandwidth
[  3]  0.0-**11.4** sec  1.88 MBytes  1.38 Mbits/sec

From the server:

[ ID] Interval       Transfer     Bandwidth
[  4]  0.0-**19.1** sec  1.88 MBytes   823 Kbits/sec

For some reason, the server thinks the test is taking ~8 seconds longer than the client does. That would be enough to drop the overall bandwidth (from the server's perspective) to 823 Kbps.

EEAA
  • 109,363
  • 18
  • 175
  • 245
  • Actually, the bw reported by the server is way closer to the real bandwidth of my internet link than the one reported by the client. Anyway, I don't know why there are 8 seconds of difference... – Eric MORAND May 09 '14 at 01:57
  • @EricMORAND - sounds like a fun exercise to figure out. Anyway, now you have your answer of why the reported bandwidths are different. – EEAA May 09 '14 at 01:59
  • That doesn't answer the question. Saying that the bandwidth is lower because time is higher is paraphrasing the problem. The question is why are bandwidth (and then time) different between client and server output. – Eric MORAND May 09 '14 at 08:06
  • Bandwidth is an expression of the amount data transferred and **the time it takes** for that data to be transferred. This is why bandwidth units are always "X bytes per second" or something similar. In your case, the server thinks it is taking longer, so it's bandwidth calculation differs from the client. This is not difficult to understand. – EEAA May 09 '14 at 12:21
  • If you want to ask another question about the time differences, then do that. This question, though, has been answered. – EEAA May 09 '14 at 12:32
1

I believe the problem is the client is communicating with a device that has buffered up the outbound traffic, so the client believes it is done before the server has actually received the last block of data. I have noticed this a lot with iperf - the server's second-by-second report is much more stable than the client's. I have also noticed that the first second in the client is always the highest throughput, which I assume is filling the buffer of whatever device along the path is doing so. The following is the client and server testing a link that is bi-directionally shaped to 7Mbps...

------------------------------------------------------------
Client connecting to 204.22.22.104, TCP port 5001
TCP window size: 20.0 KByte (default)
------------------------------------------------------------
[  3] local 10.125.20.100 port 49248 connected with 204.22.22.104 port 5001
[ ID] Interval       Transfer     Bandwidth
[  3]  0.0- 1.0 sec  1.12 MBytes  9.44 Mbits/sec
[  3]  1.0- 2.0 sec   768 KBytes  6.29 Mbits/sec
[  3]  2.0- 3.0 sec   768 KBytes  6.29 Mbits/sec
[  3]  3.0- 4.0 sec   896 KBytes  7.34 Mbits/sec
[  3]  4.0- 5.0 sec   768 KBytes  6.29 Mbits/sec
[  3]  5.0- 6.0 sec   896 KBytes  7.34 Mbits/sec
[  3]  6.0- 7.0 sec   768 KBytes  6.29 Mbits/sec
[  3]  7.0- 8.0 sec   896 KBytes  7.34 Mbits/sec
[  3]  8.0- 9.0 sec   768 KBytes  6.29 Mbits/sec
[  3]  9.0-10.0 sec   768 KBytes  6.29 Mbits/sec
[  3]  0.0-10.2 sec  8.38 MBytes  6.91 Mbits/sec
------------------------------------------------------------
Server listening on TCP port 5001
TCP window size: 85.3 KByte (default)
------------------------------------------------------------
[  4] local 204.22.22.104 port 5001 connected with 10.125.20.100 port 49248
[ ID] Interval       Transfer     Bandwidth
[  4]  0.0- 1.0 sec   828 KBytes  6.78 Mbits/sec
[  4]  1.0- 2.0 sec   764 KBytes  6.25 Mbits/sec
[  4]  2.0- 3.0 sec   857 KBytes  7.02 Mbits/sec
[  4]  3.0- 4.0 sec   815 KBytes  6.68 Mbits/sec
[  4]  4.0- 5.0 sec   811 KBytes  6.64 Mbits/sec
[  4]  5.0- 6.0 sec   814 KBytes  6.66 Mbits/sec
[  4]  6.0- 7.0 sec   815 KBytes  6.68 Mbits/sec
[  4]  7.0- 8.0 sec   814 KBytes  6.66 Mbits/sec
[  4]  8.0- 9.0 sec   812 KBytes  6.65 Mbits/sec
[  4]  9.0-10.0 sec   806 KBytes  6.60 Mbits/sec
[  4]  0.0-10.6 sec  8.38 MBytes  6.64 Mbits/sec