17

The implementation of traceroute(tracert) differs on Windows and Unix. I wanted to compare both with Wireshark. I am on Windows 7 now and I wanted to get Unix traceroute implementation quickly.

My first idea was to get it using MSYS or Cygwin. I installed Cygwin with "inetutils*" packages checked, but there is no traceroute command and corresponding executable in /usr/bin/.

I also tried searching for "traceroute" with Cygwin package search and found this substring in list of "zsh" files. I installed zsh and tried traceroute and tcptraceroute with no results.

Which package should i check for installation of traceroute and is there traceroute for Cygwin at all?

Jeff Schaller
  • 66,199
  • 35
  • 114
  • 250
Kirill
  • 985
  • 3
  • 10
  • 20

3 Answers3

18

There is no traceroute in the Cygwin packages, because tracert is always available on Windows. See https://cygwin.com/ml/cygwin/2005-12/msg00443.html for a thread briefly discussing this. You can try compiling a Unix-style traceroute from source usign Cygwin.

If you want to compare Windows-style tracert to Unix-style traceroute though, I'd recommend running traceroute on Unix or Linux, because the network stacks are different; so running a Unix-style traceroute on Windows won't give you quite the same network traces as Unix-style traceroute on Unix.

Stephen Kitt
  • 411,918
  • 54
  • 1,065
  • 1,164
  • 3
    `ping` also exists on Windows, but is availible for Cygwin :) Anyway, thanks for your answer. Maybe i will try to compile `traceroute` for Cygwin manually. – Kirill Mar 07 '15 at 16:51
  • 4
    Fair point, and `traceroute` offers quite a few more features than `tracert`. – Stephen Kitt Mar 07 '15 at 20:24
5

Ok, as Stephen Kitt said there is no ready to use traceroute binaries for Cygwin. That's why i tried to compile it myself.

I can see there is modern traceroute but from it's description follows, that it can't be used with old Linux kernels and for me compilation stuck on missing "dccp.h" and i gave up.

I was able to compile the old implementation, but it works like it can not see ICMP replies on TTL exceeded (there are asterisks instead of results):

1 * * *

2 * * *

Maybe it requires some fixes to work on Cygwin and that's is the reason why there is no traceroute package for Cygwin.

I checked with Wireshark and see it uses UDP test packets and corresponding ICMP replies are delivered correctly. I want to notice that this old traceroute works slowly like Win's tracert ("querying" nodes one by one). Modern traceroute gives results very quickly.

Kirill
  • 985
  • 3
  • 10
  • 20
3

I was able to build a port of mtr in Cygwin32 using instructions:

https://github.com/traviscross/mtr/

MTR is an alternative open source traceroute tool. It has both a GUI and Ncurses text interface. It is not exactly the classic traceroute, but I like it more.

LatinSuD
  • 1,401
  • 9
  • 8
  • Hello I tried to compile mtr on cygwin64 but there was an error I found solution to add "#define _WIN32_WINNT 0x0500" into /usr/include/w32api/mprapi.h and file has compiled, I moved mtr.exe to /bin and tried to run it like mtr google.com but there is such error: "mtr: Failure to start mtr-packet: Invalid argument" any idea what I could do to manage latest mtr working in latest cygwin? I also tried older mtr but no success. – mike Dec 20 '21 at 15:07
  • It's been a while and I don't have Cygwin in my new computer, I moved to WSL. That being said, I think you had to run as Administrator for it to work. – LatinSuD Dec 20 '21 at 17:38
  • Sure I thought about that and run it with admin rights :) didn't help. – mike Dec 21 '21 at 09:29