iperf
Measure network bandwidth performance
TLDR
Run on server
Run on server using UDP mode and set server port to listen on 5001
Run on client
Run on client every 2 seconds
Run on client with 5 parallel threads
Run on client using UDP mode
SYNOPSIS
iperf [-s|-c host] [options]
PARAMETERS
-s
Run in server mode, listening for connections on a specified port.
-c host
Run in client mode, connecting to the server at 'host'.
-p port
Specify the port number to use. Default is 5201.
-u
Use UDP instead of TCP.
-b bandwidth
Set target bandwidth in bits/sec. (UDP only)
-t time
Set the duration of the test, in seconds. Default is 10 seconds.
-i interval
Set the reporting interval, in seconds. Default is 1 second.
-f format
Format to report: 'k' (KBytes), 'm' (MBytes), 'g' (GBytes). Default is 'm' for TCP and 'k' for UDP
-n num
Number of bytes to transmit (instead of -t).
-l length
Set the length of read/write buffers. Default 8 KB.
-w size
TCP window size (socket buffer size). Auto determines if not set.
-M MSS
TCP maximum segment size (MTU - 40 bytes).
DESCRIPTION
iperf is a widely used command-line tool for performing network throughput measurements.
It allows users to test the bandwidth between two nodes, one acting as a server and the other as a client.
iperf supports various protocols, including TCP, UDP, and SCTP, and offers options to adjust buffer sizes, window sizes, and transport settings.
This makes it a versatile tool for diagnosing network performance issues, identifying bottlenecks, and verifying network configurations.
With iperf, you can quickly assess the achievable bandwidth, packet loss, and latency of a network connection.
It is commonly employed by network administrators, developers, and researchers to ensure network stability and optimize data transfer rates.
Its simplicity and flexibility have made it a standard tool for network performance analysis across diverse platforms.
CAVEATS
iperf provides a measurement of achievable bandwidth between two points. It does not guarantee actual application throughput, as many factors can influence the actual throughput of an application (e.g. application layer protocol overhead).
PRACTICAL CONSIDERATIONS
Ensure firewalls allow traffic on the selected port.
Run tests multiple times and average results to account for network variability.
For accurate UDP tests, consider adjusting the bandwidth parameter (-b) to avoid exceeding network capacity.
HISTORY
iperf was originally developed by NLANR/DAST as a tool for measuring network performance. It has evolved through various versions and is now maintained and distributed by different projects. The tool became popular and widely used for network benchmarking and troubleshooting.