ethr 的使用方法
ethr的下载编译方式:
https://github.com/microsoft/ethr
根据readmie的方式进行编译 也可以直接下载release的包
编译的时候直接make也是可以的
命令介绍
server模式
-s 以server mode运行.
-ui 在text UI中展示输出信息.
-ports <k=v,...> 使用指定端口.多个key=value对通过逗号分隔. Key指定protocol, value指定端口port.默认'control=8888,tcp=9999,udp=9999,http=9899,https=9799'
client模式
-c <server>以client mode 运行连接到<server>.
-r 用于Bandwidth测试,发送数据从server 到 client.
-d <duration> 用于test的时间周期(format: <num>[ms | s | m | h] 0:一直运行; 默认: 10s
-n <number> 并发Sessions (and Threads). 0: 设置与CPUs数相同 默认: 1
-ncs 打印没有Connection Stats. 常与-n option一起使用.
-l <length> buffer大小 (format: <num>[KB | MB | GB]) ,只对Bandwidth测试有效. Max 1GB. 默认: 16KB
-p <protocol> 协议 ("tcp", "udp", "http", "https", or "icmp") 默认: tcp
-ports <k=v,...> 指定端口. 键值对. Key指定 protocol, value指定 base port. 注意:client & server这个设置需要保持一致.默认: 'control=8888,tcp=9999,udp=9999,http=9899,https=9799'
-t <test> 运行测试 ("b", "c", "p", or "l") b: Bandwidth c: Connections/s or Requests/s p: Packets/s l: Latency, Loss & Jitter 默认: b - Bandwidth measurement.
-i <iterations> Number of round trip iterations for each latency measurement. 默认: 1000
External server模式
-m <mode> 必须指定'-m x'用于external mode.
-s :以server mode运行.
-ports <k=v,...> 键值对. Key指定 protocol, value指定 base port.默认: 'tcp=9999,http=9899,https=9799'
iperf详细使用方法:
Iperf使用方法与参数说明
参数说明
-s 以server模式启动,eg:iperf -s
-c host 以client模式启动,host是server端地址,eg:iperf -c 222.35.11.23
-f [k|m|K|M] 分别表示以Kbits, Mbits, KBytes, MBytes显示报告,默认以Mbits为单位,eg:iperf -c 222.35.11.23 -f K
-i sec 以秒为单位显示报告间隔,eg:iperf -c 222.35.11.23 -i 2
-l 缓冲区大小,默认是8KB,eg:iperf -c 222.35.11.23 -l 16 -m 显示tcp最大mtu值
-o 将报告和错误信息输出到文件eg:iperf -c 222.35.11.23 -o c:\iperflog.txt
-p 指定服务器端使用的端口或客户端所连接的端口eg:iperf -s -p 9999;iperf -c 222.35.11.23 -p 9999
-u 使用udp协议
-w 指定TCP窗口大小,默认是8KB
-B 绑定一个主机地址或接口(当主机有多个地址或接口时使用该参数)
-C 兼容旧版本(当server端和client端版本不一样时使用)
-M 设定TCP数据包的最大mtu值
-N 设定TCP不延时
-V 传输ipv6数据包 server专用参数
-D 以服务方式运行ipserf,eg:iperf -s -D -R 停止iperf服务,针对-D,eg:iperf -s -R
client端专用参数
-d 同时进行双向传输测试
-n 指定传输的字节数,eg:iperf -c 222.35.11.23 -n 100000
-r 单独进行双向传输测试
-t 测试时间,默认10秒,eg:iperf -c 222.35.11.23 -t 5
-F 指定需要传输的文件
-T 指定ttl值
操作举例:
1)TCP测试
服务器执行:#iperf -s -i 1 -w 1M
客户端执行:#iperf -c host -i 1 -w 1M 其中-w表示TCP window size,host需替换成服 务器地址。
2)UDP测试
服务器执行:#iperf -u -s
客户端执行:#iperf -u -c 10.32.0.254 -b 900M -i 1 -w 1M -t 60