Traceroute: Tracing the Path to Network Connectivity ๐Ÿ›ค๏ธ

Ping: Checking Reachability ๐Ÿ”

With Ping, you now have a way to determine if you can reach a certain computer from another one. You can also understand the general quality of the connection. But communications across networks, especially across the internet, usually cross lots of intermediary nodes. Sometimes, you need a way to determine where in the long chain of router hops the problems actually are.

Traceroute to the Rescue ๐Ÿš€

Traceroute is an awesome utility that lets you discover the paths between two nodes, and gives you information about each hop along the way. The way Traceroute works is through a clever manipulation technique of the TTL (Time-To-Live) Field at the IP Level. Traceroute uses the TTL Field by first setting it to 1 for the first packet, then 2 for the second, 3 for the third and so on. By doing this, Traceroute makes sure that the very first packet sent will be discarded by the first router hop, resulting in an ICMP time-exceeded message. The second packet will make it to the second router, the third will make it to the third, and so on, until the packet finally makes it all the way to its destination.

Understanding Traceroute Output ๐Ÿ’ป

For each hop, Traceroute will send three identical packets. The output of a Traceroute command is pretty simple. On each line, you'll see the number of the hop and the round trip time for all three packets. You will also see the IP of the device at each hop and a host name if Traceroute can resolve one.

Variations and Alternatives ๐ŸŒ

On Linux and Mac OS, Traceroute sends UDP packets to very high port numbers, while on Windows, the command has a shortened name tracert, and defaults to using ICMP echo requests. Two more tools that are similar to Traceroute are mtr on Linux and Mac OS and pathping on Windows. These two tools act as long-running trace routes, allowing you to better see how things change over a period of time. Mtr works in real-time and will continually update its output with all the current aggregate data about the Traceroute, while pathping runs for 50 seconds and then displays the final aggregate data all at once.

Last updated