iperf is a free tool for active measurements of the maximum achievable bandwidth on IP networks. It supports tuning of various parameters related to timing, protocols, and buffers.
For each test it reports the measured throughput / bitrate, loss, and other parameters.
The following arguments are the one that we used in the workshop. All will work in iperf3 version 3.1, or newer. All of them will work on Windows, Linux, and macOS. There are a few others, that might be plattform specific.
The -c
/ --client
argument let iPerf in client mode, connecting to an iPerf server running on host.
The -p
/ --port
argument specifies server port for the server to listen on and the client to connect to, default is 5201.
The -t
/ --time
argument specifies the test duration time in seconds, default is 10 secs.
The -i
/ --interval
argument indicates the interval in seconds between periodic bandwidth reports, default is zero.
The -u
/ --udp
argument uses UDP rather than TCP. (TCP is the default)
The -r
/ --reverse
argument run everything in reverse mode (server sends, client receives).
The --udp-counters-64bit
argument supports very long-running UDP tests, which could cause a counter to overflow
The --cport
argument specifies the client-side port. Useful for tracing or Firewall tests.
The -k
/ --blockcount
argument defines the number of blocks (packets) to transmit.
The -l
/ --length
argument define the length of buffers to read or write, default is 128 KB for TCP, 8 KB for UDP.
The -P
/ --parallel
argument defines the number of simultaneous connections to make to the server, default is 1.
The -V
/ --verbose
argument give more detailed output
The -J
/ --json
argument creates output in JSON format
The -4
/ --version4
argument only use IPv4.
The -6
/ --version6
argument only use IPv6.
The -w
/ --window
argument sets the socket buffer sizes to the specified value. For TCP, this sets the TCP window size.
The -M
/ --set-mss
argument attempts to set the TCP maximum segment size (MSS). The MSS is usually the MTU - 40 bytes for the TCP/IP header. For ethernet, the MSS is 1460 bytes (1500 byte MTU).
The -O
/ --omit
argument omits the first n seconds of the test, to skip past the TCP slowstart period.
The -Z
/ --zerocopy
argument uses a "zero copy" method of sending data, such as sendfile(2), instead of the usual write(2). This uses much less CPU.
The -N
/ --no-delay
argument set the TCP no delay option, disabling Nagle's algorithm. Normally this is only disabled for interactive applications like telnet.
The -f
/ --format
argument specifies the format to print bandwidth numbers in. Supported formats are:
k
= Kbits/secK
= KBytes/secm
= Mbits/secM
= MBytes/sec
iperf3 -c 10.26.22.110 -p 5201 -t 20 -i 2 -f m
iperf3 -c 10.26.22.110 -p 5201 -t 20 -i 2 -f m -R
iperf3 -c 10.26.22.110 -p 5201 -t 120 -i 4 -f M
iperf3 -c 10.26.22.110 -p 5201 -t 120 -i 4 -f M -R
iperf3 -c bouygues.iperf.fr -p 5200 -t 20 -i 2 -f m
iperf3 -c bouygues.iperf.fr -p 5200 -t 20 -i 2 -f m -R
iperf3 -c 10.26.22.110 -p 5201 -t 120 -i 4 -R -f M -u
See how much bandwidth can be pushed using UDP
iperf3 -c 10.26.22.110 -p 5201 -u -t 30 -b 50m
iperf3 -c 10.26.22.110 -p 5201 -u -t 30 -b 50m -R
iperf3 -c 10.26.22.110 -p 5201 -u -t 30 -b 100m
iperf3 -c 10.26.22.110 -p 5201 -u -t 30 -b 100m -R
iperf3 -c 10.26.22.110 -p 5201 -u -t 30 -b 300m
iperf3 -c 10.26.22.110 -p 5201 -u -t 30 -b 300m -R
iperf3 -c 10.26.22.110 -p 5201 -u -t 30 -b 500m
iperf3 -c 10.26.22.110 -p 5201 -u -t 30 -b 500m -R
iperf3 -c 10.26.22.110 -p 5201 -u -t 30 -b 600m
iperf3 -c 10.26.22.110 -p 5201 -u -t 30 -b 600m -R
See how much bandwidth can be pushed using TCP
iperf3 -c 10.26.22.110 -p 5201 -t 30 -b 50m
iperf3 -c 10.26.22.110 -p 5201 -t 30 -b 50m -R
iperf3 -c 10.26.22.110 -p 5201 -t 30 -b 100m
iperf3 -c 10.26.22.110 -p 5201 -t 30 -b 100m -R
iperf3 -c 10.26.22.110 -p 5201 -t 30 -b 300m
iperf3 -c 10.26.22.110 -p 5201 -t 30 -b 300m -R
iperf3 -c 10.26.22.110 -p 5201 -t 30 -b 500m
iperf3 -c 10.26.22.110 -p 5201 -t 30 -b 500m -R
iperf3 -c 10.26.22.110 -p 5201 -t 30 -b 600m
iperf3 -c 10.26.22.110 -p 5201 -t 30 -b 600m -R
Parallel tests, single client, TCP window moving up.
If you start seeing a lot of Retrs/drops you reached the limit. I use this kind of tests for WiFi or WAN connections to find the limits of them.
If your Client CPU usage get's to hig, try the -Z
argument. If the local CPU is overloaded, this might givr you the wrong results.
iperf3 -c 10.26.22.110 -p 5201 -t30 -P 2 -w 10k
iperf3 -c 10.26.22.110 -p 5201 -t30 -P 2 -w 10k -R
iperf3 -c 10.26.22.110 -p 5201 -t30 -P 2 -w 100k
iperf3 -c 10.26.22.110 -p 5201 -t30 -P 2 -w 100k -R
iperf3 -c 10.26.22.110 -p 5201 -t30 -P 2 -w 300k
iperf3 -c 10.26.22.110 -p 5201 -t30 -P 2 -w 300k -R
iperf3 -c 10.26.22.110 -p 5201 -t30 -P 2 -w 400k
iperf3 -c 10.26.22.110 -p 5201 -t30 -P 2 -w 400k -R
iperf3 -c 10.26.22.110 -p 5201 -t30 -P 5 -w 10k
iperf3 -c 10.26.22.110 -p 5201 -t30 -P 5 -w 10k -R
iperf3 -c 10.26.22.110 -p 5201 -t30 -P 5 -w 100k
iperf3 -c 10.26.22.110 -p 5201 -t30 -P 5 -w 100k -R
iperf3 -c 10.26.22.110 -p 5201 -t30 -P 5 -w 300k
iperf3 -c 10.26.22.110 -p 5201 -t30 -P 5 -w 300k -R
iperf3 -c 10.26.22.110 -p 5201 -t30 -P 5 -w 400k
iperf3 -c 10.26.22.110 -p 5201 -t30 -P 5 -w 400k -R
iperf3 -c 10.26.22.110 -p 5201 -t30 -P 10 -w 10k
iperf3 -c 10.26.22.110 -p 5201 -t30 -P 10 -w 10k -R
iperf3 -c 10.26.22.110 -p 5201 -t30 -P 10 -w 100k
iperf3 -c 10.26.22.110 -p 5201 -t30 -P 10 -w 100k -R
iperf3 -c 10.26.22.110 -p 5201 -t30 -P 10 -w 300k
iperf3 -c 10.26.22.110 -p 5201 -t30 -P 10 -w 300k -R
iperf3 -c 10.26.22.110 -p 5201 -t30 -P 10 -w 400k
iperf3 -c 10.26.22.110 -p 5201 -t30 -P 10 -w 400k -R
See the impact when disabling no delay. Guess?
iperf3 -c 10.26.22.110 -p 5201 -t30 -N
iperf3 -c 10.26.22.110 -p 5201 -t30 -N -R
iperf3 -c 10.26.22.110 -p 5201 -t30
iperf3 -c 10.26.22.110 -p 5201 -t30 -R
The -s
/ --server
argument starts iPerf in server mode. (This will only allow one iperf connection at a time)
The -p
/ --port
argument specifies server port for the server to listen on and the client to connect to, default is 5201.
iperf3 -s -p 5201
iperf3 -s -p 5200
Same as above, but as daemon (Centos Linux)
sudo -u nobody iperf3 -s -p 5200 -D >/dev/null 2>&1
You should visit the iPerf Hoempage!
You will find a lot of pre-compiled binaries in the download section of the Project.
There is an excelent documentation.
There is a GitHub page for this project.
iPerf3 issue tracker on GitHub: https://github.com/esnet/iperf/issues