iPerf Throughput Testing

iPerf Throughput Testing

February 12, 2016·Ryan
Ryan

Testing a network’s throughput is a good move, if you are testing a new service you stood up or making sure you getting what you paid for. iPerf is good free open source tool when there isn’t really a need to use commercial more expensive tools. In this short tutorial I’ll go over how to configure iPerf which is a CLI tool so let’s get started.

iPerf needs client and server on each end of the connection in order to test the throughput. There is also a list of available iPerf servers that are over the internet if you wanted to test internet speed and that information is also where you would download the latest version of iPerf at: https://iperf.fr/ If you are in Windows you have to download the compressed folder from the website and extract it somewhere on your machine. Open command prompt at where the uncompressed files are located: Run from Command Prompt (You’ll get a list of the available CLI switches)

D:\ryan\iperf\iperf-3.0.11-win64>iperf3.exe

In Linux you can do the following to install:

NOTE: At the time of writing version 3.0.11 is the latest

wget https://iperf.fr/download/iperf_3.0/libiperf0_3.0.11-1_amd64.deb
wget https://iperf.fr/download/iperf_3.0/iperf3_3.0.11-1_amd64.deb
sudo dpkg -i libiperf0_3.0.11-1_amd64.deb iperf3_3.0.11-1_amd64.deb
rm libiperf0_3.0.11-1_amd64.deb iperf3_3.0.11-1_amd64.deb

Run from terminal (You’ll get a list of the available CLI switches):

iperf3

Everything else in the command switches for the most part is the same when it comes to Windows and Linux. There are some commands that run in Linux that don’t on Windows but this doesn’t apply here. :) So in this example on one machine will be the server.

iperf3.exe -s
-----------------------------------------------------------
Server listening on 5201
-----------------------------------------------------------

On the another will be the client who is connecting to the server. You will want the IP address of the server and by default you can just use:

iperf3.exe -c 10.9.8.7
Connecting to host 10.9.8.7, port 5201
[  4] local 10.1.2.3 port 57979 connected to 10.9.8.7 port 5201
[ ID] Interval           Transfer     Bandwidth
[  4]   0.00-1.00   sec   512 KBytes  4.19 Mbits/sec
[  4]   1.00-2.00   sec  1.00 MBytes  8.39 Mbits/sec
[  4]   2.00-3.00   sec  1.25 MBytes  10.5 Mbits/sec
[  4]   3.00-4.00   sec  2.25 MBytes  18.9 Mbits/sec
[  4]   4.00-5.00   sec   640 KBytes  5.24 Mbits/sec
[  4]   5.00-6.00   sec   384 KBytes  3.15 Mbits/sec
[  4]   6.00-7.00   sec  2.00 MBytes  16.8 Mbits/sec
[  4]   7.00-8.00   sec  1.38 MBytes  11.5 Mbits/sec
[  4]   8.00-9.00   sec  1.38 MBytes  11.5 Mbits/sec
[  4]   9.00-10.00  sec  1.38 MBytes  11.5 Mbits/sec
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bandwidth
[  4]   0.00-10.00  sec  12.1 MBytes  10.2 Mbits/sec                  sender
[  4]   0.00-10.00  sec  11.9 MBytes  10.0 Mbits/sec                  receiver
 
iperf Done.

So in this example in 10 seconds we transferred about 12 MBytes of data and bandwidth was between 3.15 and 18.9Mbps.

Pretty good data to have if you are troubleshooting or verifying anything. In the above example we used TCP but if we switch to UDP notice the difference?

iperf3.exe -u -b 0 -c 10.9.8.7
Connecting to host 10.9.8.7, port 5201
[  4] local 10.1.2.3 port 59361 connected to 10.9.8.7 port 5201
[ ID] Interval           Transfer     Bandwidth       Total Datagrams
[  4]   0.00-1.00   sec  11.6 MBytes  97.3 Mbits/sec  1490
[  4]   1.00-2.00   sec  11.4 MBytes  95.6 Mbits/sec  1460
[  4]   2.00-3.00   sec  11.4 MBytes  95.6 Mbits/sec  1460
[  4]   3.00-4.01   sec  11.4 MBytes  95.6 Mbits/sec  1460
[  4]   4.01-5.01   sec  11.4 MBytes  95.6 Mbits/sec  1460
[  4]   5.01-6.00   sec  11.3 MBytes  95.6 Mbits/sec  1450
[  4]   6.00-7.00   sec  11.4 MBytes  95.6 Mbits/sec  1460
[  4]   7.00-8.00   sec  11.4 MBytes  95.6 Mbits/sec  1460
[  4]   8.00-9.00   sec  11.4 MBytes  95.6 Mbits/sec  1460
[  4]   9.00-10.00  sec  11.4 MBytes  95.6 Mbits/sec  1460
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bandwidth       Jitter    Lost/Total Datagrams
[  4]   0.00-10.00  sec   114 MBytes  95.8 Mbits/sec  1.160 ms  3212/14619 (22%)
[  4] Sent 14619 datagrams
 
iperf Done.

We transferred 114 MBytes in 10 seconds, but lost 22 percent of that data thanks to UDP which is good example of the difference between TCP and UDP. ;) That’s all I got so I hope this helpful,its a pretty easy install if you are on Windows or Linux. More information about the types of command switches supported are at https://iperf.fr/iperf-doc.php