Project 1. 1 Introduction. October 4, Spec version: 0.1 Due Date: Friday, November 1st, General Instructions

Similar documents
Project Introduction

Lab 1 - Reliable Data Transport Protocol

Operating Systems and Networks Project 1: Reliable Transport

Basic Reliable Transport Protocols

Discussion 1: Project 1, Networking Basics. CSE 123: Computer Networks Marti Motoyama & Chris Kanich

COMP 3500 Introduction to Operating Systems Project 5 Virtual Memory Manager

CSE434 Computer Networks (FALL, 2009) Programming Assignment 3 Due: Wed, December 2, 2009

The Norwegian text is authoritative, this translation is provided for your convenience.

CIS 505: Software Systems

ECE5650: Computer Networking and Programming Term Project Assignment Part II: Total 100 points

Programming Assignment Multi-Threading and Debugging 2

Project #1: Tracing, System Calls, and Processes

INF3190 Mandatory Assignment:

14-740: Fundamentals of Computer and Telecommunication Networks

EE122 Project 1 Fall 2010

Project 2 Reliable Transport

15-441: Computer Networks - Project 3 Reliability and Congestion Control protocols for MPEG

CS 43: Computer Networks. 16: Reliable Data Transfer October 8, 2018

CS 0449 Project 4: /dev/rps Due: Friday, December 8, 2017, at 11:59pm

EE122 Project 1. Fall Version 0.4. Part A due at 11:50pm on Monday, October 11, 2010 Part B due at 11:50pm on Wednesday, October 27, 2010

COMP/ELEC 429/556 Project 2: Reliable File Transfer Protocol

Lecture 7: Sliding Windows. CSE 123: Computer Networks Geoff Voelker (guest lecture)

Assignment 1: Plz Tell Me My Password

Programming: Reliable Transport - Alternating Bit

Reliable File Transfer

Announcements. No book chapter for this topic! Slides are posted online as usual Homework: Will be posted online Due 12/6

New York University Computer Science Department Courant Institute of Mathematical Sciences

CS 344/444 Spring 2008 Project 2 A simple P2P file sharing system April 3, 2008 V0.2

Project 1: A Web Server Called Liso

Computer Networks. Project 2. Project Assigned: November 14 Checkpoint: November 21 12:01 AM Due: December 04 12:01 AM. Networks - Project 2 1

CSE 123: Computer Networks Alex C. Snoeren. HW 1 due NOW!

Chapter 3: Transport Layer Part A

The print queue was too long. The print queue is always too long shortly before assignments are due. Print your documentation

Lab 2: Implementing a Reliable Transport Protocol (30 points)

CS 640 Introduction to Computer Networks. Role of data link layer. Today s lecture. Lecture16

Program Assignment 2

UNIT IV -- TRANSPORT LAYER

Computer Networks CS3516 B Term, 2013

Lecture 7: Flow Control"

Project 3: Chat Application Using Nachos Networking Module *

Figure 1: Graphical representation of a client-server application

Reliable Data Transmission

ICSI 516 Fall 2018 Project 1 Due October 26th at 11:59PM via Blackboard

CSE 461: Computer Networks John Zahorjan Justin Chan Rajalakshmi Nandkumar CJ Park

No book chapter for this topic! Slides are posted online as usual Homework: Will be posted online Due 12/6

Spring 2006: Project # 3 Reliable Sliding-Window Transport

Programming Assignment 5: Implementing a Reliable Transport Protocol

Operating System Labs. Yuanbin Wu

COMP3331/9331 Computer Networks and Applications. Assignment for Session 2, 2016

Problem 7. Problem 8. Problem 9

Routing. CS5516: Project 2 Spring 2000

Creating a Shell or Command Interperter Program CSCI411 Lab

Principles of Reliable Data Transfer

Lab 2: Threads and Processes

Transport Layer Review

Operating System Labs. Yuanbin Wu

Total Points 100 (One Hundred)

Computer Communications and Networks (COMN), 2017/18, Semester 1

