Netperf and network performance measurement indicators
Source: Internet
Author: User
Article title: Netperf and network performance measurement indicators. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
This article first introduces some basic concepts and methods of network performance measurement, and then discusses how to test network performance in different situations based on the use of the netperf tool.
When building or managing a network system, we are more concerned about the availability of the network, that is, whether the network is connected. However, we often do not consider the overall performance of the network, or even considering the performance issues, we find that there is no proper way to test the network performance.
When a network application is developed, we will find that in actual network environments, the use of network applications is not very effective, and the problem may occur in program development, it may also be caused by bottlenecks in the actual network environment. In the face of such problems, programmers are generally unable to do anything, because they do not master some network performance measurement tools.
In this article, we will first introduce some basic concepts and methods of network performance measurement, and then discuss how to test network performance in different situations based on the use of the netperf tool.
Network Performance Test overview Five indicators for network performance measurement
The following are the five indicators used to measure network performance:
The first step to test network performance is to determine whether the network works normally. The simplest method is to use the ping command. Send the icmp echo request to the remote machine and wait for the icmp echo reply to be received to determine whether the remote machine is connected and whether the network works properly.
The Ping command has rich command options. for example,-c can specify the number of echo requests sent, and-s can specify the size of the ping packet sent each time.
A network device generally has multiple buffer pools. different buffer pools use different buffer sizes to process different groups (packet ). For example, a vSwitch usually has three types of packet buffering: one for small groups, the other for medium-size groups, and the other for large groups. To test such a network device, the test tool must be able to send packets of different sizes. The Ping command-s can be used in this scenario.
2. Response time
The time it takes to Ping the echo request/reply round-trip command is the response time. There are many factors that affect the response time, such as network segment load, network host load, broadcast storm, and abnormal network devices.
When the network works normally, record the normal response time. When users complain about slow network response time, they can compare the current response time with the normal response time. if the difference between the two is large, it indicates that the network device is faulty.
3. network utilization
Network Utilization refers to the proportion of the time used by the network to the total time (that is, the time used + the idle time. For example, although Ethernet is shared, only one packet can be transmitted at the same time. Therefore, at any time, Ethernet, 100% utilization, or 0% utilization.
It is relatively easy to calculate the network utilization of a network segment, but it is complicated to determine the utilization of a network. Therefore, network testing tools generally use network throughput and network bandwidth capacity to determine the performance between two nodes in the network.
4. network throughput
Network throughput refers to the remaining bandwidth that is provided to the network application between two nodes in the network at a certain time point.
Network throughput can help groups find bottlenecks in network paths. For example, even if both the client and server are connected to their respective 100 M Ethernet, if the two 100 M Ethernet are connected by 10 M Ethernet, 10 M Ethernet is the network bottleneck.
The network throughput is very dependent on the current network load. Therefore, in order to get the correct network throughput, it is best to perform tests at different times of the day, or on different days of the week, only in this way can we get a comprehensive understanding of network throughput.
Some network applications can run normally during the development test, but cannot work normally in the actual network environment (because there is not enough network throughput ). This is because the test is only in an idle network environment, without considering the existence of other network traffic in the actual network environment. Therefore, it is of practical significance to define the network throughput as the remaining bandwidth.
5. network bandwidth capacity
Different from network throughput, network bandwidth refers to the maximum available bandwidth between two nodes in the network. This is determined by the capabilities of devices that make up the network.
There are two difficulties in testing the network bandwidth capacity: How to know the maximum available bandwidth of the network when other network traffic exists in the network; during the test, it does not affect the existing network traffic. Network Testing tools generally use packet pairs and packet trains to overcome such difficulties.
How to collect network performance data After determining the network performance test indicators, you need to use the network test tool to collect the corresponding performance data. There are three ways to obtain data from the network:
1. get it directly from the network device through the snmp protocol, such as the net-snmp tool.
2. listen for network performance data. a typical tool is tcpdump.
3. generate test data by yourself, such as the netperf tool used in this article.
Netperf Netperf is a network performance measurement tool, mainly for TCP or UDP-based transmission. According to different applications, Netperf can perform network performance tests in different modes, that is, bulk data transmission mode and request/response mode. The Netperf test results reflect how fast a system can send data to another system, and the other system can receive data at multiple blocks.
The Netperf tool works in client/server mode. The server is netserver, which is used to listen for connections from the client, and the client is netperf, which is used to initiate network tests to the server. First, establish a control connection between the client and the server to pass the test configuration information and test results. after the control connection is established and the test configuration information is passed, A test connection is established between the client and the server to pass back and forth a special traffic mode to test the network performance.
TCP network performance Because the TCP protocol can provide end-to-end reliable transmission, it is used by a large number of network applications. However, the establishment of reliability is costly. Measures to ensure the reliability of the TCP protocol, such as establishing and maintaining connections and controlling the orderly transmission of data consume a certain amount of network bandwidth.
Netperf can simulate three different TCP traffic modes:
1) a single TCP connection transmits a large amount of data in bulk
2) a single TCP connection, client request/server response transaction (transaction) method
3) multiple TCP connections, one transaction method for a request/response in each connection
UDP network performance UDP does not have the burden of establishing connections, but UDP cannot guarantee the reliability of transmission. Therefore, UDP applications need to track each sent group and resend the lost Group.
Netperf can simulate two UDP traffic modes:
1) one-way batch transmission from client to server
2) transaction method of request/response
Due to the reliability of UDP transmission, when using netperf, make sure that the size of the sent buffer is not greater than the size of the received buffer. otherwise, data will be lost and netperf will give an incorrect result. Therefore, the statistics of the received Group are not necessarily accurate. Therefore, you need to draw a conclusion based on the statistics of the sent group.
Netperf command line parameters In unix systems, you can directly run executable programs to start netserver, or enable inetd or xinetd to automatically start netserver.
After netserver is started on the server, you can run netperf on the client to test the network performance. Netperf uses command line parameters to control the test type and specific test options. Depending on the scope, the netperf command line parameters can be divided into two categories: global command line parameters and test-related local parameters. use -- to separate the two:
Here we only explain the commonly used command line parameters. Other parameters can be queried by the netperf man manual.
-H host: specify the IP address of the server that runs netserver remotely.
-L testlen: specify the test duration (in seconds)
-T testname: indicates the testing type, including TCP_STREAM, UDP_STREAM, TCP_RR, TCP_CRR, and UDP_RR.
In subsequent tests, netserver runs at 192.168.0.28, and the server and client are connected through a LAN (100 M Hub ).
Netperf testing network performance Test the performance of bulk network traffic
Typical examples of batch data transmission include ftp and other similar network applications (that is, one transmission of the entire file ). Depending on the transmission protocol, batch data transmission is divided into TCP batch transmission and UDP batch transmission.
1. TCP_STREAM
By default, Netperf performs TCP batch transmission, that is,-t TCP_STREAM. During the test, netperf sends a batch of TCP data groups to netserver to determine the throughput during data transmission:
./Netperf-H 192.168.0.28-l 60
Tcp stream test to 192.168.0.28
Recv Send
Socket Message Elapsed
Size Time Throughput
Bytes secs. 10 ^ 6 bits/sec
87380 16384 16384 60.00 88.00
From the netperf result output, we can know the following information:
1) the remote system (that is, the server) uses a socket buffer of 87380 bytes.
2) the local system (client) uses a 16384-byte socket sending buffer.
3) the size of the test group sent to the far-end system is 16384 bytes.
4) the tested time is 60 seconds.
5) The throughput test result is 88 Mbits/s.
By default, netperf sets the size of the test group sent to the socket sending buffer used by the local system.
Test-related local parameters in TCP_STREAM mode are shown in the following table:
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.