# Traceroute

> A tool that shows every stop your data makes on the way to a destination.

- Level: Intermediate
- Topics: Networks
- URL: https://tidbit.legios.com.ar/traceroute/
- In Spanish: [Traceroute](https://tidbit.legios.com.ar/es/traceroute/)

Data sent across the internet does not travel in a straight line: it hops from router to router until it arrives. **Traceroute** is a command that shows those hops. Run `traceroute example.com` on a Mac or Linux, or `tracert example.com` on Windows, and you get a numbered list of every router along the path and how long each one took to answer.

It works with a clever trick. Every packet carries a counter called **TTL** (time to live), and each router subtracts one from it; when it reaches zero, the router drops the packet and sends back an error saying so. Traceroute sends a first packet with TTL 1, so the first router replies; then TTL 2, so the second one replies; and so on until it reaches the destination. Each reply reveals one hop.

Network engineers use it to find where things go wrong. If the times jump suddenly at one hop, or the list stops at some point, the problem is probably around there. Read it with care, though: rows of asterisks, `* * *`, often just mean that router is set not to answer, not that it is broken, and the path back to you can differ from the path there.

## An analogy

Sending a series of letters, each told to stop one post office further than the last, with a note asking that office to write back. The replies, in order, map the whole route.

## Keep in mind

- Traceroute lists every router between you and a destination.
- It is `traceroute` on Mac and Linux, `tracert` on Windows.
- It sends packets with a growing TTL and collects the error replies.
- Asterisks usually mean a router stays silent, not that it is down.

## Go deeper

- [Traceroute on Wikipedia](https://en.wikipedia.org/wiki/Traceroute)
- [tracert (Microsoft docs)](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/tracert)
- [traceroute(8) manual page](https://man7.org/linux/man-pages/man8/traceroute.8.html)

## Related terms

- [Internet](https://tidbit.legios.com.ar/internet/): A worldwide network of networks that lets any connected device reach any other.
- [Router](https://tidbit.legios.com.ar/router/): The box that connects your devices to each other and to the internet.
- [Linux](https://tidbit.legios.com.ar/linux/): A free, open source operating system that runs most of the internet's servers.
- [Packet](https://tidbit.legios.com.ar/packet/): The small chunk every piece of internet data is cut into before it travels.
