Skip to main content
RunBook Academy

LinuxXLII · Network Performanceiperf3

iperf3 and throughput testing - measuring bandwidth

Foundation⏱ ~10 miniperf3

What you'll learn

  • Run iperf3 in TCP and UDP modes
  • Measure bandwidth, latency, jitter, and loss
  • Interpret the output
  • Test the path between two specific hosts

Prerequisites

Verified against Ubuntu 24.04 LTS · Debian 12 (Bookworm) · RHEL 9.x · Rocky Linux 9.x · AlmaLinux 9.x · Linux kernel 6.1 LTS / 6.6 LTS · systemd 255+ · OpenSSH 8.7p1 (RHEL 9) / 9.6p1 (Ubuntu 24.04) · nftables 1.0.x · chrony 4.x · Pacemaker 2.1.x · Corosync 3.1.x · 2026-08-09

Not yet marked complete on this device.

iperf3 is the standard tool for measuring network performance. It can measure TCP bandwidth, UDP throughput, latency, jitter, and packet loss. This lesson covers the common uses.

Install iperf3

sudo apt install iperf3
# or
sudo dnf install iperf3

TCP bandwidth test

# Server
iperf3 -s

# Client
iperf3 -c server

Output:

[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.00  sec  1.09 GBytes   935 Mbits/sec    0
[  5]   0.00-10.00  sec  1.09 GBytes   935 Mbits/sec    0

Reading:

  • Transfer: 1.09 GB transferred.
  • Bitrate: 935 Mbits/sec.
  • Retr: 0 retransmits. Higher = more network loss.

For a 1 Gbps link, ~935 Mbps is normal. Lower indicates bottleneck.

UDP test

iperf3 -c server -u -b 1G

Output:

[ ID] Interval           Transfer     Bitrate         Jitter    Lost/Total Datagrams
[  5]   0.00-10.00  sec  1.19 GBytes  1.02 Gbits/sec  0.057 ms  0/858029 (0%)
  • Jitter: variation in packet arrival time. Low is better for streaming.
  • Lost/Total: packet loss. 0% is ideal; >0% indicates network loss or host saturation.

UDP tests at a target bitrate (-b 1G). The host sends 1 Gbps of UDP; the network may drop some. This tells you how much loss occurs at a given load.

Multiple parallel streams

iperf3 -c server -P 4

-P 4 runs 4 parallel streams. Some networks (Wi-Fi, multi-path TCP) perform better with multiple streams.

Reverse mode

iperf3 -c server -R

-R reverses the direction: server sends, client receives. Useful for testing download speeds.

UDP with bitrate limit

iperf3 -c server -u -b 100M    # 100 Mbps target
iperf3 -c server -u -b 1G      # 1 Gbps target

Use UDP to test how the network handles a specific load.

JSON output

iperf3 -c server -J    # JSON output

For machine-readable output, useful in CI or monitoring.

Test specific intervals

iperf3 -c server -t 30 -i 5    # 30s total, 5s intervals

Reports bitrate per interval. Useful for spotting variability.

Common patterns

PatternUse
Single TCP streamMaximum bandwidth
4 parallel TCP streamsEffective bandwidth (multi-path)
UDP at 1 GbpsLoss under load
UDP at 100 MbpsLoss at a specific rate
Reverse modeDownload speed
Long test (60s)Variability, jitter

Knowledge check

Knowledge check · 3 questions

  1. Q1. What does iperf3 -c server -u -b 1G do?

  2. Q2. iperf3 with -R tests the reverse direction.

  3. Q3. Which of the following are valid iperf3 options? Select all that apply.

Passing score: 75%. Answers are checked in this browser.