traceroute如何工作? [英] How does traceroute work?

查看:113
本文介绍了traceroute如何工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这似乎很神奇.为了将整个路径映射到Internet上其他节点的traceroute命令在做什么?

It seems almost magical. What is the traceroute command doing in order to map out the entire path to some other node on the Internet?

推荐答案

Traceroute传输具有较小TTL(生存时间)值的数据包. TTL是IP头字段,用于防止数据包陷入无限循环.当处理数据包的路由器从数据包的TTL中减去1时.当TTL达到零时,数据包将过期并被丢弃.

Traceroute transmits packets with small TTL (Time To Live) values. The TTL is an IP header field that is used to prevent packets from running into endless loops. When a router that handles the packet subtracts one from the packet's TTL. The packet expires and it's discarded when the TTL reaches zero.

Traceroute将ICMP超时消息( RFC 792 )发送回发送者当这种情况发生时.通过使用较小的TTL值,数据包将很快过期,因此traceroute会导致沿数据包路径的所有路由器生成标识该路由器的ICMP消息.

Traceroute sends ICMP Time Exceeded messages, (RFC 792), back to the sender when this occurs. By using small TTL values, the packets will quickly expire, so traceroute causes all routers along a packet's path to generate the ICMP messages that identify the router.

例如,TTL = 1应该从第一个路由器生成消息,TTL = 2从路径中的第二个路由器生成消息,依此类推...

For example, TTL = 1 should produce the message from the first router, TTL = 2 generates a message from the second router in the path, and so on...

这篇关于traceroute如何工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