Netperf is an open-source network performance testing tool for TCP and UDP transmission testing. It has four working modes: tcp_stream, tcp_rr, udp_stream, and udp_rr. Each working mode will be described in detail later.
I will not describe how to install it in Linux. There are many materials on the Internet. Is there any netperf for windows? Of course, if you need to download, please stamp here: NetPerf-2.4.5-w32.zip. [Note the operating system version it applies to] tested by myself, XP
SP3 is indeed usable. NETServer serves as the server and netperf serves as the client.
When running NETServer for the first time, the following problem occurs:
C:\>netserver.exenetserver: fopen of debug file as new stdout failed!: The system cannot find the path specified.
Solution: create a directory named temp under the root directory of the C drive. Why? Check the source code:
Source: netserver.c#ifndef DEBUG_LOG_FILE#ifndef WIN32#define DEBUG_LOG_FILE "/tmp/netperf.debug"#else#define DEBUG_LOG_FILE "c:\\temp\\netperf.debug"#endif /* WIN32 */#endif /* DEBUG_LOG_FILE */
Okay, so that you can use it normally.
Common global parameters of netperf include:
- -H help
- -H: Specify the Server IP Address
- -T indicates the test type, including tcp_stream, tcp_rr, udp_stream, and udp_rr.
- -L specify the test time, in seconds.
1. tcp_stream
The network bandwidth used to test TCP streaming communication. This is the default test type of netperf.
C:\>netperf -H 192.168.1.152 -t TCP_STREAM -l 10TCP STREAM TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to 192.168.1.152 (192.168.1.152) port 0 AF_INETRecv Send SendSocket Socket Message ElapsedSize Size Size Time Throughputbytes bytes bytes secs. 10^6bits/sec8192 8192 8192 10.00 454.21
The test results show that the TCP bandwidth is 454.21 Mbps.
2. udp_stream
Test the network bandwidth of UDP streaming communication. It is worth noting that during UDP testing, make sure that the data buffer zone of the sending end cannot be greater than the buffer zone of the receiving end. Otherwise, data packets will be lost, resulting in inaccurate test results. The-M parameter is used to specify the size of the sending buffer, and the-M parameter is used to specify the buffer size of the receiving end.
C:\>netperf -H 192.168.1.152 -t UDP_STREAM -l 10 -- -m 1024 -M 1024UDP UNIDIRECTIONAL SEND TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to 192.168.1.152 (192.168.1.152) port 0 AF_INETSocket Message Elapsed MessagesSize Size Time Okay Errors Throughputbytes bytes secs. # # 10^6bits/sec8192 1024 10.01 0 386.008192 10.01 56.27
The first line is the local sending statistics, that is, the local UDP sending throughput is 386 Mbps, and the second line is the server-side receiving statistics, with the throughput of 56.27 Mbps.
3.
The number of transactions between the client and server in a TCP connection.
C:\>netperf -H 192.168.1.152 -t TCP_RRTCP REQUEST/RESPONSE TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to 192.168.1.152 (192.168.1.152) port 0 AF_INET : first burst 0Local /RemoteSocket Size Request Resp. Elapsed Trans.Send Recv Size Size Time Ratebytes Bytes bytes bytes secs. per sec8192 8192 1 1 10.00 10076.088192 8192
In the test results, the first row is the local statistical result, the second row is the remote statistical result, the request and response packets are in 1 byte, and the transaction times on both ends of C/S are 10076.08.
4.
Udp_rr
The number of transactions between the client and server in a UDP-based connection.
C:\>netperf -H 192.168.1.152 -t UDP_RRUDP REQUEST/RESPONSE TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to 192.168.1.152 (192.168.1.152) port 0 AF_INET : first burst 0Local /RemoteSocket Size Request Resp. Elapsed Trans.Send Recv Size Size Time Ratebytes Bytes bytes bytes secs. per sec8192 8192 1 1 10.00 9120.108192 8192
Similarly, in the test results, the first two rows are the local and remote statistical results. The request and response packets are in 1 byte, and the transaction times on both ends of C/S are 9120.10.
In the tcp_rr and udp_rr tests, how do I specify the size of request and response packets? The-R parameter is used. The usage is-r req, [RSP].