In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-09 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains "what is the use of Linux's iperf command". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "what is the use of Linux's iperf command"?
Linux common command iperf command is a network performance testing tool. Iperf can test the bandwidth quality of TCP and UDP. Iperf can measure the maximum TCP bandwidth.
Iperf Network performance testing tool
Add that 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, the Unix/ Linux version and the Windows version. The Unix/Linux version is updated faster and the latest version. The update of Windows version is slow. The Windows version of iperf is called jperf, or xjperf. Jperf develops better UI and new functions on the basis of iperf.
Install iperf for windows version of iperf, copy the extracted iperf.exe and cygwin1.dll directly to% systemroot% directory, for linux version of iperf, use the following command to install:
Gunzip-c iperf-.tar.gz | tar-xvf-cd iperf-. / configure make make install options Command Line options describe client and server sharing options
-f,-format [bkmaBKMA] formatted 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-. 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,-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. -l,-len # [KM] sets the length of the read-write buffer. The default of TCP mode is 8KB. The default is 1470 bytes. -m,-print_mss outputs the TCP MSS value (supported by TCP_MAXSEG). The MSS value is generally 40 bytes smaller than the MTU value. Usually-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. -u,-udp uses 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 mode, this setting is set to accept the buffer size of UDP packets, limiting the maximum value that can be accepted. -B,-bind host 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,-compatibility 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,-mss # 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 sets the TCP no delay option and disables 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. 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 dedicated options
-s,-serverIperf server mode-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. -R (v1.2 or later, for Windows only) uninstall the Iperf service if it is running. -o (v1.2 or later, for Windows only) redirects output to the 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 from the specified host. This parameter does not work in UDP mode. -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 option
-b,-bandwidth # [KM] the bandwidth used by the UDP mode, in bits/sec. This option is related to the-u option. The default value is 1 Mbit/sec. -c,-client host runs the client mode of Iperf and connects to the specified Iperf server. -d,-dualtest runs 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,-num # [KM] 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,-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. -t,-time # sets the total transfer 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. -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. -P,-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. -S,-tos # service type of 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 the TTL value of the IPTOS_LOWDELAY minimize delay 0x10 IPTOS_THROUGHPUT maximize throughput 0x08 IPTOS_RELIABILITY maximize reliability 0x04 IPTOS_LOWCOST minimize cost 0x02-T,-ttl # unstacked multicast packet. This is essentially the number of hops of data passing through the router. The default is 1, the link is local. -F (from v1.2 or higher) measures bandwidth using specific data streams, such as specified files. Iperf-c-Fmuri (from v1.2 or higher) is the same as-F, which inputs data from standard input / output files. Miscellaneous
-h,-help displays the command line reference and exits. -v,-version displays version information and compilation information and exits. UDP mode is usually used in instance bandwidth testing, because it can measure limit bandwidth, delay jitter and packet loss rate. When testing, we first test the theoretical bandwidth of the link as the data transmission rate, for example, the theoretical bandwidth of the link from the client to the server is 100Mbps, first test it with-b 100m, then according to the test results (including the actual bandwidth, delay jitter and packet loss rate), and then use the actual bandwidth as the data transmission rate, we will find that the delay jitter and packet loss rate are much better than the first time. A stable actual bandwidth can be obtained by repeating the test several times.
UDP mode
Server side:
Iperf-u-s client:
Iperf-u-c 192.168.1.1-b 100m-t 60 in udp mode, using 100Mbps as the data transmission rate, the client uploads the bandwidth test to the server 192.168.1.1, the test time is 60 seconds.
Iperf-u-c 192.168.1.1-b 5m-P 30-t 60 client initiates 30 connection threads to the server at the same time, using 5Mbps as the data transmission rate.
Iperf-u-c 192.168.1.1-b 100m-d-t 60 uses 100m as the data transmission rate to test the upstream and downlink bandwidth.
TCP mode
Server side:
Iperf-s client:
Iperf-c 192.168.1.1-t 60 in tcp mode, the client uploads the bandwidth test to the server 192.168.1.1, and the test time is 60 seconds.
Iperf-c 192.168.1.1-P 30-t 60 client initiates 30 connection threads to the server at the same time.
Iperf-c 192.168.1.1-d-t 60 tests the uplink and uplink bandwidth.
At this point, I believe you have a deeper understanding of "what is the use of Linux's iperf command?" you might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
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.