How to run experiments in the 241 network

Who is this for?

This document is intended for students in Don Smith's spring 2006 Internet Architecture and Performance class (COMP 241). Most of this information is attainable elsewhere, but the purpose of this document is to get 241 students up to speed quickly. Long made a presentation on running experiments in the gigabit network, but it is more specific re: thttp and tmix.

First things first: the network diagram

The 241net network diagram (png, ppt) is your best friend. It details the physical connectivity, ethernet interfaces, IP addresses, and pretty much anything that's relevant to the network layout and topology.

Network Overview

Now let's talk about the purpose of each of the components of the network.

Getting started

All experiments should start by reserving 241net and logging in to lorenzo. If you are in the wheel group, you can run sudo -H bash (and type in your password) to start the bash shell as root. At that point, you can log in to any of the machines in the network as root (including the routers and monitors) by typing rsh <machinename>. Instead of logging in, you could choose to run a remote command, e.g. rsh marina166 ifconfig to see marina166's network interface configuration.

Running experiments

iperf is installed on all the machines for testing purposes. thttp is also available in /usr/home2/thttp/. tmix is not quite ready, but we're working on it (see note below). If you need other packages installed, let me know.

Distributing commands - bash loops

A common task is to run a command on all of the machines or all of the end systems. There are a couple of ways to do this. The first is a bash for loop. (Note that you'll need to be running bash for this, which isn't the default shell on most of these systems.) As an example, let's say you need to want to ping all of the end-systems. Let's assume a list of the end-system hostnames is in the file all-end-systems. Then, to ping each system once (the -c 1 option), do the following.

for machine in `cat all-end-systems`; do
ping -c1 $machine
done

for, in, do, and done are keywords. machine is a variable name. The semicolon is necessary to tell bash you're done with the list upon which to iterate. You can make a complex statement inside the loop by chaining statements together with &&, so that the next statement will only execute if all the previous statements returned success. You could also simply use a semicolon to chain commands. Read the bash manpage for more details.

Testing

The /playpen1/testing/ directory on lorenzo has a few files that might be useful for testing purposes, including lists of machines in the network. When you're doing your testing, feel free to save your results here, or see the section below on "Saving your data". (Note that this directory is NFS-exported from lorenzo, so you will be able to access it from any 241net machine at /net/lorenzo/playpen1/testing/--see "Saving your data" below.)

Routing

There are two routes between barney165 and marina166. (See the network diagram.) The first route is a 1Gbps fiber connection, and the second is a 100Mbps copper connection. In both routes, the monitors are able to listen in on the traffic flowing between the routers, either through a split of the fiber or through a hub.

To determine which route is currently in use, say netstat -r -n -finet on one of the routers. -r tells netstat to display the routing table; -n says not to translate IP addresses into names (otherwise netstat will hang); and -finet tells netstat to only display Internet v4 routes.

As an example, let's say we just issued this command on barney165. The relevant line starts with 152.19.166/24, and might look like this:

152.19.166/24	192.168.3.137	UGS	0	0	xl0

What this means is that, for barney165 to reach any IP address within the 152.19.166/24 network, it must forward those packets to 192.168.3.137, which is the (private) IP address corresponding to the em1 interface on marina166. (The network diagram is your friend here!)

So, let's say you want to switch the configuration to use the 100Mbps route instead of the 1Gbps route. You would need to do the following steps.

$ rsh barney165
$ route delete 152.19.166.0/24  # get rid of barney165's old route
$ route add 152.19.166.0/24 192.168.1.137  # add new 100Mbps route
$ logout

$ rsh marina166
$ route delete 152.19.165.0/24
$ route add 152.19.165.0/24 192.168.2.11
$ logout

Likewise, to switch the configuration to use the 1Gbps connection, you would do the same thing, except the destination gateway is 192.168.3.137 for barney165 and 192.168.3.11 for marina166. Don't use the above as a recipe; instead, understand why the particular values of IP addresses and networks were chosen. It will help your knowledge of networking, and besides, I don't guarantee that the above is correct. ;-)

tcpdump captures

tcpdump is used by the monitors to capture the traffic flowing along the bottleneck link and by any host to read and examine the traffic. The best resource for tcpdump is the manpage, but I'll provide a crash-course here.

Assuming you're on regan, you can capture a trace with the following command.

tcpdump -i <interface> -w <filename.l2r.dump> <filter>

The -i option specifies an interface to listen on, such as sk0 for the 1Gbps link. The -w option saves the dump instead of outputting it to the screen. (I used l2r to mean left-to-right, but the point is that you'll probably have both regan and roderigo capturing, so you'll want to be able to disambiguate the direction from the filename.) The filter can be empty or some expression of the traffic you care about. Examples of filters include the following.

Later, you can read a saved trace, also using tcpdump. The same set of filter expressions can be used, the -r option should be used to read the file (instead of writing it), and other useful switches include -n and -tt. (Shameless plug: for easy-to-parse per-packet text output of a tcpdump trace, see my ipstats tool in /net/felix/littlepen/jsterrel on lorenzo. ;-) )

Saving your data

lorenzo exports two directories, /playpen1 and /playpen2, via NFS. All of the machines in the 241net, including the routers and monitors, mount these directories at /net/lorenzo/playpen[12]. This means that you can have code, data, or whatever you want in one of these directories, and you will be able to access it from any machine in the network.

As far as the monitors go, regan has 4 playpens and roderigo has 3. All of these are exported so that lorenzo can access them at /net/{regan,roderigo}/playpen*/. So, when you're taking a tcpdump capture of the traffic seen on the bottleneck link, just save it to one of the monitor's playpens, and lorenzo will be able to find it.

Other notes


If you have any questions about any of this stuff, or if you have questions about the network that aren't covered here, feel free to email me.


Jeff Terrell 2006-03-23