Update: Now that I no longer run my own server, this doesn't work. But it should still work on yours...
|
To Infinity and Beyond
Traceroute is fun because it's so easy to fool. Try tracing to my computer, and you'll notice that it seems kinda far away... Why is this, you ask? Traceroute works by sending out successive UDP packets with increasing TTL's in the IP header. As each packet is routed through the internet, the TTL is decremented at every hop. When the TTL hits zero, the intermediate router sends an ICMP TTL Exceeded message back to the originating host - and that packet contains its IP address. So, by sending out packets, first with a TTL of 1, then a TTP of 2, and so forth, traceroute gets ICMP messages from the first hop, second hop, and so on. When the TTL is high enough to reach the destination, it will send back a ICMP Port Unreachable message (assuming the port is not being listened on), which will mark the end of the path. Of course, the big assumption here is that the destination host has the appropriate port closed and sends back an appropriate port unreachable message. If, instead, that host happens to be listening on that port and happens to, say, send back TTL Exceeded messages, it can make traceroute think that there are a bunch of routers sitting between it and the destination. Anyway, here's the (very ugly) source for a little program I hacked together. I wrote it because this silly networking class I was taking offered a prize for finding the longest path on the internet using traceroute - so I said, "aha, i'll just make one." I don't think I got the prize. |