CSE 461: Introduction to Computer-Communication Networks, Winter 2010
  CSE Home   About Us   Search   Contact Info 
 
Course Home
  Home
Administation
  Overview
  Using course email
  Email archive
  Anonymous feedback
  View feedback
 
Assignment Utilities
  Homework Turnin
  Assignment Wiki
  Gradebook
  Discussion: Protocol Bert
  Discussion: Protocol Ernie
  Discussion: Protocol Elmo
 
Most Everything
  Schedule
    Homework 0
Out: Tuesday January 5
Due: Tuesday, January 12 (midnight)
Turnin: Online


HW0 Plot Utilities

An example of what the tools produce is here.

Prerequisites

At least bash, perl, and gnuplot. Everything should work under cygwin on Windows, but a *nix system is the natural host. (X11 is required to see plots on the screen, without creating a pdf file.)

Overview

These tools are intended to be useful. They inherently interact with system configurations more than the actual assignment code, and so are certainly less robust for running on everyone's personal machine. They work using attu to measure, and a standard Linux box to create graphs, though.

There are two parts:

  • driver is a bash script that runs multiple experiments. The experiment set is the cross product of transfer sizes (0, 1, 10, 100, ..., 10000000) and transfer configurations (null source to null sink, file to null sink, etc.). One of the configurations is a localhost network transfer. Another one is a true network transfer.

  • createGraph.pl is a perl script that lets you view results as a graph. You can either view them in a window or you can create a pdf file.
Everything is written assuming that you place these scripts in the homework main directory (probably called hw0-dist) and that you launch them from there, although some very small amount of robustness to both has been built in. The two tools communicate (sort of) through a subdirectory, driverResultsFiles, that the driver will create.

While createGraph.pl is reading the output produced by runs of your program, it's pretty insensitive to any additional lines you write beyond what was being written as it came in the original distribution. (It looks for line prefixes '---', 'Processed', and 'Goodput'. So long as you're not writing any lines that start with those, and haven't changed the existing lines that do, the script should work.)

driver Invocation

./driver localPortNum [remoteHost remotePortNum]
Examples:
  • ./driver.pl 34567
    Runs all configurations that can be run using only the machine you're executing on. That turns to be all of them except the single one that has a client on one machine and a server on another.

  • ./driver.pl 34567 attu4 54321

    Runs all the configurations, including one in which a client on the machine you issued that command on tries to contact a server at attu4:54321 (which is how we write "host attu4, port 54321").

    You must have manually started the server on the remote host before the script gets to that configuration. (It comes last, so minutes into execution.)

The output file has the name of the host you're running on (assuming $HOSTNAME is set - if not, things probably fail).

You may/will see some "Killed..." messages. That's normal.

You may see other errors indicating that the required socket is in use. That's just bad luck. It has happened to me on shared machines (like attu), but not on not-as-shared machines.

Each experiment configuration is run for about 10 seconds, or a minimum of 2 experiments. Output appears on the screen as the experiments run, so you get some idea of progress.

You must have the code configured and built for multitrial experiments, of course. (See the main assignment for instructions.)

createGraph.pl Invocation

./createGraph.pl [--wbf] someFileSpecifier [pdf]
The optional switch, --wbf (for "with best fit"), controls whether or not best fit curves are displayed. If given, best fits of the function
x / (a + bx)
are applied to all data involving TCP (where x is the data transfer size). These best fits are computed by gnuplot "using an implementation of the nonlinear least-squares (NLLS) Marquardt-Levenberg algorithm."

Examples Invocations:

  • ./createGraph.pl driverResultsFiles/attu2.cs.washington.edu
    Assuming you have all the required software installed (at least perl and gnuplot), and are running X Windows, a window will appear with the graph in it. To terminate, type ctrl-d in the text window in which you launched the script.

  • ./createGraph.pl attu2
    The script tries to offer a bit of convenience, looking around for the file you probably meant. This command is functionally equivalent to the first one so long as there is only one file attu2* in the driverResultsFiles directory.

  • ./createGraph.pl --wbf attu2 pdf
    Creates file attu2.pdf in the current working directory, and includes best fit curves.

Software Changes

Before fetching the utilities, you should understand what has changed:
  • datasink/DataSink.java has been slightly altered. It now terminates cleanly in a failure mode that caused the originally distributed version to hang. There are no functional changes under normal operation. (And there are no API or other significant changes, of course.)

  • dataFiles/makefile has been changed. Additionally, the files that used to be called file0, file1, file10, ... are now called file.0, file.1, file.10, .... That made it easier on the scripts.

  • driver has changed from the original distribution.

  • createGraph.pl is entirely new.

Understanding the Scripts

If you want to modify the scripts, it would help if you knew some bash scripting and/or perl, which I expect isn't the common case. You can probably make some simple changes, even having never seen either, by looking at the source. I recommend trying to live with what you have, though.

The one change I can imagine might both have widespread demand and might be realistic to everyone to attempt is to change which experiments are run by the driver, or in which order they're run. That should be easy. After a brief and possibly confusing bit of code at the beginning of driver, the individual experiment sets are easily recognized blocks of code. You can shuffle those blocks - they are not mutually dependent in any way. To run fewer of them, my advice is to move the one(s) you want to the top and then put an exit 0 immediately after those. (That way you leave the code for all the unwanted experiments, to be moved above the exit should you later want them.)

Changing the transfer size set is even easier: there's an obvious list at the top of the driver.

I would think about modifying createGraph.pl only if that appeals to you as a recreational activity.

The Files

They're in here: plotFiles.tar.gz. Here's what will be overwritten if you expand that file:
$ tar tzf plotFiles.tar.gz 
driver
createGraph.pl
datasink/DataSink.java
dataFiles/makefile

The Example Graphs

The examples shows output when driver is run on my home desktop (which has $HOSTNAME 'fileserver'). The function showing goodput to attu3 is truncated (I think because my ISP gets annoyed at the rate of connections, because the script suddenly stops being able to connect at all). Also, I have a very slow uplink, 368Kbps.

The graph without best fit curves is here, and with best fit curves is here.


Computer Science & Engineering
University of Washington
Box 352350
Seattle, WA  98195-2350
(206) 543-1695 voice, (206) 543-2969 FAX
[comments to zahorjan at cs.washington.edu]