powerpc linux交叉编译器,基于PowerPC架构交叉编译netperf网络测试工具

Netperf是一种网络性能的测量工具,主要针对基于TCP或UDP的传输。Netperf根据应用的不同,可以进行不同模式的网络性能测试,即批量数据传输(bulk data transfer)模式和请求/应答(request/reponse)模式。Netperf测试结果所反映的是一个系统能够以多快的速度向另外一个系统发送数据,以及另外一个系统能够以多块的速度接收数据。

Netperf工具以client/server方式工作。server端是netserver,用来侦听来自client端的连接,client端是netperf,用来向server发起网络测试。在client与server之间,首先建立一个控制连接,传递有关测试配置的信息,以及测试的结果;在控制连接建立并传递了测试配置信息以后,client与server之间会再建立一个测试连接,用来来回传递着特殊的流量模式,以测试网络的性能。

当netserver在server端启动以后,就可以在client端运行netperf来测试网络的性能。netperf通过命令行参数来控制测试的类型和具体的测试选项。

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 [secs,units] * Display interim results at least every secs seconds

using units as the initial guess for units per second

-f G|M|K|g|m|k    Set the output units

-F fill_file      Pre-fill buffers with data from fill_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)

-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

-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

=======================================================

Client[192.168.1.2]:

#./netperf.sh 192.168.1.1 17171

netperf -p $2 -cC -H $1 -t TCP_STREAM -- -m 65535 -s 16384 -S 16384

netperf 是命令

-p 指定端口号, 要与netserver使用的端口号一致

$2, 因为这行命令来自脚本, 所有这个代表脚本运行时的第二个参数,此处代表端口号17171

-cC, 报告CPU的使用情况, -c代表的本地CPU;-C代表远端的CPU

-H,  指的是服务器IP地址192.168.1.1

-t, 指定进行的测试类型,包括TCP_STREAM,UDP_STREAM,TCP_RR,TCP_CRR,UDP_RR

-m,设置本地系统发送测试分组的大小

-M,设置远端系统接收测试分组的大小

-s,设置本地系统的socket发送与接收缓冲大小

-S,设置远端系统的socket发送与接收缓冲大小-----------------------------------------------------------------------------------------------------------------------

Server[“192.168.1.1]:

#./netserver -p 17171

-----------------------------------------------------------------------------------------------------------------------

5、测试输出结果

-----------------------------------------------------------------

TCP STREAM TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to 192.168.1.10 (192.168.1.10) port 0 AF_INET

Recv   Send    Send                          Utilization       Service Demand

Socket Socket  Message  Elapsed              Send     Recv     Send    Recv

Size   Size    Size     Time     Throughput  local    remote   local   remote

bytes  bytes   bytes    secs.    10^6bits/s  % S      % S      us/KB   us/KB

32768  32768  65535    10.00       478.43   13.44    35.03    18.409  11.996

-------------------------------------------------------------------

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值