ping 时出现request time out 和destination is unreachable

发表于:2007-07-04来源:作者:点击数: 标签:
ping时出现requesttimeout和destinationisunreachable有什么区别马? 【发表回复】【查看CU论坛原帖】【添加到收藏夹】【关闭】 eager linux er 回复于:2003-12-26 08:46:46 requesttimeout是指icmp包发出后,长时间没有回应,所以会产生requesttimeout。一

ping 时出现request time out 和destination is unreachable有什么区别马?

【发表回复】【查看CU论坛原帖】【添加到收藏夹】【关闭】
 eagerlinuxer 回复于:2003-12-26 08:46:46
request time out  是指icmp包发出后,长时间没有回应,所以会产生request time out。一般是ping 了一台网络中不存在的主机。

destination is unreachable 或 destination port unreachable 一般是收到了目标主机或中间路由器回应的端口或目标主机不可达icmp包。
如你ping一台用iptables封了icmp包的主机且用了-j REJECT 就会出现destination port unreachable 的信息,这是目标主机给的回应。

两者主要的区别是看目标主机或中间路由器是不是给了icmp不可达的回应。

 platinum 回复于:2003-12-26 11:23:07
MIRROR又是做什么的呢?请指教!

 JohnBull 回复于:2003-12-26 13:10:19
[quote:60883028f9="eagerlinuxer"]request time out  是指icmp包发出后,长时间没有回应,所以会产生request time out。一般是ping 了一台网络中不存在的主机。

destination is unreachable 或 destination port unreachable 一般是收到了目标主机..........[/quote:60883028f9]

说反了吧. :P
request time out是因为丢包,(说明最后一跳是可以送达的(但是不一定正确)所以不会返回不可达消息)
destination is unreachable是因为对方主机不存在(因为最后一跳无法送达,所以返回不可达消息)
network is unreachable是因为路径中的某一跳因为缺乏路由项而无法执行.

 jigenxiang 回复于:2003-12-26 13:38:08
[quote:6436a68b6a="JohnBull"]

说反了吧. :P
request time out是因为丢包,(说明最后一跳是可以送达的(但是不一定正确)所以不会返回不可达消息)
destination is unreachable是因为对方主机不存在(因为最后一跳无法送达,所以返回不可达消息)
n..........[/quote:6436a68b6a]

为什么都要说是最后一跳呢?其实都差不多的。我觉得request time out 就是包已经发出去了,但是没收到确认包
distination is unreachable 就是你根本不能把包发出去
还有一个network is unreachable 可能是你本地的网络设备有问题,比如ping 127.0.0.1 和localhost 都不通,那你的本地设备肯定有问题!!!

 eagerlinuxer 回复于:2003-12-29 00:48:32
[quote:2f1a21af94="JohnBull"]

说反了吧. :P
request time out是因为丢包,(说明最后一跳是可以送达的(但是不一定正确)所以不会返回不可达消息)
destination is unreachable是因为对方主机不存在(因为最后一跳无法送达,所以返回不可达消息)
n..........[/quote:2f1a21af94]

没有说反,你可以试一下,ping一台不存在的主机,看看是不是显示request time out,也就是ping发出的icmp(echo request)包没有得到任何的icmp(echo reply或destination unreachable)回应而超时。

而ping时显示destination unreachable则说明源主机收到了中间路由器或目标主机反回的icmp(destination unreachable)包。 

查了一下“TCP/IP详解“一书,icmp类型3(destination unreachable)下还有0~15个代码,0--网络不可达  1--主机不可达  2--协议不可达  3--端口不可达  等等,我就不一个个写了:)

 網中人 回复于:2003-12-29 07:28:45
request time out 有很多原因,主機不存在是其一。
若 icmp 單純被 ignore 或 drop 掉而非 reject ,也有可能得到 request time out ...

原文转自:http://www.ltesting.net