Tracing connections with traceroute

When you're connecting to a remote computer, you're actually connecting through a series of computers (and routers, and other expensive Internet stuff). That is, your computer connects to another computer, which connects to another, which connects to yet another, and so on until your computer connects to the one you're trying to reach.

The data that you're sending or receiving actually meanders through the path in packets (little chunks of data) that are reassembled into the correct sequence at the other end. But not all packets take precisely the same route from the sending computer to the destination computer. Communication on the Internet is much more like sending a lot of letters than making a telephone call. It's a bunch of little messages being passed along, not a continuous connection.

Using traceroute, you can satisfy your curiousity or, possibly, identify bottlenecks. How? You find out what route the packets take to arrive at the destination computer, as shown in Code Listing 12.4. If, for example, you see that the routes to your three favorite (but currently inaccessible) Web sites all end at a specific computer, that's where the network outage is and who you're waiting for to get things up and running.

Code Listing 12.4. Using traceroute, you can see how data meanders between your computer and a remote computer.
ejray> traceroute www.yahoo.com
traceroute to www10.yahoo.com (204.71.200.75), 30 hops max, 40 byte packets
 1 198.60.22.1 (198.60.22.1) 8 ms 2 ms 3 ms
 2 903.Hssi5-0-0.GW1.SLT1.ALTER.NET (157.130.160.141) 18 ms 13 ms 14 ms
 3 124.ATM4-0-0.CR1.SFO1.Alter.Net (137.39.68.9) 68 ms 65 ms 52 ms
 4 311.atm3-0.gw1.sfo1.alter.net (137.39.13.49) 60 ms 50 ms 39 ms
 5 Hssi1-0.br1.NUQ.globalcenter.net (157.130.193.150) 40 ms 39 ms 28 ms
 6 pos0-1-155M.wr1.NUQ.globalcenter.net (206.132.160.25) 30 ms 48 ms 42 ms
 7 pos1-0-622M.wr1.SNV.globalcenter.net (206.251.0.74) 50 ms 67 ms 61 ms
 8 pos5-0-0-155M.cr1.SNV.globalcenter.net (206.251.0.105) 48 ms 40 ms 41 ms
 9 www10.yahoo.com (204.71.200.75) 43 ms 50 ms 53 ms
ejray>

To trace a connection with traceroute:

  • traceroute www.yahoo.com

    At the shell prompt, type traceroute plus the address of the other computer in the connection. You'll see results similar to those shown in Code Listing 12.4. Each line in the traceroute output represents a computer (or other device) on the Internet that receives your packets and passes them on to the next computer.

Tip

If you're experiencing connectivity problems, try using traceroute to several different, geographically dispersed hosts to isolate the problem. For example, if you're in the Midwest and can traceroute all the way to http://www.altavista.digital.com (physically located in Palo Alto, California) but not to www.mit.edu (in Boston, Massachusetts), there's likely trouble on the Internet between you and the East Coast.


Tip

You can speed up the traceroute process by using the -n flag; for example, traceroute -n hostname. This checks the path using only IP numbers and does not translate the IP numbers into the DNS addresses you're familiar with.


..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.222.111.24