SHREE LEARNING ACADEMY
Command Line Tools: Tracert
As you journey through the world of computers and networks you may come across the term 'tracert' or 'traceroute.' If this term is unfamiliar to you, don't worry. In this article, we'll decode this tech jargon and present it in a simpler, more digestible manner.
At its core, tracert or traceroute is a command-line tool used to track and illustrate the path that data takes from one point to another. This command, known as 'tracert' in Windows and 'traceroute' in Linux, is a utility that helps you understand how data travels from your computer to its intended destination - be it a website, a networked computer, or any remote system on the internet.
Think of this journey like a trip you might make across the country. Your starting point is your local system, and your destination is the remote system. Along the way, your data doesn't take a straight shot to the destination. Instead, it makes several stops at different routers, just as you might stop at several cities during your cross-country trip. Tracert is like the travel diary that records each city you visit during your trip.
Let's get into the specifics. Tracert uses the Internet Control Message Protocol (ICMP), a supporting protocol that sends error messages when there are issues with the delivery of IP packets. It's much like a courier service sending you a notification when your package faces a delay or cannot be delivered.
The tool sends a sequence of ICMP Type 8 echo requests, which are very similar to the requests sent by the ping command. What's unique here is that tracert manipulates a property known as Time-to-Live (TTL) in the IP header of these requests. The TTL is like the expiry date on your packaged food. It tells the network how long the packet should be kept alive or how many routers (hops) it should pass through before it's considered stale and discarded.
Tracert starts with a TTL of 1 for its first request. This means the packet will expire and be discarded after just one hop. The router that discards this packet will send an ICMP Type 11 Time Exceeded message back to the originating system. This message tells tracert the address of the router, the first stop on the data's journey.
Upon receiving this response, tracert will then send out another wave of requests, this time with a TTL of 2. This allows the packets to reach the second router in the path before they expire and are discarded. The second router, like the first, sends back a message with its address. The process continues, with tracert incrementing the TTL by 1 for each new wave of requests, allowing it to discover the path one hop at a time.
If you were to observe the output of the tracert command, you'd see a list of routers' IP addresses, each representing a stop on the journey your data takes. Additionally, tracert performs a reverse DNS lookup on each IP address, which can often provide the domain name associated with the router's IP address. This additional information may give you a clearer picture of where your data has traveled.
This journey is repeated until the data reaches its destination, or until the number of hops reaches 30, which is the default limit set by the tracert command. Once the destination is reached, it sends back an ICMP Type 0 Echo Reply, telling tracert that the destination has been reached. This marks the end of the data's journey.
To give you an example of how this works, imagine you're sitting in New York and you want to send a packet of data to a friend in San Francisco. You'd initiate a tracert command to your friend's IP address. Tracert would then send out the first wave of requests with a TTL of 1, reaching a router, say, in Philadelphia. This router would discard the packet and send back a Time Exceeded message. Tracert would then send the second wave of requests with a TTL of 2, reaching the next router, perhaps in Chicago, which would again discard the packet and send back a message. This process would continue until the packet reached your friend in San Francisco.
Using the tracert command is quite easy. On a Windows computer, you'd simply open the Command Prompt, type in 'tracert', followed by the IP address or domain name of the remote system you're trying to reach. In Linux, you'd open the terminal and type in 'traceroute', followed by the same information.
You may find various options for using tracert, which can be discovered using the 'tracert -h' command in Windows or 'man traceroute' in Linux. These options can allow you to change the maximum number of hops, specify the size of the packets sent, and more.
Understanding tracert and its function can be instrumental in diagnosing network problems, planning network paths, or simply satisfying your curiosity about how data gets from point A to point B on the vast landscape of the internet. By revealing the hidden network paths, tracert gives you a window into the complex world of data transmission, making the invisible visible.
Test Yourself
Take Free Quiz
Watch our Video Tutorial