Figure 1: Network topology and link costs for DV routing

Similar documents
Computer Networks. Project 3. Project Assigned: December 2 Due: December 17 12:01 AM Show and Tell: December Networks - Project 3 1

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

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

Total Points 100 (One Hundred)

Programming Assignment 5: Implementing a Reliable Transport Protocol

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

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

Programming: Reliable Transport - Alternating Bit

Lab 1 - Reliable Data Transport Protocol

Data Networks Project 3: Implementing Intra-Domain Routing Protocols

New Concepts. Lab 7 Using Arrays, an Introduction

ECE/CSC 570 Section 001. Final test. December 11, 2006

Project #1 Exceptions and Simple System Calls

Chapter 4 Defining Classes I

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

CSE 489/589 Programming Assignment 2

Overview. Exercise 0: Implementing a Client. Setup and Preparation

And Even More and More C++ Fundamentals of Computer Science

Overview. Exercise 0: Implementing a Client. Setup and Preparation

IP Routing Lab Assignment Configuring Basic Aspects of IP IGP Routing Protocols

COSC Advanced Data Structures and Algorithm Analysis Lab 3: Heapsort

New York University Computer Science Department Courant Institute of Mathematical Sciences

Practical 2: Ray Tracing

Genie Snoop lab. Laboration in data communication GenieLab Department of Information Technology, Uppsala University

Programming Assignment HW5: CPU Scheduling draft v04/02/18 4 PM Deadline April 7th, 2018, 5 PM. Late deadline with penalty April 9th, 2018, 5 PM

Project #2: FishNet Distance Vector Routing

Programming Assignments #4. Group project: Priority-based Job Scheduling

Fishnet Assignment 1: Distance Vector Routing Due: May 13, 2002.

Announcements. Late homework policy

EE 355 PA4 A* Is Born

MULTICAST ROUTING PROTOCOL COMMUNICATION NETWORKS 2. Draft Document version 0.3

Lab 8 The Stack (LIFO) Structure

Computer 2 App1. App3 API Library. App3. API Library. Local Clipboard

Routing. CS5516: Project 2 Spring 2000

Data Management, Spring 2015: Project #1

15-213/18-213/15-513, Fall 2017 C Programming Lab: Assessing Your C Programming Skills

CSCI4211: Introduction to Computer Networks Fall 2017 Homework Assignment 2

CSCE-608 Database Systems. COURSE PROJECT #2 (Due December 5, 2018)

Note: This is a miniassignment and the grading is automated. If you do not submit it correctly, you will receive at most half credit.

EE 352 Lab 3 The Search Is On

CS4215 Programming Language Implementation

CS 113: Introduction to

C++ for Java Programmers

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

Lab Configure Routing Authentication and Filtering

CS168 Programming Assignment 2: IP over UDP

Carleton University Department of Systems and Computer Engineering SYSC Foundations of Imperative Programming - Winter 2012

CSEE 4119: Computer Networks, Spring 2014

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

Lab 3 Process Scheduling Due date: 29-Nov-2018

CNT5505 Programming Assignment No. 4: Internet Packet Analyzer (This is an individual assignment. It must be implemented in C++ or C)

Reliable Data Transmission

The Assignment is divided into preparation, practical part, and documentation.

CS3114 (Fall 2013) PROGRAMMING ASSIGNMENT #2 Due Tuesday, October 11:00 PM for 100 points Due Monday, October 11:00 PM for 10 point bonus

Lecture 11 Overview. Last Lecture. This Lecture. Next Lecture. Medium Access Control. Flow and error control Source: Sections , 23.

Lab 03 - x86-64: atoi

For this assignment, you will implement a collection of C functions to support a classic data encoding scheme.

CS 216 Fall 2007 Final Exam Page 1 of 10 Name: ID:

Lab 1 Implementing a Simon Says Game

A PROGRAM IS A SEQUENCE of instructions that a computer can execute to

