DNS & Diagnostics / Practical guide

How to Use iPerf for Network Testing and Troubleshooting

how to use iperf

How to use iPerf: the quick answer

iPerf measures the real throughput between two devices on a network. Run one device as the server, run the other as the client, then compare the measured throughput with the link speed you expected. This makes iPerf useful for checking Wi-Fi, Ethernet, VPN and site-to-site connections without relying on an internet speed-test server.

Quick-start commands

On the server device, start iPerf3 with:

iperf3 -s

On the client device, replace the example address with the server’s IP address:

iperf3 -c 192.168.1.10

The default test uses TCP for 10 seconds and connects to port 5201. The rest of this guide explains installation, UDP testing, reverse testing and the main result fields.

What is iPerf?

iPerf measures the maximum achievable throughput between two network endpoints by generating controlled traffic between them. It reports useful details such as throughput, transferred data, jitter and packet loss, depending on the test type.

What does iPerf do?

It helps you measure network performance and isolate where a connection is slower or less stable than expected.

Its main features include:

1) Throughput testing

iPerf measures the achievable throughput between two endpoints during the test.

2) TCP and UDP performance testing

TCP tests show sustained throughput over a reliable connection.

UDP tests let you set a target bit rate and measure jitter and packet loss.

3) Performance metrics

iPerf reports throughput and the amount of data transferred. UDP tests also report jitter and packet loss.

4) Custom traffic settings

You can set the target bit rate, test duration, number of parallel streams and other traffic parameters.

5) Platform compatibility

iPerf is available on Linux and macOS, while Windows users can use community-provided builds. This makes it practical in mixed environments.

How to install iPerf3

Installing iPerf3 on Windows

For Windows, download a portable community-provided iPerf3 build here. ESnet does not officially support iPerf3 on Windows and recommends iPerf2 when official Windows support is required.

After downloading it, extract the ZIP file. There is no installer: keep iperf3.exe and its included files together in the extracted folder, then run it from Command Prompt.

windows download iperf

Now you can start using iPerf3 from Command Prompt.

Click the folder path in File Explorer’s address bar:

iperf directory windows

Replace the path with cmd and press Enter:

open cmd windows

Command Prompt opens directly in the extracted iPerf3 directory:

command prompt windows

To display the available options, run iperf3.exe --help:

use iperf on windows

Installing iPerf3 on macOS

To install iPerf3 on macOS, use Homebrew. If Homebrew is not installed, get it from the official Homebrew website.

Open Terminal on your Mac:

MacOS terminal

Run brew install iperf3:

install iperf on MacOS with brew

Installing iPerf3 on Linux

On Debian or Ubuntu, run:

On current Red Hat, Rocky Linux, AlmaLinux or Fedora releases, run:

How to use iPerf3

iPerf uses a client-server model. One endpoint listens as the server, while the other starts the test as the client.

For most tests, either endpoint can be the server. Choose the device that is easiest to reach through the firewall, then use -R when you need to test traffic in the opposite direction.

The iPerf client-server model

In this example, a Windows PC and a Windows Server host are connected to the same network.

There is a switch and access point between them. The topology would look something like this:

iperf test network topology

Setting up the iPerf server

On Windows Server, open Command Prompt and navigate to the folder containing iperf3.exe:

iperf server

Run:

The iPerf server will start like this:

use iperf server

Setting up the iPerf client

Now run the test from the Windows PC acting as the iPerf3 client.

On the client, open Command Prompt and navigate to the folder containing iperf3.exe:

iperf client

Running a basic TCP test

iPerf will perform a default 10-second TCP test and display results, including throughput and data transferred.

Enter the command as follows:

Command Prompt displays the test result:

use iperf client

Testing the reverse direction

By default, traffic flows from the client to the server. Add -R when you want the server to send traffic back to the client:

iperf3.exe -c [server_ip] -R

Running a UDP test

UDP does not automatically try to fill the link like TCP. Use -u to select UDP and -b to set the target bandwidth. This example targets 100 Mbit/s:

The output also shows jitter and packet loss:

use udp with iperf

Set a test duration

You can set a duration in seconds by entering the following command:

Duration should be entered in seconds.

Set a bandwidth target

Use -b to set the target bit rate for the test:

Use suffixes such as K, M or G. For example:

50M means a target of 50 Mbit/s.

Run multiple parallel connections

You can run multiple connections with parallel data streams:

With two parallel streams, iPerf3 displays each stream and a combined SUM line:

run multiple iPerf connections

Understanding the results

Throughput (Mbits/sec or Gbits/sec): the rate of data successfully transferred during the test. In iPerf3 output, lowercase bits/sec indicates bits per second, not bytes per second. 

Transfer: the total amount of data sent or received during the test.

Jitter (UDP): variation in packet arrival time.

Packet loss (UDP): the percentage of transmitted packets that did not arrive.

More advanced iPerf3 options

Save the test results to a text file:

The command writes the output to result.txt:

iperf output to file

Save the output in JSON format:

Note: these output files are saved in the current working directory.

Run iPerf3 in the background on Linux or macOS:

On Linux or macOS, daemon mode keeps the iPerf3 server running in the background:

Troubleshooting an iPerf connection

If the client cannot connect to the iPerf3 server, check the following:

– Ping the server from the client. If it is unreachable, confirm that both endpoints are on the expected network or connected through the VPN.

– If ping works but iPerf3 does not connect, confirm that the server process is running and allow TCP port 5201 through the relevant firewall.

Frequently asked questions

Which port does iPerf3 use?

iPerf3 uses TCP port 5201 by default for its control connection and tests. If the client can ping the server but cannot connect, allow port 5201 through the relevant host or network firewall. You can choose a different port with -p on both devices.

Does iPerf test internet speed?

Not by itself. iPerf measures the path between the client and the iPerf server you control. It is ideal for LAN, Wi-Fi, VPN and site-to-site testing. It measures internet performance only when the server is across the internet, and then the result also depends on that remote server and route.

Why is iPerf throughput lower than the link speed?

The advertised link rate includes protocol overhead and does not guarantee usable throughput. Wi-Fi interference, signal quality, device CPU, cabling, switch ports, VPN encryption, packet loss and TCP behaviour can all reduce the measured result.

Conclusion

iPerf is a practical way to test throughput on a business network or a home network.

With the client-server setup and the examples above, you can test both directions and interpret the main iPerf3 results.

Save the results when you need a baseline for troubleshooting or a before-and-after comparison.

Continue troubleshooting.

More practical notes from the same working archive.