What is iperf?
Iperf is a network performance testing tool. Iperf can test the maximum TCP bandwidth and report UDP bandwidth, latency jitter, and packet loss. Specific functions include
- Measure network bandwidth
- Report the size and observations of MSS/MTU values
- Supports TCP Window value buffering through socket
- Multithreading is supported when P or Win32 threads are available. The client and server support multiple connections at the same time
- The client can create a UDP stream with the specified bandwidth.
- Measurement packet loss
- Measurement Delay
- Support Multicast
- Multithreading is supported when P threads are available. The client and server support multiple connections at the same time (windows is not supported)
- Where appropriate, K (kilo-) and M (mega-) can be used in the options -). For example, 131072 bytes can be replaced by kb.
- Specify the total running time, or even set the total amount of transmitted data.
- Select the most appropriate unit for data in the report.
- The server supports multiple connections instead of waiting for a Single-thread test.
- The network bandwidth, fluctuations, and packet loss are repeatedly displayed at the specified interval.
- The server can be used as the backendProgramRun.
- The server can run as a Windows service.
- Use typical data streams to test the effect of link layer compression on available bandwidth.
Parameters:
-S starts in server mode. For example: iperf-S
-C host is started in client mode. The host is the server address, for example, iperf-C 222.35.11.23.
Common Parameters
-F [k | M | K | M]: displays reports in kbits, Mbits, Kbytes, and Mbytes. The default value is Mbits. For example: iperf-C 222.35.11.23-f k.
-I sec displays the report interval in seconds. For example: iperf-C 222.35.11.23-I 2
-L buffer size, 8 KB by default, eg: iperf-C 222.35.11.23-L 16
-M: displays the maximum MTU value of TCP.
-O Outputs Reports and error messages to the file eg: iperf-C 222.35.11.23-o c: \ iperflog.txt
-P specifies the port used by the server or the port connected by the client, such as: iperf-s-p 9999; iperf-C 222.35.11.23-P 9999
-U uses UDP protocol
-W: Specifies the TCP window size. The default value is 8 KB.
-B binds a host address or interface (this parameter is used when the host has multiple addresses or interfaces)
-C is compatible with the old version (used when the server and client versions are different)
-M: sets the maximum MTU value of TCP packets.
-N: set no TCP latency
-V transmission of IPv6 data packets
Server-specific parameters
-D run ipserf, eg: iperf-s-d as a service
-R stops the iperf service. For-D, eg: iperf-S-R
Dedicated client Parameters
-D. Perform bidirectional transmission test at the same time.
-N indicates the number of bytes transmitted. For example, iperf-C 222.35.11.23-N 100000
-R independent bidirectional transmission test
-T test time. The default value is 10 seconds. For example, iperf-C 222.35.11.23-T 5.
-F specifies the file to be transferred
-T specifies the TTL value.
Example:
1. UDP Mode
Server
Iperf-u-s
Client
Iperf-C 192.168.1.1-u-p 1-I 1-P 5001-f m-B 45 m-T 20-T 10
In UDP mode, the data transmission rate is 45 Mbps, and the client-to-server 192.168.1.1 upload bandwidth is tested. The test time is 20 seconds.
Iperf-u-c 192.168.1.1-B 5 m-P 30-T 60
The client simultaneously initiates 30 connection threads to the server at a rate of 5 Mbps.
Iperf-u-c 192.168.1.1-B 100 m-D-T 60
Use MB as the data transmission rate to test the upstream and downstream bandwidth.
2. TCP Mode
Server
Iperf-S
Client
Iperf-C 192.168.1.1-P 1-I 5-P 5001-F M-T 120
In TCP mode, the upload bandwidth from the client to the server 192.168.1.1 is tested for 120 seconds.
Iperf-C 192.168.1.1-P 30-T 60
The client simultaneously initiates 30 connection threads to the server.
Iperf-C 192.168.1.1-D-T 60
Test the upstream and downstream bandwidth.
Jperf: iperf Gui
Note:
- It is best to use UDP when testing htb. The UDP communication overhead is small, and the test bandwidth is more accurate.
- The bandwidth test usually uses the UDP mode because it can measure the limit bandwidth, latency jitter, and packet loss rate. During the test, the theoretical bandwidth of the link is used as the data transmission rate. For example, if the theoretical bandwidth of the link from the client to the server is 100 Mbps, the test is performed with-B M, then, based on the test results (including actual bandwidth, latency jitter, and packet loss rate), and then using the actual bandwidth as the data transmission rate for testing, we will find that latency jitter and packet loss rate are much better than the first time, after repeated tests, a stable actual bandwidth can be obtained.
Reference:
The quality of a link can be tested as follows:
-Latency (Response Time or RTT): can be measured with the ping command.
-Jitter (latency variation): can be measured with an iperf UDP test.
-Datemediloss: can be measured with an iperf UDP test.