In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/03 Report--
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.
The main functions of 1.Iperf are as follows:
TCP measures network bandwidth report the size and observations of MSS/ MTU values support TCP window values to be buffered through sockets when P or Win32 threads are available. Client and server support multiple connections at the same time UDP client can create UDP flow measurement with specified bandwidth packet loss measurement delay support Multicast when P thread is available, support multi-thread. Client and server support multiple connections at the same time (Windows is not supported) introduction to Iperf parameters
The client and server sharing options include the following
(1)-f,-- format [bkmaBKMA] formatted bandwidth output. 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-. All fields except bandwidth are output as bytes, unless specified, 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.
(2)-I,-- interval # 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.
(3)-l,-- len # [KM] sets the length of the read-write buffer. The default of TCP mode is 8KB. The default is 1470 bytes.
(4)-m,-- print_mss outputs the TCP MSS value (supported by TCP_MAXSEG). The MSS value is generally 40 bytes smaller than the MTU value. Under normal circumstances
(5)-p,-- port # 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.
(6)-u,-- udp uses UDP instead of TCP. See the-b option.
(7)-w,-- window # [KM] 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.
(8)-B,-- bind host is bound to one of multiple addresses of the host. For the client, this parameter sets the out-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.
(9)-C,-- compatibility can be used in compatibility mode when 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.
(10)-M,-- mss # [KM} 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.
(11)-N,-- nodelay sets the TCP no delay option and disables the Nagle's algorithm. Typically, this option is disabled for interactive programs, such as telnet.
(12)-V (from v1.6 or higher) 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-side specific options include the following
(1)-s,-- serverIperf server mode
(2)-D (v1.2 or later) Iperf runs as a background daemon on the Unix platform. Under the Win32 platform, Iperf will run as a service.
(3)-R (v1.2 or later, for Windows only) uninstall the Iperf service if it is running.
(4)-o (v1.2 or later, for Windows only) redirects output to the specified file
(5)-c,-- client host if Iperf runs in server mode and specifies a host with the-c parameter, then Iperf will only accept connections from the specified host. This parameter does not work in UDP mode.
(6)-P,-the number of connections held before the parallel # server was shut down. The default is 0, which means that connections are always accepted.
Client-specific options include the following
(1)-b,-- bandwidth # [KM] the bandwidth used in UDP mode, in bits/sec. This option is related to the-u option. The default value is 1 Mbit/sec.
(2)-c,-- client host runs the client mode of Iperf and connects to the specified Iperf server.
(3)-d,-- dualtest runs in 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.
(4) the number of buffers transmitted by-n,-- num # [KM]. 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.
(5)-r,-- tradeoff 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.
(6)-t,-- time # sets the total transmission time. 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.
(7)-L,-- listenport # 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.
(8)-P,-number of parallel # 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.
(9)-S,-- Service type of tos # 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
(10)-T,-- ttl # stack the TTL value of multicast packets. This is essentially the number of hops of data passing through the router. The default is 1, the link is local.
(11)-F (from v1.2 or higher) measures bandwidth using specific data streams, such as specified files.
$iperf-c-F
(12)-I (from v1.2 or higher), like-F, inputs data from standard input / output files.
Miscellaneous items include the following
(1)-h,-- help displays the command line reference and exits.
(2)-v,-- version displays version information and compilation information and exits.
3. Testing the performance of Network Card with Iperf
(1) [endif] Test single-thread TCP
Run iperf on the server and enter the command iperf-s-p 12345-I 1-M to enable iperf on native port 12345
Run iperf on the client, and enter the command iperf-cserver-ip-pserver-port-I 1murt 10-w 20K, where the parameters are described as follows:
-c: client mode, followed by server ip
-p: follow the port that the server listens to
-I: sets the interval between bandwidth reports (in seconds)
-t: sets the duration of the test (in seconds)
-w: set the size of the tcp window. Generally, you don't have to set it. Default is fine.
The screenshot after testing is as follows: client screenshot
Server screenshot
Where: Interval represents the time interval. Transfer represents the amount of data transferred during the interval. Bandwidth is the transmission rate in the time interval. The last line is the statistics of this test. The test shows that the average bandwidth is 89.9Mbit/s.
2. Test multithreaded TCP
Add the-P parameter to the client to test the TCP performance of multithreading. The following is the test using two threads.
The screenshot after testing is as follows:
Client screenshot
Server screenshot
3. Test single-threaded UDP (default bandwidth)
Run iperf on the server, enter the command iperf-s-u-p 12345-I 1 to enable iperf on native port 12345 and run in udp mode
Run iperf on the client side and enter the command iperf-c server-ip-p server-port-I 1-t 10-b with the following parameters:
-c: client mode, followed by server ip
-p: follow the port that the server listens to
-I: sets the interval between bandwidth reports (in seconds)
-t: sets the duration of the test (in seconds)
-b: sets the transmission bandwidth of udp (in bit/s)
The screenshot after testing is as follows:
Client screenshot
Server screenshot
Where Jitter is jitter, lost/total is the number of packets lost, and Datagrams is the number of packets lost.
4. Test single-threaded UDP (bandwidth is 10Mbit/s)
Set the client bandwidth to 10m, and use the parameter-b to specify
The screenshot after testing is as follows: client screenshot
Server screenshot
5. Test multithreaded UDP
Similar to multithreaded TCP, the client only needs to specify the number of threads using the-P parameter
6. Test the two-way transmission of UDP
The client uses the parameter-d to run the dual test mode, and the client performs a udp round trip test with the server. You can use the-L parameter to specify the port on which the local dual test listens.
The screenshot after the test is as follows:
Client screenshot
Server screenshot
7. Test UDP reciprocating transmission
Similar to two-way transport, use the parameter-r to run the interaction mode, and you can still use the-L parameter to specify the port for the interaction.
Client screenshot
Server screenshot
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.