TCP Windowing Lab

Sliding Window

Background:

In this lab you will have the opportunity to implement reliable transmission using the sliding window algorithm.  This will be fairly similar to the scheme used by TCP and will help you to understand the details of TCP when we get to it. There are three fairly distinct parts of the lab that must be completed:

Details:

For example: if a segment was sent with sequence number 100 and length 8, the acknowledgement for that segment would contain the number 108. The next segment starts with sequence number 108 and length 8. The acknowledgement for this segment would be 116.

Diagram:

 
 

Specifications:

The TCP layer object will be similar to the other objects you have written in prior labs.  The TCP layer object must support the following methods:

                   

Passoff:

The arguments to the binary are:

tcp <host> <port> <srcIP> <srcETH> <dstIP> <dstETH> <-c | -s> [-v 0xXX]

where 0xXX is the hex value of the debug BIT pattern (see example below for BIT pattern).
We are reserving 2 and 3 as bottom IP octet numbers for the switches. Use the ones you've used for previous labs.

Example:

On the machine cs460-7 run

./tcp cs460-7 1234 192.168.102.7 00:a0:cc:66:99:33 192.168.102.2 00:a0:cc:66:99:35 -c -v 0xff

On the machine cs460-5 run with exactly the same arguments, except for the hostname and client flag

./tcp cs460-5 1234 192.168.102.7 00:a0:cc:66:99:33 192.168.102.2 00:a0:cc:66:99:35 -s -v 0xff

While you are getting your code working, you will probably want to turn on some serious debug statements. If you run the lab code with the -v option like "-v 0xff" it will turn on a lot of debug in the lower layers. Logically OR these values together to turn on multiple debugs at once.

0x01 - debug physical layer.
0x02 - debug ethernet layer.
0x04 - turns on a printf when something is not destined for your ethernet address.
0x08 - debug arp layer (basic).
0x10 - debug arp layer (table related output).
0x40 - debug IP layer.

The passoff procedure will test the following specific items:

Run your code, compiled with the versions of main.cc and rpc.cc in the framework at ~cs460ta/labs/tcp_window_template.  Your code needs to be able to run as both server and client (with the TA code on the other side of the connection) in order to pass off.  The lab version of the code, found at ~cs460ta/labs/tcp, should be run on another machine in order to pass off your program for the TA during his office hours. This lab code will basically do the same thing as the framework code. It will first receive all of the packets you send from main. When you hit the ENTER key on the server window, it will send you frames to test your response. You should plan on having the lab code drop packets when it is sending to you. You may want to run additional tests of your own to make sure that things are working.

The following passoff levels will apply to this lab:
 
Passoff Level
Behavior
Points
Minimal Passoff
At least one set of segments can be reliably sent and received
without waiting for an ack to send the next segment
5
Both Connect and Accept work
Code can function as a client and a server
2
Perfect Behavior
All tests pass correcttly
3