CS643 01                            Assignment 3:  TCP/IP Network Programming
Due 05/05/2008

Develop TCP/IP client/server programs to simulate the full-duplex stop-and-wait data link protocol:

1. Write a connection-oriented File Server (FS) program to do the following:

a. Export the FS address (hostname, port_number, server name) to a text file.
b. Accept a connection request from the client.
c. Fork/Create a child process/thread to process the client request:
    Receive the file uploaded from the client in a number of data frames using the stop-and-wait protocol with Positive and Negative acknowledgment.
FRAME data structure used should be the same as your previous assignment.
 

2. Write a client program to do the following:

a. Connect to the FS server using the FS address from the text file.
b. Upload an image file to the FS server simulating the stop-and-wait protocol with
    Positive and Negative acknowledgment. Simulate the transmission errors by using random number generating function.
(You need to have a full-duplex TCP connection on the client side so that it can send data packets and read acknowledgement at the same time by two different processes/threads.)

Protocol specifications:

a. Client and FS server communication should use the TCP/IP connection-oriented service.
    The FRAME data size is limited to 512-byte and 1-bit sending window size should be used.
    You should use the sleep() function to simulate the transmission delay and message rate.
b. FS server must be a multi-process/multi-thread program to be able to serve multiple clients.
c. Assume the Data frames have 20% transmission errors, but they will not be lost.
    Short ACK/NACK frames will not have transmission errors.
   (Therefore no timer is needed to simulate this protocol.)
d. Using a random number generator (rand(...)) to simulate the transmission errors.

Testing

a. Start the FS server on a UNIX machine and export the FS server address to a text file.
b. Start the Client on a machine other than the FS server machine and then send the request to the FS server for uploading a large (at least 1MB) image file. (Download the FS server address file first)

Assignment hand in policies

Write a Microsoft word report to describe the execution environment and run results (screen shots are required).
Email instructor the report and the programs source codes files on the due day.

Instructor reserves the right to ask you demonstrate your programs in instructor's office if needed.

Non-working programs will have at most 50% of the total grade.