Position of IP and other network-layer protocols in TCP/IP protocol suite

EPITA S3 promo 2019 Programming - Machine Test

Homework 1. Question 1 - Layering. CSCI 1680 Computer Networks Fonseca

CS447-Network and Data Communication Project #2 Specification, Fall 2017 Due December 5, 2017

Transport Protocols & TCP TCP

Reliable Data Transfer

THE TRANSPORT LAYER UNIT IV

CS43: Computer Networks Reliable Data Transfer. Kevin Webb Swarthmore College October 5, 2017

2.1 CHANNEL ALLOCATION 2.2 MULTIPLE ACCESS PROTOCOLS Collision Free Protocols 2.3 FDDI 2.4 DATA LINK LAYER DESIGN ISSUES 2.5 FRAMING & STUFFING

Transport Protocols Reading: Sections 2.5, 5.1, and 5.2. Goals for Todayʼs Lecture. Role of Transport Layer

Project 2 - Kernel Memory Allocation

Transport Layer Marcos Vieira

A4: HTML Validator/Basic DOM Operation

Transport Protocols Reading: Sections 2.5, 5.1, and 5.2

ECE 333: Introduction to Communication Networks Fall 2001

Computer Science 461 Midterm Exam March 14, :00-10:50am

EECE.2160: ECE Application Programming

CS155: Computer Security Spring Project #1

ECE 650 Systems Programming & Engineering. Spring 2018

CS457 Transport Protocols. CS 457 Fall 2014

Programming Assignment #4 Arrays and Pointers

Final Exam Solutions May 11, 2012 CS162 Operating Systems

CS 1550 Project 3: File Systems Directories Due: Sunday, July 22, 2012, 11:59pm Completed Due: Sunday, July 29, 2012, 11:59pm

Lecture - 14 Transport Layer IV (Reliability)

CSc 450/550: Computer Communications and Networks (Summer 2007)

It is academic misconduct to share your work with others in any form including posting it on publicly accessible web sites, such as GitHub.

Machine Problem 1: A Simple Memory Allocator

CS4516 Advanced Computer Networks. Program 1 {February 4, 2013} 70 points

Networking Link Layer

Programming Standards: You must conform to good programming/documentation standards. Some specifics:

Programming Tips for CS758/858

Assignment 5: Priority Queue

CMPE 655 Fall 2016 Assignment 2: Parallel Implementation of a Ray Tracer

Recitation 14: Proxy Lab Part 2

Lecture 4: CRC & Reliable Transmission. Lecture 4 Overview. Checksum review. CRC toward a better EDC. Reliable Transmission

COMP 412, Fall 2018 Lab 1: A Front End for ILOC

Final Project: LC-3 Simulator

Assignment 1. Due date February 6, 2007 at 11pm. It must be submitted using submit command.

User Datagram Protocol

Unit 2.

Reliable Transport II: TCP and Congestion Control

Fishnet Assignment 2: Routing Due: Wednesday, February 2 at the beginning of class CSE/EE 461: Winter 2005

Transcription:

Project 1 October 4, 2013 Spec version: 0.1 Due Date: Friday, November 1st, 2013 1 Introduction The sliding window protocol (SWP) is one of the most well-known algorithms in computer networking. SWP is used to ensure the reliable, in-order delivery of packets across unreliable links. For your first project, you will be tasked with implementing a version of SWP for communication between threads. There are two types of threads you are responsible for implementing: senders and receivers. Senders must transmit messages typed in at the command line to a corresponding receiver. Messages can and will be either dropped or corrupted in flight. You are responsible for ensuring that messages eventually reach their destination. 1.1 General Instructions 1. All code must be written in C/C++. 2. All submitted code should be accompanied by a brief design document, describing, at high level, how your code works, and what each major function does. 3. Please make sure your code is clean, well-formatted, and well-documented. 4. Your code must compile and run on department machines. We cannot grade programs that work only on Windows. 1

