Programming Assignment #2
ARQ Programming

Assigned: November 3
Due: Monday November 20 , 11:59PM

Specifications

For this homework you will implement a reliable file transfer protocol over UDP. You are responsible for achieving reliability over an unreliable service. The main objective of the assignment is to design and implement the Go-Back-N ARQ protocol.

You are to design and implement a reliable file-transfer application called MYFT (My File Transfer). The MYFT client can upload a file from its home directory to the server's home directory. A MYFT server need only handle one client at a time, however, it should "run forever". In other words, the MYFT server should be iterative and not concurrent. The MYFT client, on the other hand, should terminate after the successful completion of the upload.

The MYFT application should implement the basic functionality of a Go-Back-N transport protocol using sequence numbers, (positive) acknowledgments, retransmissions and timeouts. The application will be using UDP/IP sockets for transferring datagrams. Note that you should not use TCP sockets in this assignment.

To make things more interesting, a "packet dropper" will be introducing random packet losses. To use the packet dropper, you should use the function sendto_dropper() (provided by us), instead of the standard sendto() system call. The parameters of the sendto_dropper() function are the same as sendto(). You should initialize the dropper at the start of your program using the function set_dropper() that is also provided. For simplicity, these parameters are specified as integer percentages at the client and server command-line arguments. Click here for the dropper.h and for the dropper.c files.

You have significant flexibility in designing the underlying reliable transport functionality. You should however adhere to the following specifications:

The command lines of your client and server should look like:

%myftserver <server_port_number> <buffer_size> <loss_percent>
(e.g., %myftserver 7777 16384 3)
and
%myftclient <server_name> <server_port_number> <local_filename> <max_packet_size> <loss_percent>
(e.g. %myftclient gaia.cc.gatech.edu 7777 foo.txt 1000 2)

Note that the dropper can have different parameters at the client and server. The parameters specified at the client determine the error characteristics in the network path from the client to the server, while the parameters specified at the server determine the error characteristics from the server to the client.


Notes
  1. You should implement two separate programs: a client and a server. Your final submission should include two executable programs. To simplify the grading process, please call the executables: myftserver and myftclient.

  2. Your programs are to be written in C or C++. When linking socket programs on Solaris you should use the "-lsocket -lnsl" options to include the required socket libraries.

  3. You can develop your programs using any Unix variant, but you should make sure that they work on the CoC Solaris and Linux systems for full credit. For Solaris testing we will use the machine "gaia.cc.gatech.edu" and for Linux testing we will use "helsinki.cc.gatech.edu".

  4. Make sure you terminate the server when you are done working. See the netstat command for checking on busy network ports. You may want to use the socket option SO_REUSEADR to make sure that the port that you use is reusable immediately after your server exits.

  5. Make sure that no client or network problems cause your server to crash. Similarly for the client. Also, check for error conditions at every system call. Use perror() to report the exact error type. You may want to write your own signal handlers for the major signals mentioned at the DC textbook. We will grade your programs mostly based on whether they run correctly, not only under "normal conditions", but also under specific failure scenarios (such as the unexpected termination of a client). At the very least, you should handle SIGINT signal for terminating your client and server. We WILL take points off if your server crashes when the client misbehaves or crashes.

  6. Provide us with a sample output of your programs. You can use script or cut-and-paste.

  7. Your submissions must contain the string "[CS3251 MYFT PRJ2]" in your subject line. This string *must* appear verbatim *without* modification in the mail subject i.e. do not make it "[CS3251 homework 3]" or such. Cut and paste this string in your mail subject. If you wish to add more to the subject (e.g. my good version or my buggy version), put it after this string.

  8. Use a cross platform Makefile to compile your programs. We are including a sample Makefile here that would link your programs appropriately on both solaris and linux. Modify it appropriately to suit your needs.

Submission Instructions

  1. You should turn in well-documented source code, a README file, and a sample output file called Sample.txt. The README file should contain:
    1. Your name and email address
    2. Section, date, and assignment title
    3. Names and descriptions of all files submitted
    4. Detailed instructions for compiling and running your client and server programs, including a Makefile.
    5. A description of your application protocol (1/2 to 1 page) with sufficient detail for someone else to implement your protocol independently
    6. Any known bugs, limitations of your design or program

    You will be graded based on the correctness of the code and the readability and structure.

  2. You should submit your program by 11:59PM on the due date.
    1. Use the UNIX "tar" command to create an archive of your complete set of files, naming your .tar archive file "firstname_lastname.tar": (e.g. tar cvf george_burdell.tar <directory name>)
    2. Email your submission as an attachment to the TAs: bpetit@cc.gatech.edu for both Section A and Section B