
- Iperf3 Overview
- Common Used Parameters for both TCP and UDP
- TCP Network Performance Testing
- UDP Network Performance Testing
Iperf3 Overview
Iperf3 is a tool for performing network performance testing. It allows you to test the bandwidth, latency, and packet loss across network links by sending and receiving streams of data between two hosts. iperf3 operates in a client-server mode, where one machine runs as the server and another as the client. The client connects to the server and begins sending data, while iperf3 measures the performance of the network link between these two endpoints. It supports both TCP and UDP protocols, by default TCP is used.
Common Used Parameters for both TCP and UDP
-t, –time # time in seconds to transmit for (default 10 secs)
-P, –parallel # number of parallel client streams to run.
-i, interval # seconds between periodic throughput reports
TCP Network Performance Testing
Commonly used parameters for TCP Testing
-w, –window #[KMG] set send/receive socket buffer sizes. It indirectly sets TCP window size. You possibly need to use this parameter in a long fat network environment. Please refer to https://en.wikipedia.org/wiki/Bandwidth-delay_product for further information
-M, –set-mss # set TCP/SCTP maximum segment size. This setting will indirectly determine the packet size utilized for TCP performance testing. It may be necessary in scenarios involving IPSec or GRE tunnels within your network infrastructure to mitigate the effects of fragmentation on performance.
One example of TCP Testing on Linux
iperf3 -c server-ip -w 32M -M 1280 -P 16 -t 60
So my command uses the following parameters:
- send/receive socket buffer sizes = 32 MBytes
- 16 concurrent TCP sessions from IPerf3 client to server
- TCP MSS = 1280 bytes
- run the testing for 60 seconds
Regarding the set-mss parameter, I want to emphasize two points: First, it is still constrained by the NIC card’s MTU settings; even if you set an MSS value larger than the value of (MTU – TCP Headers – TCP Options – IP Headers), IPerf3 will not use that MSS size. Additionally, this parameter merely instructs the IPerf3 client and server on the configured TCP MSS value to use during TCP negotiation, but it does not change the TCP negotiation mechanism itself or override other mechanisms, such as path MTU discovery or TCP MSS clamping. For example, if a device in the network path is performing TCP MSS clamping, TCP will compare the clamped MSS and the one you set in IPerf3, and the smaller of the two will be used as the TCP MSS in IPerf3.
Notes: IP Headers = 20 bytes (IPv4) or 40 bytes (IPv6), TCP headers + TCP options can be as large as 60 bytes.
UDP Network Performance Testing
Commonly used parameters for UDP Testing
-u, –udp # use UDP rather than TCP
-b, –bitrate #[KMG][/#] target bitrate in bits/sec (0 for unlimited). Because the default value for TCP is unlimited, you normally don’t need to change this setting when performing TCP testing. However, you will need to adjust the setting for UDP to align with your network link capacity, as it defaults to only 1 Mbit/s.
-l, –length #[KMG] used to set the UDP payload size.
iperf3 -c server-ip -u -t 10 -b 1M -l 1000 -P 3
IPerf3 measures UDP performance using a mechanism different from TCP’s, primarily because UDP lacks TCP’s built-in mechanisms for ensuring delivery and order. In the UDP Iperf3 testing report, beyond traffic throughput, two metrics are especially crucial: packet loss and latency jitter. Achieving a high bitrate does not necessarily imply that end-to-end network connectivity is high-performing. A high packet loss rate signifies that either the underlying network cannot transmit the packets quickly enough, or the IPerf3 server lacks the computing capacity to process the received packets efficiently. Below is an example of an Iperf3 UDP test result, which shows the jitter and packet loss metrics.
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bitrate Jitter Lost/Total Datagrams
[ 5] 0.00-10.00 sec 358 MBytes 300 Mbits/sec 0.000 ms 0/280669 (0%) sender
[ 5] 0.00-10.00 sec 339 MBytes 284 Mbits/sec 0.077 ms 13401/279463 (4.8%) receiver
[ 7] 0.00-10.00 sec 358 MBytes 300 Mbits/sec 0.000 ms 0/280669 (0%) sender
[ 7] 0.00-10.00 sec 339 MBytes 284 Mbits/sec 0.068 ms 13475/279466 (4.8%) receiver
[ 9] 0.00-10.00 sec 358 MBytes 300 Mbits/sec 0.000 ms 0/280669 (0%) sender
[ 9] 0.00-10.00 sec 329 MBytes 276 Mbits/sec 0.064 ms 21895/280263 (7.8%) receiver
[SUM] 0.00-10.00 sec 1.05 GBytes 900 Mbits/sec 0.000 ms 0/842007 (0%) sender
[SUM] 0.00-10.00 sec 1007 MBytes 845 Mbits/sec 0.070 ms 48771/839192 (5.8%) receiver
iperf Done.
Thank you for your reading!