Traceroute is an application to trace the path from A to B. (A is your location and B is the server you want to trace).
The basic algorithm is as follows:
send UDP with TTL = 1
Server A1 received, and return ICMP packet to A because TTL is expired.
--> know first machine between. For example A1.
send UDP with TTL = 2
Server A1 received, and send this UDP to server A2.
Server A2 received, and return ICMP packet to A because TTL is expired
--> know second machine between. In this example is A2.
Do it until to B. we can track down: A -> A1 -> A2 -> ... ->B
I have a doubt that makes me skeptical as to whether this algorithm works correctly.
Since routing tables are updated frequently, during a traceroute, say for TTL=3, the probe packet follows the path A1->A2->A3->A4.
Now, when we send a probe packet with TTL=4, is it guaranteed to pass through A1, A2, A3, and A4 and then onto A5?
If not? Does the final output represent a valid path?
Hope someone can shed some light on this issue. Thanks a lot in advance!