免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2108 | 回复: 0
打印 上一主题 下一主题

Iperf: 一个优秀的网络性能测量工具 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2006-11-23 19:28 |只看该作者 |倒序浏览

                                                [color="#0099cc"]Iperf: 一个优秀的网络性能测量工具
Iperf 是一个 TCP/IP 和 UDP/IP 的性能测量工具,能够提供网络吞吐率信息,以及震动、
丢包率、最大段和最大传输单元大小等统计信息;从而能够帮助我们测试网络性能,定位
网络瓶颈。其设计从根本上克服了原来的一些工具,如 ttcp 和 nettest 等,的固有的缺陷。
为了方便使用,Iperf 还提供了一个 Java 前端。如下图所示:



  
  
  
  
  
  
  
  
  
  
  
  




  
这个前端仅仅是让用户以图形化的方式配置选项,实际上最终还是要(另外打开一个窗口)
运行 Iperf 程序。其启动方式为运行 jperf,实际上jperf 只是shell脚本,后台运行的
为java -classpath jperf.jar Interface。
Iperf 的命令行选项与jperf界面展示的基本一样。下面我们结合例子进行介绍其主要用法。
使用 iperf -s 命令将 Iperf 启动为 server 模式,在客户机上使用 iperf -c启动client模式。
[wfchair@wfchair]$ iperf -c bfp1 -i1
命令的输出如下:
--------------------------------------------------------------------------------
Client connecting to bfp1, TCP port 5001
TCP window size: 64.0 KByte (default)
--------------------------------------------------------------------------------
[ 3] local 152.16.3.132 port 1026 connected with 152.3.2.110 port 5001
[ ID] Interval Transfer Bandwidth
[ 3] 0.0- 1.0 sec 720 KBytes 5.5 Mbits/sec
[ 3] 1.0- 2.3 sec 704 KBytes 4.3 Mbits/sec
[ 3] 2.3- 3.0 sec 448 KBytes 5.0 Mbits/sec
[ 3] 3.0- 4.1 sec 504 KBytes 3.6 Mbits/sec
[ 3] 4.1- 5.4 sec 656 KBytes 3.9 Mbits/sec
[ 3] 5.4- 6.1 sec 360 KBytes 4.1 Mbits/sec
[ 3] 6.1- 7.2 sec 584 KBytes 4.1 Mbits/sec
[ 3] 7.2- 8.1 sec 600 KBytes 5.1 Mbits/sec
[ 3] 8.1- 9.2 sec 472 KBytes 3.4 Mbits/sec
[ 3] 9.2-10.1 sec 480 KBytes 4.3 Mbits/sec
bfp1 为启动了 Iperf server 模式的一台机器。其中 -i 参数的含义是周期性报告的时间间隔
(interval),单位为秒;在上面的例子中,表示每隔一秒报告一次(带宽等信息)。
另外还有其它一些选项,您可以参看手册里的说明。
 
How to use iperf
作者changys  
http://cpss.zz.ha.cn
       Iperf和Ttcpw相比较有几个区别:Iperf服务器端起来以后,不会因为客户端每次测试完毕而自动退出;而Ttcpw服务器端起来后会随着客户端 每次测试的完毕而自动退出。Ttcpw被集成到了CISCO路由器的IOS中,所以可以对路由器直接进行测试,这项功能是Iperf所不能支持的。其他的 区别可以在学习和使用中慢慢发掘。以下是一个简单的使用文档,请参考:
1.       where to download iperf ?
   
http://dast.nlanr.net/Projects/Iperf/
2.       how to use iperf ?
server side:
#iperf -s   
  client side:
   #iperf -c  -i  -t  -w
3.       how to use iperf  as a Service under Win32
-o outputfilename
output the messages into the specified file
-s -D
install Iperf as a service and run it
-s -R
uninstall the Iperf service
4.       usage
    Usage: iperf [-s|-c host] [-p port] [-t secs] [-w bytes] ...
       iperf [-h|--help] [-v|--version]

Client/Server:
  -f, --format    [kmKM]   format to report: Kbits, Mbits, KBytes, MBytes
  -i, --interval  #        seconds between periodic bandwidth reports
  -l, --len       #[KM]    length of buffer to read or write (default 8 KB)
  -m, --print_mss          print TCP maximum segment size (MTU - TCP/IP header)
  -p, --port      #        server port to listen on/connect to
  -u, --udp                use UDP rather than TCP
  -w, --window    #[KM]    TCP window size (socket buffer size)
  -B, --bind         bind to , an interface or multicast address
  -M, --mss       #        set TCP maximum segment size (MTU - 40 bytes)
  -N, --nodelay            set TCP no delay, disabling Nagle's Algorithm

Server specific:
  -s, --server             run in server mode
  -D, --daemon             run the server as a daemon

Client specific:
  -b, --bandwidth #[KM]    for UDP, bandwidth to send at in bits/sec
                           (default 1 Mbit/sec, implies -u)
  -c, --client       run in client mode, connecting to
  -n, --num       #[KM]    number of bytes to transmit (instead of -t)
  -t, --time      #        time in seconds to transmit for (default 10 secs)
  -F, --fileinput    input the data to be transmitted from a file
  -I, --stdin              input the data to be transmitted from stdin
  -P, --parallel  #        number of parallel client threads to run
  -T, --ttl       #        time-to-live, for multicast (default 1)
  -W, --windowSizeSuggest  Run the client so as to suggest a suitable window size (default off)

Miscellaneous:
  -h, --help               print this message and quit
  -v, --version            print version information and quit
               
               
               
               
               
               

本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/11226/showart_205397.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP