IPerf is an open source tool that can be used to test the network throughput between two hosts. iPerf allows you to generate TCP and UDP traffic/load between two hosts. You can use iPerf to quickly measure the maximum network bandwidth (throughput) between a server and a client, stress test the ISP connection, router, network gateway (firewall), Ethernet, or Wi-Fi network.
In this post we will show you how to install and use the iPerf tool to test network bandwidth on Windows and Linux CentOS (there are iPerf versions for Android, macOS, MikroTik’s RouterOS, and other platforms).
iPerf versions: iPerf2 vs iPerf3
IPerf is a multi-platform tool that requires no installation. Just copy it and run it on the two devices between which you want to test the network bandwidth.
IPerf works in server-client mode. On the first device, iPerf is running in server mode (waiting for traffic from the iPerf client). On the second computer, iPerf runs in client mode, generates TCP or UDP traffic and measures the maximum data transfer rate.
Two independent sites of the iPerf are currently being developed in parallel: iPerf2 and iPerf3. Most features of these tools are compatible, but they use different network ports by default. In iPerf1/2 it is 5001, in iPerf3 it is 5201.
- iPerf2 is preferably used for parallel threads and bi-directional testing, and this version is officially supported by Windows ;
- iPerf3 has improved the implementation of high-speed UDP testing. The IPerf3 code is much smaller and better optimized.
The other differences are not so important, so it is not necessary to use a specific version of iPerf (even the CLI settings are the same). In this article we will use iperf3. iPerf3 is not officially supported by the Windows platform, but it works pretty well. I haven’t noticed any obvious mistakes. You can send an error message to https://github.com/esnet/iperf.
How do I install iPerf on Windows?
You can download iPerf 3.1.3 for Windows via the following link: https://iperf.fr/iperf-download.php. You don’t need to install the tool, just download the iPerf archive and extract it to a local directory on your disk. There are only two files in the archive: cygwin1.dll and iperf3.exe.
There are several implementations of the iPerf GUI for Windows. For example Iperf3-Cygwin-GUI or jperf.
jperf is written in Java (the Java VM must be installed on the computer to run jperf). In addition to the graphic form of the CLI interface, Jperf can display the link rate in real time.
To use it, simply enter the address of the iPerf server and start scanning.
The PowerShell Script Gallery has a separate iPerfAutomate module that you can use to retrieve network performance measurements from your PowerShell scripts. You can install the module with the command : InstallationModule -Name iPerfAutomate
Installing iPerf under CentOS Linux
In CentOS 8, the iperf3 package is included in the basic AppStream repository (in CentOS 7, iperf3 is in the EPEL repository). You can install it with the command dnf (yum) :
# dnf install iperf3A on Debian/Ubuntu distributions with the command
sudo apt install iperf3
If you want to use your Linux instance as an iperf3 server you have to open the TCP/UDP port 5201 in the firewalld (iptables):
# firewall-cmd –permanent –add-port=5201/udp
# firewall-cmd –permanent –add-port=5201/tcp
# firewall-cmd –reload
Using the iPerf Control to measure network speed/bandwidth
Let’s take a look at some examples of using iPerf to test the network throughput. In this example we are using a Linux CentOS host as an iPerf server. Run the iPerf3 tool in server mode:
# iperf3 -s
The iPerf server is running and waiting for a connection on TCP port 5201.
The server is listening at 5201.
Pay attention. The arguments of iPerf are case sensitive!
Depending on the firewall settings between the client and the server, you can change the eavesdropping port using the -p [door_number] argument. You can run an iPerf server with a large TCP window and on a different TCP port. Use the command :
# iperf3 -s -w 32768 -p 5200
- -w 32768 – sets the size of the TCP window to 32 kB (standard about 8 kB).
- -p 5200 is the port on which iPerf listens for a connection (remember that iperf2 listens by default on port 5001 and iperf3 on port 5201).
I am using a computer with Windows 10 installed as an iPerf client. Start the command line and navigate to the directory containing the iPerf executable file:
cd c:toolsiperf
To run the network throughput test of a client, specify the address (or DNS name) of the iPerf server:
iperf3.exe -c 192.168.1.200
If you run the iPerf server with a larger TCP window, you can use the following command to get maximum network utilization:
iperf3.exe -c 192.168.1.200 -P 8 -t 30 -w 32768
- -c 192.168.1.200 – IP address of the iPerf server;
- -w 32768 – enlarge the TCP window;
- -t 30 – Time in seconds to perform the test (10 seconds by default) ;
- -P 8 – Number of parallel wires to obtain the maximum channel load ;
In my example, the test lasted 30 seconds. In the final report we are interested in the values of the bandwidth columns in the last row [SUM]. In this case, the average network speed between the two hosts is 85.9 Mbps. 307 MB data transfer (column transfer) with symmetrical speed (transmitter=receiver).
You can use the -f argument to change the speed format (bits, kilobits or megabits). For continuous testing, if you want to evaluate the performance over several minutes (hours), you can use the -i option to specify the time period for displaying the intermediate results.
You can run iPerf in reverse mode (the server sends data and the client receives it). The -R option is available to the user on the customer for this purpose.
By default, the tool generates TCP traffic. If you need to check the network bandwidth for UDP packets, use the -u option. In this case the iPerf server must be started with the command: iperf3 -s -u).
If you need to test the bandwidth of your ISP, you can use one of the public iPerf servers (a list of public iPerf hosts can be found here) :
iperf3 -c iperf.scottlinux.com
If you need to measure the maximum network speed in both directions (in duplex mode), use the -d option on the client :
iperf3.exe -c IP -P 8 -t 30 -w 32768 -d
When testing the network with iPerf, you can check the bandwidth table of the network connection using the Task Manager function. It is important to note that during testing iPerf uses all available bandwidth of the communication channel between the client and the server, which can have a negative impact on the performance of the application and the user.
You can view the full list of options as follows:
iperf3 -help
Iperf is an easy to use and user-friendly network program that allows you to measure the performance of your network connection and the maximum data transfer rate between two devices.
Related Tags:
iperf connection refused,iperf3 udp test,install iperf ubuntu,iperf 10gb test,iperf no route to host,iperf command not found,iperf bandwidth test command,iperf vlan tagging,analysing iperf results,iperf uplink and downlink,download iperf for windows,iperf parallel streams,iperf 2 vs 3,iperf udp vs tcp test,public iperf3 servers,jperf,iperf vs iperf3,public iperf server,iperf raspberry pi,iperf alternative,iperf3 command line examples,how to use iperf ubuntu,iperf download,iperf. test meraki,iperf window size gigabit,iperf3 examples,owamp,iperf wireless testing,iperf slow one direction,iperf speed test,iperf windows,how to use iperf windows,iperf speed test windows,network throughput test,iperf3 udp