5. Please do not hesitate to contact the TAs or post questions to Piazza. 1.2 Submission Instructions 1. Log in to a campus machine 2. cd into the directory containing your code. 3. Run: make submit. This will tar up everything in the directory, create an archive file called project1.tgz, and run turnin on that file. 4. Please see Lab Instructions Manual for specific details. 1.3 Late Policy You will lose a grade for every day the project is late. Assuming the project is out of 100 points (this is subject to change), if you submit the project one day late (meaning anywhere from 1 second to 23 hours, 59 minutes, and 59 seconds after the deadline), the highest grade you can get is an 89, two days late a 79, and three days late a 69. Any project submitted after 3 days will receive 0 credit. 2 Project Specifications As stated in the introduction, the objective of this project is to ensure the reliable, in-order delivery of messages between threads. The communication channel between the threads will be lossy and unreliable, meaning that messages will be dropped or corrupted (e.g. bits will be flipped at random). To overcome this, you will implement a version of the sliding window protocol (SWP). Please read the sections 2.4 and 2.5 in P&D for further details regarding the algorithm. 2.1 Getting Started The goal of this project is to guarantee the reliable, in-order deliver of messages between the sender and receiver threads. The sender will take messages from stdin (that the user has typed in at the command line), then direct them to the appropriate receiver. The sender will call send msg to receivers, which will broadcast the message to ALL the receiving threads. The receiver merely needs to output the messages to stdout via printf. Here is a brief overview of how to get started using the skeleton code. 2

run_stdinthread Input Thread run_sender ll_input_head Input Cmd Queue ll_inframe_head ll_inframe_head Sender Thread(s) Input Msg Queue send_msg_to_receivers send_msg_to_senders Input Msg Queue Receiver Thread(s) Figure 1: Diagram illustrating how the stdin, sender, and receiver threads interact. 1. Use the prep command to begin working on cs123f assignments: prep cs123f 2. Please copy over the tar file into your directory and untar it: cp../public/projects/project1.tgz.; tar xzvf project1.tgz 3. Please compile the skeleton code by typing: make You should now have an tritontalk binary in the same folder as the skeleton code. 4. To see the full list of command line options and a corresponding explanation, please type: >./tritontalk -h 5. You can start up the skeleton code with the following command: >./tritontalk -s 1 -r 2 The command line options -s and -r specify the number of sender and receiver threads to run concurrently. 6. You should see the following: Messages will be dropped with probability=0.000000 Messages will be corrupted with probability=0.000000 3

Available sender id(s): send id=0 Available receiver id(s): recv id=0 recv id=1 7. You can now send messages between the sender and receiver threads. Type in the following command: msg 0 1 hello world This command intuitively says: have the sender with id 0 send the hello world message to the receiver with id 1. 8. You should see the message printed to the screen. However, note that both receiver threads print this message. <RECV 0>:[hello world] <RECV 1>:[hello world] You need to make sure that ONLY RECV 1 prints the messages. 2.2 Breakdown of Included Files The provided skeleton code consists of the following files: 1. main.c: Responsible for handling command line options and initializing data structures 2. common.h: Houses commonly used data structures among the various source files. 3. communicate.c: Takes care of transporting messages between the sender and receiver threads. 4. input.c: Responsible for handling messages inputted by the user (e.g. msg 0 0 hello world). 5. util.c: Contains utility functions, namely, all of those for the provided linked list implementation. 6. sender.c: Contains the skeleton code for the sender threads. 7. receiver.c: Contains the skeleton code for the receiver threads. You are responsible for modifying the sender.c and receiver.c files to incorporate in concepts from the sliding window protocol that handle the lossy, unreliable links. You may modify any of the other files above, and add any additional files as necessary (also taking care to change the Makefile). HOW- EVER, we will be overwriting the input.h, input.c, communicate.h, 4