COSC-211: DATA STRUCTURES HW5: HUFFMAN CODING. 1 Introduction. 2 Huffman Coding. Due Thursday, March 8, 11:59pm

EECS 560 Lab 8: Leftist Heap as Priority Queue

Internet Architecture. Network Layer Overview. Fundamental Network Layer Function. Protocol Layering and Data. Computer Networks 9/23/2009

Out: April 19, 2017 Due: April 26, 2017 (Wednesday, Reading/Study Day, no late work accepted after Friday)

(the bubble footer is automatically inserted into this space)

CS 103 The Social Network

Routing Protocols. The routers in an internet are responsible for receiving and. forwarding IP datagrams through the interconnected set of

Introduction CHAPTER. Review Questions

OpenACC Course. Office Hour #2 Q&A

Compilers Project 3: Semantic Analyzer

Activity 6: Loops. Content Learning Objectives. Process Skill Goals

cs/ee 143 Fall

COMP 3500 Introduction to Operating Systems Project 5 Virtual Memory Manager

CIS* Programming

Mobile Computing. FINAL EXAM Due date: Dec. 23, 2018 NOTE: WRITE YOUR ANSWERS IN ENGLISH. ID#: Name: (Kor.) (Eng.)

15-213/18-213/15-513, Spring 2018 C Programming Lab: Assessing Your C Programming Skills

Machine Problem 1: A Simple Memory Allocator

MARKING KEY The University of British Columbia MARKING KEY Computer Science 260 Midterm #2 Examination 12:30 noon, Thursday, March 15, 2012

Programming in C++ Prof. Partha Pratim Das Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur

CISC220 Lab 2: Due Wed, Sep 26 at Midnight (110 pts)

Instructions PLEASE READ (notice bold and underlined phrases)

CS 315 Software Design Homework 3 Preconditions, Postconditions, Invariants Due: Sept. 29, 11:30 PM

LAB EXERCISES (TP) 6 INTER-DOMAIN ROUTING: BGP-4 With Solutions

CS143 Handout 05 Summer 2011 June 22, 2011 Programming Project 1: Lexical Analysis

This is a combination of a programming assignment and ungraded exercises

Informatica 3 Syntax and Semantics

Array Basics: Outline. Creating and Accessing Arrays. Creating and Accessing Arrays. Arrays (Savitch, Chapter 7)

Introduction to Programming Using Java (98-388)

Problem Set 7 Due: Start of Class, November 2

a f b e c d Figure 1 Figure 2 Figure 3

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

CS311 Lecture: The Architecture of a Simple Computer

Individual Coursework 2: Distance-Vector Routing

Cpt S 122 Data Structures. Course Review Midterm Exam # 2

a b c d a b c d e 5 e 7

CSE Theory of Computing Fall 2017 Project 2-Finite Automata

CS 211 Programming Practicum Fall 2018

Recommended Group Brainstorm (NO computers during this time)

Activity 6: Loops. Content Learning Objectives. Process Skill Goals

2. CONNECTIVITY Connectivity

Transcription:

ECE5650: Computer Networking and Programming Term Project Assignment Part III: Total 100 points Due Noon of Dec 18 The objective of this term project is to develop deep understanding of key concepts and fundamental principles of computer networking through hands-on programming exercises. Part III of the project is implementing a distance vector routing algorithm. Overview In this lab, you will be writing a "distributed" set of procedures that implement a distributed asynchronous distance vector routing for the network shown in Figure 1. Implementation in C Figure 1: Network topology and link costs for DV routing In this assignment, you are to write the following routines which will execute asynchronously within the emulated environment that the authors have provided for this assignment. For node 0, you will write the routines: rtinit0() This routine will be called once at the beginning of the emulation. rtinit0() has no arguments. It should initialize the distance table in node 0 to reflect the direct costs of 1, 3, and 7 to nodes 1, 2, and 3, respectively. In Figure 1, all links are bi-directional and the costs in both directions are identical. After initializing the distance table, and any other data structures needed by your node 0 routines, it should then send its directly-connected neighbors (in this case, 1, 2 and 3) the cost of it minimum cost paths to all other network nodes. This minimum cost information is sent to neighboring nodes in a routing packet by calling the routine tolayer2(), as described below. The format of the routing packet is also described below. rtupdate0(struct rtpkt *rcvdpkt). This routine will be called when node 0 receives a routing packet that was sent to it by one if its directly connected neighbors. The parameter *rcvdpkt is a pointer to the packet that was received.

