{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

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

Info icon This 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 ) F IGURE 1
Image of page 1

Info icon This 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,
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 ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern