$50
Objectives
In this assignment, you will implement client and server for file transfer. After completing this assignment, you should
• be able to construct application later packets
• have a good understanding communication protocol design.
Question & Answer
If you have any doubts on this assignment, please post your questions on Piazza forum before consulting the teaching team. However, the teaching team will NOT debug programs for students and we provide support for language-specific questions as a best-effort service. The intention of Q&A is to help clarify misconceptions or give you necessary directions.
FAQ
We will collate your questions here: link
The Unreliable Channel
We have implemented 3 simulators on the machine 137.132.92.111, to mimic unreliable channels. Your server and client have to connect to any simulators and transfer files.
• The simulator waits for both the client and server to connect the simulator via TCP connection before enabling the channel.
• The architecture can be found in fig:1
• Task
– connect to the simulator with a handshake. The handshake is similar to Assignment 1, with an extra character C to signify client and S to signify server. The handshake details can be found in fig:2
– The simulator will send you the current waiting list number; you need to wait till you receive 0_. We allow only 10 students to connect to a simulator at any given time.
– Then you transfer file from the server to the client. The input file will be provided as command line parameter to the server
– Save the received file to the file name provided to client as command line parameter
• You earn 1 mark per correct file transfer in the case of Reliable Channel.
• You earn 2 mark per correct file transfer in the case of other channels.
• Forgot to mention; the simulator really hates making friends. It will timeout and terminate in a fixed time. It is set to 100 Sec now, but will be progressively reduced based on the statistics we collect.
Figure 1: Architecture.
Figure 2: Handshake FSM.
Let us understand the Simulator further:
• All the simulators have the following constraints
– The packet size from the server is fixed to 1024 B.
– The packet size from the client is fixed to 64 B.
– Partial packets will not be delivered
– No packets will be dropped
• The 3 Simulators are:
– Reliable Channel (Mode 0): This channel introduces no error or reordering of packets. Fig 3
– Error Channel (Mode 1): This channel introduces errors in packets. Fig 4
– Reordering Channel (Mode 2): This channel reorders packets. Fig 5
Figure 3: Reliable channel FSM.
Figure 4: Error channel FSM.
Testing Your Program
To test your program, please use your SoC UNIX ID and password to log on to sunfire as instructed on Assignment_0.
• Since you have 2 programs, you will be running them on 2 separate terminals
• Your program should receive five command-line argument as the following command shows:
python3 Sever-A0165432X.py <student_key> <mode> <ip_address> <port_num> <input_ file_name> python3 Client-A0165432X.py <student_key> <mode> <ip_address> <port_ num> <output_file_name>
– <student_key>: The 6 digit key is the same as the one used in Assignment_1.
– <mode>: Is the integer input corresponding to the simulator we are connecting to
– <ip_address>: The IP address of the machine on which the simulator is running.
– <port_num>: The port number of the TCP socket corresponding to the simulator.
– <input_file_name>: The file to be transferred
– <output_file_name>: The destination file name
• During the evaluation, we will change the input files, the IP address and the port number; hence your code should accept all the above mentioned command line parameters.
• Note that your program should not read from stdin. Your program can print anything to stdout or stderr, and our test script will silently ignore them.
• We also release a set of grading scripts to you under the test folder.
Figure 5: Reorder channel FSM.
• To use the grading script, please upload your program along with the test folder given in the package to sunfire. Ensure that your program and the test folder are in the same directory. You can run the following command for help: bash test/FileTransfer.sh -h
• To run the test script for server, kindly use the -s option
"con
ges
All of you will be connection to a single server, hence start the assignment early to avoid tion" during last few days.