iperf软件介绍.doc

上传人:w****2 文档编号:6628919 上传时间:2020-03-01 格式:DOC 页数:19 大小:547KB
返回 下载 相关 举报
iperf软件介绍.doc_第1页
第1页 / 共19页
iperf软件介绍.doc_第2页
第2页 / 共19页
iperf软件介绍.doc_第3页
第3页 / 共19页
点击查看更多>>
资源描述
Iperf 是一种用来测量网络带宽和网络质量的工具。Jperf与Iperf一起使用的话可以提供一个java写成的图形界面。 两个运行Iperf的主机将网络分成了两份 可以用以下方法测试连接的质量:- 延时(反应时间或者RTT):用ping命令量度- jitter(延时变化):用 Iperf UDP 测试来量度- 数据报丢失:用Iperf UDP 测试来量度带宽可以通过TCP测试来量度 TCP (Transmission Control Protocol)与 UDP (User Datagram Protocol)的区别是:TCP检查数据包是否正确的传送给接受者,而UDP并不进行检查。所以UDP的传送速度比TCP要快。 Tperf使用TCP与UDP的不同功能来提供网络连接的统计数据。 最后,Iperf可以很容易的安装在任何UNIX/Linux或者Microsoft Windows系统中。必须将一台主机设置为客户端,一台设置为服务器。 以下是Iperf安装在Linux以及Microsoft Windows系统中的截图。在这里,Linux是Iperf客户端,Windows是 Iperf服务器端。当然,两个都用上Linux系统也是可以的。Iperf tests:no arg. -b -r -d -w 缺省设置 数据格式 双向性带宽 同步双向性带宽 TCP窗口大小 -p, -t, -i -u, -b -m -M -P -h 端口,时间,间隔 UDP测试,带宽设置 显示最大片段大小 最大片段大小设置 平行测试 帮助 Jperf:no arg. -d -u, -b 缺省设置 同步双向性带宽 UDP测试,带宽设置 缺省Iperf设置同时检查Jperf部分 初始状态,Iperf客户端使用TCP端口5001来连接Iperf服务器,Iperf显示的带宽是从用户到服务器之间的带宽。如果想使用UDP测试,使用-u 参数。Iperf客户端的-d 和-r参数可以用来测量双向性带宽。(详情见指导书) 客户端#iperf -c 10.1.1.1 - Client connecting to 10.1.1.1, TCP port 5001 TCP window size: 16384 Byte (default) - 3 local 10.6.2.5 port 33453 connected with 10.1.1.1 port 5001 30.0-10.2 sec1.26 MBytes1.05 Mbits/sec 服务器端#iperf -s - Server listening on TCP port 5001 TCP window size: 8.00 KByte (default) - 852 local 10.1.1.1 port 5001 connected with 10.6.2.5 port 33453 IDIntervalTransferBandwidth 8520.0-10.6 sec1.26 MBytes1.03 Mbits/sec 数据形式(-f参数)-f参数可以指定结果显示的格式: bits(b), bytes(B), kilobits(k), kilobytes(K), megabits(m), megabytes(M), gigabits(g) or gigabytes(G). 一般来说,带宽使用的单位是bits (或者 Kilobit,等等),大量的数据使用bytes(或者Kilobytes,等等) 回顾一下,1 bytes等于8 bits,在电脑科学中,1 kilo等于1024(2的10次方) 例如:100000000 bytes不等于100 Mbytes而是等于95.37 Mbytes(=100000000/1024/1024) 客户端#iperf -c 10.1.1.1 -f b - Client connecting to 10.1.1.1, TCP port 5001 TCP window size: 16384 Byte (default) - 3 local 10.6.2.5 port 54953 connected with 10.1.1.1 port 5001 30.0-10.2 sec1359872 Bytes1064272 bits/sec 服务器端#iperf -s - Server listening on TCP port 5001 TCP window size: 8.00 KByte (default) - 852 local 10.1.1.1 port 5001 connected with 10.6.2.5 port 33453 IDIntervalTransferBandwidth 8520.0-10.6 sec920 KBytes711 Kbits/sec Top of the page 双向带宽测量(-r 参数)为了量度双向带宽,Iperf服务器会主动向客户端发起连接。初始状态时,只会量度客户到服务器的带宽。如果你想同时测量双向带宽,请使用-d 关键字。(见以下实验) 客户端#iperf -c 10.1.1.1 -r - Server listening on TCP port 5001 TCP window size: 85.3 KByte (default) - - Client connecting to 10.1.1.1, TCP port 5001 TCP window size: 16.0 KByte (default) - 5 local 10.6.2.5 port 35726 connected with 10.1.1.1 port 5001 50.0-10.0 sec1.12 MBytes936 Kbits/sec 4 local 10.6.2.5 port 5001 connected with 10.1.1.1 port 1640 40.0-10.1 sec74.2 MBytes61.7 Mbits/sec 服务器端#iperf -s - Server listening on TCP port 5001 TCP window size: 8.00 KByte (default) - 852 local 10.1.1.1 port 5001 connected with 10.6.2.5 port 54355 IDIntervalTransferBandwidth 8520.0-10.1 sec1.15 MBytes956 Kbits/sec - Client connecting to 10.6.2.5, TCP port 5001 TCP window size: 8.00 KByte (default) - 824 local 10.1.1.1 port 1646 connected with 10.6.2.5 port 5001 IDIntervalTransferBandwidth 8240.0-10.0 sec73.3 MBytes61.4 Mbits/sec Top of the page 同步双向性带宽测量(-d 参数)同时检查Jperf部分。 使用-d 参数同步测量双向带宽。如果你想将测试分开进行 ,请使用-r参数(见前面测试)。如果不加任何参数的话,只会量度从客户端到服务器端的带宽。 客户端#iperf -c 10.1.1.1 -d - Server listening on TCP port 5001 TCP window size: 85.3 KByte (default) - - Client connecting to 10.1.1.1, TCP port 5001 TCP window size: 16.0 KByte (default) - 5 local 10.6.2.5 port 60270 connected with 10.1.1.1 port 5001 4 local 10.6.2.5 port 5001 connected with 10.1.1.1 port 2643 4 0.0-10.0 sec 76.3 MBytes 63.9 Mbits/sec 5 0.0-10.1 sec 1.55 MBytes 1.29 Mbits/sec 服务器端#iperf -s - Server listening on TCP port 5001 TCP window size: 8.00 KByte (default) - 852 local 10.1.1.1 port 5001 connected with 10.6.2.5 port 60270 - Client connecting to 10.6.2.5, TCP port 5001 TCP window size: 8.00 KByte (default) - 800 local 10.1.1.1 port 2643 connected with 10.6.2.5 port 5001 IDIntervalTransferBandwidth 8000.0-10.0 sec76.3 MBytes63.9 Mbits/sec 8520.0-10.1 sec1.55 MBytes1.29 Mbits/sec Top of the page TCP窗口大小:(-w 参数)在连接中,如果接收方来不及验证,数据会暂时被存在一个缓冲区里。这个缓冲区的上限就是所谓的TCP窗口大小。 窗口的大小可以在2到65,535 bytes之间。在Linux系统中,如果用-w 参数指定TCP 缓存的大小,核心将会分配指定的双倍。 客户端#iperf -c 10.1.1.1 -w 2000 WARNING: TCP window size set to 2000 bytes. A small window size will give poor performance. See the Iperf documentation. - Client connecting to 10.1.1.1, TCP port 5001 TCP window size: 3.91 KByte (WARNING: requested 1.95 KByte) - 3 local 10.6.2.5 port 51400 connected with 10.1.1.1 port 5001 30.0-10.1 sec704 KBytes572 Kbits/sec 服务器端#iperf -s -w 4000 - Server listening on TCP port 5001 TCP window size: 3.91 KByte - 852 local 10.1.1.1 port 5001 connected with 10.6.2.5 port 51400 IDIntervalTransferBandwidth 8520.0-10.1 sec704 KBytes570 Kbits/sec Top of the page 端口(-p),时间(-t)以及间隔(-i)-p 参数可以修改Iperf服务器的端口。客户端与服务器必须同样的端口,默认的TCP端口是5001. -t 参数指定测试持续时间(以秒为单位),默认值为10秒。 -I 参数制定两个带宽报告之间的间隔(以秒为单位)。 客户端#iperf -c 10.1.1.1 -p 12000 -t 20 -i 2 - Client connecting to 10.1.1.1, TCP port 12000 TCP window size: 16.0 KByte (default) - 3 local 10.6.2.5 port 58316 connected with 10.1.1.1 port 12000 30.0- 2.0 sec224 KBytes918 Kbits/sec 32.0- 4.0 sec368 KBytes1.51 Mbits/sec 34.0- 6.0 sec704 KBytes2.88 Mbits/sec 36.0- 8.0 sec280 KBytes1.15 Mbits/sec 38.0-10.0 sec208 KBytes852 Kbits/sec 310.0-12.0 sec344 KBytes1.41 Mbits/sec 312.0-14.0 sec208 KBytes852 Kbits/sec 314.0-16.0 sec232 KBytes950 Kbits/sec 316.0-18.0 sec232 KBytes950 Kbits/sec 318.0-20.0 sec264 KBytes1.08 Mbits/sec 30.0-20.1 sec3.00 MBytes1.25 Mbits/sec 服务器端#iperf -s -p 12000 - Server listening on TCP port 12000 TCP window size: 8.00 KByte (default) - 852 local 10.1.1.1 port 12000 connected with 10.6.2.5 port 58316 ID Interval Transfer Bandwidth 8520.0-20.1 sec3.00 MBytes1.25 Mbits/sec Top of the page UDP 测试: (-u), 带宽设置 (-b)同时检查Jperf 部分 使用-u 参数进行UDP测试会得到关于jitter和数据包丢失的重要信息。 要保持良好的连接质量,数据包的丢失率要小于1%。数据包的丢失率过高会导致许多TCP数据报需要重传,从而影响带宽。 Jitter基本上代表的是延时变化,而并不依赖于延时本身。你可能拥有很长的反应时间,但是jitter却很低。在支持IP话音(VoIP)的网络中,Jitter的值非常重要,因为jitter值很高的话会打断话音呼叫。如果需要带宽,可以用-b 参数来分配 客户端#iperf -c 10.1.1.1 -u -b 10m - Client connecting to 10.1.1.1, UDP port 5001 Sending 1470 byte datagrams UDP buffer size: 108 KByte (default) - 3 local 10.6.2.5 port 32781 connected with 10.1.1.1 port 5001 30.0-10.0 sec11.8 MBytes9.89 Mbits/sec 3 Sent 8409 datagrams 3 Server Report: 30.0-10.0 sec11.8 MBytes9.86 Mbits/sec2.617 ms9/ 8409(0.11%) 服务器端#iperf -s -u -i 1 - Server listening on UDP port 5001 Receiving 1470 byte datagrams UDP buffer size: 8.00 KByte (default) - 904 local 10.1.1.1 port 5001 connected with 10.6.2.5 port 32781 IDIntervalTransferBandwidthJitterLost/Total Datagrams 9040.0- 1.0 sec1.17 MBytes9.84 Mbits/sec1.830 ms0/ 837(0%) 9041.0- 2.0 sec1.18 MBytes9.94 Mbits/sec1.846 ms5/ 850(0.59%) 9042.0- 3.0 sec1.19 MBytes9.98 Mbits/sec1.802 ms2/ 851(0.24%) 9043.0- 4.0 sec1.19 MBytes10.0 Mbits/sec1.830 ms0/ 850(0%) 9044.0- 5.0 sec1.19 MBytes9.98 Mbits/sec1.846 ms1/ 850(0.12%) 9045.0- 6.0 sec1.19 MBytes10.0 Mbits/sec1.806 ms0/ 851(0%) 9046.0- 7.0 sec1.06 MBytes8.87 Mbits/sec1.803 ms1/ 755(0.13%) 9047.0- 8.0 sec1.19 MBytes10.0 Mbits/sec1.831 ms0/ 850(0%) 9048.0- 9.0 sec1.19 MBytes10.0 Mbits/sec1.841 ms0/ 850(0%) 9049.0-10.0 sec1.19 MBytes10.0 Mbits/sec1.801 ms0/ 851(0%) 9040.0-10.0 sec11.8 MBytes9.86 Mbits/sec2.618 ms9/ 8409(0.11%) Top of the page 最大数据段大小(-m参数)显示:最大的数据段大小(MSS)是电脑能够支持的单个,未切分的TCP 数据段的最大容量,以bytes为单位。可以用如下方法计算:MSS =MTU-TCP & IP 头TCP & IP 头等于40bytes。MTU(最大传输单位)是可以在单个帧(frame)中传输的最大数据量。以下是一些不同网络结构的默认MTU大小Ethernet - 1500 bytes: 在LAN中使用 PPPoE - 1492 bytes: 在ADSL连接中使用 Token Ring (16Mb/sec) - 17914 bytes: IBM研发的一项旧技术 Dial-up - 576 bytes 一般来说,较高的MTU(及MSS)可以提高带宽的效率。客户端#iperf -c 10.1.1.1 -m - Client connecting to 10.1.1.1, TCP port 5001 TCP window size: 16.0 KByte (default) - 3 local 10.6.2.5 port 41532 connected with 10.1.1.1 port 5001 30.0-10.2 sec1.27 MBytes1.04 Mbits/sec 3 MSS size 1448 bytes (MTU 1500 bytes, ethernet) 这里MSS不等于1500-40,而是1500-40-12(时间戳选项)=1448.服务器端#iperf -s Top of the page 最大数据段大小(-M 参数)设置:用-M 参数 改变MSS。(更多关于MSS的解释见之前的实验)#iperf -c 10.1.1.1 -M 1300 -m WARNING: attempt to set TCP maximum segment size to 1300, but got 536 - Client connecting to 10.1.1.1, TCP port 5001 TCP window size: 16.0 KByte (default) - 3 local 10.6.2.5 port 41533 connected with 10.1.1.1 port 5001 30.0-10.1 sec4.29 MBytes3.58 Mbits/sec 3 MSS size 1288 bytes (MTU 1328 bytes, unknown interface) 服务器端#iperf -s Top of the page 并行实验(-P参数)使用-P 参数来运行并行实验。客户端#iperf -c 10.1.1.1 -P 2 - Client connecting to 10.1.1.1, TCP port 5001 TCP window size: 16.0 KByte (default) - 3 local 10.6.2.5 port 41534 connected with 10.1.1.1 port 5001 4 local 10.6.2.5 port 41535 connected with 10.1.1.1 port 5001 40.0-10.1 sec1.35 MBytes1.12 Mbits/sec 30.0-10.1 sec1.35 MBytes1.12 Mbits/sec SUM0.0-10.1 sec2.70 MBytes2.24 Mbits/sec 服务器端#iperf -s Top of the page Iperf帮助#iperf -h Usage: iperf -s|-c host options iperf -h|-help -v|-version 用户/服务器 -f-i-l-m-p-u-w-B-C-M-N-V -format -interval -len -print_mss -port -udp -window -bind -compatibility -mss -nodelay -IPv6Version kmKM # #KM # #KM host # 报告格式: Kbits, Mbits, KBytes, MBytes 连个带宽报告的间隔时间 读写的缓冲大小 (默认 8 KB) 打印最大的TCP数据段大小 (MTU - TCP/IP header) 监听/连接到服务器端口 使用UDP而不是TCP TCP 窗口大小 (socket缓冲大小) 捆绑到 主机, 接口或者多点传送地址 使用较旧版本时不发送额外信息 设置TCP最大数据段大小 (MTU - 40 bytes) 设置无延迟TCP,禁用 Nagles Algorithm 设置域 为Ipv6 服务器 -s-U-D -server -single_udp -daemon 服务器模式下运行 单线程UDP模式下运行 以守护进程模式运行服务器 用户 -b-c-d-n-r-t-F-I-L-P-T -bandwidth -client -dualtest -num -tradeoff -time -fileinput -stdin -listenport -parallel -ttl #KM host #KM # name # # # 对于UDP, 使用bits/sec (默认 1 Mbit/sec, 亦即 -u)传送带宽 运行为客户端,连接到“主机“ 同步进行双向测试 传输的字节量 (非 -t) 分别进行双向测试 传输的时间 (默认10 secs) 从文件中读取要传输的数据 从标准输入(stdin)中读取要传输的数据 双向测试接受端口 并行客户线程数量 多点传送的生存时间 (默认1) 其他: -h-v -help -version print this message and quit print version information and quit Top of the page JPERFJperf是用java写成的Iperf图形界面。 1. 安装下载Jperf Linux解压下载文件 #tar -xvf jperf2.0.0.zip 运行Jperf #cd jperf2.0.0#./jperf.sh 如果出现以下信息,你需要在安装Iperf时加上apt-get install iperf Iperf is probably not in your Path!Please download it here http:/dast.nlanr.net/Projects/Iperf/and put the executable in your PATH environment variable. Microsoft Windows用你最喜欢的程序解压下载文件。访问解压后名为jperf2.0.0的文件夹,双击jperf.bat。注意iperf已经存在于bin 文件夹中。 Note that the iperf utility is already present in the /bin folder. 2. 例子缺省设置:带宽测量查看Iperf的更多详细信息。 - Linux用户- Windows服务器Top of the page Jperf同时双向带宽测量查看Iperf的更多详细信息。 - Linux用户- Windows服务器Top of the page JperfJitter测量查看Iperf的更多详细信息。 - Linux用户- Windows服务器
展开阅读全文
相关资源
相关搜索

当前位置:首页 > 临时分类 > 人文社科


copyright@ 2023-2025  zhuangpeitu.com 装配图网版权所有   联系电话:18123376007

备案号:ICP2024067431-1 川公网安备51140202000466号


本站为文档C2C交易模式,即用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。装配图网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知装配图网,我们立即给予删除!