CS:43 Lab3: Ping and Traceroute

Additional Documentation

Lab Documents and Code

The primary lab document can be found here: lab3.pdf .

You can retrieve the skeleton code for this lab using update43, or you can download a tgz file here lab_03_part1.tgz .

Online Documentation Sources

Read the header files: ICMP info: Manual Pages (type in terminal):

VM Import Instructions

  1. Look up your computer assignment here .
  2. ssh into your assigned computer with the -Y flag
  3. open virtualbox from the command line
  4. Open File->Preference
  5. Open File->Import Appliance
  6. Start VM: username is "student" and password is "swatcs"

Advice for Developing on your VM

Here is some unsolicited advice for developing on your VM
  1. Use SSH

    Start up your VM, and instead of working within the small VirtualBox terminal, ssh into the VM using the host only network. You can do this easily by opening two terminals on the CS lab machine, one terminal running the VM and one terminal you ssh into the VM machine.

    Recall that the VM will always have the host-only IP address of 192.168.56.101. While within the VM, it sees the host machine as having the IP address 192.168.56.1.

    Once you are ssh'ed in, you can resize that terminal and run vim or emacs as you want.

  2. You have root, use it!

    You have root on these VM's, and if you find that there is some software that you don't have that you want, you can install yourself.

    This is an ubuntu install:

    # apt-cache search package
    # sudo apt-get install package
    
  3. Use versioning software to easy copying:

    I highly recommend that you use svn/git to move things on and off the VM as you need. You can easily setup a svn repo on your assigned lab machine in your /local directory

    # svnadmin create /local/cs43/uname/svn
    
    And then within your VM, you can checkout the repo like so:
    # svn co svn+ssh://username@192.168.56.1/local/cs43/uname/svn
    
    Similarly, on your lab machine (the host), you can checkout the repo:
    [lab-machine]# svn co svn+ssh://username@your-lab-machine.cs.swarthmore.edu/local/cs43/uname/svn
    
    which will create a directory called svn. Copy all relevant files into that director, such as the part1 folder. Then, you add those file to the repository. (assuming you've cp -r part1 svn)
    [lab-machine]# svn add part1/
    
    Finally, you need to check in the material,
    [lab-machine]# svn ci
    
    which will bring up an editor (liekly vi) for you to enter a commit message. Just write whatever you like to describe what you have done, like: "Initial commit". After closing the editor, the files will be committed to the repository, where they can be accessed on the virtual machine via an update. So: Go back to the VM machine in the svn directory:
    [vm-machine]# svn up
    
    There is lots of instructions out there for svn, so use those resources.

    Of course, you can always transfer stuff back and forth using scp/rsnc as you would between any computers.

Hosts to Traceroute on Campus

All IP-addresses on campus begin with 130.58.X prefix. The swarthmore network is then divided into subnets, beginning with prefix 158.130.68.X (CS) to 158.130.255 (Faculty WiFi). To generate your campus map, you'll need to select a few hosts in each of the subnets to traceroute, and pay particular attention to the intermediate routers within the network. These router paths may be different when you traceroute from different part of campus.

Note that hosts within each subnet may not be static; that is, a host at address 158.130.226.5 may be there one time but not there when you check back 20 minutes later. To account for these dynamics, you should use ping first to see what is reachable, and then traceroute to reachable hosts. You may still find it useful to traceroute to unreachable hosts, since this will still expose some internals of the network. Finally, you could probably traceroute the 158.130.68.X.1 address because it is a likely gateway.

Here is a list of subnets to use: subnets . I've protected them with a .httaccess file. I will post the username/password to Piazza.

External vs. Internal ICMP Traffic

ITS has opened intra-swarthmore ICMP traffic. That means you can peform internal pings and traceroutes within the swarthmore network; however, you can only traceroute/ping hosts off the swarthmore network from CS lab machines. The parts of the lab where you must ping external servers (e.g, the servers from PlanetLab), you must use your VM machine on your lab computer. When you are generating your campus network map, you can use your laptop or other machines.

Finding Geographic Distances to IP address

First, you'll need to geo-locate a given IP. You can do this using You can then, use the latitude and longitude values to get a distance using this site: