iperf 网络性能测试工具

Summary: Author: 张亚飞 | Read Time: 1 minute read | Published: 2021-04-25
Filed under Categories: LinuxTags: Note,

iperf 网络性能测试工具

iperf 是一款网络性能测试工具,也可以用来做 UDP 端口扫描

iperf 安装

brew install iperf

客户端同时发起 30 个线程连接,以 5Mbps 为数据发送速率,测试时间60秒

iperf -u -c 103.234.22.131 -p 3478 -b 5M -P 30 -t 60

测试 UDP 端口是否可用

iperf -c 103.234.22.131 -u -p 3478 -b 1K

测试可用端口 3478

$ iperf -c 103.234.22.131 -u -p 3478 -b 1K
------------------------------------------------------------
Client connecting to 103.234.22.131, UDP port 3478
Sending 1470 byte datagrams, IPG target: 11484375.00 us (kalman adjust)
UDP buffer size: 9.00 KByte (default)
------------------------------------------------------------
[  1] local 172.27.12.143 port 53843 connected with 103.234.22.131 port 3478
[ ID] Interval       Transfer     Bandwidth
[  1] 0.00-14.50 sec  8.61 KBytes  4.87 Kbits/sec
[  1] Sent 7 datagrams
[  4] WARNING: did not receive ack of last datagram after 10 tries.

测试不可用端口 3477

$ iperf -c 103.234.22.131 -u -p 3477 -b 1K
------------------------------------------------------------
Client connecting to 103.234.22.131, UDP port 3477
Sending 1470 byte datagrams, IPG target: 11484375.00 us (kalman adjust)
UDP buffer size: 9.00 KByte (default)
------------------------------------------------------------
[  1] local 172.27.12.143 port 56000 connected with 103.234.22.131 port 3477
[ ID] Interval       Transfer     Bandwidth
[  1] 0.00-14.25 sec  4.31 KBytes  2.48 Kbits/sec
[  1] Sent 4 datagrams
read failed: Connection refused
read failed: Connection refused
read failed: Connection refused
read failed: Connection refused
read failed: Connection refused
read failed: Connection refused
read failed: Connection refused
read failed: Connection refused
[  4] WARNING: did not receive ack of last datagram after 10 tries.

iperf

Comments

Cor-Ethan, the beverage → www.iirii.com