Windows 上的 Tracert 返回速度比 Linux 慢

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5574205/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 16:34:42  来源:igfitidea点击:

Tracert on Windows Returns Slower than on Linux

windowslinuxtraceroute

提问by Paul

I have two computers, one Windows and one Linux sitting side by side on my desk, both connecting to the same internet. If I run a tracert on www.stackoverflow.com and traceroute www.stackoverflow.com, both return the same data. However, tracert on Windows takes 3x as long (with the same params) as traceroute on Linux (linux tr is almost instantaneous)

我有两台电脑,一台 Windows 和一台 Linux 并排坐在我的桌子上,都连接到同一个互联网。如果我在 www.stackoverflow.com 和 traceroute www.stackoverflow.com 上运行 tracert,两者都返回相同的数据。但是,Windows 上的 tracert 所需的时间是 Linux 上的 traceroute 的 3 倍(具有相同的参数)(linux tr 几乎是瞬时的)

I tried tracert -d but no real difference to speak of.

我试过 tracert -d 但没有真正的区别可言。

How can I get Windows tracert to return at the same speed?

如何让 Windows tracert 以相同的速度返回?

Thanks

谢谢

采纳答案by sarnold

The Windows tracerttool sends ICMP echo requests; many routers will just DROPICMP echo requests. Thus the tool must wait for an internal timeout before declaring that route dead.

Windowstracert工具发送ICMP 回显请求;许多路由器只会DROP响应 ICMP 回显请求。因此,该工具必须等待内部超时,然后才能宣布该路由已失效。

The Linux traceroutetool sends UDP connection attempts; routers have to forward these packets, so it works pretty reliably. This means the tool won't have to wait for timeouts from most of the routers along the way.

Linuxtraceroute工具发送 UDP 连接尝试;路由器必须转发这些数据包,因此它的工作非常可靠。这意味着该工具不必等待沿途大多数路由器的超时。

回答by Zr40

The Windows tracertwaits about 1 second between hops. The Linux traceroutedoes not wait between hops. There is no documented option for the Windows tracertto disable this delay.

Windowstracert在跃点之间等待大约 1 秒。Linuxtraceroute不会在跃点之间等待。Windows 没有记录选项tracert可以禁用此延迟。

回答by Max

Stumbled upon this old thread and wanted to say that there is an option to speed up tracert in Windows.

偶然发现了这个旧线程,想说有一个选项可以在 Windows 中加速 tracert。

tracert -d -w 100

tracert -d -w 100

-d prevents hostname resolution

-d 阻止主机名解析

-w 100 sets the response timeout to 100ms.

-w 100 将响应超时设置为 100 毫秒。

You may get a missed ping reply if your pinging slow network gear over a VPN or distant MPLS, but it speeds up the tracert to about 40 seconds.

如果您通过 VPN 或远程 MPLS ping 速度较慢的网络设备,您可能会收到错过的 ping 回复,但它会将 tracert 加速到大约 40 秒。

回答by Erik van Velzen

As a tip, you can speed up traceroute in Windows by disabling resolving with tracert -d.

作为提示,您可以通过禁用解析来加速 Windows 中的跟踪路由tracert -d

回答by user2347953

tracertsends the probes one by one, traceroutesends 16 at a time (can be changed with the -N argument).

tracert一个一个地发送探测器,一次traceroute发送 16 个(可以用 -N 参数更改)。