SEARCH

How-To Geek

How to Use Traceroute to Identify Network Problems

image

Traceroute is a command-line tool included with Windows and other operating systems. Along with the ping command, it’s an important tool for understanding Internet connection problems, including packet loss and high latency.

If you’re having trouble connecting to a website, traceroute can tell you where the problem is. It can also help visualize the path traffic takes between your computer and a web server.

How Traceroute Works

When you connect to a website – say, howtogeek.com – the traffic has to go through several intermediaries before reaching the website. The traffic goes through your local router, your Internet service provider’s routers, onto larger networks, and so on.

Traceroute shows us the path traffic takes to reach the website. It also displays the delays that occur at each stop. If you’re having issues reaching a website and that website is working properly, it’s possible there’s a problem somewhere on the path between your computer and the website’s servers. Traceroute would show you where that problem is.

We’ve used traceroute to explain – and demonstrate — who provides the Internet service for your Internet service provider.

In more technical terms, traceroute sends a sequence of packets using the ICMP protocol (the same protocol used for the ping command.) The first packet has a time-to-live (also known as TTL, or hop limit) of 1, the second packet has a TTL of 2, and so on. Each time a packet is passed to a new router, the TTL is decreased by 1. When it reaches 0, the packet is discarded and the router returns an error message. By sending packets in this manner, traceroute ensures that each router in the path will discard a packet and send a response.

How to Use Traceroute

Traceroute is run from a command prompt or terminal window. On Windows, press the Windows key, type Command Prompt, and press Enter to launch one.

To run a traceroute, run the tracert command followed by the address of a website. For example, if you wanted to run a traceroute on How-To Geek, you’d run the command:

tracert howtogeek.com

(On Mac or Linux, run traceroute howtogeek.com instead.)

You’ll gradually see the route take form as your computer receives responses from the routers along the way.

image

If you run a traceroute for another website – particularly one hosted in a different region of the world – you’d see how the paths differ. The first “hops” are the same as the traffic reaches your ISP, while the later hops are different as the packets go elsewhere. For example, below you can see the packets travelling to Baidu.com in China.

image

Understanding the Output

The basic idea is self-explanatory. The first line represents your home router (assuming you’re behind a router), the next lines represent your ISP, and each line further down represents a router that’s further away.

The format of each line is as follows:

Hop RTT1 RTT2 RTT3 Domain Name [IP Address]

  • Hop: Whenever a packet is passed between a router, this is referred to as a “hop.” For example, in the output above, we can see that it takes 14 hops to reach How-To Geek’s servers from my current location.
  • RTT1, RTT2, RTT3: This is the round-trip time that it takes for a packet to get to a hop and back to your computer (in milliseconds). This is often referred to as latency, and is the same number you see when using ping. Traceroute sends three packets to each hop and displays each time, so you have some idea of how consistent (or inconsistent) the latency is. If you see a * in some columns, you didn’t receive a response – which could indicate packet loss.
  • Domain Name [IP Address]: The domain name, if available, can often help you see the location of a router. If this isn’t available, only the IP address of the router is displayed.

You should now be able to use the tracert command and understand its output.

Chris Hoffman is a technology writer and all-around computer geek. He's as at home using the Linux terminal as he is digging into the Windows registry. Connect with him on Google+.

  • Published 01/19/13

Comments (16)

  1. C_3PO

    Fab explanation, I use this technique quite often. :-)

  2. Xentinel

    I am behind a home router, but for me, the first hop isn’t my home router. Are you guys sure you don’t have two gateways in your network before reaching your ISP?

    It seems a little redundant to trace the default gateway, because your computer is already aware of it, if it wasn’t, then no routing could be achieved.

  3. R2D2
  4. Will

    Step 1: Go to YouTube
    Step 2: Search “tracert”
    Step 3: Laugh uncontrollably

  5. Cousin IT

    You can often find who owns a “node” (or server) whenever you trace a route with “whois”. Then again, just typing an IP address into a Google search will also give you info – sometimes. This info is nice to know but all too often worthless!

    You may actually be able to detect a node with a high latency and it may even be your own ISP. But try and notify anyone about it – let alone, fix it – is like trying to explain Chinese Algebra to an American 2nd grader. Therefore, I say big whoop!

    Knowing a problem exists and being able to fix it are not related when it comes to networking issues and someone’s server (or “hop”). It’s not worth your time to try and explain things is to some brain dead IT goon (usually in a call center) who could care less if his/her server even has power. They already know that you’re using a different protocol (ICMP) when tracing a route or “pinging” them. They may even want to point out that they serve pages or mail which uses a different protocol too. The really crafty ones might even try some double-speak and use terms he/she clearly doesn’t even understand. And THAT’S even assuming you were even successful in finding who’s network (node) was having problems!

    So good luck with that traceroute thing if you happen to find an issue. Aren’t you glad you now know something that you can’t do a darn thing about?

  6. Michael

    This is more “How to Use Traceroute” then “How to Use Traceroute to Identify Network Problems”.

    With traceroute you can usually identify two kind of problems:
    1 – Network loops: You’ll see the route to destination going back and forward between two routers
    2 – Routing issues: When you can’t reach destination hop because one of the routes on the way is “down” (but to recognise this, you’ll usually need to be familiar with the usual route since not all destinations will return answer to traceroute)

    For checking consistency or inconsistency you probably better off with MTR.

  7. ColJackboot

    my first hop to my router times out. what does THAT mean?

  8. aj

    my flavor of linux uses tracepath (gives mtu as well

  9. Arie

    Common mistakes reading traceroute output:

    – Traceroute shows the upstream path, but the traffic back often takes a different path. There is no easy way to see the reverse path, but there are some useful resources at http://traceroute.org

    – Sometimes hop x would show a higher rtt value than hop x+1. This could be a result of the above issue. Another common issues are control plane issues on transit routers. Often the routers would delay packets punted to the cpu (ttl=0 in traceroute) because of policies to protect the cpu or cpu load. This has nothing to do with the regular packets switched by the router because that is often done by a separate data plane

  10. Zaba

    So when do you have a problem and what do you do to fix it?

  11. David

    windows has “pathping” that I find very useful at times as well. Kinda combines tracert and ping together.

  12. Prumzy247

    i luv dis thread so much.keep it up!

  13. jespo1351

    Will there be an additional line for a switch? I am connected from computer -> switch -> router -> ispmodem?

  14. Informer

    I tried this with my laptop with win7 installed. I just get one line and it says trace complete.
    You can see a snap screen from here :
    http://dk1.ti1ca.com/get/76.164.195.68/ynnk2wfw/tracert_win7.jpg
    PS: I read the article at
    http://support.microsoft.com/kb/162326 but still, did not help much.
    Anyone know what should I do to have tracert work properly ?
    Thank you.

  15. Wayne

    A hop showing* could also be inductive of a router not responding to ICMP requests

  16. tslmy

    Baidu.com… LOL

Enter Your Email Here to Get Access for Free:

Go check your email!