netperf network performance testing next release of the operating system Linux and the unicorn
Netperf is a network performance measurement tools, mainly for the transmission of TCP or UDP based. Netperf Depending on the application, network performance testing may be performed in different modes, i.e. bulk data transfer (bulk data transfer) mode and a request / response (request / reponse) mode.
working principle
Netperf tool works in client / server mode. NetServer is a server-side, from the client terminal to listen for connections, the client side is Netperf, used to initiate a network test server. between the client and the server, establishing a first control connection, transmit information about the configuration of the test, and the test results: after the connection establishment message and transmitting the test configuration, will then be established between a client and server connection test, passing back and forth of the special traffic patterns to test network performance
Software Installation
- Download and install the tool Netperf
下载链接:ftp://ftp.netperf.org/netperf/
[root@xiesshavip001 ~]# wget ftp://ftp.netperf.org/netperf/netperf-2.7.0.tar.gz
- Installation dependencies gcc cc
[root@xiesshavip001 ~]# yum install gcc cc -y
- Extracting installer
Release Linux (CentOS7 etc.) compiled and installed as follows:
-
[root@xiesshavip001 ~]# tar -zxvf netperf-2.7.0.tar.gz [root@xiesshavip001 ~]#cd ./netperf-2.7.0/ [root@xiesshavip001 netperf-2.7.0]# ./configure [root@xiesshavip001 netperf-2.7.0]# cd ./src/ [root@xiesshavip001 netperf-2.7.0]# make [root@xiesshavip001 netperf-2.7.0]# make install
Kirin operating system Linux (Kylin, with the FT-1500A 64-bit processors) compiled and installed the following steps:
[xiesshavip001 the root @ ~] # -zxvf Netperf the tar-2.7.0.tar.gz [xiesshavip001 the root @ ~] #cd ./netperf-2.7.0/ [@ xiesshavip001 Netperf the root-2.7.0] # ./configure - build = alpha // Note: here specify the compiler platform Alpha [root @ xiesshavip001 netperf-2.7.0] # cd ./src/ [root @ xiesshavip001 netperf-2.7.0] # the make [root @ xiesshavip001 netperf-2.7. 0] # make install
Command parameters introduced
Command line parameters include the following options:
-H host :指定远端运行netserver的server IP地址。 -l testlen:指定测试的时间长度(秒) -t testname:指定进行的测试类型,包括TCP_STREAM,UDP_STREAM,TCP_RR,TCP_CRR,UDP_RR -s size 设置本地系统的socket发送与接收缓冲大小 -S size 设置远端系统的socket发送与接收缓冲大小 -m size 设置本地系统发送测试分组的大小 -M size 设置远端系统接收测试分组的大小 -D 对本地与远端系统的socket设置TCP_NODELAY选项
netperf network testing
1, the TCP bulk transfers under TCP_STREAM Netperf default, namely -t TCP_STREAM. Testing, Netperf transmitted to netserver TCP bulk data packets, to determine the data throughput during the transmission:
-
[root @ xiesshavip002 ~] # netserver # netserver service server starts Starting with Host netserver 'the IN (. 6) of ADDR_ANY' Port '12865' and Family AF_UNSPEC [xiesshavip001 the root @ ~] -l # 60 Netperf -H 192.168.130.20 MIGRATED the TCP 0.0.0.0 the TEST from the STREAM (0.0.0.0) Port 0 to 192.168.130.20 AF_INET () Port 0 AF_INET Recv the Send the Send the Socket the Elapsed the Socket the Message Size Size Size Time Throughput bytes bytes bytes secs. 6bits 10 ^ / sec 87380 16384 16384 60.01 935.66 [xiesshavip001 the root @ ~] # [@ xiesshavip001 the root ~] -l # 192.168.130.20 Netperf -H 60 - # 10240 -m modify the size of the transmitted packet MIGRATED TCP STREAM TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to 192.168.130.20 () port 0 AF_INET Recv Send Send Socket Socket Message Elapsed Size Size Size Time Throughput bytes bytes bytes secs. 10^6bits/sec 87380 16384 10240 60.02 937.58
2, UDP_STREAM UDP_STREAM to test network performance when the UDP bulk transfer. Note: At this point no larger than the size of the test packet send and receive buffer size of the socket, otherwise it will be reported netperf error message:
[root@xiesshavip001 ~]# netperf -t UDP_STREAM -H 192.168.130.20 -l 10 MIGRATED UDP STREAM TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to 192.168.130.20 () port 0 AF_INET Socket Message Elapsed Messages Size Size Time Okay Errors Throughput bytes bytes secs # # 10^6bits/sec 212992 65507 10.01 131286 0 6874.75 212992 10.01 1 0.05 [root@xiesshavip001 ~]# [root@xiesshavip001 ~]# netperf -t UDP_STREAM -H 192.168.130.20 -l 10 -- -m 300000 # 超过socket的发送与接收缓冲大212992 MIGRATED UDP STREAM TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to 192.168.130.20 () port 0 AF_INET send_data: data send error: Message too long (errno 90) netperf: send_omni: send_data failed: Message too long
3, the test object TCP_RR TCP_RR way that multiple TCP request and response transaction process
-
[root@xiesshavip001 ~]# netperf -t TCP_RR -H 192.168.130.20 MIGRATED TCP REQUEST/RESPONSE TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to 192.168.130.20 () port 0 AF_INET : first burst 0 Local /Remote Socket Size Request Resp. Elapsed Trans. Send Recv Size Size Time Rate bytes Bytes bytes bytes secs. per sec 16384 87380 1 1 10.00 8228.63 16384 87380
We can change the size of the request and response packets over the relevant test parameters, the parameters shown in Table TCP_RR follows:
参数 说明 -r req,resp 设置request和reponse分组的大小 -s size 设置本地系统的socket发送与接收缓冲大小 -S size 设置远端系统的socket发送与接收缓冲大小 -D 对本地与远端系统的socket设置TCP_NODELAY选项
-
[root@xiesshavip001 ~]# netperf -t TCP_RR -H 192.168.130.20 -- -r 64 64 MIGRATED TCP REQUEST/RESPONSE TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to 192.168.130.20 () port 0 AF_INET : first burst 0 Local /Remote Socket Size Request Resp. Elapsed Trans. Send Recv Size Size Time Rate bytes Bytes bytes bytes secs. per sec 16384 87380 64 64 10.00 8143.22 16384 87380
4, TCP_CRR and TCP_RR different, TCP_CRR for each transaction to establish a new TCP connection.
[root@xiesshavip001 ~]# netperf -t TCP_CRR -H 192.168.130.20 MIGRATED TCP Connect/Request/Response TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to 192.168.130.20 () port 0 AF_INET Local /Remote Socket Size Request Resp. Elapsed Trans. Send Recv Size Size Time Rate bytes Bytes bytes bytes secs. per sec 16384 87380 1 1 10.00 899.38 # 数值明显比TCP_RR值小 16384 87380
5, UDP_RR UDP_RR way to use UDP packet transaction request / response of
[root@xiesshavip001 ~]# netperf -t UDP_RR -H 192.168.130.20 MIGRATED UDP REQUEST/RESPONSE TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to 192.168.130.20 () port 0 AF_INET : first burst 0 Local /Remote Socket Size Request Resp. Elapsed Trans. Send Recv Size Size Time Rate bytes Bytes bytes bytes secs. per sec 212992 212992 1 1 10.00 8425.86 212992 212992
6, netperf use the Help command: netperf --help
[root@xiesshavip001 ~]# netperf --help netperf: invalid option -- '-' Usage: netperf [global options] -- [test options] Global options: -a send,recv Set the local send,recv buffer alignment -A send,recv Set the remote send,recv buffer alignment -B brandstr Specify a string to be emitted with brief output -c [cpu_rate] Report local CPU usage -C [cpu_rate] Report remote CPU usage -d Increase debugging output -D time,[units] * Display interim results at least every time interval using units as the initial guess for units per second A negative value for time will make heavy use of the system's timestamping functionality -f G|M|K|g|m|k Set the output units -F lfill[,rfill]* Pre-fill buffers with data from specified file -h Display this text -H name|ip,fam * Specify the target machine and/or local ip and family -i max,min Specify the max and min number of iterations (15,1) -I lvl[,intvl] Specify confidence level (95 or 99) (99) and confidence interval in percentage (10) -j Keep additional timing statistics -l testlen Specify test duration (>0 secs) (<0 bytes|trans) -L name|ip,fam * Specify the local ip|name and address family -o send,recv Set the local send,recv buffer offsets -O send,recv Set the remote send,recv buffer offset -n numcpu Set the number of processors for CPU util -N Establish no control connection, do 'send' side only -p port,lport* Specify netserver port number and/or local port -P 0|1 Don't/Do display test headers -r Allow confidence to be hit on result only -s seconds Wait seconds between test setup and test start -S Set SO_KEEPALIVE on the data connection -t testname Specify test to perform -T lcpu,rcpu Request netperf/netserver be bound to local/remote cpu -v verbosity Specify the verbosity level -W send,recv Set the number of send,recv buffers -v level Set the verbosity level (default 1, min 0) -V Display the netperf version and exit -y local,remote Set the socket priority -Y local,remote Set the IP_TOS. Use hexadecimal. -Z passphrase Set and pass to netserver a passphrase For those options taking two parms, at least one must be specified; specifying one value without a comma will set both parms to that value, specifying a value with a leading comma will set just the second parm, a value with a trailing comma will set just the first. To set each parm to unique values, specify both and separate them with a comma. * For these options taking two parms, specifying one value with no comma will only set the first parms and will leave the second at the default value. To set the second value it must be preceded with a comma or be a comma-separated pair. This is to retain previous netperf behaviour.
Reference links:
1, source code and documentation to help
2, netperf network performance testing
3, installation and use of netperf
Netperf is a network performance measurement tools, mainly for the transmission of TCP or UDP based. Netperf Depending on the application, network performance testing may be performed in different modes, i.e. bulk data transfer (bulk data transfer) mode and a request / response (request / reponse) mode.
working principle
Netperf tool works in client / server mode. NetServer is a server-side, from the client terminal to listen for connections, the client side is Netperf, used to initiate a network test server. between the client and the server, establishing a first control connection, transmit information about the configuration of the test, and the test results: after the connection establishment message and transmitting the test configuration, will then be established between a client and server connection test, passing back and forth of the special traffic patterns to test network performance
Software Installation
- Download and install the tool Netperf
下载链接:ftp://ftp.netperf.org/netperf/
[root@xiesshavip001 ~]# wget ftp://ftp.netperf.org/netperf/netperf-2.7.0.tar.gz
- Installation dependencies gcc cc
[root@xiesshavip001 ~]# yum install gcc cc -y
- Extracting installer
Release Linux (CentOS7 etc.) compiled and installed as follows:
-
[root@xiesshavip001 ~]# tar -zxvf netperf-2.7.0.tar.gz [root@xiesshavip001 ~]#cd ./netperf-2.7.0/ [root@xiesshavip001 netperf-2.7.0]# ./configure [root@xiesshavip001 netperf-2.7.0]# cd ./src/ [root@xiesshavip001 netperf-2.7.0]# make [root@xiesshavip001 netperf-2.7.0]# make install
Kirin operating system Linux (Kylin, with the FT-1500A 64-bit processors) compiled and installed the following steps:
[xiesshavip001 the root @ ~] # -zxvf Netperf the tar-2.7.0.tar.gz [xiesshavip001 the root @ ~] #cd ./netperf-2.7.0/ [@ xiesshavip001 Netperf the root-2.7.0] # ./configure - build = alpha // Note: here specify the compiler platform Alpha [root @ xiesshavip001 netperf-2.7.0] # cd ./src/ [root @ xiesshavip001 netperf-2.7.0] # the make [root @ xiesshavip001 netperf-2.7. 0] # make install
Command parameters introduced
Command line parameters include the following options:
-H host :指定远端运行netserver的server IP地址。 -l testlen:指定测试的时间长度(秒) -t testname:指定进行的测试类型,包括TCP_STREAM,UDP_STREAM,TCP_RR,TCP_CRR,UDP_RR -s size 设置本地系统的socket发送与接收缓冲大小 -S size 设置远端系统的socket发送与接收缓冲大小 -m size 设置本地系统发送测试分组的大小 -M size 设置远端系统接收测试分组的大小 -D 对本地与远端系统的socket设置TCP_NODELAY选项
netperf network testing
1, the TCP bulk transfers under TCP_STREAM Netperf default, namely -t TCP_STREAM. Testing, Netperf transmitted to netserver TCP bulk data packets, to determine the data throughput during the transmission:
-
[root @ xiesshavip002 ~] # netserver # netserver service server starts Starting with Host netserver 'the IN (. 6) of ADDR_ANY' Port '12865' and Family AF_UNSPEC [xiesshavip001 the root @ ~] -l # 60 Netperf -H 192.168.130.20 MIGRATED the TCP 0.0.0.0 the TEST from the STREAM (0.0.0.0) Port 0 to 192.168.130.20 AF_INET () Port 0 AF_INET Recv the Send the Send the Socket the Elapsed the Socket the Message Size Size Size Time Throughput bytes bytes bytes secs. 6bits 10 ^ / sec 87380 16384 16384 60.01 935.66 [xiesshavip001 the root @ ~] # [@ xiesshavip001 the root ~] -l # 192.168.130.20 Netperf -H 60 - # 10240 -m modify the size of the transmitted packet MIGRATED TCP STREAM TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to 192.168.130.20 () port 0 AF_INET Recv Send Send Socket Socket Message Elapsed Size Size Size Time Throughput bytes bytes bytes secs. 10^6bits/sec 87380 16384 10240 60.02 937.58
2, UDP_STREAM UDP_STREAM to test network performance when the UDP bulk transfer. Note: At this point no larger than the size of the test packet send and receive buffer size of the socket, otherwise it will be reported netperf error message:
[root@xiesshavip001 ~]# netperf -t UDP_STREAM -H 192.168.130.20 -l 10 MIGRATED UDP STREAM TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to 192.168.130.20 () port 0 AF_INET Socket Message Elapsed Messages Size Size Time Okay Errors Throughput bytes bytes secs # # 10^6bits/sec 212992 65507 10.01 131286 0 6874.75 212992 10.01 1 0.05 [root@xiesshavip001 ~]# [root@xiesshavip001 ~]# netperf -t UDP_STREAM -H 192.168.130.20 -l 10 -- -m 300000 # 超过socket的发送与接收缓冲大212992 MIGRATED UDP STREAM TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to 192.168.130.20 () port 0 AF_INET send_data: data send error: Message too long (errno 90) netperf: send_omni: send_data failed: Message too long
3, the test object TCP_RR TCP_RR way that multiple TCP request and response transaction process
-
[root@xiesshavip001 ~]# netperf -t TCP_RR -H 192.168.130.20 MIGRATED TCP REQUEST/RESPONSE TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to 192.168.130.20 () port 0 AF_INET : first burst 0 Local /Remote Socket Size Request Resp. Elapsed Trans. Send Recv Size Size Time Rate bytes Bytes bytes bytes secs. per sec 16384 87380 1 1 10.00 8228.63 16384 87380
We can change the size of the request and response packets over the relevant test parameters, the parameters shown in Table TCP_RR follows:
参数 说明 -r req,resp 设置request和reponse分组的大小 -s size 设置本地系统的socket发送与接收缓冲大小 -S size 设置远端系统的socket发送与接收缓冲大小 -D 对本地与远端系统的socket设置TCP_NODELAY选项
-
[root@xiesshavip001 ~]# netperf -t TCP_RR -H 192.168.130.20 -- -r 64 64 MIGRATED TCP REQUEST/RESPONSE TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to 192.168.130.20 () port 0 AF_INET : first burst 0 Local /Remote Socket Size Request Resp. Elapsed Trans. Send Recv Size Size Time Rate bytes Bytes bytes bytes secs. per sec 16384 87380 64 64 10.00 8143.22 16384 87380
4, TCP_CRR and TCP_RR different, TCP_CRR for each transaction to establish a new TCP connection.
[root@xiesshavip001 ~]# netperf -t TCP_CRR -H 192.168.130.20 MIGRATED TCP Connect/Request/Response TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to 192.168.130.20 () port 0 AF_INET Local /Remote Socket Size Request Resp. Elapsed Trans. Send Recv Size Size Time Rate bytes Bytes bytes bytes secs. per sec 16384 87380 1 1 10.00 899.38 # 数值明显比TCP_RR值小 16384 87380
5, UDP_RR UDP_RR way to use UDP packet transaction request / response of
[root@xiesshavip001 ~]# netperf -t UDP_RR -H 192.168.130.20 MIGRATED UDP REQUEST/RESPONSE TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to 192.168.130.20 () port 0 AF_INET : first burst 0 Local /Remote Socket Size Request Resp. Elapsed Trans. Send Recv Size Size Time Rate bytes Bytes bytes bytes secs. per sec 212992 212992 1 1 10.00 8425.86 212992 212992
6, netperf use the Help command: netperf --help
[root@xiesshavip001 ~]# netperf --help netperf: invalid option -- '-' Usage: netperf [global options] -- [test options] Global options: -a send,recv Set the local send,recv buffer alignment -A send,recv Set the remote send,recv buffer alignment -B brandstr Specify a string to be emitted with brief output -c [cpu_rate] Report local CPU usage -C [cpu_rate] Report remote CPU usage -d Increase debugging output -D time,[units] * Display interim results at least every time interval using units as the initial guess for units per second A negative value for time will make heavy use of the system's timestamping functionality -f G|M|K|g|m|k Set the output units -F lfill[,rfill]* Pre-fill buffers with data from specified file -h Display this text -H name|ip,fam * Specify the target machine and/or local ip and family -i max,min Specify the max and min number of iterations (15,1) -I lvl[,intvl] Specify confidence level (95 or 99) (99) and confidence interval in percentage (10) -j Keep additional timing statistics -l testlen Specify test duration (>0 secs) (<0 bytes|trans) -L name|ip,fam * Specify the local ip|name and address family -o send,recv Set the local send,recv buffer offsets -O send,recv Set the remote send,recv buffer offset -n numcpu Set the number of processors for CPU util -N Establish no control connection, do 'send' side only -p port,lport* Specify netserver port number and/or local port -P 0|1 Don't/Do display test headers -r Allow confidence to be hit on result only -s seconds Wait seconds between test setup and test start -S Set SO_KEEPALIVE on the data connection -t testname Specify test to perform -T lcpu,rcpu Request netperf/netserver be bound to local/remote cpu -v verbosity Specify the verbosity level -W send,recv Set the number of send,recv buffers -v level Set the verbosity level (default 1, min 0) -V Display the netperf version and exit -y local,remote Set the socket priority -Y local,remote Set the IP_TOS. Use hexadecimal. -Z passphrase Set and pass to netserver a passphrase For those options taking two parms, at least one must be specified; specifying one value without a comma will set both parms to that value, specifying a value with a leading comma will set just the second parm, a value with a trailing comma will set just the first. To set each parm to unique values, specify both and separate them with a comma. * For these options taking two parms, specifying one value with no comma will only set the first parms and will leave the second at the default value. To set the second value it must be preceded with a comma or be a comma-separated pair. This is to retain previous netperf behaviour.
Reference links:
1, source code and documentation to help
2, netperf network performance testing
3, installation and use of netperf