In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >
Share
Shulou(Shulou.com)06/01 Report--
I. introduction
Iperf is a network performance testing tool. Iperf can test the bandwidth quality of TCP and UDP. Iperf can measure the maximum TCP bandwidth and has a variety of parameters and UDP characteristics. Iperf can report bandwidth, delay jitter and packet loss. Using the feature of Iperf, it 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.
The latest version of linux is iperf 3.1.4, download address: https://iperf.fr/download/source/iperf-3.1.3-source.tar.gz
The latest version of the official update of the windows version is 3.1.3 (packaged in jperf) divided into 32-bit and 64-bit, downloaded from: https://iperf.fr/download/windows/iperf-3.1.3-win64.zip
II. The main functions of Iperf
TCP
Measure network bandwidth
Report the size and observations of the MSS/ MTU value
Support for TCP window values buffered by sockets
Multithreading is supported when P or Win32 threads are available. Client and server support multiple connections at the same time
UDP
Clients can create UDP streams with specified bandwidth
Measuring packet loss
Measurement delay
Support for multicast
Multithreading is supported when P threads are available. Client and server support multiple connections at the same time (Windows is not supported)
Other
Where appropriate, K (kilo-) and M (mega-) can be used in the options. For example, 131072 bytes can be replaced by 128K.
You can specify the total time to run, or even set the total amount of data transferred.
In the report, choose the most appropriate unit for the data.
The server supports multiple connections instead of waiting for a single-threaded test.
Repeat the display of network bandwidth, fluctuations, and packet loss at specified intervals.
The server side can be run as a daemon.
The server side can run as a Windows service.
Typical data streams are used to test the impact of link layer compression on available bandwidth.
Support for transfer of specified files, qualitative and quantitative testing
3. How to use Iperf:
1. Install Iperf:
(1) for the windows version of Iperf, you can copy the extracted cygstdc++-6.dll, cyggcc_s-seh-1.dll, iperf.exe and cygwin1.dll directly to the% systemroot% directory, and then you can run the command test in CMD.
(2) for the linux version of Iperf, use the following command to install
Tar zxf iperf-2.0.9-source.tar.gz
Cd iperf-2.0.9-source
. / configure-- prefix=/usr/local/iperf
Make
Make install
2. Use Iperf
Iperf [- s |-c host] [options] choose to run in service mode or client mode
Iperf [- h |-- help] [- v |-- version] view help information
3. Introduction of Iperf parameters
-c 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.
-the number of connections maintained before the P server was shut down. The default is 0, which means that connections are always accepted.
Client and server sharing options:
-f,-- format [kmgKMG] formatted bandwidth 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-. All fields except bandwidth are output to bytes, unless the format of the output is specified, and the default parameter is a. Note: when calculating 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 bits (bits). If this bothers you, use the-f b parameter and calculate it yourself.
-I sets the interval between each report in seconds. If set to a non-zero value, the test report is output at this interval. The default value is zero.
-l sets the length of the read-write buffer. The default of TCP mode is 8KB. The default is 1470 bytes.
-m outputs the TCP MSS value (supported by TCP_MAXSEG). The MSS value is generally 40 bytes smaller than the MTU value. Under normal circumstances
-p sets the port, which is consistent with the listening port on the server side. The default is port 5001, which is the same as ttcp's.
-u uses UDP instead of TCP. See the-b option.
-w sets the socket buffer to the specified size. For TCP mode, this setting is the TCP window size. For UDP mode, this setting is set to accept the buffer size of UDP packets, limiting the maximum value that can be accepted.
-B is bound to one of multiple addresses of the host. For the client, this parameter sets the de-stack interface. For the server side, this parameter sets the stack interface. This parameter is only used for hosts with multiple network interfaces. In Iperf's UDP mode, this parameter is used to bind and join a multicast group. Multicast addresses ranging from 224.0.0.0 to 239.255.255.255 are used. Refer to the-T parameter.
Compatibility mode can be used when-C is used with earlier versions of Iperf. It is not necessary to use compatibility mode on both sides, but it is highly recommended that both sides use compatibility mode at the same time. In some cases, the use of certain data streams can cause version 1.7 server-side crashes or unexpected connection attempts.
-M attempts to set the value of the maximum information segment of TCP 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). This option is not supported by many operating systems.
-N sets the TCP no delay option and disables the Nagle's algorithm. Typically, this option is disabled for interactive programs, such as telnet.
-V binds an IPv6 address.
Server: $iperf-s-V
Client: $iperf-c-V
Note: in version 1.6.3 or later, specifying an IPv6 address does not require binding with the-B parameter, but in versions prior to 1.6. In most operating systems, the IPv4 address mapped by the IPv4 client will respond.
Server-specific options:
-s iperf server mode
-Iperf runs as a background daemon on the D Unix platform. Under the Win32 platform, Iperf will run as a service.
-R uninstall the Iperf service (if it is running).
-o redirect output to the specified file
-b bandwidth used in UDP mode, in bits/sec. This option is related to the-u option. The default value is 1 Mbit/sec.
-c runs Iperf client mode and connects to the specified Iperf server
-d run dual test mode. This causes the server side to reverse connect to the client side, using the port specified in the-L parameter (or by default the port on which the client connects to the server side). These are completed immediately at the same time of operation. If you want an interactive test, try the-r parameter.
-n the number of buffers transmitted. Typically, Iperf sends data in 10 seconds. The-n parameter crosses this limit and sends data of the specified length a specified number of times, no matter how long the operation takes. Refer to the-l and-t options.
-r reciprocating test mode. When the client-to-server test ends, the server connects to the client in reverse through the port specified by the-l option (or by default the client connects to the server). When the client connection terminates, the reverse connection begins. If you need to do two-way testing at the same time, try the-d parameter.
-t sets the total time of transmission. Iperf repeatedly sends packets of specified length within a specified period of time. The default is 10 seconds. Refer to the-l and-n options.
-L specifies the port that the server uses to reverse connect to the client. The port on which the client connects to the server is used by default.
-number of P threads. Specifies the number of threads used between the client and the server. The default is 1 thread. This parameter needs to be used by both the client and the server.
-the service type of the de-stack packet. Many routers ignore the TOS field. You can specify this value, using hexadecimal numbers starting with "0x", or octal or decimal numbers starting with "0".
For example, hexadecimal '0x10' = octal '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
-the TTL value of the multicast packet out of the stack. This is essentially the number of hops of data passing through the router. The default is 1, the link is local.
-F measures bandwidth using specific data streams, such as specified files.
$iperf-c-F
-I, like-F, inputs data from standard input and output files.
-h contestant command parameters
-v displays version information
4. Iperf use case
(1) single thread TPC test
C:\ Users\ Administrator.DESKTOP-6JT7D2H > iperf-s-I 1---Server listening on TCP port 5001TCP window size: 208KByte (default)-- -- C:\ Users\ Administrator.DESKTOP-6JT7D2H > iperf-c 10.0.1.188-I 1---Client connecting to 10.0.1.188 TCP port 5001TCP window size: 208 KByte (default)-[3] local 10.0.1.188 port 57051 connected with 10.0.1.188 port 5001 [ID] Interval Transfer Bandwidth [3] 0.01.0 sec 298 MBytes 2.50 Gbits/sec [3] 1.0-2.0 sec 316 MBytes 2.65 Gbits/sec [3] 2.0-3.0 sec 318 MBytes 2.67 Gbits/sec [3] 3.0-4.0 sec 319 MBytes 2.68 Gbits/sec-s runs in server mode -I bandwidth reports the interval in seconds, and-c runs in client mode, where interval represents the interval, transfer represents the amount of data transferred in the interval, and bandwidth represents the transfer rate in the interval.
(2) Multithreading test, add-P parameter to the client to specify the number of threads
C:\ > iperf-c 10.0.1.188-I 1 color P 3---Client connecting to 10.0.1.188 TCP port 5001TCP window size: 208 KByte (default)-[3] local 10.0.1.188 port 55916 connected with 10.0.1.188 port 5001 [5] local 10.0.1.188 port 55918 connected with 10.0.1.188 port 5001 [4] local 10.0.1.188 port 55917 connected with 10.0.1.188 port 5001 [ID] Interval Transfer Bandwidth [3] 0.01.0 sec 106 MBytes 892 Mbits/sec [5] 0.01.0 sec 107MBytes 894 Mbits/sec [4] 0.01.0 sec 106 MBytes 891 Mbits/sec [SUM] 0.01.0 sec 319 MBytes 2.68 Gbits/sec [3] 1.0- 2.0 sec 113 MBytes 947 Mbits/sec [5] 1.0-2.0 sec 112 MBytes 943 Mbits/sec [4] 1.0-2.0 sec 113 MBytes 945 Mbits/sec [SUM] 1.0-2.0 sec 338 MBytes 2.83 Gbits/sec last behavior statistics in multithreading.
(3) single thread UDP test
C:\ > iperf-s-u-p 12345-I 1---Server listening on UDP port12345Receiving 1470 byte datagramsUDP buffer size: 208KByte (default) [3] local 10.0.1.188 port12345 connected with 10.0.1.188 port 57956 [ID] Interval Transfer Bandwidth Jitter Lost/Total Datagrams [3] 0-1.0 sec 2.87 KBytes 23.5 Kbits/sec 0.002 ms 0 / 2 [3] 1.0-2.0 sec 1.44 KBytes 11.8 Kbits/sec 0.004 ms 0 / 1 (0) [3] 2.0-3.0 sec 1.44 KBytes 11.8 Kbits/sec 0.006 ms 0 / 1 (0) %) [3] 3.0-4.0 sec 1.44 KBytes 11.8 Kbits/sec 0.008 ms 0 / 1 (0%) runs on UDP link port 12345 in server mode The report is displayed per second, where jitter is jitter, lost/total is packet loss rate, and datagrams is the number of packets. C:\ > UDP port 12345Sending 1470 byte datagrams iperf-c 10.0.1.188-p12345-I 1-u---Client connecting to 10.0.1.188 IPGtarget: 11215.21 us (kalman adjust) UDP buffer size: 208KByte (default)-[3] local 10.0.1.188 port 52275 connected with 10.0.1.188 port 12345 [ID] Interval Transfer Bandwidth [3] 0 .0-1.0 sec 131 KBytes 1.07 Mbits/sec [3] 1.0-2.0 sec 128 KBytes 1.05 Mbits/sec [3] 2.0-3.0 sec 128 KBytes 1.05 Mbits/sec [3] 3.0-4.0 sec 128 KBytes 1.05 Mbits/sec
(4) the bandwidth of the test single-threaded UDP is 10Mbit/s, specified with-b.
C:\ > UDP 10.0.1.188-p12345-I 1-u-t 10-b 10M---Client connecting to 10.0.1.188 iperf port 12345Sending 1470 byte datagrams IPGtarget: 1176.00 us (kalman adjust) UDP buffer size: 208KByte (default)-[3] local 10.0.1.188 port 57740 connected with 10.0.1.188 port 12345 [ID] Interval Transfer Bandwidth [3] 0 .0-1.0 sec 1.19 MBytes 10.0 Mbits/sec [3] 1.0-2.0 sec 1.19 MBytes 10.0 Mbits/sec [3] 2.0-3.0 sec 1.19 MBytes 10.0 Mbits/sec [3] 3.0-4.0 sec 1.19 MBytes 10.0 Mbits/sec [3] 4.0-5.0 sec 1.19 MBytes 10.0 Mbits/sec
(5) Test UDP bi-directional transmission, use-d to run bi-directional test mode, and use-L to specify local dual-test listening port.
C:\ > iperf-c 10.0.1.188-p12345-I 1-u-t 10-b 10m-L 20000-d---Client connecting to 10.0.1.188 iperf port 12345Sending 1470 byte datagrams IPGtarget: 1176.00 us (kalman adjust) UDP buffer size: 208KByte (default)-[3] local 10.0.1.188 port 59302 connected with 10.0.1.188 port 12345- -Server listening on UDP port20000Receiving 1470 byte datagramsUDP buffer size: 208 KByte (default)- -[4] local 10.0.1.188 port 20000 connected with 10.0.1.188 port 59303 [ID] Interval Transfer Bandwidth [3] 0.01.0 sec 1.19 MBytes 10.0 Mbits/sec [4] 0.01.0 sec 1.19 MBytes 10.0 Mbits/sec 0.013 ms 0 / 850 (0) [3] 1.0-2.0 sec 1.19 MBytes 10.0 Mbits/sec [4] 1 .0-2.0 sec 1.19 MBytes 10.0 Mbits/sec 0.025 ms 0 / 851 [4] 2.0-3.0 sec 1.19 MBytes 10.0 Mbits/sec 0.017 ms 0 / 850 (0) [3] 2.0-3.0 sec 1.19 MBytes 10.0 Mbits/sec [3] 3.0-4.0 sec 1.19 MBytes 10.0 Mbits/sec [4] 3.0-4.0 Sec 1.19 MBytes 10.0 Mbits/sec 0.018 ms 0 / 851 [3] 4.0-5.0 sec 1.19 MBytes 10.0 Mbits/sec [4] 4.0-5.0 sec 1.19 MBytes 10.0 Mbits/sec 0.016 ms 0 / 850 (0%)
-end!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.