cs436-A2-w14

cs436-A2-w14 - Assignment2 CS436Winter2014 :rdt3.0...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
1 Assignment 2 CS 436 Winter 2014 Reliable Data Transfer: rdt 3.0 Due Date: Friday, March 14 th 2013, at midnight (11:59 PM) Work on this assignment is to be completed individually 1 Assignment Objective The goal of this assignment is to implement the rdt 3.0 protocol, which could be used to transfer a text file from one host to another across an unreliable network. The protocol should be able to handle network errors such as packet loss and duplicate packets. For simplicity, your protocol is unidirectional, i.e., data will flow in one direction (from the sender to the receiver) and the acknowledgements (ACKs) in the opposite direction. To implement this protocol, you will write two programs: a sender and a receiver, with the specifications given below. You will test your implementation using an emulated network link (which will be provided to you) as shown in the diagram below: When the sender needs to send packets to the receiver, it sends them to the network emulator instead of sending them directly to the receiver. The network emulator then forwards the received packets to the receiver. However, it may randomly discard and/or delay received packets. The same scenario happens when the receiver sends ACKs to the sender. Note: The assignment description (data structure and program names) assumes an implementation in Java. 2 Packet Format All packets exchanged between the sender and the receiver should have the following structure (consult packet.java provided with the assignment): public class packet { … … … private int type; // 0: ACK, 1: Data, 2: EOT private int seqnum; // 0, 1 private int length; // Length of the String variable ‘data’ private String data; // String with Max Length 500 … … … } Sender ( sender ) Receiver ( receiver ) Network Emulator ( nEmulator ) FIGURE 1
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
2 The type field indicates the type of the packet. It is set to 0 if it is an ACK, 1 if it is a data packet, 2 if it is an end‐of‐transmission (EOT) packet (see the definition and use of an end‐of‐transmission packet below). For data packets, seqnum is the modulo 2 sequence number of the packet . The sequence number of the first packet should be zero. For ACK packets,
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Page1 / 4

cs436-A2-w14 - Assignment2 CS436Winter2014 :rdt3.0...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online