CPS 214 Computer Networks and Distributed Systems: Labs

Lab1: Make Your Own Internet Router

We'll use Stanford's Virtual Network System to build an Internet router. Somewhere in Stanford University, a network has been setup for you: a HTTP server is behind a router R that does not know how to forward packets yet. Your goal is to write the correct logic for R so that it behaves like a normal Internet router. The good news is, you don't need to write Linux kernel modules to achieve the goal; an infrastructure has been setup for you. You are provided with a skeleton program that receives every packet sent to R and can send packets back to R that will immediately go out of R. You only need to modify the skeleton program to do your job. If you make a good router, you'll be able to access the HTTP server with your own browser.

Please read the instruction page carefully. Each group is assigned a topology as follows:

1Peter Franklin, Justin Manweiler1
2Dongtao Liu, Ryan Scudellari2
3Matthew Fulmer, Amos Barreto3
4Harold Lim, Souvik Sen6

Each topology consists of two files: a README describing the topology and how to test whether it is correctly setup or not, and a rtable used as the input of the skeleton program you will download when reading the instructions. You can extract these two files from a topology using the following command in Linux:

tar xzf topology-file

Please only use your own topology. Otherwise, your packets may be sent to other groups' routers, frustrating both you and others.

Lab2: Implement STCP

We'll implement STCP, a simple transport layer protocol that is a simplified version of TCP. Please read the instructions carefully. Please note that this lab consists of two parts: Milestone HW3.A described in the instructions is the first part, and Milestone HW3.B is the second part. They are due at different times.

When you are doing your implementation, please keep in mind that the programs are multi-threaded. Each STCP connection is handled in a different thread, and therefore your code has to be thread-safe. For instance, when you need a random number, you cannot use rand(); instead, you have to use the thread-safe version rand_r() (and of course, you can always implement your own random number generator).

Last updated: 2/5/2009