1- Traceroute starts by sending 3 UDP packets with a TTL set to 1, towards the destination. Each UDP packet gets an ICMP reply with a Time-to-live exceeded message. The key thing is that the IPv4 Source field is now filled with an IP address (22.214.171.124 – line 2 in the packetcapture). This means 126.96.36.199 is now our first hop.
2- Sw1 then sends another 3 UDP packets to the destination with a TTL of 2. So the packet goes past the first hop (Sw3), gets to the second hop (Sw4), and another 3 ICMP TTL exceeded messages are sent back with the source IP field filled in (188.8.131.52 – line 8 in the packetcapture). This means 184.108.40.206 is our second hop.
3- Sw1 then sends another 3 UDP packets to the destination with a TTL of 3. This time it actually reaches the destination, and we get an ICMP – Destination unreachable (Port unreachable) message back. Because we can actually reach the destination (at layer 3) and the TTL has not been exceeded, it now tries to reach the destination port (layer 4). This verifies that this is the final hop, and a TTL of 3 meant the destination was 3 hops away. It doesn’t matter that the port was unreachable, it was simply a test to get that port unreachable message back so that we know we moved up the OSI stack to layer 4, which verifies layer 3 is reachable.
The final thing is that traceroute always starts at port 33434and increments by 1 each time a UDP packet is sent. The first line shows the destination port is traceroute (which is 33434). The next red line shows 33435, then 33436 and so on.