Getty Images/iStockphoto

Tip

How to use iPerf3 to test network bandwidth

In this in-depth tip, learn how to use iPerf3, a network testing tool to measure throughput and benchmark your WAN links to ensure effectivity.

Admins must measure the throughput of their WAN links to ensure they are working properly. One way to do that is by using iPerf, the open source benchmarking utility. The latest version, iPerf3, is a complete rewrite of the code first developed by the National Laboratory for Applied Network Research in the 2000s.

Like its predecessors, iPerf3 tests the bandwidth between any two networked computers to determine if the available bandwidth is large enough to support the transmission of an application.

IPerf3 is built on a client-server model and measures maximum User Datagram Protocol, TCP and Stream Control Transmission Protocol throughput between client and server stations. It can also be used to measure LAN and wireless LAN throughput.

The tool is simple to use: A single executable runs on both the client and the server. Command-line parameters indicate which system will take on the role of the server -- the target --and which will be the client. It makes no difference which is which.

How to use iPerf3?

IPerf3 is well suited to test data mover applications, such as those that run remote backups or synchronize databases. It can also be used to test the bandwidth of cloud-based systems. With services like AWS, Microsoft Azure and Google Cloud, bandwidth provisioning for a given class of VMs is often unclear. IPerf3 provides a quick and easy way to determine the effective bandwidth between the two systems, although with an important caveat: Don't assume the bandwidth is symmetrical -- continue to test in both directions.

Where did iPerf3 come from?

IPerf3 was principally developed by Energy Sciences Network/Lawrence Berkeley National Laboratory and is available under a three-clause Berkeley Software Distribution license. Because it was substantially rewritten, it is not backward-compatible with previous versions.

What systems can run iPerf3?

IPerf3 is distributed as binaries, or as executable files, which can be downloaded through Microsoft Windows, Apple macOS and popular versions of Linux, among them:

  • Ubuntu/Debian/Mint
  • Fedora/Red Hat/CentOS
  • openSUSE
  • Arch Linux
  • FreeBSD

IPerf3 is also available for Google Android, Apple iPhone/iPad and Microsoft Universal Windows Platform apps. Users should have no problems finding appropriate versions for their current clients.

How to download and install iPerf3

Iperf3 is available free of charge here. The latest version, 3.1.3, was released in 2016.

Installing iPerf3 is simple. Just place the iPerf3.exe file on both the client and server systems in a folder contained in a system path -- or one accessible via change directory -- and you are ready to go. The role of each station -- client or server -- is determined by switches at runtime. The iPerf3 program contains both client and server functionality.

As with ping, select two Windows or other OS stations on opposite ends of the WAN to serve as the endpoints for the measurement process. The stations can run different OSes, so iPerf3 on Windows can communicate with iPerf3 on macOS or Linux as long as they are addressable via private or public IP addresses or network names. Depending on the network configuration, both stations may need to be in the demilitarized zone of their respective firewalls or to map the addresses/ports in the firewall configuration.

Important considerations to use iPerf3

Conduct iPerf3 test runs outside of normal business hours for anything more than just a quick assessment. While ping generates only a minimal network load, the opposite is true of iPerf3. As it measures the capacity of your WAN link, iPerf3 attempts to consume all the bandwidth the WAN will deliver. This provides you with great bandwidth measurements, but it leaves you with unhappy users.

Consider asymmetry of both the WAN link and iPerf3 program. Older WAN link offerings, such as T1, are symmetrical, meaning bandwidth was provisioned to be the same in both directions from branch office to headquarters. This is not the case with most internet-based WAN offerings over cable or DSL.

How to use iPerf3 to measure throughput

By default, iPerf3 only measures the bandwidth from client to server, so configure the commands properly to measure bidirectional throughput.

First, open up a command-line prompt in Windows or whichever OS is in use.

Type the following into the server's command-line interface:

iPerf3 -s

Then, hit return.

That's it -- simple. This command tells this instance of iPerf3 that it will be functioning as a server -- or waiting to receive data. By default, the iPerf3 server will listen on port 5001. You may need to know this to configure your firewall to map traffic for the iPerf3 port to your iPerf3 server.

To use a port other than the default port, you must specify that in the command line. For port 7575, for example, type the following in the command-line window on the server:

iPerf3 -s -p 7575

Then, hit return.

For bandwidth testing where the two clients are on the same LAN, it should be OK to just use the default port address. We usually only change the port address to accommodate firewall rules or to use a port that the security admin has already allowed via the firewall.

Emulating the iPerf3 client presents additional configuration options because the client initiates the benchmark. For starters, the client needs to know the IP address of the target server, and it needs to know the port number if a port other than the default is in use.

In our example, we will use port 7575 for the iPerf3 traffic, and the client will communicate with an iPerf3 server located at IP address 10.10.10.1. By default, this will benchmark the throughput in one direction: from client to server. The -c tells the iPerf3 instance to function as a client station.

Type the following into the client's command-line window:

iPerf3 -c 10.10.10.1 -p 7575

Then, hit return.

By default, the benchmark will run for 20 seconds. Then, it will present the average throughput for the run.

Here is an example of the kind of output:

Output from iPerf3 testing

You'll certainly want to measure the throughput both upstream and downstream. To do that, add the —bidir (i.e., bidirectional) option to the command.

To modify our previous command to run upstream and downstream throughput simultaneously, type the following into the client's command-line window:

iPerf3 -c 10.10.10.1 -p 7575 -bidir

Then, hit return.

The bidirectional results should be virtually the same, whether run separately or simultaneously. If the simultaneous run results are significantly lower than the bidirectional results, investigate further, and determine if there is perhaps a performance issue with your cable modem or router.

While broadband providers are careful to advertise their bandwidth offerings with the "up to X Mbps" language, you want to see throughput results that are at least somewhere in that range. If you don't, you have some hard evidence to back up claims of slow service when you contact your ISP.

Check version

Given there are multiple versions of iPerf actively in use, check the version you are running -- especially if you are not the one that installed it.

To do that, simply run the following:

iPerf3 -v

Make sure you use a lowercase v because uppercase is a completely different option that places iPerf3 in verbose mode, which increases the output visible when running tests.

Dig Deeper on WAN technologies and services

Unified Communications
Mobile Computing
Data Center
ITChannel
Close