How to Use iPerf to Test Bandwidth

Posted on

iPerf is a tool which can be used for testing or measuring the performance of a network in terms of bandwidth and quality of a network line. You are able to test the quality of a link as we will explain now. First is latency. It is able to be measured with the Ping command. Then, there is jitter. You are able to measure it with an iperf UDP test. Third is datagram loss. You are able to measure it with an iperf UDP test. If you want to measure the bandwidth, you can do it through TCP tests.

How to Use iPerf Command to Measure Network Speed/ Bandwidth

Here, we will inform you of some examples of using iPerf to be able to test network throughput. Here, we are going to use a Linux CentOS host as the server of IPerf. You have to run the iPerf3 tool in the server mode:

# iperf3 -s

Then, the iPerf server is running. Now, it is waiting for connections on the 5201 TCP port.

Server listening on 5201.

It is important for you to know that iPerf arguments are case sensitive so you have to be careful when you are using them. Depending on the settings of the firewall between the server and the client, you have the ability to change the listening port by using the argument -p [port_number]. You are able to run the iPerf server with a large TCP window size and on a different TCP port. You are able to use this command:

# iperf -s -w 32768 -p 5200

What does the -w 32768 mean? It means that it sets TCP windows size to 32 kb and by default it is about 8 kb. Then, what about -p 5200? It is the port on which iPerf is waiting for connections. It is important for you to know that iperf 2 listens by default on port 5001 and the iperf3 on 5201.

Let say that you are using a computer with Windows 10 installed as an iPerf client. Now, you have to run the command prompt and then you have to go to the directory with the iPerf executable.

cd c:\tools\iperf

To be able to run a network bandwidth test from the client, you have to specify the server address of iPerf or the DNS name:

iperf3.exe -c

In case you began the server of iPerf with an increased TCP window size, you are able to use the command below to be able to get the maximum network load:

iperf.exe -c -P 8 -t 30 -w 32768

Here, we will explain to you the elements of the command above.

  • -c is the IP address of the iPerf server.
  • -w 32768 will increase the TCP window size.
  • -t 30 is the time in seconds for the test to be done and by default it is 10 seconds.
  • -P 8 is the number of parallel threads to be able to get the maximum channel load.

In this example, the test lasted 30 seconds and in the final report, you may be interested in the values of the bandwidth column listed in the last [SUM] line. In this case, 85.9 Mbit/s is the average network bandwidth between two hosts. And 307 MB of data was transferred in the Transfer column with the symmetric speed.

If you use the -f argument, you are able to change the format of the speed including bits, kilobits or megabits. In the continuous tests, when you need to estimate the performance during some times, you are able to set the period of time to show the intermediate results by using the -i option.

Running iPerf in reverse mode can be done by you. You are able to use the -R option on the client for this. By default, the utility produces TCP traffic. In case you want to check the bandwidth of your network for UDP packets, -u option must be used by you. In this case, you can begin the iPerf server with this command:

 iperf3 -s -u

What can we use to test our internet service provider bandwidth? If you want to do it, you are able to use one of the public iPerf servers:

iperf3 -c

What about measuring the maximum network speed in both directions in a duplex mode? You have to use the -d option on the client like this:

iperf3.exe -c IP -P 8 -t 30 -w 32768 -d

During the test of the network by using iPerf, your network connection throughput chart can be seen in the Task Manager. You need to know that during the test, iPerf uses all available bandwidth of the communication channel between the server and the client which is able to negatively give an effect to the productive apps and users. You are able to show the full list of the options as follows:

iperf3 -help

Installing iPerf

Before you use the iPerf command, you have to make sure that you install iPerf on your Windows. How to do that? You are able to download iPerf 3.1.3 for Windows from this link You do not have to install the tool because you just have to download the iPerf archive and extract it to a local directory on the drive. In the archive, you will only find two files including cygwin2.dll and iperf3.exe.

It is important for you to know that there are some iPerf GUI implementations for Windows for example iPerf3-Cygwin-GUI or jperf. The jperf is written in Java and if you want to run jperf, you have to install the Java VM on the computer. In addition to graphical form for the interface of the CLI, Jperf is able to build graphs bandwidth charts of the communication channel in real time. If you want to use it, you have to just specify the iPerf server address and then you have to run the scan.

It is important for you to know that there is a separate iPerfAutomate module in the PowerShell Script gallery that is able to be used to get the metrics performance of the network from your PowerShell scripts. You are able to install the module with this command:

Install-Module – Name iPerfAutomate

Leave a Reply

Your email address will not be published. Required fields are marked *