

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
In this programming assignment for the cs 471g: networking and distributed operating systems course, students are required to implement a reliable data transfer protocol using go-back-n in emulab. They will modify the udp echo server and udp echo client codes and create an environment with controlled loss scenarios to test their codes. The assignment covers the implementation of the go-back-n protocol, including sending and receiving packets, handling acknowledgements, and retransmissions.
Typology: Assignments
1 / 3
This page cannot be seen from the preview
Don't miss anything!


CS 471G: Networking and Distributed Operating Systems Spring 2009
Assigned: March 27, 2009 Due: April 13 (progress report) and April 20, 2009
In this programming assignment, you will implement a reliable data transfer protocol using emulab. You can modify the UDP echo server (UDPEchoServer.c) and UDP echo client (UDPEchoClient-Timeout.c) codes from the “TCP/IP Sockets in C” book. You should not use TCP at all. You can use the UDP echo client as the sender and the UDP echo server as the receiver. If you run the UDP codes on a pair of machines in the multilab, most likely you will not see any loss. Therefore, we need an environment that we can control the loss rate and create loss scenarios to test your codes. Fortunately, UK Laboratory for Advanced Networking has an emulab facility that meets these requirements. The protocol you will implement in this assignment is go-back-N.
Sender or Client
You can modify the UDP client code to send packets to the receiver, which is a modified version of UDP Echo server. The sender will send data in a buffer using UDP. Its interface should be: myclient server_IP server_port chunk_size window_size where server_IP is the IP address (starting with “192.”) of the server, server_port is the port number the server is listening to, chunk_size is the default value for the length of data in each packet and it should be less than 1024, window_size is the maximal number of packets the sender can send before receiving an ack. To avoid the burden of reading data from a file, you can declare a variable called buffer of type character array and initialize it with a constant. Here is an example: char buffer[4096]=‘‘Here is the message. Put at least two thousand characters here!!!’’; The message sent to the receiver is in the following format: type (4 bytes, int), sequence number (4 bytes, int), length (4 bytes, int) and data (the size of the data is specified by datalen). The field type should be 1 to indicate it is a data message. You can define the following structure for the messages you will send.
struct { int type; int sno; int datalen; char data[1024]; }
However, the size of message you will send should be 4+4+4+chunk size. In GBN, assume “base” is the smallest sequence number within the window. All packets up to “base”- have been acknowledged by the receiver. The number of packets the sender can send is window_size. The packets in the window are from “base” to “base”+“window size”-1. After sending them, it will set a timer (3 seconds). Then it has to wait for the ack from the receiver or a timeout.
After receiving the ack for the last message, the sender will send a special tear-down message with type=4 (other fields irrelevant). This message possibly needs to be retransmitted for at most 10 times unless it receives an ack message of type=8 from the receiver. Then the sender can exit.
The sender must print out the sequence numbers of all the packets transmitted and retransmitted in the format of “SENDING sno” and the sequence numbers of all the acks received in the format of “---- RECEIVING ACK ackno”. It should also print out the transmission/retransmissions of and the acks received for the special tear-down message.
Receiver or Server
The modified UDP Echo server is the receiver and its interface should be: myserver port_no chunk_size where port_no is the port number that the server will listen to, and chunk_size is the default value for the length of data in each packet. The server will keep a counter called “packet rcvd”. Starting with “-1”. After receiving a packet from the client, it will check whether the sequence number is equal to packet rcvd+1. If not, just discard the packet and send an ack with ackno=packet rcvd. If yes, add 1 to packet rcvd, put the data in the packet to the correct location of a receiving buffer, and send an ack with ackno=packet rcvd. Upon receiving the tear-down message of type=4, it will send an ack message with type=8. After that, it will wait for 7 seconds and exit. During the 7 second waiting time, it will send an ack with type=8 for any tear-down message of type=4 received and ignore all other messages. The message sent to the sender is in the following format: type (4 bytes, int), acknowledgement number (4 bytes, int). The field type should be 2 (or 8 for the ack for the tear-down message) to indicate it is an ack. You can define the following structure for the acks to be sent.
struct { int type; int ackno; }
The receiver must print out the sequence numbers of all the packets received in the format of “---- RECEIVING sno” and the sequence numbers of all the acks sent (including duplicate acks that repeat previous ackno) in the format of “SENDING ACK ackno”. It should also print out the tear-down message and the acks sent for it.
Emulab
You can find all necessary information for using the Emulab at http://www.uky.emulab.net/. Click on the Documentation on the left hand side of the page, you will find instructions such as “how to get an account” and “how to get started”. We will also spend a class to show how to create a topology and how to set parameters of the experiment.