gpt4 book ai didi

networking - 跟踪路由 : Can it trace a path from A to B correctly?

转载 作者:可可西里 更新时间:2023-11-01 02:31:43 24 4
gpt4 key购买 nike

Traceroute 是一个跟踪从 A 到 B 的路径的应用程序。(A 是您的位置,B 是您要跟踪的服务器)。在 Windows 中,您可以键入 tracert。主要算法为:

send UDP with TTL = 1
Server A1 received, and return ICMP packet to A because TTL is expired.
--> know first machine between. For example A1.

send UDP with TTL = 2
Server A1 received, and send this UDP to server A2.
Server A2 received, and return ICMP packet to A because TTL is expired
--> know second machine between. In this example is A2.

Do it until to B. we can track down: A -> A1 -> A2 -> ... ->B

这个算法是否正确工作?因为在不同的时间,中间服务器可以向不同的服务器发送消息。例如,一开始UDP报文发送给A1,但稍后可以发送给另一台服务器,例如B1。因此,跟踪路由将无法正常工作。

我是不是误会了什么?

最佳答案

来自手册页:

traceroute tracks the route packets take from an IP network on their way to a given host

因此,如果您试图找到数据包可能采用的一个可能路径,您将在跟踪路由

现在,因为路由表不会每分钟更改一次,您发送的数据包很可能采用与 traceroute 跟踪的路径相同的路径。

另一个不能错过的重点是 IPv4 header 中的记录路由选项。一旦指定要使用此选项,路径中的每个路由器都会将其 IP 地址添加到 header 中的选项中。您可以阅读更多相关信息 here .问题是目的地了解中间跃点,而不是源。

我看到你在 traceroute 的描述中忽略了 icmp echo request and reply messages 的作用。如果这不是故意的,请使用 look .

更新:您可以通过执行 ping -R

查看正在运行的记录路由选项

ping -R Turns on route recording for the Echo Request packets, and display the route buffer on returned packets (ignored by many routers).

关于networking - 跟踪路由 : Can it trace a path from A to B correctly?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13329155/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com