Traceroute is a command-line interface based tool uses to identify the path used by a packet to reach its target. This tool also uses ICMP messages, but unlike ping, it identifies every router in a path taken by the packets. It is useful for troubleshooting network problems because it can help identify where exactly the problem is. You can figure out which router in the path to an unreachable target should be examined more closely as the probable cause of the network’s failure.

It sends a series of ICMP echo request packets to a destination. First series of messages has a Time to Live (TTL) parameter set to 1. This means that the first router in a path will discard the packet and send an ICMP Time Exceeded message. TTL is then increases by one until the destination host is reached and an ICMP echo reply message is received. Originating host can then use received ICMP messages to identify all routers in a path.

The name of the traceroute command on Windows is tracert. On Unix and Cisco IOS traceroute it is invoked using the traceroute command.

Here is an example of using the tracert command in Windows:

Traceroute: tracert

In the output above you can see that the traceroute command has listed the IP addresses of all of the routers in the path.

Traceroute on Unix-like operating systems

Traceroute command on Unix works slighty different than the Windows version. It uses UDP packets with a large destination port number (33434 to 33534). Also, this is unlikely to be used by any application at the destination host. Like the Windows version of the command, traceroute on Unix uses TTL to get the IP addresses of the intermediary routers. When a destination host is reached, it replies with an ICMP port unreachable message.

In case you have any queries, please feel free to post them in the comments section below.

Leave a Reply

%d bloggers like this: