The Traceroute program can be useful when used for debugging purposes. Traceroute enables us to determine the route that IP datagrams follow from host to host.
Traceroute is based upon ICMP. It sends an IP datagram with a TTL of 1 to the destination host. The first router to see the datagram will decrement the TTL to 0 and return an ICMP Time Exceeded message as well as discarding the datagram. In this way, the first router in the path is identified. This process can be repeated with successively larger TTL values in order to identify the series of routers in the path to the destination host. Traceroute actually sends UDP datagrams to the destination host which reference a port number that is outside the normally used range. This enables Traceroute to determine when the destination host has been reached, that is, when an ICMP Port Unreachable message is received.
Traceroute is implemented in AIX/6000. It is also implemented in TCP/IP for OS/2.