1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
| Client/Server: # 客户端和服务端公有的参数 指定端口号,默认为5201 -p, --port # server port to listen on/connect to 回显报告的间隔时间 -i, --interval # seconds between periodic bandwidth reports 显示帮助菜单 -h, --help print this message and quit 显示版本 -v, --version print version information and quit
Server specific: #服务端私有参数 指定以服务端运行 -s, --server run in server mode
Client specific: #客户端私有参数 带宽参数,单位:字节每秒:KMG,为2的n次方,比如1K=1024,;设置为0代表无限制,此参数UDP默认1M/s,TCP无限制 -b, --bandwidth #[KMG][/#] target bandwidth in bits/sec (0 for unlimited) (default 1 Mbit/sec for UDP, unlimited for TCP) (optional slash and packet count for burst mode) 指定以客户端运行,后面要带服务端的IP地址 -c, --client <host> run in client mode, connecting to <host> udp模式,不带-u默认为tcp模式 -u, --udp use UDP rather than TCP 指定测试时间,不带参数默认测试10s -t, --time # time in seconds to transmit for (default 10 secs) 翻转测试,这是iperf3比iperf2方便的主要亮点,iperf2不支持此功能,无法使用 -R, --reverse reverse the test (client receives, server sends) tcp窗口大小,默认无上限,可以不设此参数,作为udp模式测试时也不需要此参数 ,单位:KM,1K=1024 -w, --window #[KMG] set window size / socket buffer size
iperf -s -i 1 # 作为服务端运行,报告回显间隔时间1s iperf3 -c 192.168.3.250 -i 1 -t 10 -b 7M #作为客户端,连接服务端ip地址192.168.3.250,报告回显间隔1s,测试时间10s,带宽限制为7M。 iperf3 -c 192.168.3.250 -i 1 -t 10 -b 7M -R #作为客户端,连接服务端ip地址192.168.3.250,报告回显间隔1s,测试时间10s,带宽限制为7M,-R为反向测试,这个参数也是iperf3的主要亮点,支持直接转换数据发送方向
#udp不指定-b默认1M iperf -s -i 1 # 作为服务端运行,报告回显间隔时间1s,服务端不区分tcp或udp iperf3 -u -c 192.168.3.250 -b 70M -i 1 -t 10 #作为客户端运行,限制带宽70M,报告回显间隔1s,测试时间10s iperf3 -u -c 192.168.3.250 -b 70M -i 1 -t 10 -R #作为客户端运行,限制带宽70M,报告回显间隔1s,测试时间10s
|