ping ya.ru
PING ya.ru (213.180.193.3) 56(84) bytes of data.
64 bytes from www.yandex.ru (213.180.193.3): icmp_req=1 ttl=60 time=97.6 ms
64 bytes from www.yandex.ru (213.180.193.3): icmp_req=2 ttl=60 time=96.6 ms
64 bytes from www.yandex.ru (213.180.193.3): icmp_req=3 ttl=60 time=95.6 ms
64 bytes from www.yandex.ru (213.180.193.3): icmp_req=4 ttl=60 time=94.5 ms
64 bytes from www.yandex.ru (213.180.193.3): icmp_req=5 ttl=60 time=92.6 ms
64 bytes from www.yandex.ru (213.180.193.3): icmp_req=6 ttl=60 time=91.9 ms
64 bytes from www.yandex.ru (213.180.193.3): icmp_req=7 ttl=60 time=90.5 ms
64 bytes from www.yandex.ru (213.180.193.3): icmp_req=8 ttl=60 time=88.6 ms
64 bytes from www.yandex.ru (213.180.193.3): icmp_req=9 ttl=60 time=87.6 ms
64 bytes from www.yandex.ru (213.180.193.3): icmp_req=10 ttl=60 time=86.7 ms
64 bytes from www.yandex.ru (213.180.193.3): icmp_req=11 ttl=60 time=85.6 ms
64 bytes from www.yandex.ru (213.180.193.3): icmp_req=12 ttl=60 time=84.5 ms
64 bytes from www.yandex.ru (213.180.193.3): icmp_req=13 ttl=60 time=82.6 ms
64 bytes from www.yandex.ru (213.180.193.3): icmp_req=14 ttl=60 time=80.6 ms
64 bytes from www.yandex.ru (213.180.193.3): icmp_req=15 ttl=60 time=79.6 ms
64 bytes from www.yandex.ru (213.180.193.3): icmp_req=16 ttl=60 time=77.6 ms
64 bytes from www.yandex.ru (213.180.193.3): icmp_req=17 ttl=60 time=76.5 ms
64 bytes from www.yandex.ru (213.180.193.3): icmp_req=18 ttl=60 time=74.7 ms
64 bytes from www.yandex.ru (213.180.193.3): icmp_req=19 ttl=60 time=73.6 ms
64 bytes from www.yandex.ru (213.180.193.3): icmp_req=20 ttl=60 time=72.6 ms
64 bytes from www.yandex.ru (213.180.193.3): icmp_req=21 ttl=60 time=71.6 ms
64 bytes from www.yandex.ru (213.180.193.3): icmp_req=22 ttl=60 time=70.5 ms
64 bytes from www.yandex.ru (213.180.193.3): icmp_req=23 ttl=60 time=68.7 ms
64 bytes from www.yandex.ru (213.180.193.3): icmp_req=24 ttl=60 time=67.6 ms
64 bytes from www.yandex.ru (213.180.193.3): icmp_req=25 ttl=60 time=67.0 ms
64 bytes from www.yandex.ru (213.180.193.3): icmp_req=26 ttl=60 time=65.6 ms
64 bytes from www.yandex.ru (213.180.193.3): icmp_req=27 ttl=60 time=64.6 ms
64 bytes from www.yandex.ru (213.180.193.3): icmp_req=28 ttl=60 time=63.4 ms
64 bytes from www.yandex.ru (213.180.193.3): icmp_req=29 ttl=60 time=61.6 ms
64 bytes from www.yandex.ru (213.180.193.3): icmp_req=30 ttl=60 time=60.6 ms
64 bytes from www.yandex.ru (213.180.193.3): icmp_req=31 ttl=60 time=59.5 ms
64 bytes from www.yandex.ru (213.180.193.3): icmp_req=32 ttl=60 time=57.6 ms
64 bytes from www.yandex.ru (213.180.193.3): icmp_req=33 ttl=60 time=56.5 ms
64 bytes from www.yandex.ru (213.180.193.3): icmp_req=34 ttl=60 time=54.5 ms
64 bytes from www.yandex.ru (213.180.193.3): icmp_req=35 ttl=60 time=53.6 ms
64 bytes from www.yandex.ru (213.180.193.3): icmp_req=36 ttl=60 time=52.3 ms
64 bytes from www.yandex.ru (213.180.193.3): icmp_req=37 ttl=60 time=50.5 ms
64 bytes from www.yandex.ru (213.180.193.3): icmp_req=38 ttl=60 time=49.5 ms
64 bytes from www.yandex.ru (213.180.193.3): icmp_req=39 ttl=60 time=47.5 ms
64 bytes from www.yandex.ru (213.180.193.3): icmp_req=40 ttl=60 time=45.6 ms
64 bytes from www.yandex.ru (213.180.193.3): icmp_req=41 ttl=60 time=44.6 ms
64 bytes from www.yandex.ru (213.180.193.3): icmp_req=42 ttl=60 time=44.0 ms
64 bytes from www.yandex.ru (213.180.193.3): icmp_req=43 ttl=60 time=42.5 ms
64 bytes from www.yandex.ru (213.180.193.3): icmp_req=44 ttl=60 time=40.5 ms
64 bytes from www.yandex.ru (213.180.193.3): icmp_req=45 ttl=60 time=39.4 ms
64 bytes from www.yandex.ru (213.180.193.3): icmp_req=46 ttl=60 time=37.6 ms
64 bytes from www.yandex.ru (213.180.193.3): icmp_req=47 ttl=60 time=36.5 ms
64 bytes from www.yandex.ru (213.180.193.3): icmp_req=48 ttl=60 time=34.6 ms
64 bytes from www.yandex.ru (213.180.193.3): icmp_req=49 ttl=60 time=33.5 ms
64 bytes from www.yandex.ru (213.180.193.3): icmp_req=50 ttl=60 time=31.6 ms
64 bytes from www.yandex.ru (213.180.193.3): icmp_req=51 ttl=60 time=30.6 ms
64 bytes from www.yandex.ru (213.180.193.3): icmp_req=52 ttl=60 time=29.5 ms
64 bytes from www.yandex.ru (213.180.193.3): icmp_req=53 ttl=60 time=27.5 ms
64 bytes from www.yandex.ru (213.180.193.3): icmp_req=54 ttl=60 time=26.5 ms
64 bytes from www.yandex.ru (213.180.193.3): icmp_req=55 ttl=60 time=24.6 ms
64 bytes from www.yandex.ru (213.180.193.3): icmp_req=56 ttl=60 time=23.5 ms
64 bytes from www.yandex.ru (213.180.193.3): icmp_req=57 ttl=60 time=21.5 ms
64 bytes from www.yandex.ru (213.180.193.3): icmp_req=58 ttl=60 time=19.5 ms
64 bytes from www.yandex.ru (213.180.193.3): icmp_req=59 ttl=60 time=17.6 ms
64 bytes from www.yandex.ru (213.180.193.3): icmp_req=60 ttl=60 time=17.4 ms
64 bytes from www.yandex.ru (213.180.193.3): icmp_req=61 ttl=60 time=15.5 ms
64 bytes from www.yandex.ru (213.180.193.3): icmp_req=62 ttl=60 time=13.4 ms
64 bytes from www.yandex.ru (213.180.193.3): icmp_req=63 ttl=60 time=12.0 ms
64 bytes from www.yandex.ru (213.180.193.3): icmp_req=64 ttl=60 time=10.5 ms
64 bytes from www.yandex.ru (213.180.193.3): icmp_req=65 ttl=60 time=8.57 ms
64 bytes from www.yandex.ru (213.180.193.3): icmp_req=66 ttl=60 time=6.55 ms
64 bytes from www.yandex.ru (213.180.193.3): icmp_req=67 ttl=60 time=4.51 ms
64 bytes from www.yandex.ru (213.180.193.3): icmp_req=68 ttl=60 time=2.68 ms
64 bytes from www.yandex.ru (213.180.193.3): icmp_req=69 ttl=60 time=1.55 ms
64 bytes from www.yandex.ru (213.180.193.3): icmp_req=70 ttl=60 time=99.5 ms
64 bytes from www.yandex.ru (213.180.193.3): icmp_req=71 ttl=60 time=97.6 ms
64 bytes from www.yandex.ru (213.180.193.3): icmp_req=72 ttl=60 time=96.7 ms
64 bytes from www.yandex.ru (213.180.193.3): icmp_req=73 ttl=60 time=95.6 ms
64 bytes from www.yandex.ru (213.180.193.3): icmp_req=74 ttl=60 time=93.7 ms
看一下“时间”字段,它随着每个数据包从 100 减少到 0,间隔 1 毫秒,之后时间 = 0,它又从 100 毫秒开始。
我的朋友重新启动了这台服务器,但我想知道它到底是什么情况。
重启后就好了:
ping -c 3 ya.ru
PING ya.ru (213.180.193.3) 56(84) bytes of data.
64 bytes from www.yandex.ru (213.180.193.3): icmp_req=1 ttl=60 time=1.71 ms
64 bytes from www.yandex.ru (213.180.193.3): icmp_req=2 ttl=60 time=2.69 ms
64 bytes from www.yandex.ru (213.180.193.3): icmp_req=3 ttl=60 time=2.57 ms
tracepath 有 2 个变体:
tracepath ya.ru -n
1?: [LOCALHOST] pmtu 1500
1: 86.62.102.1 0.531ms
1: 86.62.102.1 0.548ms
2: 86.62.124.66 37.162ms
3: 86.62.124.129 0.946ms asymm 2
4: 193.232.244.93 2.492ms asymm 3
5: no reply
6: 87.250.239.75 2.759ms
7: 87.250.239.75 3.062ms asymm 6
8: no reply
9: no reply
10: no reply
11: 93.158.134.3 2.986ms reached
Resume: pmtu 1500 hops 11 back 58
或者
tracepath ya.ru -n
1?: [LOCALHOST] pmtu 1500
1: 86.62.102.1 0.670ms
1: 86.62.102.1 0.601ms
2: 86.62.124.66 0.858ms
3: 86.62.124.129 0.978ms asymm 2
4: 193.232.244.93 2.353ms asymm 3
5: 87.250.239.49 1.820ms asymm 4
6: no reply
7: 213.180.193.3 3.164ms reached
Resume: pmtu 1500 hops 7 back 60
答案1
往返变化看起来非常不自然。我不认为这些可能是由不准确的时间测量或网络拥塞引起的。
但网络模拟硬件和/或软件很可能能够插入合成延迟。这将是软件开发过程中非常有用的功能。而且您看到的变化并不难通过网络模拟工具引入。
另外,我猜你其实并没有真正 ping 过服务器,你以为你在 ping 。考虑到往返时间小于 2ms 和光纤中的光速,你可以计算出你的服务器和你一直 ping 的主机之间的最大距离。它不会超过几百公里远。
TTL 是另一个线索。数据包到达时的 TTL 为 60。它们发送时的 TTL 可能为 64。这意味着您和您正在 ping 的节点之间只有四个路由器。