本文共 1665 字,大约阅读时间需要 5 分钟。
C:\>ping 192.168.0.1
Pinging 192.168.0.1 with 32 bytes of data:
Reply from 192.168.0.1: bytes=32 time=12ms TTL=64Reply from 192.168.0.1: bytes=32 time=12ms TTL=64Reply from 192.168.0.1: bytes=32 time=5ms TTL=64Reply from 192.168.0.1: bytes=32 time=2ms TTL=64Ping statistics for 192.168.0.1:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:Minimum = 2ms, Maximum = 12ms, Average = 7msC:\>
TTL有3个值,64 , 128 , 255
对应的OS linux , windows, router其实这是不准确的,可以修改注册表的值来改变TTL的值C:\>ping www.baidu.com
Pinging www.a.shifen.com [14.215.177.39] with 32 bytes of data:
Reply from 14.215.177.39: bytes=32 time=10ms TTL=54Reply from 14.215.177.39: bytes=32 time=10ms TTL=54Reply from 14.215.177.39: bytes=32 time=10ms TTL=54Reply from 14.215.177.39: bytes=32 time=16ms TTL=54Ping statistics for 14.215.177.39:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:Minimum = 10ms, Maximum = 16ms, Average = 11msC:\>
ping www.baidu.com 其TTL值是54 ,64-54=10 ,所以我的这个电脑访问百度经过了10个路由器
可以用tracert来验证其是不是经过10个路由器,从以下结果可以知道是经过10路由器,但是不包含最后一个路由器的。
C:\>tracert www.baidu.comTracing route to www.a.shifen.com [14.215.177.39]
over a maximum of 30 hops:1 2 ms 1 ms 9 ms 192.168.0.1
2 7 ms 3 ms 1 ms 192.168.1.13 6 ms 9 ms 11 ms 100.64.0.14 7 ms 4 ms 7 ms 113.106.42.535 9 ms 5 ms 7 ms 17.107.38.59.broad.fs.gd.dynamic.163data.com.cn [59.38.107.17]6 20 ms 4 ms 16 ms 202.105.158.737 13 ms 14 ms 26 ms 113.96.4.668 Request timed out.9 10 ms 8 ms 20 ms 14.29.121.20210 Request timed out.11 23 ms 7 ms 8 ms 14.215.177.39Trace complete.
转载于:https://blog.51cto.com/guanhaizhan/2063112