🎁 New User? Get 20% off your first purchase with code NEWUSER20 Register Now →
Menu

Categories

iperf3 Command

Intermediate Networking man(1)

Network bandwidth measurement tool

📅 Updated: Mar 16, 2026
SYNTAX
iperf3 [-s | -c SERVER] [OPTIONS]

What Does iperf3 Do?

The iperf3 command is the industry-standard tool for measuring network bandwidth, latency, jitter, and packet loss between two endpoints. It generates TCP or UDP traffic at maximum or controlled rates and reports detailed performance statistics.

iperf3 works in a client-server model: one host runs iperf3 in server mode (-s) and the other connects as a client (-c). The client generates traffic, and both sides report throughput, retransmissions, congestion window size, and other network metrics. Tests can run over TCP (default) or UDP, with customizable duration, parallel streams, bandwidth limits, and buffer sizes.

System administrators and network engineers use iperf3 for baseline performance testing, troubleshooting slow connections, validating QoS configurations, testing VPN overhead, verifying link speeds after hardware changes, and comparing network paths. It is far more accurate than speed test websites because it measures point-to-point performance within your infrastructure.

iperf3 is a complete rewrite of the original iperf2, offering JSON output for automation, a more reliable testing engine, and a cleaner codebase. It is available on virtually every platform including Linux, macOS, Windows, FreeBSD, and even Android.

Options & Flags

OptionDescriptionExample
-s Run as server (listen for connections) iperf3 -s
-c SERVER Run as client, connect to server iperf3 -c 10.0.0.1
-p PORT Set server port (default: 5201) iperf3 -s -p 5200
-t SECONDS Test duration (default: 10 seconds) iperf3 -c 10.0.0.1 -t 30
-P N Number of parallel streams iperf3 -c 10.0.0.1 -P 4
-R Reverse mode (server sends, client receives) iperf3 -c 10.0.0.1 -R
-u Use UDP instead of TCP iperf3 -c 10.0.0.1 -u -b 100M
-b RATE Target bandwidth (UDP default: 1Mbps) iperf3 -c 10.0.0.1 -u -b 1G
-J Output in JSON format iperf3 -c 10.0.0.1 -J > result.json
--bidir Bidirectional test (simultaneous send/receive) iperf3 -c 10.0.0.1 --bidir

Practical Examples

#1 Start iperf3 server

Listen on port 5201 for incoming test connections. Keep running until terminated.
$ iperf3 -s
Output: Server listening on 5201

#2 Basic TCP bandwidth test

Run a 10-second TCP throughput test. Reports bandwidth, retransmissions, and congestion window size.
$ iperf3 -c 10.0.0.1 -t 10

#3 Test with parallel streams

Use 4 parallel TCP streams for 30 seconds. Multiple streams can saturate high-bandwidth links better.
$ iperf3 -c 10.0.0.1 -P 4 -t 30

#4 UDP test with packet loss

Send 100 Mbps of UDP traffic. Reports jitter, packet loss percentage, and out-of-order packets.
$ iperf3 -c 10.0.0.1 -u -b 100M -t 10

#5 Test download speed (reverse)

Reverse mode: server sends to client. Tests download bandwidth instead of upload.
$ iperf3 -c 10.0.0.1 -R

#6 Bidirectional test

Test upload and download simultaneously. Reveals full-duplex performance and asymmetric bottlenecks.
$ iperf3 -c 10.0.0.1 --bidir -t 20

#7 JSON output for automation

Get machine-readable results. Pipe through jq to extract specific metrics for monitoring dashboards.
$ iperf3 -c 10.0.0.1 -t 10 -J | jq .end.sum_sent.bits_per_second

#8 Test VPN overhead

Compare bandwidth with and without VPN to measure encryption/encapsulation overhead.
$ echo "Direct:" && iperf3 -c 10.0.0.1 -t 5 -J | jq .end.sum_sent.bits_per_second && echo "VPN:" && iperf3 -c 10.8.0.1 -t 5 -J | jq .end.sum_sent.bits_per_second

Tips & Best Practices

Open firewall for iperf3: Allow port 5201/tcp on the server: sudo ufw allow 5201/tcp or sudo firewall-cmd --add-port=5201/tcp. Remember to close it after testing.
iperf3 uses significant bandwidth: iperf3 will saturate the link by default. Run tests during maintenance windows or use -b to limit bandwidth. Avoid running on production networks during peak hours.
TCP vs UDP testing: TCP tests measure maximum achievable throughput. UDP tests measure jitter and packet loss at a specified rate. Use TCP for bandwidth measurement, UDP for VoIP/video quality assessment.
Multiple test runs: Run tests multiple times and at different times of day. Single tests can be misleading due to network congestion, CPU load, or temporary conditions.
Install iperf3: Install with: apt install iperf3 (Debian/Ubuntu), dnf install iperf3 (Fedora/RHEL). Public iperf3 servers exist for testing: ping.online.net, iperf.scottlinux.com.

Frequently Asked Questions

How do I test network speed between two Linux servers?
On server A: iperf3 -s. On server B: iperf3 -c SERVER_A_IP. The client will report bandwidth, retransmissions, and congestion window for a 10-second TCP test.
What is a good iperf3 result?
It depends on your link: 1 Gbps links should achieve 920-940 Mbps (some overhead). 10 Gbps should hit 9.3-9.5 Gbps. Low retransmissions and consistent throughput indicate a healthy link.
How do I test UDP performance with iperf3?
Use -u flag with a target bandwidth: iperf3 -c SERVER -u -b 100M. Reports jitter and packet loss %. Less than 1% loss and <5ms jitter is good for real-time applications.
Can I use iperf3 to test internet speed?
Yes, using public iperf3 servers: iperf3 -c ping.online.net. However, results depend on the route to the server. For consumer internet speed tests, speedtest-cli may be more appropriate.
Why is iperf3 showing lower bandwidth than expected?
Common causes: CPU bottleneck (use -P for parallel streams), small TCP window (adjust with -w), network congestion, MTU issues, or driver/firmware problems. Check for retransmissions in the output.

Master Linux with Professional eBooks

Curated IT eBooks covering Linux, DevOps, Cloud, and more

Browse Books →