momo's Blog.

检查网络质量的一些手段

字数统计: 637阅读时长: 3 min
2022/01/06 Share

前言

这里列出一部分网络质量的检查手段

PING 时延检查

我们可以通过PING命令来检查节点之间的延迟,如

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
-> % ping -c 30 www.baidu.com
PING www.a.shifen.com (36.152.44.95): 56 data bytes
64 bytes from 36.152.44.95: icmp_seq=0 ttl=55 time=10.172 ms
64 bytes from 36.152.44.95: icmp_seq=1 ttl=55 time=20.612 ms
64 bytes from 36.152.44.95: icmp_seq=2 ttl=55 time=9.035 ms
64 bytes from 36.152.44.95: icmp_seq=3 ttl=55 time=8.976 ms
64 bytes from 36.152.44.95: icmp_seq=4 ttl=55 time=8.715 ms
64 bytes from 36.152.44.95: icmp_seq=5 ttl=55 time=8.923 ms
64 bytes from 36.152.44.95: icmp_seq=6 ttl=55 time=8.826 ms
64 bytes from 36.152.44.95: icmp_seq=7 ttl=55 time=10.348 ms
64 bytes from 36.152.44.95: icmp_seq=8 ttl=55 time=9.480 ms
64 bytes from 36.152.44.95: icmp_seq=9 ttl=55 time=8.611 ms
64 bytes from 36.152.44.95: icmp_seq=10 ttl=55 time=14.721 ms
64 bytes from 36.152.44.95: icmp_seq=11 ttl=55 time=12.461 ms
64 bytes from 36.152.44.95: icmp_seq=12 ttl=55 time=9.163 ms
64 bytes from 36.152.44.95: icmp_seq=13 ttl=55 time=10.491 ms
64 bytes from 36.152.44.95: icmp_seq=14 ttl=55 time=8.779 ms
64 bytes from 36.152.44.95: icmp_seq=15 ttl=55 time=8.747 ms
64 bytes from 36.152.44.95: icmp_seq=16 ttl=55 time=12.940 ms
64 bytes from 36.152.44.95: icmp_seq=17 ttl=55 time=13.856 ms
64 bytes from 36.152.44.95: icmp_seq=18 ttl=55 time=8.787 ms
64 bytes from 36.152.44.95: icmp_seq=19 ttl=55 time=23.326 ms
64 bytes from 36.152.44.95: icmp_seq=20 ttl=55 time=9.005 ms
64 bytes from 36.152.44.95: icmp_seq=21 ttl=55 time=20.493 ms
64 bytes from 36.152.44.95: icmp_seq=22 ttl=55 time=8.609 ms
64 bytes from 36.152.44.95: icmp_seq=23 ttl=55 time=8.577 ms
64 bytes from 36.152.44.95: icmp_seq=24 ttl=55 time=9.038 ms
64 bytes from 36.152.44.95: icmp_seq=25 ttl=55 time=8.658 ms
64 bytes from 36.152.44.95: icmp_seq=26 ttl=55 time=8.999 ms
64 bytes from 36.152.44.95: icmp_seq=27 ttl=55 time=8.730 ms
64 bytes from 36.152.44.95: icmp_seq=28 ttl=55 time=8.663 ms
64 bytes from 36.152.44.95: icmp_seq=29 ttl=55 time=8.842 ms

--- www.a.shifen.com ping statistics ---
30 packets transmitted, 30 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 8.577/10.886/23.326/3.899 ms

主要关注丢包率和时延。

30 packets transmitted, 30 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 8.577/10.886/23.326/3.899 ms

可以看到上述的平均时延 10.886ms

吞吐量测试

在需要测试的服务端执行

1
iperf3 -s

客户端执行

1
iperf3 -c 172.20.0.131

然后记录接收端的数据。

PPS性能测试

PPS=发送成功的报文数÷测试时间。

服务端执行

1
iperf3 -s

客户端执行

1
iperf3 -u -l 16 -b 100m -c <ip>
CATALOG
  1. 1. 前言
  2. 2. PING 时延检查
  3. 3. 吞吐量测试
  4. 4. PPS性能测试