Iperf is a network performance testing tool. Iperf can test TCP and UDP bandwidth quality. The Iperf can measure the maximum TCP bandwidth with multiple parameters and UDP characteristics. Iperf can report bandwidth, delay jitter, and packet loss. Using Iperf, this feature can be used to test the performance of some network devices such as routers, firewalls, switches, and so on.
There are two versions of Iperf, Windows and Linux versions. Linux version update fast, the latest version is Iperf 3.0, the download address is http://code.google.com/p/iperf/downloads/list, The latest version of Windows version official update is 1.7 (packaged in jperf) and the download address is:
http://sourceforge.net/projects/iperf/files/jperf/jperf%202.0.0/, but migrated version iperf2.5 was found on the network. Iperf also has a graphical interface program called Jperf, which simplifies the construction of complex command-line parameters using the Jperf program, and it also saves test results while graphically displaying the results in real time. Of course, Jperf can test TCP and UDP bandwidth quality. The Jperf can measure the maximum TCP bandwidth with multiple parameters and UDP characteristics. Jperf can report bandwidth, delay jitter, and packet loss. To test the accuracy, try to use the Linux environment test.
Iperf and Jperf related files are packaged in the attachment
The main functions of Iperf are as follows: TCP Measurement network bandwidth report MSS/MTU value size and observations support TCP window values through socket buffering when p threads or Win32 threads are available, multithreading is supported. Client and server support simultaneous multi-connection UDP client can create UDP flow measurement packet with specified bandwidth latency support multicast when P threads are available, multithreading is supported. Client and server support simultaneous multi-connection (not supported Windows) other where appropriate, K (kilo-) and M (mega-) can be used in the options. For example, 131072 bytes can be replaced with 128K. You can specify the total time to run, and you can even set the total amount of data transferred. In the report, choose the most appropriate unit for your data. The server supports multiple connections, rather than waiting for a single-threaded test. Displays network bandwidth, fluctuations, and drops repeatedly at specified intervals. The server side can be run as a daemon. The server side can be run as a Windows service. Use typical data streams to test the impact of link-layer compression on available bandwidth. Supports transfer of specified files for qualitative and quantitative testing
Iperf Use method to install Iperf for Windows version of Iperf, directly extracted Iperf.exe and cygwin1.dll copied to%systemroot% directory for the Linux version of Iperf, Please use the following command to install
Gunzip-c iperf-<version>.tar.gz | TAR-XVF-
CD iperf-<version>
./configure
Make
Make install
Using Iperf (for example in Windows version)
Enter the Iperf command at the command prompt to run Iperf, and use the command iperf–help to view Iperf Help
Iperf parameter Introduction
command-line Options |
Description |
Client-to-server sharing options |
-F,--format [Bkmabkma] |
Formats the output of the number of bandwidths. The supported formats are: ' B ' = Bits/sec ' b ' = bytes/sec ' k ' = kbits/sec ' k ' = kbytes/sec ' m ' = mbits/sec ' m ' = mbytes/sec ' g ' = gbits/sec ' g ' = gbytes/sec ' A ' = Adaptive bits/sec ' A ' = Adaptive bytes/sec The adaptive format is one of kilo-and mega-. Fields other than bandwidth are output as bytes, unless the format of the output is specified, the default parameter is a. Note: Kilo = 1024x768 When calculating bytes byte, Mega = 1024^2,giga = 1024^3. Typically, in the network, Kilo = +, Mega = 1000^2, and Giga = 1000^3, so Iperf also calculates the bit (bit) by this. If this bothers you, use the-F B parameter and calculate it yourself. |
-I.,--interval # |
Sets the time interval, in seconds, between each report. If set to a value other than 0, the test report is output at this time interval. The default value is zero. |
-L,--len #[km] |
Sets the length of the read-write buffer. The default TCP mode is 8KB,UDP by default to 1470 bytes. |
-M,--print_mss |
Output TCP MSS value (via TCP_MAXSEG support). MSS values are generally 40 bytes smaller than the MTU value. Usual situation |
-P,--port # |
Set the port to be the same as the server-side listening port. The default is Port 5001, which is the same as ttcp. |
-U,--UDP |
Use UDP instead of TCP. See the-B option. |
-W,--window #[km] |
Sets the socket buffer to the specified size. For TCP mode, this setting is the TCP window size. For UDP, this is set to accept the buffer size of the UDP packet, limiting the maximum value that can be accepted for the packet. |
-B,--bind host |
One of several addresses that are bound to a host. For the client, this parameter sets the out-of-stack interface. For the server side, this parameter is set into the stack interface. This parameter is only used for hosts with multiple network interfaces. In Iperf UDP mode, this parameter is used to bind and join a multicast group. Use a multicast address ranging from 224.0.0.0 to 239.255.255.255. Refer to the-t parameter. |
-C,--compatibility |
Compatibility mode can be used when used with a lower version of Iperf. There is no need to use compatibility mode at both ends, but it is strongly recommended to use compatibility mode at both ends. In some cases, using some data streams can cause a server-side crash of version 1.7 or cause unintended connection attempts. |
-M,--mss #[km} |
Attempts to set the value of the TCP maximum information segment through the TCP_MAXSEG option. The size of the MSS value is usually the TCP/IP header minus 40 bytes. In Ethernet, the MSS value is 1460 bytes (MTU1500 bytes). Many operating systems do not support this option. |
-N,--nodelay |
Set the TCP no delay option to disable the Nagle ' s algorithm. Typically this option is disabled for interactive programs, such as Telnet. |
-V (from v1.6 or higher) |
Binds an IPV6 address. Service side: $ iperf-s–v Client: $ iperf-c <server IPv6 address>-V Note: In 1.6.3 or later, specifying a IPV6 address does not require the-B parameter binding, which is required prior to 1.6. In most operating systems, the IPV4 address of the IPV4 client map will be responded to. |
Server-side Private options |
-S,--server |
Iperf Server Mode |
-D (v1.2 or later) |
The UNIX platform Iperf is run as a daemon process. Under the Win32 platform, Iperf will run as a service. |
-R (v1.2 or later, for Windows only) |
Uninstall the Iperf service (if it is running). |
-O (v1.2 or later, for Windows only) |
Redirect output to the specified file |
-C,--client host |
If Iperf is running in server mode and a host is specified with the-c parameter, then Iperf will only accept connections from the specified host. This parameter does not work in UDP mode. |
-P,--parallel # |
The number of connections that were maintained before the server was shut down. The default is 0, which means that the connection is always accepted. |
Client-only options |
-B,--bandwidth #[km] |
The bandwidth used by UDP mode, Unit bits/sec. This option is related to the-u option. The default value is 1 mbit/sec. |
-C,--client host |
Run the Iperf client mode and connect to the specified Iperf server side. |
-D,--dualtest |
Run dual test mode. This causes the server side to reverse-connect to the client, using the port specified in the-l parameter (or by default, using the client to connect to the server-side port). This is done immediately at the same time as the operation. If you want an interactive test, try the-r parameter. |
-N,--num #[km] |
The number of buffers transmitted. Typically, Iperf sends data in 10 seconds. The-n parameter spans this limit and sends the specified length of data, regardless of how long it takes, for a specified number of times. Refer to the-L and-t options. |
-R,--tradeoff |
Reciprocating test mode. When the client-to-server test ends, the server side connects to the client by the port specified by the-l option (or by default, the client connects to the server-side port). When the client connection terminates, the reverse connection starts. If you need to do both bidirectional testing, try the-d parameter. |
-T,--time # |
Sets the total time for the transfer. Iperf sends packets of a specified length over a specified period of time. The default is 10 seconds. Refer to the-L and-n options. |
-L,--listenport # |
Specifies the port to use when the server is reverse-connected to the client. The default is to use a client connection to the port on the server. |
-P,--parallel # |
The number of threads. Specifies the number of threads that are used between the client and the server. The default is 1 threads. This parameter needs to be used by both the client and the server side. |
-S,--tos # |
The service type of the out-of-stack packet. Many routers ignore the TOS field. You can specify this value using a 16-digit number starting with "0x" or a 8-or 10-binary number starting with "0". For example, 16 binary ' 0x10 ' = 8 binary ' 020 ' = Decimal ' 16 '. The TOS value of 1349 is: Iptos_lowdelay Minimize Delay 0x10 Iptos_throughput Maximize Throughput 0x08 Iptos_reliability Maximize Reliability 0x04 Iptos_lowcost Minimize Cost 0x02 |
-T,--ttl # |
The TTL value of the outbound multicast packet. This is essentially the number of hops that data passes through the router. The default is 1, link local. |
-F (from v1.2 or higher) |
Use a specific data stream to measure bandwidth, such as the specified file. $ iperf-c <server address>-F <file-name> |
-I (from v1.2 or higher) |
As with-F, data is entered by a standard input and output file. |
Miscellaneous |
-H,--help |
Displays the command line reference and exits. |
-V,--version |
Displays version information and compilation information and exits. |
Testing the performance of a router with Iperf
test single-threaded TCP run Iperf on the server, enter command iperf–s–p 12345–i 1–m to enable Iperf on native port 12345
On the client run Iperf, enter the command iperf–c server-ip–p server-port–i 1–t 10–w 20K, where the parameters are described as follows:
-C: Client mode, followed by server IP
-P: Port after the server is listening
-I: Set the time interval for bandwidth reporting in seconds
-T: Sets the duration of the test in seconds
-W: Set the TCP window size, generally can not set, the default can be
After the test screenshot is as follows:
Client Screenshots
Service-side screenshot
Where: Interval represents the time interval. Transfer represents the amount of data transferred within the time interval. The bandwidth is the transfer rate in the time interval. The last line is the statistic for this test. The test shows that the average bandwidth is 89.9mbit/s.
Testing Multithreaded TCP
You can test multi-threaded TCP performance by adding the-p parameter to the client as follows: test case using two threads
Client
test single-threaded UDP (default bandwidth) run Iperf on the server, enter command iperf–s-u–p 12345–i 1 to enable Iperf on native Port 12345, and run in UDP mode on the client run Iperf, enter command iperf-c Server-ip-p server-port-i 1-t 10-b, wherein the parameters are described as follows:
-C: Client mode, followed by server IP
-P: Port after the server is listening
-I: Set the time interval for bandwidth reporting in seconds
-T: Sets the duration of the test in seconds
-B: Set the transmit bandwidth of UDP, Unit bit/s
Client
Service side
Among them, jitter is jitter, Lost/total is the number of packets lost, datagrams is the number of packets. test single-threaded UDP (Bandwidth is 10mbit/s)
Set the client bandwidth to 10M and use the parameter-B to specify
Client
Service side
Testing multithreaded UDP
Similar to multi-threaded TCP, you only need the client to specify the number of threads using the-p parameter
test two-way transmission of UDP
The client uses the parameter-D to run the dual test mode, and the client makes a UDP round trip test with the server. You can use the-l parameter to specify the port on which the dual test listens.
Client
Service-side test UDP reciprocating transmission
Similar to bidirectional transports, using the parameter-R to run interactive mode, you can still specify the port of interaction using the-l parameter.
Client
Service side
Distributed Testing
Test multiple IP addresses using multiple computers or using a single computer. When testing with multiple IP addresses for a single computer, you can use the-B command to bind an IP address of the NIC to test
Jperf How to use