Iperf is a network performance testing tool. Iperf can test TCP and UDP bandwidth quality. Iperf can measure the maximum TCP bandwidth, with a variety of parameters and UDP characteristics. Iperf can report bandwidth, delay jitter, and packet loss. Using the Iperf feature, you can test the performance of some network devices such as routers, firewalls, switches, and so on.
There are two versions of Iperf, the Windows version and the Linux version. Linux version update fast, the latest version of Iperf 3.0, download address for http://code.google.com/p/iperf/downloads/list, The latest version of the official update for Windows version is 1.7 (packaged in jperf) and the download address is:
http://sourceforge.net/projects/iperf/files/jperf/jperf%202.0.0/, but the porting 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 by using Jperf programs, and it also saves test results and graphically displays results in real time. Of course, Jperf can test TCP and UDP bandwidth quality. Jperf can measure the maximum TCP bandwidth, with a variety of parameters and UDP characteristics. Jperf can report bandwidth, delay jitter, and packet loss. For the accuracy of the test, 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 for TCP window values through socket buffering supports multithreading when P threads or Win32 threads are available. Client and server-side support simultaneous multiple-connection UDP clients can create a specified bandwidth UDP stream measure packet loss measurement latency support for multicast when P threads are available, multithreading is supported. The client and server support simultaneous multiple connections (Windows not supported) other in the appropriate place, 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, or even set the total amount of data to be transferred. In the report, select the most appropriate unit for the data. The server supports multiple connections, rather than waiting for a single threaded test. Repeats network bandwidth, fluctuations, and packet loss at specified intervals. The server side can be run as a background program. The server side can run as a Windows service. Use typical data streams to test the impact of link layer compression on available bandwidth. Supports the transfer of specified files, which can be qualitatively and quantitatively tested
Iperf Use the method to install Iperf for Windows version of the Iperf, directly to the extracted Iperf.exe and cygwin1.dll copied to the%systemroot% directory for the Linux version of the 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 the 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-server sharing options |
-F,--format [Bkmabkma] |
Format bandwidth number output. 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 Adaptive format is one of kilo-and mega-. Fields other than bandwidth are output as bytes, unless the output is specified in the format, the default parameter is a. Note: When you count byte byte, Kilo = 1024, Mega = 1024^2,giga = 1024^3. Typically, in the network, Kilo = 1000, Mega = 1000^2, and Giga = 1000^3, so Iperf also calculates the bit (bit). If this bothers you, then use the-F-B parameter and then do the calculations 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. TCP mode defaults to 1470 bytes by default to 8KB,UDP mode. |
-M,--print_mss |
Outputs the TCP MSS value (supported by TCP_MAXSEG). The MSS value is typically 40 bytes smaller than the MTU value. Usually the case |
-P,--port # |
Set the port to match the server-side listening port. The default is Port 5001, the same as ttcp. |
-U,--UDP |
Use UDP instead of TCP mode. Refer to 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 is bound to a host. For the client, this parameter sets the Stack interface. For the server side, this parameter is set into the stack interface. This parameter is used only 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. Reference-T parameter. |
-C,--compatibility |
Compatibility mode can be used when used with a iperf version. There is no need to use compatibility mode at both ends, but it is strongly recommended that both ends use compatibility mode. In some cases, the use of certain data streams can cause the server side of version 1.7 to crash or cause unexpected connection attempts. |
-M,--mss #[km} |
Attempt to set the TCP maximum information segment value with the TCP_MAXSEG option. The MSS value is usually the size of the TCP/IP header minus 40 bytes. In Ethernet, the MSS value is 1460 bytes (MTU1500 bytes). This option is not supported by many operating systems. |
-N,--nodelay |
Set TCP No Latency option, disable Nagle ' s algorithm. Typically this option is disabled for interactive programs, such as Telnet. |
-V (from v1.6 or higher) |
Binds a IPV6 address. Service side: $ iperf-s–v Client: $ iperf-c <server IPv6 address>-V Note: In 1.6.3 or later versions, the specified IPV6 address does not need to be bound with the-b parameter, which is required prior to 1.6. In most operating systems, the IPV4 address of the IPV4 client mapping is responded to. |
Server-Side specific options |
-S,--server |
Iperf Server Mode |
-D (v1.2 or later) |
The UNIX platform under Iperf runs as a daemon. Under the Win32 platform, Iperf will run as a service. |
-R (v1.2 or later, only for Windows) |
Uninstall the Iperf service (if it is running). |
-O (v1.2 or later, only for Windows) |
Redirect output to specified file |
-C,--client host |
If Iperf is running in server mode and specifies a host with the-c parameter, then Iperf will only accept connections for 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-specific options |
-B,--bandwidth #[km] |
The bandwidth used in UDP mode, Unit bits/sec. This option is associated with the-u option. The default value is 1 mbit/sec. |
-C,--client host |
Runs the Iperf client mode and connects 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). These are done immediately at the same time as the operation. If you want an interactive test, try the-r argument. |
-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 at a specified number of times, regardless of how long the operation takes. Reference-L and-t options. |
-R,--tradeoff |
Reciprocating test mode. When the client to the server-side test ends, the server side connects to the client via 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 begins. If you need to do both bi-directional testing, try the-D argument. |
-T,--time # |
Sets the total time of the transfer. Iperf sends packets of a specified length repeatedly over a specified amount of time. The default is 10 seconds. Refer to the-L and-n options. |
-L,--listenport # |
Specifies the port to use when the service side is connected to the client in reverse. The default is to use the port that the client connects to the server. |
-P,--parallel # |
The number of threads. Specifies the number of threads to use between the client and the server. The default is 1 threads. This parameter is required for both the client and the server side. |
-S,--tos # |
The service type of the stack packet. Many routers ignore the TOS field. You can specify this value, using the 16 number starting with "0x", or the 8 or 10 binary number starting with "0". For example, the 16 ' 0x10 ' = 8 in ' 020 ' = Decimal ' 16 '. TOS Value 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 stack multicast packet. This is essentially the number of hops the data passes through the router. The default is 1, the link is local. |
-F (from v1.2 or higher) |
Measure bandwidth using a specific data flow, such as a specified file. $ iperf-c <server address>-F <file-name> |
-I (from v1.2 or higher) |
As with-f, input data from a standard input and output file. |
Miscellaneous |
-H,--help |
Displays the command line reference and exits. |
-V,--version |
Displays version information and compiles information and exits. |
Using Iperf to test router performance
Test single-threaded TCP running 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 below:
-C: Client mode, followed by server IP
-P: Ports that are followed by a service-side listener
-I: Set the time interval for bandwidth reporting, in seconds
-T: Set the length of the test in seconds
-W: Set the TCP window size, you can generally do without settings, default can
After the test screenshot is as follows:
Client screenshot
Service-side Screenshots
Where: Interval represents the time interval. Transfer represents the amount of data that is transferred within the time interval. Bandwidth is the rate of transmission in the time interval. The last line is the statistics for this test. The test shows that the average bandwidth is 89.9mbit/s.
Testing Multithreaded TCP
Adding the-p parameter on the client tests multithreaded TCP performance, as follows: Testing with two threads
Client
Test single-threaded UDP (default bandwidth) to run Iperf on the server, enter command iperf–s-u–p 12345–i 1 to enable Iperf on native Port 12345, and run Iperf in UDP mode on the client, enter command iperf-c Server-ip-p server-port-i 1-t 10-b, where parameters are described below:
-C: Client mode, followed by server IP
-P: Ports that are followed by a service-side listener
-I: Set the time interval for bandwidth reporting, in seconds
-T: Set the length of the test in seconds
-B: Set UDP send bandwidth, unit bit/s
Client
Service side
Among them, jitter is jitter, Lost/total is lost packet number, datagrams is packet quantity. test single-threaded UDP (Bandwidth is 10mbit/s)
Set client bandwidth to 10M, use parameter-B to specify
Client
Service side
Testing multithreaded UDP
Similar to multithreaded TCP, the client only needs to specify the number of threads using the-p parameter
test the two-way transmission of UDP
The client uses parameter-D to run the dual test mode, and the client carries out UDP round-trip testing with the server. You can use the-l parameter to specify the port on which the dual test is listening.
Client
Service-side test for UDP reciprocating transmission
Similar to bidirectional transport, use parameter-R to run interactive mode, and you can still use the-l parameter to specify the port of the interaction.
Client
Service side
Distributed Testing
Test multiple IP addresses using more than one computer or using a single computer. When using multiple IP address tests for a single computer, you can use the-B command to bind an IP address of the NIC to test
How to use Jperf