Linux Network Performance evaluation Tool IPERF, chariot test network throughput

Source: Internet
Author: User
Tags dashed line gz file

Network performance evaluation is mainly to monitor network bandwidth usage, maximizing network bandwidth utilization is the basis of network performance, but due to unreasonable network design and network security loopholes, network bandwidth utilization is not high. To find out why network bandwidth utilization is not high, you need to monitor the network transmission, you need to use some network performance assessment tools, and IPERF is such a network bandwidth testing tool, this section will detail the use of iperf.

1. What Iperf can do

The Iperf is a network performance testing tool based on TCP/IP and UDP/IP that can be used to measure network bandwidth and network quality, as well as to provide statistical information such as network latency jitter, packet loss rate, and maximum transmission unit. Based on this information, network administrators can understand and judge network performance problems, thus locating network bottlenecks and resolving network failures.

The main features of Iperf are described below.

(1) TCP aspects

Q Test network bandwidth.

Q supports multi-threading and supports multiple connections on the client and server side.

Q reports the size of the MSS/MTU value.

Q supports TCP window values customization and can be buffered via sockets.

(2) UDP aspect

Q You can set the UDP data stream for the specified bandwidth

Q can test the network jitter value, drop the number of packets

Q Supports multicast testing

Q supports multi-threading and supports multiple connections on the client and server side.

Second, the installation and use of Iperf

Iperf can be run on any IP network, including local Ethernet, Internet access, Wi-Fi network, etc. In operating mode, Iperf runs in server, client mode, its server side is mainly used for listening to the test request arrives, and the client is mainly used to initiate the connection session, so to use Iperf, two servers are required, one is running in server mode and the other is running in client mode.

1. Installing Iperf

Iperf supports multiple operating system platforms such as Win32, Linux, FreeBSD, MacOS X, OpenBSD, and Solaris. Readers can download the various versions from the Iperf official homepage http://iperf.fr/, the latest version is iperf3.0, download the package here is iperf-3.0.tar.gz, the installation process is as follows:

[Email protected] networkserver ~]# tar zxvf iperf-3.0.tar.gz

[Email protected] Networkserver ~]# CD Iperf

[[email protected] networkserver iperf]# make

[[email protected] networkserver iperf]# make install

In this way, the Iperf installation is complete.

2. Iperf parameter Introduction

After completing the Iperf installation, perform "iperf3–h" to display the detailed usage of the iperf. Iperf's command-line options are divided into three categories: client and server-side common options, server-side private options, and client-specific options, which are described below for common options.

The meaning of the server-side private option is shown in table 1.

Table 1 Meaning of server-side private options

Command-line arguments

Meaning description

-S

Start Iperf in server mode, for example: IPERF3–S,IPERF3 The default boot listener port is 5201, you can modify the default listening port through the "-P" option

-D

Run Iperf as a daemon, for example: Iperf3-s-D

The meaning of the client-only option is shown in Table 2.5.

Table 2 Meaning of client-only options

Command-line arguments

Meaning description

-C

Start Iperf in client mode

For example: Iperf3-c 192.168.12.168, where 192.168.12.168 is the server-side IP address

-U

Specify the use of the UDP protocol

