13

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)

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

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

Thanks

KingFish
  • 8,773
  • 12
  • 53
  • 81

5 Answers5

13

The Windows tracert waits about 1 second between hops. The Linux traceroute does not wait between hops. There is no documented option for the Windows tracert to disable this delay.

Zr40
  • 1,910
  • 18
  • 20
11

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

The Linux traceroute tool 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.

sarnold
  • 102,305
  • 22
  • 181
  • 238
  • As an addition to this, i believe there is a traceroute plugin for cygwin, so you can get linuxesque traceroutes on windows. – richzilla Apr 06 '11 at 23:45
  • 3
    This is from a comment an anonymous user left behind but got rejected (invalid message edit): `This answer is wrong for three reasons: 1) Few if any Internet routers drop ICMP packets 2) Linux/Unix traceroute uses UDP, not TCP 3) The use of ICMP versus UDP has no real affect on speed The answer below (Windows waits 1 second between hops) is the true and accurate answer.` – ChrisWue Mar 30 '12 at 23:44
  • @Chris: Many thanks for the notice! I don't know how I wrote TCP in the first place, and I'm embarrassed that it took a _year_ for it to be corrected. But I stand by the "drop ICMP packets" portion -- I've seen that exact behavior too many times, especially on networks where a security-paranoid person thinks they'll "improve security" by dropping far too many packet types. – sarnold Mar 30 '12 at 23:45
7

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

tracert -d -w 100

-d prevents hostname resolution

-w 100 sets the response timeout to 100ms.

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.

Max
  • 71
  • 1
  • 1
4

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

Erik van Velzen
  • 6,211
  • 3
  • 23
  • 23
2

tracert sends the probes one by one, traceroute sends 16 at a time (can be changed with the -N argument).