iPerf is a command-line tool to measure the bandwidth and quality of a network link. It requires two hosts with the tool installed in order to execute the test with one functioning as a ‘server’ and the other as the ‘client’. iPerf can be used to test:

  • Jitter ( measured via UDP)
  • Datagram loss (measured via UDP)
  • Bandwidth (measured via TCP)

You can combine this information with the average, min, and max latency results from a prolonged ping output in order to get a better idea about the quality of your link.

For the purposes of this post it is assumed both ends will be utilizing an Ubuntu Linux box. The first step we need to do is get iPerf 3 installed by running:

1
sudo apt-get install iperf3

For a basic test which defaults to TCP and unlimited bandwidth you would then run:

Server

1
iperf -s

Client

1
iperf -c <ip address of server>

For more information on jitter and packet loss you would want to include the -u switch to force UDP. The default amount of bandwidth when using UDP is 1 Mbit/sec which can be modified by using the -b switch and specifying an alternate value (such as 10 meg) as shown below:

Client

1
iperf3 -c <server ip> -u -b 10m

On the server side this should output something like:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
Accepted connection from 1.1.1.1, port 55678
[ 5] local 2.2.2.2 port 5201 connected to 1.1.1.1 port 59949
[ ID] Interval Transfer Bandwidth Jitter Lost/Total Datagrams
[ 5] 0.00-1.00 sec 1.06 MBytes 8.91 Mbits/sec 5.044 ms 0/136 (0%)
[ 5] 1.00-2.00 sec 1.19 MBytes 9.96 Mbits/sec 5.197 ms 0/152 (0%)
[ 5] 2.00-3.00 sec 1.17 MBytes 9.83 Mbits/sec 6.790 ms 0/150 (0%)
[ 5] 3.00-4.00 sec 1.20 MBytes 10.1 Mbits/sec 5.414 ms 0/154 (0%)
[ 5] 4.00-5.00 sec 984 KBytes 8.06 Mbits/sec 9.347 ms 2/125 (1.6%)
[ 5] 5.00-6.00 sec 1.29 MBytes 10.8 Mbits/sec 9.425 ms 0/165 (0%)
[ 5] 6.00-7.00 sec 1016 KBytes 8.32 Mbits/sec 5.686 ms 0/127 (0%)
[ 5] 7.00-8.00 sec 1.34 MBytes 11.3 Mbits/sec 5.418 ms 1/173 (0.58%)
[ 5] 8.00-9.00 sec 1.25 MBytes 10.5 Mbits/sec 4.858 ms 1/161 (0.62%)
[ 5] 9.00-10.00 sec 1.30 MBytes 10.9 Mbits/sec 5.770 ms 0/166 (0%)
[ 5] 10.00-10.05 sec 24.0 KBytes 3.71 Mbits/sec 5.520 ms 0/3 (0%)
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bandwidth Jitter Lost/Total Datagrams
[ 5] 0.00-10.05 sec 11.8 MBytes 9.86 Mbits/sec 5.520 ms 4/1512 (0.26%)