Fishnet Assignment 3: Reliable Transport

Out: Friday, February 8, 2002.

Due: Tuesday, February 26, 2002.

CSE/EE461 Winter 2002; Anderson.

In this assignment, you will work in teams of two to develop a Fishnet node that reliably transfers files to other nodes. The program you write builds on your solution so far. The goal of this assignment is for you to understand reliable transport.

Start this assignment early. Bugs are easy to write and challenging to understand.

  1. What You Need To Write

Write a C program called hw3.c that implements a file transfer application on top of a bi-directional transport protocol, as described below. Continue to bear in mind the Robustness Principle: "Be conservative in what you send and liberal in what you accept." This specification may leave some points ambiguous; do what you think is best as long as your program can interoperate with the sample solution and other nodes, and document the design decisions you make.

Event

Sent

Received

SYN

S

S

FIN

F

F

Data packet

.

,

Acknowledgement

:

;

Retransmission or duplicate

!

*

Out-of-order

 

?

Connection state deleted

x

X

  1. Step-by-Step Development and Test Instructions

Here is a suggested set of steps to develop the required functionality.

  1. Start with hw2.c by copying it to the new file hw3.c
  2. Run the fishhead with high loss (try "--help" or just "--loss 0.2") to stress the reliability mechanisms.
  3. Code the "put" command syntax, but rather than sending the file, just send a series of dummy text packets reliably using acknowledgements and retransmissions and print the text to the console on the receiver. Rather than using full connection setup and teardown just yet, let the first received packet start the connection and the idle timer terminate the connection. Test between two nodes on your local fishnet.
  4. Add connection setup on the sender and receiver, adding the relevant printouts, and test a dummy transfer. Then implement and test connection teardown. (The TCP state transition diagram on page 381 of Peterson and Davie may help you understand how to implement connection setup and teardown.)
  5. Add the file transfer code by letting the SYN packet carry the filename, reading from the input file at the sender and writing to the output file at the receiver, keeping track of bytes transferred, and printing the remaining messages. In case your implementation is buggy at first, you may want to test by sending a file you don’t particularly care about. Test with both text files and binary files (e.g., a picture or a copy of your executable). You can use the Unix diff command to verify that the received file is the same as the sent file.
  6. If you haven’t done so already, test your program for interoperability with the class reference solution. Then try joining the class Fishnet and transferring some files to nodes run by the TAs or your friends.
  7. You’re done! Read and do any turnin work now.
  1. Turn In and Discussion Questions

Submit your source file(s) and the modified Makefile, if needed, using the turnin program. Hand in a paper copy of the discussion questions and test cases below as well as your source code.

  1. Join the class Fishnet at jimbo:7777 and use the put command to send a file to node 1. This file should have your username in its name, it should be at least 2KB, and it should be something you want other people to look at. It will be posted to a collaborative web site, which will be linked to from the main course web page.
    This transfer is the turnin test case. Save the output and print it for us. (Please use FISH_DEBUG_TRANSPORT for the debug level, as described above, to save paper and make the output easier for us to read.)
  2. Leave a node running on the class Fishnet, as in the previous two assignments. You may want to run this node in a directory by itself (with no other files in it) so you can easily see what has been sent to you.
  3. What difference (advantage or disadvantage in terms of reliability) does having a SYN flag make compared to simply using a sequence number of one to signify the start of a new connection?
  4. What difference (advantage or disadvantage in terms of reliability) does having a FIN flag make compared to simply not signaling FIN and letting old state be deleted by the idle timeout?
  5. In what ways does the system you have built fall short of perfect reliable file transfer? You should assume that the data in packets is protected by a 32 bit checksum while in transit (and this is in fact the case).