How traceroute works in linux?

Different system implement traceroute in different ways.The linux version of traceroute works as follow:
First step of traceroute is to generate UDP packet with destination port 33434 to 33600 and TTL equal to 1. When the first host in the path recieves the the packet with TTL=1 it will try to decrease it to 0 which will generate a reply back to the source with 'Time Exceeded' ICMP error. when the source recieves the ICMP 'Time Exceeded' it record the total delay of the packet (RTT) and the name/ip of the host, the source will then send a new UDP packet but this time it will increase the TTL to 2 causing the next host in the path to reply with 'Time Exceeded' ICMP error. When the destination host recieves the UDP packet it will answer with ICMP packet "Port unreachable" which indicate that the last host on the path has recieved the packet.

 

Simulation

Simulation shows the theory behind traceroute in Linux operating systems. Unlike MS-Windows , linux machine sends UDP packets in stand of ICMP 'Echo Request'.

 

 

 

To post this tutorial in your website copy the following code: <script type="text/javascript"> var tID=25; </script> <script type="text/javascript" src="http://www.osischool.com/library/code.js"></script>