iperf3
Measure network bandwidth performance
TLDR
Run iperf3 as a server
Run an iperf3 server on a specific port
Start bandwidth test
Run iperf3 in multiple parallel streams
Reverse direction of the test. Server sends data to the client
SYNOPSIS
iperf3 [OPTIONS]
iperf3 -s [OPTIONS] (Server mode)
iperf3 -c <server_address> [OPTIONS] (Client mode)
PARAMETERS
-s, --server
Run in server mode. iperf3 will listen for incoming client connections.
-c, --client <host>
Run in client mode, connecting to the specified host (server address or hostname).
-p, --port <N>
Set the port number for the server to listen on or for the client to connect to. The default port is 5201.
-P, --parallel <N>
Number of parallel client streams to run. This can significantly increase throughput on high-latency links.
-u, --udp
Use UDP instead of TCP. When used with client mode, a target bandwidth (-b) is usually specified.
-b, --bandwidth <N[KMGT]>
Target bandwidth in bits/sec for UDP tests (e.g., 100M for 100 Mbps). Default for UDP is 1 Mbit/sec.
-t, --time <N>
Time in seconds to transmit data. Default is 10 seconds.
-n, --bytes <N[KMGT]>
Number of bytes to transmit. Alternative to --time.
-R, --reverse
Run in reverse mode. The server sends data, and the client receives it. Useful for testing upload bandwidth from the client's perspective.
-J, --json
Output results in JSON format. Useful for scripting and parsing results programmatically.
-i, --interval <N>
Print periodic reports every N seconds during the test.
-w, --window <N[KMGT]>
Set TCP window size (socket buffer size). Affects TCP performance over high-latency links.
-B, --bind <host>
Bind to a specific local interface (IP address) for incoming/outgoing connections.
--bidir
Run a bidirectional test simultaneously (both client and server send and receive data).
-V, --version
Show iperf3 version information.
-h, --help
Show help message and exit.
DESCRIPTION
iperf3 is a powerful command-line utility designed for active measurements of the maximum achievable bandwidth on IP networks. It allows users to test network throughput, loss, and jitter between two endpoints, one acting as a server and the other as a client.
It supports both TCP and UDP protocols, offering various options to tune test parameters such as connection duration, target bandwidth, and number of parallel streams. iperf3 is an essential tool for network administrators and engineers for troubleshooting network bottlenecks, validating network infrastructure, and capacity planning by simulating different traffic loads.
CAVEATS
- Requires iperf3 to be installed and running on both client and server machines.
- Firewalls (e.g., firewalld, ufw, network ACLs) must allow traffic on the chosen port (default 5201) for the test to succeed.
- Results can be influenced by CPU load, disk I/O, OS buffer settings, and other network traffic on participating hosts.
- UDP tests may show high bandwidth even with significant packet loss, as iperf3 measures the rate at which packets are sent/received, not necessarily successfully delivered.
TCP VS. UDP TESTING
When using TCP (the default), iperf3 measures the achievable maximum throughput, reflecting how much data can be reliably transmitted. For UDP, it measures the sending rate and reports statistics on jitter and packet loss, which are crucial for real-time applications like voice and video. UDP tests often require setting a target bandwidth (-b).
CLIENT/SERVER OPERATION
iperf3 always requires one instance to run as a server (listening for connections with -s) and another as a client (initiating connections to the server with -c). This dual-role setup allows for point-to-point network performance evaluation.
INTERPRETING RESULTS
The output typically includes bandwidth in bits/sec, duration of the test, and amount of data transferred. For UDP, additional metrics like jitter (variation in packet delay) and packet loss percentage are reported. High packet loss or jitter in UDP indicates network congestion or poor quality, while low TCP bandwidth might point to bottlenecks, insufficient buffer sizes, or network path issues.
HISTORY
iperf3 is a significant redesign of the original iperf (now often referred to as iperf2). It was developed by ESnet to address some limitations and simplify the codebase of its predecessor. Key improvements include a more modern architecture, JSON output for easier parsing, and support for a single connection bidirectional testing. Its development aims to provide a robust and extensible tool for modern network performance measurement.