Chinaunix首页 | 论坛 | 博客
  • 博客访问: 3401273
  • 博文数量: 534
  • 博客积分: 11595
  • 博客等级: 上将
  • 技术积分: 5785
  • 用 户 组: 普通用户
  • 注册时间: 2006-12-22 17:00
文章分类

全部博文(534)

文章存档

2015年(4)

2014年(27)

2013年(15)

2012年(38)

2011年(36)

2010年(85)

2009年(63)

2008年(142)

2007年(124)

分类: 系统运维

2007-06-28 16:58:21

用于确定IP数据报访问目标所通过的路径。Tracert命令用IP生存时间(TTL)字段和ICMP错误消息来确定从一个主机到网络上其他主机的路由。
 
Tracert 工作原理
通过向目标发送不同IP生存时间(TTL)值的“Internet控制消息协议(ICMP)”回应数据包,Tracert诊断程序确定到目标所通过的路由。要求路径上的每个路由器在转发数据包之前至少将数据包上的TTL递减1。数据包上的TTL减为0时,路由器应该将“ICMP 已超时”的消息发回源系统。
Tracert先发送TTL为1的回应数据包(默认最大30跳),并在随后的每次发送过程将TTL递增1,直到目标响应或TTL达到最大值,从而确定路由。通过检查中间路由器发回的“ICMP 已超时”的消息确定路由。某些路由器不经询问直接丢弃 TTL 过期的数据包,这在 Tracert 实用程序中看不到。
Tracert命令按顺序打印出返回“ICMP已超时”消息的路径中的近端路由器接口列表。如果使用-d选项,则 Tracert实用程序不在每个IP地址上查询DNS。
 
Tracert命令行选项
tracert [-d] [-h maximum_hops] [-j host-list] [-w timeout] target_name
-d 指定不将IP地址解析到主机名称。
-h maximum_hops 指定跃点数以跟踪到称为target_name的主机的路由。
-j host-list 指定Tracert实用程序数据包所采用路径中的路由器接口列表。
-w timeout 等待timeout为每次回复所指定的毫秒数。
target_name 目标主机的名称或 IP 地址。
 
tracert命令查看某个地址,得到的时间有3个如下   
     比如:   26ms     10ms     10ms.
表示发送的三个探测包的回应时间;一般在网络情况平均的情况下,三个时间差不多;如果相差比较大,说明网络情况变化比较大.
 
 
例子:
C:\>tracert (IP 地址也行)
Tracing route to [202.108.42.64]
over a maximum of 30 hops:
1 <10 ms <10 ms 10 ms 192.168.1.1
2 <10 ms <10 ms <10 ms 192.168.1.110
3 10 ms 20 ms 20 ms 218.20.189.1
4 10 ms 20 ms 10 ms 218.19.208.241
5 10 ms 10 ms 10 ms 61.144.11.17
6 10 ms 10 ms 20 ms 61.144.0.9
7 10 ms 10 ms 20 ms 61.140.1.121
8 10 ms 30 ms 20 ms GE7-0-R1-C-GZ-A.gd.cn.net [202.105.1.145]
9 10 ms 10 ms 20 ms 61.140.0.21
10 60 ms 40 ms 40 ms 202.97.38.162
11 50 ms 51 ms 50 ms 202.96.12.38
12 51 ms 50 ms 70 ms 202.106.192.226
13 50 ms 50 ms 50 ms 202.106.192.174
14 50 ms 50 ms 60 ms 202.108.42.64
Trace complete.
说明了到 [202.108.42.64],必须先经过14跳之后才能到达.
 
 
 
当出现以下Request timed out情况说明是路由器拒绝回复,中间的路由器是要回应一个ICMP的超时消息,也就是TTL=0造成的. 我们公司用的是tplink tl-r470+宽带路由器就不支持回复,给tplink打电话说宽带型号都不支持,也不能手工调试.
C:\>tracert 218.83.82.15
Tracing route to 218.83.82.15 over a maximum of 30 hops
  1     *        *        *     Request timed out.
  2     *        *        *     Request timed out.
  3     *        *        *     Request timed out.
  4     *        *        *     Request timed out.
  5     *        *        *     Request timed out.
  6     *        *        *     Request timed out.
  7     *        *        *     Request timed out.
  8     *        *        *     Request timed out.
  9    28 ms    31 ms    26 ms  218.83.82.15
Trace complete.
阅读(3234) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~