Shravan Kumar Pattiwar Network Lab

iperf Commands for Network Testing

Installation Commands

sudo apt update
sudo apt install iperf3
Install iperf3 on a Debian-based system.
brew install iperf3
Install iperf3 using Homebrew on macOS.
yum install iperf3
Install iperf3 on a Red Hat-based system.

1. Basic Server Mode

iperf3 -s
Starts the iperf server, listening for incoming connections.

2. Basic Client Mode

iperf3 -c <server_ip_address>
Connects to the iperf server to measure network performance.

3. Run Test for a Specified Duration

iperf3 -c <server_ip_address> -t 30
Runs the test for 30 seconds instead of the default 10 seconds.

4. Use UDP Instead of TCP

iperf3 -c <server_ip_address> -u
Switches the test to use UDP protocol.

5. Set Bandwidth for UDP Tests

iperf3 -c <server_ip_address> -u -b 10M
Sets the bandwidth for the UDP test to 10 Mbps.

6. Run Multiple Parallel Streams

iperf3 -c <server_ip_address> -P 5
Runs the test with 5 parallel client streams.

7. Reverse Mode Test

iperf3 -c <server_ip_address> -R
Runs the test in reverse mode, where the server sends data to the client.

8. Display Bandwidth in Bits Per Second

iperf3 -c <server_ip_address> -f b
Displays the bandwidth in bits per second.

9. Set Specific Port

iperf3 -s -p 5201
Runs the server on port 5201 instead of the default.

10. Show Detailed Statistics

iperf3 -c <server_ip_address> -V
Displays detailed statistics for the test.

11. Test with TCP Window Size

iperf3 -c <server_ip_address> -w 512K
Sets the TCP window size to 512 KB for the test.

12. Set Time Interval for Reporting

iperf3 -c <server_ip_address> -i 5
Sets the interval for reporting bandwidth, default is 1 second.

13. JSON Output Format

iperf3 -c <server_ip_address> -J
Outputs results in JSON format, useful for parsing by scripts.

14. Specify Number of Streams

iperf3 -c <server_ip_address> -P 10
Runs the test with 10 parallel streams, increasing total throughput.

15. Use IPv6

iperf3 -c <server_ip_address> -6
Runs the test using IPv6 addresses.

iperf UDP Extra Commands

This guide will help you understand how to send a specific amount of data (in MB) using iperf over UDP. The goal is to specify the total data size to be transmitted, rather than using the time-based condition.

Basic Syntax

To send a specified amount of data using UDP in iperf, the following command can be used:

iperf -c <server_ip> -u -b <bandwidth> -n <data_size>

Command Breakdown

Examples

Example 1: Send 50 MB of UDP Data

In this example, the client sends 50 MB of data to the server at an IP address of 192.168.1.1 with a bandwidth of 10 Mbps:

iperf -c 192.168.1.1 -u -b 10M -n 50M

Example 2: Send 100 MB of UDP Data

To send 100 MB of data at 20 Mbps, the command would look like this:

iperf -c 192.168.1.1 -u -b 20M -n 100M

Important Notes