iperf3 is a professional network performance testing tool. Its core function is to measure the maximum available bandwidth between two network nodes by generating data streams.
You can think of it as a network “stress test” or “checkup” tool — it accurately reflects the actual bandwidth and quality of network links.
Main Use Cases
1. Bandwidth Measurement
Typical application scenario: Run the iperf3 server (server mode) on one computer and the iperf3 client on another. The client sends data to the server, and the bandwidth between them is calculated. For example, test the actual speed from your computer to your home router, or the network speed between different locations in your office.
2. Network Troubleshooting
When you feel that network speed is slow, you can use iperf3 to determine whether the issue is at the application layer (e.g., a website server responding slowly) or at the network level. If the bandwidth measured by iperf3 is also low, the problem likely lies in the network link, switch, or network interface card.
3. Verifying Network Configuration and Performance
After adjusting QoS (Quality of Service), rate-limiting policies, or firewall rules on network devices (e.g., switches, routers), use iperf3 to verify that the configuration has taken effect and performance meets expectations.
4. Comparing Wired and Wireless Network Performance
At the same location, run tests via both wired and Wi-Fi connections to intuitively compare the losses and stability differences of the wireless network.
5. Testing Network Stability (Jitter and Packet Loss Rate)
iperf3 can report jitter (variation in packet delay) and packet loss rate during the test, which is especially important for applications that require high network stability, such as video conferencing and online gaming.
Usage Tutorial
Note: Testing requires two computers — one deployed as a server and the other as a client.
- Download and Extract
- Download iperf3 and extract it. It is recommended to place it in the root directory of the disk.
- This software cannot be run by double-clicking; it must be operated via the command line.
- Prepare the Runtime Environment
- Open the Command Prompt (cmd) and use the
cdcommand to switch to the disk where the extracted directory is located. For example, if extracted to the D drive, enter:
// Example code
cd D:/
- After entering the disk root directory, use the
cdcommand again to enter the iperf3 directory. You can typeiperfand press the Tab key for auto-completion, then addcdin front of it.
- Run iperf3
- After entering the iperf3 directory, type
iperf3.exeto run the software. If you see the following prompt, it means the software has started successfully:
// Example code
iperf 3.17 (c2 2023-08-24) Windows 10 These are the basic commands...
- To view the complete command list, enter
iperf3 -h.
- Start the Server
- Run the following command on the server to start the service (listening on port 5201 by default):
// Example code
iperf3 -s
- After successful startup, the following will be displayed:
// Example code
Server listening on 5201
- Client Initiates Test
- Run the following command on the client to connect to the server and start testing:
// Example code
iperf3 -c <server IP>
- After the test completes, the bandwidth and other results will be displayed.
- Custom Port
- If the default port cannot be used, you can specify a custom port using the
-por--portparameter. - Server listening on port 5202:
// Example code
iperf3 -s -p 5202
- Client connecting to the server on the specified port:
// Example code
iperf3 -c 192.168.1.10 -p 5202
TCP Test Commands
- Parallel connections (suitable for high-bandwidth link performance testing):
// Example code
iperf3 -c <server IP> -P 4
- Reverse test (server sends data, client receives — used to rule out client-side performance bottlenecks):
// Example code
iperf3 -c <server IP> -R
- Specify test duration (default is 10 seconds; here changed to 30 seconds):
// Example code
iperf3 -c <server IP> -t 30
- Combining options (4 parallel connections, reverse test, 30 seconds):
// Example code
iperf3 -c <server IP> -P 4 -R -t 30
UDP Test
UDP testing does not automatically saturate the bandwidth; you must manually specify the target bandwidth. It is suitable for testing jitter and packet loss under specific traffic conditions.
- Basic UDP test (bandwidth must be specified):
// Example code
iperf3 -c <server IP> -u -b 100M
-u: Specifies the use of the UDP protocol.-b 100M: Specifies a target bandwidth of 100 Mbps. Adjust to10M,1G, etc., as needed for your network.- Common UDP parameters
- Test 50 Mbps traffic:
// Example code
iperf3 -c <server IP> -u -b 50M
- Specify UDP packet length (default is 1470 bytes; here set to 1000 bytes):
// Example code
iperf3 -c <server IP> -u -b 100M -l 1000
- Reverse UDP test (server sends UDP stream to client):
// Example code
iperf3 -c <server IP> -u -b 100M -R
Interpreting UDP Test Results
In UDP test results, in addition to bandwidth, you should also pay close attention to:
- Jitter: The smaller the value, the more stable the network.
- Lost/Total Datagrams (Packet Loss Rate): The lower the packet loss rate, the better.
Example result:
// Example code
[ ID] Interval Transfer Bitrate Jitter Lost/Total Datagrams
[ 5] 0.00-20.00 sec 119 MBytes 50.0 Mbits/sec 0.123 ms 12/85216 (0.014%)
The above result shows that at 50 Mbps traffic, jitter is only 0.123 ms and the packet loss rate is 0.014%, indicating excellent network quality.
Test Scenario Examples
Assume the server IP is 192.168.1.10.
- Scenario 1: Test intranet TCP performance using 4 parallel connections
// Example code
iperf3 -c 192.168.1.10 -P 4
Result focus: Check the Bitrate. If it is close to the network device limit (e.g., 941 Mbits/sec for a gigabit network card), it is normal.
- Scenario 2: Simulate video streaming, test network quality under 50 Mbps UDP traffic
// Example code
iperf3 -c 192.168.1.10 -u -b 50M -t 20
Result focus: Check Jitter and Lost/Total Datagrams to evaluate network stability.
Important: The server must first run iperf3 -s, then execute the above -c commands on the client.