Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 08-30-2012, 12:13 PM   #1
LQ Newbie
Registered: Aug 2012
Distribution: Ubuntu
Posts: 3

Rep: Reputation: 0
What exactly does traceroute do?

I'm reading an instructional Linux book and I came across a command named 'traceroute'. From what the book says it seems that it might be the same command as ping. Is it? Or does it do something different?
Old 08-30-2012, 01:11 PM   #2
Senior Member
Registered: Aug 2009
Distribution: CentOS
Posts: 3,244

Rep: Reputation: 1403Reputation: 1403Reputation: 1403Reputation: 1403Reputation: 1403Reputation: 1403Reputation: 1403Reputation: 1403Reputation: 1403Reputation: 1403
traceroute does a lot more than ping. traceroute attempts to elicit a response from each of the routers in the path to a destination. It does this by sending packets with a limited TTL (Time To Live), starting with a limit of 1 (by default -- can be overridden) and then successively larger by an increment of 1. Each router in the path decrements the TTL by 1 and returns an ICMP type 11 ("TTL equals zero") error if the result is zero. The source IP address of each of the returned ICMP packets reveals the addresses of the routers involved.

You don't always get a response from every router in the path. Constructing and returning those ICMP TTL limit messages is often made a low-priority job, so you might not get a response if the router is busy, or the router might be configured to rate-limit such responses, or not to send them at all. Even if a given router does not send a response itself, you can still get responses from routers further down the path.
Old 08-30-2012, 01:19 PM   #3
LQ Guru
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 6,713
Blog Entries: 14

Rep: Reputation: 1038Reputation: 1038Reputation: 1038Reputation: 1038Reputation: 1038Reputation: 1038Reputation: 1038Reputation: 1038
ping simply checks to see if it can reach the given IP and get an ICMP packet returned.

traceroute tries to show you all the intermediate hops that were taken to get to the IP (or alternatively the last hop it got to if it can NOT get to the IP. It is often used for debugging connections that are broken. (That is if you can't ping it then doing a traceroute might help identify where in the chain it is stopping.)

So for example:

$ ping
PING ( 56 data bytes
64 bytes from icmp_seq=0 ttl=241 time=78.808 ms
64 bytes from icmp_seq=1 ttl=241 time=79.752 ms
^C PING Statistics----
2 packets transmitted, 2 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 78.808/79.280/79.752/0.668 ms

$ traceroute
traceroute to (, 64 hops max, 52 byte packets
1 ( 0.362 ms 0.367 ms 0.250 ms
2 ( 0.215 ms 0.242 ms 0.249 ms
3 ( 0.950 ms 1.124 ms 0.996 ms
4 ( 0.632 ms 0.667 ms 0.686 ms
5 ( 79.378 ms ( 78.704 ms ( 79.482 ms
6 ( 78.648 ms 78.148 ms 78.081 ms
7 ( 78.389 ms 79.030 ms 78.312 ms
8 ( 80.240 ms 80.335 ms 80.329 ms
9 ( 79.727 ms 79.785 ms 80.660 ms
10 ( 80.439 ms 77.527 ms 77.619 ms
11 ( 78.462 ms 78.908 ms 79.022 ms

Both end up showing as the IP for (even though they don't resolve to that name in the end) but with traceroute you can see every device it went through to get there.

On UNIX/Linux you can find manual pages for most commands so if you type "man traceroute" you can get more detail for it and "man ping" will give you more detail for it. Additionally on Linux there are info pages that may give even more information.

Last edited by MensaWater; 08-31-2012 at 08:32 AM.
Old 08-30-2012, 07:50 PM   #4
LQ Newbie
Registered: Aug 2012
Distribution: Ubuntu
Posts: 3

Original Poster
Rep: Reputation: 0
Wow, great explanations, thanks!


linux, ping, terminal, traceroute

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
traceroute? prodigius Linux - Networking 12 02-01-2015 02:52 PM
[SOLVED] What exactly does traceroute do? linuxvstheworld Linux - Networking 2 08-30-2012 01:08 PM
traceroute kaviazzz Linux - Networking 8 09-21-2008 10:05 PM
traceroute - help? ocset Linux - Networking 6 10-15-2004 03:34 PM
traceroute mint567 Linux - Networking 3 11-23-2003 02:37 PM

All times are GMT -5. The time now is 09:58 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration