windwos : Release 3.21 · ar51an/iperf3-win-builds · GitHub
linux:
apt-get install iperf3
yum -y install iperf3
服务端配置:
服务端:
iperf3 -s -i 2 -p 8888 -D
客户端:
iperf3 -c 192.168.10.20 -p 8888 -f m -i 1
# 测试单线程tcp速度
iperf3 -c 192.168.10.20 -p 8888 -f m -i 1 -b 1000M -n 100M -u
iperf3 -c 192.168.10.20 -p 8888 -f m -i 1 -b 1000M -n 100M -l 15000 -u
iperf3 -c 192.168.10.20 -p 8888 -f m -i 2 -u -R
iperf3 -c 192.168.10.20 -p 8888 -f m -i 1 -b 1000M -n 100M -u
iperf3 -c 192.168.10.20 -p 8888 -P 4
# 4线程测试
通用参数
-v # 查看版本信息
-p # 端口
-f # 指定带宽输出格式: Kbits、Mbits、Gbits、Tbits
-i # 监控报告时间间隔,单位秒(s)
-J # Json格式输出结果
--logfile # 将结果输出到指定文件中
服务端参数
-s # 以服务器模式运行
-D # 后台运行服务器模式
客户端参数
-c # 以客户端模式运行,连接到服务端
-t # 传输时间,默认10秒
-n # 传输内容大小,不能与-t同时使用
-b # 目标比特率(0表示无限)(UDP默认1Mbit/sec,TCP不受限制)
-l # 要读取或写入的缓冲区长度(TCP默认128 KB,UDP默认1460)
-O # 忽略前几秒
-R # 反向模式运行,即服务端发送,客户端接收
-u # 使用UDP协议,默认使用TCP协议
--get-server-output #输出服务端的结果
root@ubuntu-home:~# iperf3 -c 192.168.10.20 -p 8888
Connecting to host 192.168.10.20, port 8888
[ 5] local 192.168.1.100 port 53120 connected to 192.168.10.20 port 8888
[ ID] Interval Transfer Bitrate Retr Cwnd
[ 5] 0.00-1.00 sec 130 MBytes 1.09 Gbits/sec 67 382 KBytes
[ 5] 1.00-2.00 sec 257 MBytes 2.15 Gbits/sec 29 446 KBytes
[ 5] 2.00-3.00 sec 316 MBytes 2.65 Gbits/sec 59 538 KBytes
[ 5] 3.00-4.00 sec 328 MBytes 2.75 Gbits/sec 30 576 KBytes
[ 5] 4.00-5.00 sec 332 MBytes 2.79 Gbits/sec 36 614 KBytes
[ 5] 5.00-6.00 sec 203 MBytes 1.70 Gbits/sec 68 393 KBytes
[ 5] 6.00-7.00 sec 230 MBytes 1.93 Gbits/sec 2 399 KBytes
[ 5] 7.00-8.00 sec 156 MBytes 1.31 Gbits/sec 13 366 KBytes
[ 5] 8.00-9.00 sec 257 MBytes 2.15 Gbits/sec 61 389 KBytes
[ 5] 9.00-10.00 sec 286 MBytes 2.40 Gbits/sec 7 473 KBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bitrate Retr
[ 5] 0.00-10.00 sec 2.44 GBytes 2.09 Gbits/sec 372 sender
[ 5] 0.00-10.00 sec 2.43 GBytes 2.09 Gbits/sec receiver
iperf Done.
含义:
| 字段 | 含义 |
|---|---|
| ID | 流编号 |
| Interval | 统计时间段 |
| Transfer | 这一秒发送的数据量 |
| Bitrate | 实际带宽 |
| Retr | TCP重传次数 |
| Cwnd | TCP拥塞窗口 |