and communicate.c files after you have submitted your project. 2.3 Frame and Behavioral Specifications 1. The char * buffers communicated via send msg to receivers and send msg to senders should be, at most, 64 bytes. Please refer to MAX FRAME SIZE in common.h. For example, suppose that, in your frame specification, you use 16 bytes for the header on each frame. This leaves you with a payload size of 48 bytes, meaning that you can only transmit 48 characters worth of inputted text per frame. 2. You should NOT use more than a 8 bits (unsigned char) for the sequence/ack numbers inside your encapsulating frame. In your design document, please detail the fields (that is, list the field names and data types) used within your frames. We WILL be testing sequence/ack number wrap around, meaning that when either value reaches 255, your sequence/ack numbers SHOULD wrap back around to 0, and your SWP implementation SHOULD continue to function correctly. 3. If a message is lost in transmit, your senders/receivers should retransmit it within 0.10 seconds. 4. If a message is corrupted in transmit, your senders/receivers should retransmit it within 0.10 seconds. 5. A receiver cannot buffer more than 8 messages from a particular sender. For example, if you type in a string at the command line that is more than 64 bytes (see above restriction on MAX FRAME SIZE) * 8, your sender should send up to 8 messages, then queue the remaining bytes. The corresponding receiver should acknowledge having received some subset of the 8 messages before the sender can continue sending. 6. We will not be strict about checking to see whether you free dynamically allocated memory (via malloc or new), but please, do your best to call free when appropriate. Memory leaks are bad, and this is good practice for when you finally enter the real world. 7. To reiterate, we will be overwriting all input.* and communicate.* files. 8. Please send any debugging output to standard error. Substituting printf("msg",...) with fprintf(stderr, "msg",...) should send the output of this method call to stderr. 5

2.4 Tasks/Hints The following are suggestions for implementing the project. 1. Create a Frame Format: You should encapsulate all messages communicated between the senders and receivers in some type of frame. Think about what attributes should be included in the frame to meet the goals of the project. For example, receivers should be able to tell when a message is intended for them. Remember, any communication between senders and receivers is broadcast based, meaning that, for example, when a sender sends a message, all receivers get a copy of the message. Again, we cannot emphasize enough, read the SWP section in P&D. 2. Receiver Acknowledgments: Implement acknowledgments, That is, when a message arrives, the intended receiver should respond to the sender that it has received the corresponding message. 3. Retransmitting Messages: The next task you should look into is retransmitting lost packets. Now that acknowledgments have been implemented, your senders should be able to detect that a message has been lost. 4. Sequence numbers: The next task you should look into is adding sequence numbers to the frames. This will allow you to have multiple outstanding frames, and also allow the receiver to acknowledge having received specific frames. 5. Implement SWP: At this point, this should be fairly straightforward to implement. Again, please read section 2.5 in P&D. Note that the SWP implementation described in the book only covers a single receiver and sender pair. One way to emulate this is to start up tritontalk with only 1 receiver and 1 sender. We recommend taking this approach first, to ensure that your SWP implementation is well tested before moving on. However, each of your senders will need to be able to send messages to each of the other receivers. You can try tackling this requirement first, but it will make testing more difficult. 6. Implement Message Partitioning: Recall that any transmitted frame cannot consist of more than 64 bytes. When a string is typed at the command line with more than 64 characters, your senders should partition the input string into multiple frames. 7. Sender/Receiver Buffering: Recall from the overall project specification that no sender or receiver should buffer more than 8 messages. You should make sure that if a user types an incredibly long input string at the command 6

line, that the sender takes the necessary steps to not overrun the receiver (and vice versa), while at the same time keeping the communication channel well utilized (that is, allowing for up to 8 in-flight messages between each sender/receiver pair). 8. Detecting Corrupted Packets: The next task you should tackle is detecting when a message is corrupted. You should be familiar with methods for discerning corrupted packets. If not, reread Chapter 2 in P&D. 9. (Optional, for extra 10% credits) Implement Messaging Multiple Receivers: You might have already done this, but your senders should have the ability to maintain SWP state on a per receiver basis. That is, if more than 1 receiver is present in the system, each sender should be able to send a message to each of the receivers (meaning that, for every sender, you will have to maintain state for each receiver). Similarly, receivers should maintain state for each sender. 7