nullstream weblog - traceroute + ping = mtr


« Suspend Firefox | The case against Apple »

traceroute + ping = mtr

Hacking

August 5, 2009 01:35 PM PST

Matt at Twitter turned me on to using mtr. It's a mix of traceroute and ping, and produces a nice little list of where your packets are going.

The source tarball of mtr compiles fine on Mac OS X with a simple "make". I typically avoid "make install", and rather just copied the executable to /usr/sbin and did a setuid so it will run without typing "sudo" first.

$ wget ftp://ftp.bitwizard.nl/mtr/mtr-0.75.tar.gz
$ make
$ sudo cp mtr /usr/sbin
$ sudo chmod +s /usr/sbin/mtr
$ mtr www.google.com
                            My traceroute  [v0.75]
xxxxxxxx-macbook-pro.local (0.0.0.0)                  Wed Aug  5 13:19:34 2009
Keys:  Help   Display mode   Restart statistics   Order of fields   quit
                                       Packets               Pings
 Host                                Loss%   Snt   Last   Avg  Best  Wrst StDev
 1. 192.168.0.1                       0.0%    37    0.8   0.8   0.7   0.9   0.0
 2. xx.xxx.xx.xx                      0.0%    37    2.2   2.3   2.0   4.4   0.5
 3. xxx.xxx.xx.xxx                    2.7%    37    3.7   3.7   3.3   5.7   0.5
 4. xx.x.xxx.xxx                     11.1%    36    7.3  11.2   6.7  67.7  12.1
 5. xxxxxxxxxxx.sea.eschelon.com      8.3%    36    7.0   9.0   6.8  58.7   9.0
 6. xxx.xxx.xx.xx                     5.6%    36    7.3  12.4   7.0 102.7  16.9
 7. xxxxxxxxxx.sttlwawb.integra.net   2.8%    36    7.4  15.3   7.0 129.9  23.4
 8. six.sea01.google.com              5.6%    36    7.5  14.8   7.1  89.1  18.2
...
13. xxxxxxxxxx.google.com             5.6%    36   14.8  16.4  14.4  33.7   4.4

Yes, that is some packet loss :-)

Comments (2)

Paul, August 5, 2009 02:27 PM:

I've been using mtr for ages now, it has been a very useful tool.

Packet loss really only matters to the last hop though, as intermediate routers routinely drop or ignore ICMP packets.

In the above example however, it looks like you're on a crappy network.

John, August 5, 2009 11:23 PM:

I've never heard of MTR. It looks cool I'll have to try it out.






All links will be marked with the nofollow tag, making them useless for search rankings. Any posts containing spam URLs will then be deleted.