1

I am using iperf for testing ethernet performance. It has several capabilities which I am using:

  1. measuring maximal bandwidth

    for example with iperf -c 192.168.0.1

  2. statistics of packet loss for a given bandwidth,

    for example with iperf -uVZc 192.168.0.1 -b400m

I am surprised to see that the bandwidth it measures for a link is a bandwidth which includes loss packets (if I run the second example on the same bandwidth which it gives as maximal bandwidth, then I get packet loss of 30%)

So, I am not sure, whct is the actual meaning of bandwidth in iperf terms ?

Thank you.

ransh
  • 1,589
  • 4
  • 30
  • 56

2 Answers2

2

iperf allows you to perform both UDP and TCP tests.

When running iperf in UDP mode, you may state the bandwidth. This is actually the amount of data per second the client is trying to pump towards the server. Some of the data may arrive safely, but some of the data may be lost (due to the actual bandwidth that is in place between the server and the client).

When running iperf in TCP mode, stating the bandwidth is relevant only if you want to limit it (and you have to take the packet size into account, as well, because that imposes limits on the minimal bandwidth limit, due to iperf behavior...). The actual bandwidth is determined by the TCP window size and the connection latency. See here for more information on TCP window and throughput.

Yaniv Shaked
  • 698
  • 6
  • 12
  • Do you mean that "iperf -c 192.168.0.1" shall return the TCP bandwidth ? Does packet loss have any factor (influence) on the returned TCP bandwidth ? – ransh Dec 18 '17 at 09:20
  • If you don't state `-u`, TCP is implied. Naturally, TCP can sustain packet loss as well, but TCP adapts itself to the quality of the connection, and you cannot impose bandwidth using the `-b` switch. The TCP and UDP tests are two totally different tests, try to read more about TCP. – Yaniv Shaked Dec 18 '17 at 09:23
  • Packet loss is detected by TCP and may cause TCP to exhause its transmission window - thus lowering the bandwidth. Read more: http://blog.performancevision.com/tcp-series-3-packet-loss-retransmissions-and-duplicate-acknowledgements – Yaniv Shaked Dec 18 '17 at 09:26
0

For UDP (-u) -b is the offered load on the client as defined by the client writing data to the socket. For actual network bandwidth look at the server's reports.

Also, for TCP, the -b rate limits the client to this value using a token bucket. In iperf version 2.0.11 one can rate limit both the client and the server.

rjmcmahon
  • 324
  • 1
  • 3