

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


CMSC 417 Computer Networks Spring 2009
Assigned: Mar. 28 Due: Apr. 8, 23:59:59.
You will design a simple transport protocol that provides reliable datagram service. Your protocol will be responsible for ensuring data is delivered in order, without duplicates or errors. Since the local area networks in the university are far too reliable, we will provide a header file (emulation.h) and a source file (emulation.c) for emulating an unreliable network. To used them, you have to include the header file and compile with the source file. There is a macro defined in emulation.h to replace all call of sendto with emulate_sendto which can be configured to drop, damage, duplicate, or delay packets on demand. If the packet is not dropped, then it is sent to (using UDP) the destination node as if sendto is invoked. Note that the emulate_sendto may corrupt a packet and then send it, may send multiple copies of the same packet, or may delay for an amount of time and then send it. While debugging, You can select the behavior of the function, and use it to test parts of your code. However, your selection will be ignored in grading, and the function will randomly drop, damage, duplicate, or delay packets. For the assignment, you will transfer a named file reliably from between two nodes (a sender and a receiver). You do NOT have to implement connection open/close etc. You may assume that the receiver is run first and will wait indefinitely, and the sender can just send a named file to the receiver.
Both of your sender and receiver program have to include the header file emulation.h and use only sendto() function to send all packets. Including emulation.h will replace all instances of sendto() with emulate sendto(), which is implemented in emulation.c. You may configure the emulated network conditions by calling the following function:
void emulate_config(char drop, char damage, char duplicate, char delay, int frequency);
You may modify emulation.c and emulation.h for testing, but make sure your submitted program works with the given emulation code. The emulation code you submit will be ignored.
You have to design your own packet format and use UDP as a carrier to transmit packets. Your packet might include fields for packet type, acknowledgement number, advertised window, data, etc. This part of the assignment is entirely up to you. Your code MUST:
You may implement any reliability algorithm you choose. However, a more sophisticated algo- rithm will be given higher credit. For example, some desired properties include (but are not limited to):
The command line syntax and output for the sender executable is as follows:
sendfile -r recv_host:recv_port -f name_of_file_to_be_transmitted