rtupdate0() is the "heart" of the distance vector algorithm. The values it receives in a routing packet from some other node i contain i's current shortest path costs to all other network nodes. rtupdate0() uses these received values to update its own distance table (as specified by the distance vector algorithm). If its own minimum cost to another node changes as a result of the update, node 0 informs its directly connected neighbors of this change in minimum cost by sending them a routing packet. Recall that in the distance vector algorithm, only directly connected nodes will exchange routing packets. Thus nodes 1 and 2 will communicate with each other, but nodes 1 and 3 will node communicate with each other. As we saw in class, the distance table inside each node is the principal data structure used by the distance vector algorithm. You will find it convenient to declare the distance table as a 4-by-4 array of int's, where entry [i,j] in the distance table in node 0 is node 0's currently computed cost to node i via direct neighbor j. If 0 is not directly connected to j, you can ignore this entry. We will use the convention that the integer value 999 is ``infinity.'' Figure 2 provides a conceptual view of the relationship of the procedures inside node 0. Similar routines are defined for nodes 1, 2 and 3. Thus, you will write 8 procedures in all: rtinit0(), rtinit1(), rtinit2(), rtinit3(),rtupdate0(), rtupdate1(), rtupdate2(), rtupdate3() Software Interfaces Figure 2: Relationship between procedures inside node 0 The procedures described above are the ones that you will write. Authors Kurose and Ross have written the following routines in router_simulator.c that can be called by your routines. tolayer2(struct rtpkt pkt2send) where rtpkt is the following structure, which is already declared for you. The procedure tolayer2() is defined in the file router_simulator.c. extern struct rtpkt { int sourceid; /* id of node sending this pkt, 0, 1, 2, or 3 */ int destid; /* id of router to which pkt being sent (must be an immediate neighbor) */

int mincost[4]; /* min cost to node 0... 3 */ }; Note that tolayer2() is passed a structure, not a pointer to a structure. printdt0() will pretty print the distance table for node 0. It is passed a pointer to a structure of type distance_table. printdt0() and the structure declaration for the node 0 distance table are declared in the file node0.c. Similar pretty-print routines are defined for you in the files node1.c, node2.c node3.c. The simulated network environment Your procedures rtinit0(), rtinit1(), rtinit2(), rtinit3() and rtupdate0(), rtupdate1(), rtupdate2(), rtupdate3() send routing packets (whose format is described above) into the medium. The medium will deliver packets in-order, and without loss to the specified destination. Only directly-connected nodes can communicate. The delay between is sender and receiver is variable (and unknown). When you compile your procedures and Kurose-Ross's procedures together and run the resulting program, you will be asked to specify only one value regarding the simulated network environment: Tracing. Setting a tracing value of 1 or 2 will print out useful information about what is going on inside the emulation (e.g., what's happening to packets and timers). A tracing value of 0 will turn this off. A tracing value greater than 2 will display all sorts of odd messages that are for my own emulator-debugging purposes. A tracing value of 2 may be helpful to you in debugging your code. You should keep in mind that real implementors do not have underlying networks that provide such nice information about what is going to happen to their packets! The Basic Assignment You are to write the procedures rtinit0(), rtinit1(), rtinit2(), rtinit3() and rtupdate0(), rtupdate1(), rtupdate2(), rtupdate3() which together will implement a distributed, asynchronous computation of the distance tables for the topology and costs shown in Figure 1. You should put your procedures for nodes 0 through 3 in files called node0.c,... node3.c. You are NOT allowed to declare any global variables that are visible outside of a given C file (e.g., any global variables you define in node0.c. may only be accessed inside node0.c). This is to force you to abide by the coding conventions that you would have to adopt is you were really running the procedures in four distinct nodes. To compile your routines: cc router-simulator.c node0.c node1.c node2.c node3.c You can