-B [k| m| G

Specifies the bandwidth used by the UDP mode, in units bits/sec. This option is related to the "-u" option. The default value is 1 mbit/sec

-T

Specifies the total time to transmit the packet. Iperf will repeatedly send packets of the specified length within the specified time. Default is 10 seconds

-N [k| m| G

Specify the number of bytes to transmit packets, for example: Iperf3-c 192.168.12.168–n 100M

-L

Specifies the length of the read-write buffer. The default size of TCP is 8KB,UDP by default size of 1470 bytes

-P

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 server side

-R

Switch data send receive mode, such as default client send, server-side receive, set this parameter, data flow to client receive, server-side send

-W

Specifies the socket buffer size, which, in TCP mode, is the size of the TCP window. In UDP mode, this setting is the size of the buffer that accepts UDP packets, which is used to limit the maximum number of packets that can be received

-B

Used to bind a host address or interface, this parameter is used only for hosts with multiple network interfaces. In UDP mode, this parameter is used to bind and join a multicast group

-M

Set the value of the TCP maximum information segment

-N

Set TCP no delay

The client and server-side common options are as shown in table 3.

Table 3 What the client and server-side common options mean

Command-line arguments

Meaning description

-f[k|m|g| k| m| G

Specify the bandwidth output unit, "[K|m|g| k| m| G] "for Kbits, Mbits, Gbits, Kbytes, mbytes,gbytes show output, default in Mbits units, for example: Iperf3-c 192.168.12.168-f M

-P

Specify the port used on the server side or the port to which the client is connected, for example:

Iperf3-s-P 9527;

Iperf3-c 192.168.12.168-p 9527

-I.

Specifies 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 1.

Example: Iperf3-c 192.168.12.168-i 2

-F

Specifies that the file is bandwidth tested as a data stream.

Example: Iperf3-c 192.168.12.168-f web-ixdba.tar.gz

2.3.3 Iperf Application Example

To use Iperf, first enable a server, which assumes that the IP address of the server is 192.168.12.168, Run "iperf3-s" on this servers to turn on the Iperf mode. By default, IPERF3 will open a 5201 listening port on the server, and you can perform the Iperf function test as a client at this point.

1. Testing TCP Throughput

To determine the maximum throughput of a network card, you can run the Iperf command on any client, and Iperf will attempt to send data requests to the server as quickly as possible from the client and output the amount of data sent and the average bandwidth of the NIC. Figure 1 is one of the simplest bandwidth test commands.

Figure 1 Testing network bandwidth utilization with Iperf

As can be seen from Figure 1, iperf default run time is 10 seconds, output once every second transmission state, but also can see the amount of data transmitted per second around 112MB, just corresponding to the value of the "Bandwidth" column, the bandwidth rate of the network card is maintained in 941mbits/ SEC, and the test server is a gigabit network card, the test value is basically reasonable. At the end of the output, Iperf also gives the total data transmit and receive amount, and give the average bandwidth rate, through these values, the basic can determine whether the network bandwidth is normal, the network transmission state is stable.

Iperf provides a number of parameters that can be used to test network bandwidth utilization at multiple angles and in all directions, for example, to change the time and output frequency of the Iperf run, which can be achieved with the "-T" and "-i" parameters, as shown in 2.

Figure 2 Iperf output after adding "-T" and "-I" parameters

As can be seen from Figure 2, the interval of the output state becomes every 5 seconds, the total test time is 20 seconds, the bandwidth rate of the test remains around 941mbits/sec, and the only change is that the number of failed retransmissions increases.

In order to simulate a large amount of data transfer, you can also specify the amount of information to send, which can be achieved through the "-n" parameter. After the "-n" parameter is specified, the "-T" parameter is invalidated, and the iperf automatically ends after transmitting the packet of the specified size, as shown in 3.

Figure 3 Iperf Client Specifies the amount of data to transfer through the "-N" parameter

The example in Figure 3 is to specify that a packet of about 5GB is sent, and the transmission state is output every 10 seconds, and from this output it can be seen that the transfer rate drops sharply when the number of failed retransmissions is high.

Sometimes, in order to emulate a more realistic TCP application, the Iperf client allows data to be sent from a specific file, which can be implemented with the "-F" parameter, as shown in 4.

Figure 4 Iperf client sends data by specifying a file with the "-F" parameter

In the example in Figure 4, the "-F" parameter specifies a webdata.tar.gz file as the data to be transferred by the Iperf, when using this parameter, you need to specify a "-T" parameter to set the time to test the transfer, this time as long as possible, because in the default transmission time of 10 seconds , this file may not have been passed through.

When using Iperf for network bandwidth testing, if you do not specify a send method, the Iperf client will only use a single thread, and Iperf is multi-threaded, you can use the "-P" parameter provided by Iperf to set the number of multiple threads, by using multi-threading, Can increase the throughput of the network to some extent.

The following is a simple comparison of two examples, and Figure 5 is the time and bandwidth usage used by Iperf to transmit 1.86GBytes of data using a single thread. In order to unify the rate units, the "-F" parameter is used here to display the output results through MBytes.

Figure 5 Iperf transfer time and transfer rate in single-threaded mode

As can be seen from Figure 5, the transmission of 1.86GBytes data consumes 17 seconds, with an average bandwidth rate of 112MBYTES/SEC (note Unit). And then look at the amount of time and average bandwidth that the iperf will consume to transmit the same size data after using multi-threading, as shown in 6.

Figure 6 Iperf data transfer status after using multi-threading

Here, through the "-P" parameter to open 2 multi-threading, from the transmission time, the transmission of 1.86GBytes of data, the consumption time is 10.79 seconds, less than the previous single-threaded transmission time of nearly 7 seconds, on the average bandwidth rate, from the previous single-threaded 112mbytes/ The SEC raised to 177mbytes/sec, from this result can be seen, multithreading on the network transmission performance is not small.

2. Test UDP packet drops and delays

Iperf can also be used for UDP packet throughput, packet loss rate, and latency metrics, but since the UDP protocol is a non-connection-oriented lightweight transport protocol and does not provide reliable data transfer services, the focus on UDP applications is not how fast data is transmitted, but its packet loss and latency metrics. The transmission performance of the UDP application is tested with the "-U" parameter of Iperf, and the output of the UDP packet transmitting 100MB on the Iperf client is tested in Figure 7.:

Figure 7 Iperf output of UDP packets transmitting 100MB

In Figure 7, focusing on a piece of content under the dashed line, in which the "jitter" column represents the jitter time, or the transmission delay, the "lost/total" column represents the missing datagram and the total number of datagrams, followed by 0.33% is the average drop rate, "datagrams" Column shows the total number of transmitted datagrams.

This output is too simple, to understand more detailed UDP packet loss and delay information, can be viewed on the Iperf server, because the client performs the transmission test while the service side also displays the transmission status, as shown in 8.

Figure 8 UDP transport status shown on Iperf server

In this output, the transmission delay and packet loss rate are recorded in detail in the transmission process, and the packet loss rate and delay increase with the increase of the transmission data in the UDP application. Delays and drops can be mitigated or repaired by altering the application, such as video streaming applications, which can tolerate a greater delay by caching the data.

Using Ixchariot for network speed measurement

The chariot consists of two parts: the control console and the remote endpoint, both of which can be installed on a common PC or server, and the control terminal is installed on the Windows operating system, endpoint supports a variety of mainstream operating systems. The control side is the core part of the product, the control interface (also can use command line), test design interface, script selection and compilation, result display, report generation and API interface are provided by the control side. The endpoint can be installed in a single or multiple terminals according to the actual test needs, responsible for receiving instructions from the control side, completing the test and reporting the test data to the control terminal. Chariot through the built-in scripts, controlled by the control side of the remote mutually active packet, the device function, pressure and performance testing, testing results including throughput, delay, jitter, packet loss, packet error, etc., it can obtain quantitative data and provide detailed test report, So that users can proactively grasp the performance of the equipment, and timely to identify problems and take measures. Chariot can simulate any application with various mechanisms. First, with the built-in script, Chariot sends different streams of data that can simulate 125 of applications that are now common, and that traffic is bidirectional and really interacts with the protocol stack. Chariot support for a variety of applications is based on a variety of data streams sent between endpoint, and data streams can be transmitted based on a variety of protocols, including TCP, UDP, RTP, SPX, IPX, and SNA, and currently support IPV6. Chariot also supports multicast, QoS and many other advanced technologies, and will remain in sync. In addition, in the event of new or special applications, the tool suite application scanner is able to generate scripts that can be used by chariot. Chariot allows the script to be customized to change various parameters of the data stream, such as the starting interval, the sending window, the size of the receiving window, the size of the sending file, the rate of transmission, the type of bitstream sent, the port used, and so on, and these parameters can be a typical value specified by the user. It can also choose random values that match the average distribution, normal distribution, Poisson distribution or exponential distribution between the maximum and minimum values to truly simulate the specific data streams in the network, and comprehensively test the performance of the network or network equipment in a complex network environment. One of the characteristics of modern network is distributed development, in the network performance testing process, may involve a lot of nodes. With Chariot software, you can test the whole network directly with a few mouse clicks on the central control terminal. The far end of the chariot can be downloaded directly from the NetIQ company website or remotely installed to the required node machine through the central control terminal, chariot can support up to 10,000 remote collaboration tests, while the remote software can be installed as required,Can be awakened at the time of the test. As Chariot has become a de facto industry standard in the field of wireless product performance testing, WECA uses the product as a tool to distribute Wi-Fi signage to manufacturers. For manufacturers, chariot can be used in laboratory testing, equipment performance display, network site performance testing and fault location, such as the Ministry of Information Industry Communications measurement company using chariot products for its wireless products application layer performance testing. As a standard tool for application layer performance testing, Chariot is able to provide operators with a variety of other tools irreplaceable services due to its network environment features, with the following applications: Equipment selection, benchmark performance testing, stress testing, functional testing, network tuning, network performance display, Determine SLA and performance bottleneck targeting and troubleshooting. In the network failure, the use of chariot fault location, determine whether the network is a problem or the problem of the server, if the problem of the network, and then use the tool to locate. In addition, it is used for SLA negotiation and test standards development with customers.

Linux Network Performance assessment Tool IPERF, chariot test network throughput

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.