Traceroute is a system administrators utility to trace the route IP packets take from a source system to some destination system.
There are several implementations of this tool. Most distributions include the Lawrence Berkeley National Laboratory Network Research Group version. There is two implementations written especially for LiNUX, one by Olaf Kirch and other one by Dmitry Butskoy.
Traceroute uses the IP TTL (Time To Live) parameter to find the route. It sends a packet with a TTL value equal to 1. The first router receives the packet and decreases the TTL. With a TTL equal to 0, the router sends a timeout back to traceroute, with this packet, traceroute knows about the first router. Now, traceroute sends another packet with a TTL equal to 2. The first router decreases the TTL and sends the packet to the second router which decreases it in turn: the TTL is equal to 0…
With this method, traceroute can trace the route to a distant computer.