The iperf3 Command

Run a Speed Test

iperf3 measures actual TCP or UDP throughput between two hosts — giving you real-world bandwidth numbers that a browser speed test cannot, because you control both endpoints.

What iperf3 Measures and Why It Differs from a Speed Test

A browser-based speed test measures throughput between your device and a specific public server chosen by the test provider. iperf3 measures throughput between any two hosts you control — your laptop and a server in another data centre, two machines on a LAN, a NAS and a workstation, or any pair of endpoints you can reach. This gives you precise, repeatable measurements of the link you actually care about, without the variability introduced by a third-party server's own network congestion or server load.

iperf3 uses a client-server model. One machine runs as the server (listening), and the other runs as the client (connecting and driving traffic). By default, traffic flows from client to server. Reversing the direction with -R measures the opposite path — useful for asymmetric links like consumer broadband where upload and download speeds differ.

Setting Up the Server and Client

On the machine acting as server:

iperf3 -s

This listens on TCP port 5201. On the client machine, connect and start a test:

iperf3 -c 192.168.1.10

Replace 192.168.1.10 with the server's IP address or hostname. The default test runs for 10 seconds and reports throughput in 1-second intervals.

Key Flags Reference

Flag Purpose Example
-s Run as server iperf3 -s
-c <host> Run as client, connect to host iperf3 -c 10.0.0.1
-p <port> Use a specific port (default 5201) iperf3 -s -p 9000
-t <seconds> Test duration (default 10 s) iperf3 -c host -t 30
-n <bytes> Transfer a fixed amount of data instead of fixed time iperf3 -c host -n 1G
-u Use UDP instead of TCP iperf3 -c host -u -b 100M
-b <bandwidth> Target bandwidth for UDP (or TCP with --fq-rate) -b 500M
-R Reverse direction (server sends to client) iperf3 -c host -R
-P <n> Run n parallel streams iperf3 -c host -P 4
-i <seconds> Reporting interval (default 1 s) iperf3 -c host -i 5
-J Output results as JSON iperf3 -c host -J

Reading TCP Output

A typical TCP test produces interval-by-interval output followed by a summary:

[ ID] Interval       Transfer     Bitrate         Retr  Cwnd
[  5]  0.00-1.00 sec   112 MBytes   940 Mbits/sec    0   3.13 MBytes
[  5]  1.00-2.00 sec   112 MBytes   939 Mbits/sec    0   3.13 MBytes
...
[  5]  0.00-10.00 sec  1.09 GBytes   937 Mbits/sec    2   sender
[  5]  0.00-10.04 sec  1.09 GBytes   934 Mbits/sec        receiver

Bitrate is the throughput in that interval. Retr is the number of TCP retransmissions in that interval — ideally zero. Cwnd (congestion window) is the amount of unacknowledged data TCP allows in flight; a growing Cwnd indicates the connection is ramping up normally. A Cwnd that stays small or shrinks suggests the receiver or network is throttling the flow.

Reading UDP Output

UDP output adds jitter and loss statistics:

[ ID] Interval       Transfer     Bitrate         Jitter   Lost/Total Datagrams
[  5]  0.00-10.00 sec   119 MBytes   100 Mbits/sec   0.082 ms   3/85733 (0.0035%)

Jitter is the variation in packet arrival time, measured in milliseconds — lower is better for real-time applications. The Lost/Total ratio shows how many UDP datagrams were dropped. For VoIP, jitter above 30 ms and loss above 1% will noticeably degrade call quality.

Practical Use Cases

iperf3 is the right tool for benchmarking a LAN to verify that a new switch or cable is performing at its rated speed, comparing WiFi versus wired performance between two devices, verifying that an ISP is delivering the contracted bandwidth by running iperf3 between two cloud VPS instances in different regions, and stress-testing a link before deploying latency-sensitive workloads.

Frequently Asked Questions

What is the difference between iperf3 and iperf2?

iperf3 is a complete rewrite of iperf2 with a cleaner codebase, JSON output support, and an improved server model. Unlike iperf2, iperf3 only allows one client connection to the server at a time. iperf2 supports simultaneous bidirectional testing natively and is still maintained in parallel. For most use cases iperf3 is the better choice due to its JSON output, reverse mode, and active development, but iperf2 remains useful for scenarios requiring concurrent multi-client tests.

How do I set up an iperf3 server?

On the machine you want to use as the server, run: iperf3 -s. This listens on TCP port 5201 by default. To use a different port, add -p: iperf3 -s -p 9000. The server runs until you press Ctrl+C. Make sure your firewall allows inbound connections on port 5201. On the client machine, connect with: iperf3 -c [server IP or hostname].

What does "retransmits" mean in iperf3 output?

Retransmits is the number of TCP segments the sender had to retransmit because no acknowledgement was received from the receiver. Retransmissions happen when packets are lost or arrive corrupted. A small number of retransmits on a long test is normal, but a high retransmit count — especially if it correlates with lower-than-expected throughput — indicates packet loss on the link, which may point to a faulty cable, a congested switch port, or WiFi interference.

Can I use iperf3 to test my internet connection?

Yes, but you need an iperf3 server at the other end. Some ISPs and universities run public iperf3 servers. You can also deploy your own server on a cloud VPS in a different region. This lets you measure the actual throughput of your internet connection to a specific endpoint, which is more controlled than a browser speed test. For a quick internet speed baseline without setting up a server, a browser speed test is faster and simpler.

How do I test UDP throughput with iperf3?

Add the -u flag to switch from TCP to UDP mode, and use -b to set the target bandwidth: iperf3 -c [server] -u -b 100M. Without -b, iperf3 defaults to 1 Mbps for UDP, which is far below most links. Set -b to slightly above your expected link speed to stress the path. UDP output includes jitter (in milliseconds) and a lost/total datagrams ratio, which together show how well the link handles constant-rate traffic — important for VoIP and video streaming assessments.

What bandwidth should I expect on a gigabit LAN?

On a wired gigabit Ethernet LAN with modern hardware, iperf3 TCP throughput typically reaches 940–980 Mbps — close to the theoretical 1000 Mbps line rate, with the gap accounted for by Ethernet framing overhead. If you see significantly less — say, under 700 Mbps — check for a 100 Mbps fallback on one of the interfaces, a faulty cable, or CPU bottlenecks on low-power hardware. WiFi speeds vary widely based on standard, channel width, distance, and interference.

Related Guides

More From This Section