http://blog.163.com/hlz_2599/blog/static/142378474201341341339314/
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, for Http://code.google.com/p/iperf/downloads/list, the latest version of the official Windows version of the update is 1.7 (packaged in Jperf), as follows:
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
- Measuring network bandwidth
- Report the size and observations of the MSS/MTU value
- Supports TCP window values through socket buffering
- Multithreading is supported when a P thread or WIN32 thread is available. Client and server support simultaneous multi-connection
Udp
- Clients can create UDP streams of specified bandwidth
- Measure Drop Packets
- Measurement delay
- Support Multicast
- Multithreading is supported when P threads are available. Client and server support simultaneous multi-connection (Windows not supported)
Other
- In the right place, you can use K (kilo-) and M (mega-) 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 How to use
- Installing Iperf
- For Windows edition Iperf, copy the extracted Iperf.exe and cygwin1.dll directly to the%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 |
Describe |
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
- In 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
The following tests are followed:
Client
Service side
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-thread 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 the command iperf-c server-ip-p server-port-i 1-t 10-b, 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
-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
- Testing UDP Reciprocating Transmissions
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 JPerf2.0 introduction
Jperf is a Java program that graphically iperf the command line;
Using the JPERF program simplifies the construction of complex command-line parameters, and it also saves test results while graphically displaying the results in real time. 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.
JPERF2.0 Operating Environment
Operating system: Java Runtime Environment: JREjxpiinstall.exe
Network requirements: Jperf can run on any IP network, including local Ethernet, Internet access and Wi-Fi networks.
Other: Use JPerf must have two components installed: JPerf server (for listening to incoming test requests) and JPERF client (for initiating a test session)
JPerf2.0 pages such as:
JPerf2.0 Specific Introduction
- Iperf command Line (cannot be entered directly)
- Service-Side settings
Listening Port: 5001
Client limit: Only allow client connections to be specified
Num Connections: Maximum allowable number of connections, 0 not Limited
- Client settings
Server address: 10.0.115.82, Port: 5001, concurrent stream: one
- Application Layer Settings
1, compatible with the old version (when the server side and client side version is not the same)
2, set the test mode: The total size of the transmission bytes 15Bytes or the total length of transmission time 15 seconds
3. Simultaneous two-way transmission test
4, separate two-way transmission test, the first measurement of C to s bandwidth
5. Specify the files that need to be transferred
6. Display TCP Maximum MTU value
- Transport Layer Settings
1. TCP protocol
Set Buffer size
Specify the TCP window size
Set the maximum MTU value for a TCP packet
Set TCP no delay
2. UDP protocol
Set UDP maximum Bandwidth
Set the UDP buffer
UDP packet Package Size: Default 1470 Byte
- IP layer Settings
1. Specify the TTL value
2, service type (type of service, ToS), size range from 0x10 (minimum delay) to 0x2 (minimum cost)
In WLANs that use 802.11e to control quality of service, TOS is mapped in the context of Wi-Fi multimedia (WMM) access.
JPerf2.0 Test Examples:
- Test content (UDP):
UDP buffer Size: default, 0.01M
UDP Packet Size: default, 1470 byte
Port: 5001
Ttl:1
Test NIC Bandwidth: 1000M
Total test time: ten S
Time interval: 1 s
Display unit: M
Test Flow: A
- Client:
Bin/iperf.exe-c 10.0.115.82-u-P 1-i 1-p 5001-f m-b 1000m-t 10-t 1-f C:\Documents and settings\administrator\ desktop \c Lip2_cctv5_nba_3.75m_v3.3m_a160k.ts
Unable to open the file stream
Would use the default data stream
------------------------------------------------------------
Client connecting to 10.0.115.82, UDP Port 5001
Sending 1470 byte datagrams
UDP buffer size:0.01 MByte (default)
------------------------------------------------------------
[1832] Local 10.0.115.54 port 3297 connected with 10.0.115.82 Port 5001
[ID] Interval Transfer Bandwidth
[1832] 0.0-1.0 sec 3.46 MBytes 3.46 mbytes/sec
[1832] 1.0-2.0 sec 3.32 MBytes 3.32 mbytes/sec
[1832] 2.0-3.0 sec 3.43 MBytes 3.43 mbytes/sec
[1832] 3.0-4.0 sec 3.42 MBytes 3.42 mbytes/sec
[1832] 4.0-5.0 sec 3.43 MBytes 3.43 mbytes/sec
[1832] 5.0-6.0 sec 3.39 MBytes 3.39 mbytes/sec
[1832] 6.0-7.0 sec 3.43 MBytes 3.43 mbytes/sec
[1832] 7.0-8.0 sec 3.40 MBytes 3.40 mbytes/sec
[1832] 8.0-9.0 sec 3.43 MBytes 3.43 mbytes/sec
[1832] 9.0-10.0 sec 3.47 MBytes 3.47 mbytes/sec
[1832] 0.0-10.0 sec 34.2 MBytes 3.41 mbytes/sec
[1832] Server report:
[1832] 0.0-10.0 sec 34.2 MBytes 3.41 mbytes/sec 1.953 Ms 13/24378 (0.053%)
[1832] Sent 24378 datagrams
Bin\iperf.exe:ignoring extra argument--and
Bin\iperf.exe:ignoring extra argument--settings\administrator\ desktop \clip2_cctv5_nba_3.75m_v3.3m_a160k.ts
Done.
- Service side:
Bin/iperf.exe-s-u-p 0-i 1-p 5001-f M
------------------------------------------------------------
Server listening on UDP Port 5001
Receiving 1470 byte datagrams
UDP buffer size:0.01 MByte (default)
------------------------------------------------------------
[1928] Local 10.0.115.82 port 5001 connected with 10.0.115.54 Port 3297
[ID] Interval Transfer Bandwidth jitter lost/total Datagrams
[1928] 0.0-1.0 sec 3.45 MBytes 3.45 mbytes/sec 0.281 Ms 1649892402/2462 (6.7e+007%)
[1928] 1.0-2.0 sec 3.31 MBytes 3.31 mbytes/sec 0.264 Ms 0/2358 (0%)
[1928] 2.0-3.0 sec 3.43 MBytes 3.43 mbytes/sec 0.288 Ms 6/2450 (0.24%)
[1928] 3.0-4.0 sec 3.42 MBytes 3.42 mbytes/sec 0.271 Ms 4/2445 (0.16%)
[1928] 4.0-5.0 sec 3.43 MBytes 3.43 mbytes/sec 0.269 Ms 0/2446 (0%)
[1928] 5.0-6.0 sec 3.39 MBytes 3.39 mbytes/sec 0.662 Ms 0/2417 (0%)
[1928] 6.0-7.0 sec 3.43 MBytes 3.43 mbytes/sec 0.252 Ms 0/2446 (0%)
[1928] 7.0-8.0 sec 3.40 MBytes 3.40 mbytes/sec 0.232 Ms 3/2429 (0.12%)
[1928] 8.0-9.0 sec 3.43 MBytes 3.43 mbytes/sec 0.083 Ms 0/2448 (0%)
[1928] 9.0-10.0 sec 3.47 MBytes 3.47 mbytes/sec 0.218 Ms 0/2474 (0%)
[1928] 0.0-10.0 sec 34.2 MBytes 3.41 mbytes/sec 1.953 Ms 13/24378 (0.053%)
- Test results
[1832] 0.0-10.0 sec 34.2 MBytes 3.41 mbytes/sec 1.953 Ms 13/24378 (0.053%)
[1832] Sent 24378 datagrams
Link transfer udp speed: 3.42mbytes/sec
Total delay: 1.953ms
Drop Pack: 13 of 0.053%
Total Transmission: 34.2MB
"Reprint" Network performance test Tool