15-441 Spring 2005 Project 2 FAQ

When is the project due?
Sunday, April 24, 2005, at midnight EST.

Are time-outs per-packet or per-connection?
Per-connection

How do I handle (weird packet loss scenario)
All packet losses or timeouts are handled the same way:
  1. Set ssthresh = max(cwnd / 2, 2)
  2. set cwnd = 1
  3. Retransmit the lost packet
  4. Ignore all following duplicate ACKs until the connection has started making forward proress. (Do not count them as multiple losses).

My code works stand-alone, but not with the checkpoint script!

How can I record my program's output from the checkpoint scripts?
Modify the checkpoint scrip to run your client with ouput redirected to tee. tee copies output to both its standard output and to the file you specify. (Remember that the check script still needs the output of your program!)

set c1_pid [spawn /bin/sh -c "$client_binary -f $masterchunks -p $nodes -c $empty -i 1 -m 1 -d $debug | tee first.output"]
Another way to accomplish this, but without causing the extra debugging output to confuse the check script, is to use the debugging macros we provided (which spit debugging output to stderr instead of stdout). You can also redirect just stderr to a file:
set c1_pid [spawn /bin/sh "$client_binary -f $masterchunks -p $nodes -c $empty -i 1 -m 1 -d $debug 2> first.stderr"]

In both of these cases, we've had to modify the spawn to run a shell which then executes the specified command. Output redirection of this sort is a shell function, and by default, spawn just executes the requested program directly.

I'm having a hard time debugging my code. Help!

You can't run the checkpoint script on the netclass machines because the expect binary isn't compiled for that environment. However, you can still run your programs there and tcpdump them, if you don't have a linux / bsd / macos x machine of your own to run on. To tcpdump problems with spiffy, you'll want to supply the -i lo (linux) or -i lo0 (bsd, mac) flag to tell tcpdump to sniff on the loopback interface.