- 论坛徽章:
- 0
|
很久没上来写东西了,今天发现一个ping的小技巧,写出来大家有时间就当消遣吧。
C:\Documents and Settings\sina>ping 202.106.184.186
Pinging 202.106.184.186 with 32 bytes of data:
Reply from 202.106.184.186: bytes=32 timeping www.netease.com
Pinging www.cache.split.netease.com [202.108.9.31] with 32 bytes of data:
Reply from 202.108.9.31: bytes=32 time=1ms TTL=53
Reply from 202.108.9.31: bytes=32 time=1ms TTL=53
Reply from 202.108.9.31: bytes=32 time=1ms TTL=53
Reply from 202.108.9.31: bytes=32 time=1ms TTL=53
Ping statistics for 202.108.9.31:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 1ms, Maximum = 1ms, Average = 1ms
不小心,对网易ping了一下,:) 发现什么了吗?对,网易的服务器是linux的,为什么?继续往下看吧。
TTL windows的默认TTL规定是128 linux默认TTL是64
其实说白了也就是系统规定,数据名一旦发出去只准它跳跃最多128个结点,你要是跳的太多,这网络还能用吗?不要慢死才怪。我说的这些也只是针对windows而言,更何况现在的路由机发展的这么好,超过20跳的都很少见了吧,这只是我一厢情愿猜测的:( ,如果跳的结果点超过了系统规定怎么办?当就直期把它丢弃,也就是这个包过期了,你想啊,如果你不这样约束它,真的让它自己的在网络间传输,那这网络也活不了多久了。每跳一次TTL -1,这样当TTL等于0时到达的服务器会把它直接丢回来,看诉你,这个包啊,过期啦!实际的意思也就是说你的网络有问题,路由有问题啦
接着上面ping网易的说事吧。TTL = 53 tracert www.netease.com -d
Tracing route to www.cache.split.netease.com [202.108.9.51]
over a maximum of 30 hops:
1 ping www.sohu.com.cn
Pinging redirect.sohu.com [61.135.181.175] with 32 bytes of data:
Reply from 61.135.181.175: bytes=32 time=1ms TTL=54
Reply from 61.135.181.175: bytes=32 time=1ms TTL=54
Reply from 61.135.181.175: bytes=32 timetracert www.sohu.com.cn -d
Tracing route to redirect.sohu.com [61.135.181.176]
over a maximum of 30 hops:
1 ping www.sohu.com.cn -i 1
Pinging redirect.sohu.com [61.135.181.175] with 32 bytes of data:
Reply from 10.217.15.1: TTL expired in transit.
Reply from 10.217.15.1: TTL expired in transit.
Reply from 10.217.15.1: TTL expired in transit.
Reply from 10.217.15.1: TTL expired in transit.
Ping statistics for 61.135.181.175:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms
TTL expired in transit.这句话意思就是TTL = 0 ,意味着这个包过期啦。网关一看是过期的算了,丢弃吧,不过还是要告诉你一下的,所以就出来了,你ping一个IP,但往往是另一个IP给你的回复。这种情况要是在日常工作中发生,那应该就是你的网络有问题,可能有环呦,有环就是一个包来回的在若干IP间传递呗,不过TTL是有限的,传着传着就等于 --TTL ,所以TTL=0时,谁接到都会回复你一下,顺便把你的包也一样丢弃。
C:\Documents and Settings\sina>ping 202.106.185.200
Pinging 202.106.185.200 with 32 bytes of data:
Reply from 202.106.185.200: bytes=32 time=1ms TTL=123
Reply from 202.106.185.200: bytes=32 time=1ms TTL=123
Reply from 202.106.185.200: bytes=32 timetracert 202.106.185.200 -d
Tracing route to 202.106.185.200 over a maximum of 30 hops
1 <1 ms <1 ms <1 ms 10.217.15.1
2 <1 ms <1 ms <1 ms 10.210.4.1
3 <1 ms <1 ms <1 ms 10.210.2.6
4 <1 ms 2 ms <1 ms 10.210.1.2
5 8 ms <1 ms <1 ms 192.168.168.254
6 1 ms <1 ms 1 ms 202.106.185.200
Trace complete.
没错,正好跳了6次,说明对方一定是台windows服务器。
好玩的还有很多,不过下班了,就先玩到这吧,改天再来吧。
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/23163/showart_357014.html |
|