Iperf使用方法与参数说明

2021-01-31, updated 2021-09-12

https://iperf.fr/

iperf是一个网络性能测试工具。可以测试TCP和UDP带宽质量,可以测量最大TCP带宽,具有多种参数和UDP特性,可以报告带宽,延迟抖动和数据包丢失。Iperf在linux和windows平台均有二进制版本供自由使用。

iperf was developed by NLANRDAST as a modern alternative for measuring maximum TCP and UDP bandwidth performance. Iperf allows the tuning of various parameters and UDP characteristics. Iperf reports bandwidth, delay jitter, datagram loss.

iperf使用方法与参数说明

参数说明

通用参数

server专用参数

client端专用参数

应用实例

使用 iperf -s 命令将 Iperf 启动为 server 模式,在客户机上使用 iperf -c启动client模式。

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
iperf –s

------------------------------------------------------------

Server listening on TCP port 5001

TCP window size: 8.00 KByte (default)

------------------------------------------------------------

iperf -c 59.128.103.56

上面使用服务端和客户端的默认设置进行测试

1
2
3
4
5
6
7
8
9
iperf -s -w 300K

------------------------------------------------------------

Server listening on TCP port 5001

TCP window size:  300 KByte

------------------------------------------------------------

设定报告间隔为2秒,服务器端和客户端的TCP窗口都开到300KB

1
iperf -c 59.128.103.56 -f K -i 2 -w 300K

测试传输约1MB数据

1
iperf -c 59.128.103.56 -f K -i 2 -w 300K –n 1000000

测试持续36秒

1
iperf -c 59.128.103.56 -f K -i 2 -w 300K –t 36

测试双向的传输

1
iperf -c 59.128.103.56 -f K -i 2 -w 300K -n 10400000 –d

UDP测试

1
iperf -c 59.128.103.56 -f K -i 2 -w 300K –u

其中-i参数的含义是周期性报告的时间间隔(interval),单位为秒;在上面的例子中,表示每隔2秒报告一次带宽等信息。

words: 987 tags: tool iperf