The objective of this lab. is to get familiar with TCP/IP and its UNIX interface, and then build the skeleton of a very simple file transfer system. The system should allow you to experimentally determine the best way of transferring a large file.
Recall that some modern file transfer programs allow you parallel downloads. So in general, you can transfer a file by using m parallel downloads. In fact each of these downloads can be done in n sequential parts. Assuming each chunk to be of equal size, you will transfer mn chunks, each of size file_size/mn. The parameters m,n determine the transfer schedule. You are free to choose the part of the file being transferred in each of these chunks; e.g., you can transfer the first 1/m fraction of the file over the first connection, and so on.
Note: In general, parallel downloads can take place from more than one server. For this assignment you can just use one server.
You should write a client/server application that does the following.
* The concurrent server program runs waiting for a connection from a client.
* The clients and the server should run on different machines.
* Each client asks the user for the name (path) of a file, and the transfer parameters m,n defined above. It then opens m TCP connections to the server and transfers the chunks (as you defined them) over the connections.
* Experiment with different m,n and provide guidelines (and rationale) for a good m,n that a user should use.
* This is meant to be a simple program, you probably will need to impose some limitations; that is fine, just state them clearly.
* You will lose points if your program does not close the sockets when the program quits.
* In order to prevent two students from using the same socket number on the same machine, you should use the socket number that is 2000 + x/2, where x is the last 4 digits of your student number (take floors if needed).
* You may use C/C++ or Java. Resources for network programming in either language are on the class page.
* Check the class page for clarifications etc.
* If this assignment piques your curiosity about P2P systems, you can see a very detailed tutorial here. We will cover some aspects of P2P systems later in the course.