pick up a copy of the file router-simulator.c at http://www.ece.eng.wayne.edu/~czxu/ece5650/routersimulator/router-simulator.c. This assignment can be completed on any machine supporting C. It makes no use of UNIX features. As always, you are expected to hand in a code listing, a design document, and sample output. For your sample output, your procedures should print out a message whenever your rtinit0(), rtinit1(), rtinit2(), rtinit3() or rtupdate0(), rtupdate1(), rtupdate2(), rtupdate3() procedures are called, giving the time (available via the global variable clocktime). For rtupdate0(), rtupdate1(), rtupdate2(), rtupdate3() you should print the identity of the sender of the routing packet that is being passed to your routine, whether or not the distance table is updated, the contents of the distance table (you can use the pretty-print routines), and a description of any messages sent to neighboring nodes as a result of any distance table updates. The sample output should be an output listing with a TRACE value of 2. Highlight the final distance table produced in each node. Your program will run until there are no more routing packets in-transit in the network, at which point our emulator will terminate. What to submit Please submit a zip file electronically, that contains: the source file(s) a README file that describes your implementations of the subroutines, and special instructions (if any) for running the code. a sample output -- more on this below. For your sample output, your procedures should print out a message whenever your rtinit0(), rtinit1(), rtinit2(), rtinit3() or rtupdate0(), rtupdate1(), rtupdate2(), rtupdate3() procedures are called, giving the time (available via the global variable clocktime). For rtupdate0(), rtupdate1(), rtupdate2(), rtupdate3() you should print the identity of the sender of the routing packet that is being passed to your routine, whether or not the distance table is updated, the contents of the distance table (you can use the pretty-print routines), and a description of any messages sent to neighboring nodes as a result of any distance table updates. The sample output should be an output listing with a TRACE value of 2. Highlight the final distance table produced in each node. Your program will run until there are no more routing packets in-transit in the network, at which point our emulator will terminate. Notes on Java implementation

A java interpretation of router-simulator.c due to S. Kasera is given in the following files in http://www.ece.eng.wayne.edu/~czxu/ece5650/routersimulator RouterSimulator.java RouterPacket.java Node.java Node.java is the framework you will add your implementation to. You may also add additional class files if you feel it is necessary. You may modify the RouterSimulator.java and RouterPacket.java files for testing purposes. In Node.java you must complete the constructor and each method of the class. You may only communicate with other routers through the sendupdate method. You may not add any static members to the class, or otherwise compromise the restriction that all information between routers passes through sendupdate. recvupdate is called by the simulator when a Node receives an update from one of its neighbors updatelinkcost is called by the simulator when the cost of an edge connected to the node changes. printdistancetable is called for debugging (and grading). It should print the distance or routing table in a format that we (and you) can easily read. Running the simulator The simulator is run with java RouterSimulator The simulator begins by initializing each of the routers. From there, it is up to you to make things happen. The simulator will continue to run until the routing tables converge, i.e. there are no outstanding messages or future events in the system. If you examine the constructor, you will see that you can set the Trace property with java -DTrace=3 RouterSimulator and you can set the seed used for the random message delivery delay with java -DSeed=123 RouterSimulator Email your completed code in tarred package, including a detailed README file, to ece5650@ece.eng.wayne.edu and submit a hardcopy of your work to TA: Jia Rao in Room 3360 by the due date. In the subject line of your email, put ECE5650, Project III followed by your student ID. No late submission will be accepted. You must do it on your own and include the following statement in your submission: I have neither given nor received unauthorized assistance on this work Signature: Date: