
使用 MTR(使用 TCP,而不是 ICMP),我在執行正常 ICMP 泛洪限制的一台路由器上始終看到封包遺失。 UDP 也做了同樣的事情 - 我仍然看到損失。
然而,當我使用其他工具,即TCPing.exe、hping3、PRTG QOS時,我很少看到丟失(除了正常的ICMP丟失)。
是什麼可能導致 MTR 顯示與其他工具始終不同的結果?
跳 2 是具有 ICMP 泛洪限制的 Cisco 路由器:並查看 MTR 中的毫秒時間:
mtr -P 445 -T -rn 172.31.xx.5
Start: 2020-09-02T11:54:26+0800
HOST: xxxx Loss% Snt Last Avg Best Wrst StDev
1.|-- 172.20.x.254 0.0% 10 0.6 0.7 0.5 1.9 0.4
2.|-- 172.18.x.239 10.0% 10 7014. 3339. 0.2 7018. 3506.6
3.|-- 172.31.x.32 0.0% 10 4.3 2.4 2.0 4.3 0.7
4.|-- 172.18.x.211 0.0% 10 2.4 2.5 2.4 2.6 0.0
5.|-- 172.31.x.5 0.0% 10 81.4 81.7 81.4 82.5 0.4
惠普:
sudo hping3 -q --fast -n -c 100 172.31.x.5 -p 445 -T
HPING 172.31.x.5 (ens160 172.31.x.5): NO FLAGS are set, 40 headers + 0 data bytes
hop=1 TTL 0 during transit from ip=172.20.x.254
hop=1 hoprtt=0.9 ms
hop=2 TTL 0 during transit from ip=172.18.x.239
hop=2 hoprtt=0.8 ms
hop=3 TTL 0 during transit from ip=172.31.x.32
hop=3 hoprtt=2.8 ms
hop=4 TTL 0 during transit from ip=172.18.x.211
hop=4 hoprtt=2.8 ms
--- 172.31.x.5 hping statistic ---
100 packets transmitted, 100 packets received, 0% packet loss
round-trip min/avg/max = 0.8/78.7/86.4 ms
TCPing.exe:
./tcping -i .1 -p 445 -n 50 172.31.x.5
Probing 172.31.x.5:445/tcp - Port is open - time=81.423ms
Probing 172.31.x.5:445/tcp - Port is open - time=81.375ms
Probing 172.31.x.5:445/tcp - Port is open - time=81.246ms
Ping statistics for 172.31.x.5:445
50 probes sent.
50 successful, 0 failed. (0.00% fail)
Approximate trip times in milli-seconds:
Minimum = 81.246ms, Maximum = 85.690ms, Average = 81.628ms
答案1
不確定您使用的其他工具,但 mtr 在使用 TCP 時會向目的地發送 TCP SYN 封包,並將 TTL 從 1 遞增,直到到達目的地。因此,當封包達到 TTL 0 時,路徑中的路由器仍然會發回 ICMP 類型 11 - 生存時間超出。
如果您有興趣,您可以在這裡閱讀有關控制平面監管的一些內容:https://nwmichl.net/2021/02/03/coping-with-copp-why-icmp-drops-happen/