Project 1 : Ping and Tracerout
Command Window / Terminal Prompt
Under Window XP, get up a (black) DOS window via Start -> All Programs -> Accessories -> Command prompt. (If for some reason you can’t find it there, you can also select Start -> Run and type cmd in the box.) This is the DOS core of Windows, which was modeled on Unix, and we can run several Unix commands here, including ping.
On a Mac running OS X, you can get a command prompt by selecting Find in the Finder, and then searching for the Terminal application. Note that the DOS -n option becomes -c in Unix/Mac).
Ping exploration
Issue the command
> ping -n 5 wou.edu
(remember to use -c instead on Mac/Unix.) This will send 5 tiny packets to wou.edu and back, recording the time in milliseconds (ms=thousandths of a second). [The “-n 5” stands for “count 5,” i.e., repeat it 5 times.] It should then print summary statistics: the best (min), the worst (max), and the average (avg) round-trip time in ms (milliseconds — thousandths of a second).
Try a number of other host machines around the world (but no need to try them all!); the information in parentheses is not part of the host name. Note any “packet loss.” (Warning: There is no guarantee that all of these will respond. Many host names change, and increasingly hosts are denying pings.)
• cs.umass.edu (Amherst)
• math.harvard.edu (Boston)
• berkeley.edu (U. Calif. Berkeley)
• cs.uchicago.edu (Chicago)
• math.nsc.ru (Moscow?)
• anekdot.ru (Russia, near Moscow)
• www.mars.dti.ne.jp (Japan, Tokyo)
• dutibp.twi.tudelft.nl (The Netherlands)
• mail.cs.ruu.nl (The Netherlands)
• himiko.brunel.ac.uk (Great Britian)
• tcs.uni.wroc.pl (Poland)
• maths.uwa.edu.au (Australia)
• mpi-sb.mpg.de (Germany)
• piggy.rz.tu-ilmenau.de (Germany)
• hello.it (Italy)
• www.uoa.gr (Greece)
• mousse.ens.fr (France)
• www.univ-paris1.fr (France)
• alpha1.unilim.fr (France)
• lanczos.maths.tcd.ie (Ireland)
• libero.it (Italy)
• www.sfi.ie (Ireland)
• ida.liu.se (Sweden)
• alunos.ufv.br (Brazil)
• www.unb.br (Brazil)
• math.toronoto.edu (Toronto, Canada)
or any others you know about (you can guess College and University names). If you are wondering, yes, you can copy and paste from this text.
Timing Experiment
Select one responding site (preferably not too close) for a timing experiment. Ping it, record the minimum roundtrip time, and compare against how long it would take the speed of light to reach there. Estimate the distance between here and where you are pinging. (The estimate does not have to be very precise — see below.)
Light (and all electromagnetic signals) travels at 186,000 miles per second (in a vacuum). So if you divide the round-trip distance (twice the one-way distance) by 186000, you will get the time in seconds. Multiplying by 1,000 gives the time in milliseconds. (Dividing by 186000 and then multiplying by 1000 is the same as dividing by 186, in case you are interested in a shortcut.) Compare the minimum time found by ping to the theoretical minimum time. The theoretical min should be smaller (otherwise your packets went faster than light!).
Example: You ping Auckland, New Zealand from Salem, a 6,828*2 =13,656 mile roundtrip (very roughly). The fastest it can be done in this universe is 13,656 mi / 186,000 mi/sec = 0.073 sec = 73 ms (or 13,656 mi / 186 mi/ms = 73 ms).
Tips:
• A calculator should be available on your PC under Start -> All Programs -> Accessories -> Calculator.
Distances between cities can be found using the Xerox PARC Map Server. Pick a major city in the same country and assume that is close enough. (Or find the distance some other way.)
tracert
We will use a special Internet probing program called “traceroute,” which is truncated to tracert under DOS, but is traceroute under Unix and MacOSX. It attempts to trace the route an IP packet would follow to a specified Internet host by launching multiple probe packets with a small ttl field, which specifies “time to live.” It then listens for a TIME_EXCEEDED reply from a gateway. If it hears no response within 3 seconds, it gives up and just prints a *.
• First trace the route to wou: > tracert wou.edu
• Next try the traceroute command with a nearby site: > tracert psu.edu
This can be a time-consuming, network-intensive command, so we will use it sparingly. Just to show you, however, here is a traceroute (from Linux, which gives a bit more information) to New Zealand from wou:
traceroute to cs.auckland.ac.nz
Incidentally, when the probing process times out, it displays an asterisk * in place of the data it could not find.
It is useful to know you can cancel a DOS (or Unix or MacOSX) command with control-c. Sometimes you need this to kill overly long searches.
There are more complicated tools available, built on the same principles as tracert. If you have time, try experimenting with this visual traceroute tool (one of several such services you can find via google). Unfortunately, this will show the route from the web site’s host, not from the machine you are using.
What you need to turn in
• Use ping and traceroute (tracert in windows) to check or trace three hosts, one in Oregon, one in US, and one in other countries. Screenshot your results.
• Compare the time you calculate, according to the above method, to the time you get from the ping experiments.
• Try visual traceroute tool, make a screenshot.