

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
A programming assignment for cmsc 417 students where they are required to implement a link state routing system. The system involves each node in the network sending and receiving hello packets to maintain network topology and build routing tables. The assignment covers the use of timers, message passing, and ipv6 packet formats. Students will also need to implement the queue abstraction from a previous project.
Typology: Assignments
1 / 3
This page cannot be seen from the preview
Don't miss anything!


In this project, you will implement a link state routing system. Each node in the network will be connected to one or more other nodes. Using hello packets and bounded flooding, you will implement a system to inform all of the nodes in the network of the current network topology. Each node will also build a routing table that minimizes the number of hops to all other nodes in the network.
This project will be the first introduction to several key ideas that will be used later in the semester. It will also combine what you have learned (and probably most of the code) from projects one and two.
A key building block for this project will be the timer thread. By using the timer thread, you will be able to cause events to happen in your system at specific times in the future (for example sending hello packets at a fixed interval of time).
The implementation for the timer thread will be via the queue abstraction you built for project two. When a thread wishes to schedule an event in the future, it enqueue’s a request to the timer thread. When the re- quested time interval has elapsed, the timer thread enqueues a message indicating that the time interval has finished.
The interface for a thread that wishes to use the timer thread is:
int createAlarm(int expireTime, Queue *respQueue, bool repeats) Create a new alarm that will enqueue a response into the queue respQueue expireTime milli- seconds in the future. If the repeats parameter is true, it will en-queue a response every ex- pireTime milliseconds until canceled. If the return value is positive, it contains the unique identi- fier of the alarm event, and if it is negative it indicates an error in creating the alarm.
void cancelAlarm(int alarmId) Cancel the passed alarm. It is possible that one or more alarm notifications may occur after the alarm is canceled due to alaram events passing the cancelAlarm request in different queues.
Note: Alarm Ids should be globally unique and will likely be allocated in the context of the application thread making the request. If this is the case, don’t forget to use synchronization (e.g. mutex’s) around the update of the alarm ids.
In this project you will need to exchange messages between different threads in your system. In order to allow a single thread to respond to a variety of different message types such as a timer event or the arrival of a data packet, you will need to define a common message format to pass via the queues. Each message should start with an integer field that indicates the type of the message (e.g. TIMER_REQ, TIMER_ACK, TIMER_EXPIRE, etc.). In addition, each message can contain a variety of parameters that are specific to
While the connectivity of the network may change over time due to node failures, the topology of the un- derlying "physical network" as specified by the set of links joining the virtual nodes remains constant. When a node starts running, it calls the routine config_get_info. This routine (which we will supply to you) returns the hosts list of neighbors (see config-net.h).
The format of the network configuration file is shown below. You should use ports from your assigned ports for each node. The number after the links statement are the node numbers that are directly connected to that node.
Node fe90::0001 (tracy, 5000) links fe90:: Node fe90::0002 (tracy, 5001) links fe90::0003 fe90:: Node fe90::0003 (tracy, 5002) links fe90::0002 fe90:: Node fe90::0004 (tracy, 5003) links fe90::0002 fe90::
Every HELLO_INTERVAL mili-seconds, a node sends a hello packet to all of its neighbors. When a host receives a HELLO packet, it records the link as operational. If no HELLO packet has been received from a neighboring host in the past DEAD_INTERVAL mili-seconds, it assumes the link (or host) has failed. Every TOPOLOGY_INTERVAL mili-seconds, a host sends it current list of active neighbors to all other nodes in the network (via a flooding message). Every ROUTE_UPDATE_INTERVAL mili-seconds, a host re-computes its routing tables based on its current knowledge of the network topology.
The routing tables should be computed using a variation of Dikstra’s algorithm. When a new routing table is built, it should be printed to the screen. Also, when new topology information (not currently available to that node) is received, it should also be printed. Each node will have a routing table entry for every other node in the network, and information about the first hop to that node (i.e. the node number of the first hop).
The parameters for network operation are read from a configuration file at the start of the node operation. For this project the required parameters (and their default values) are:
Variable Default Value Description HELLO_INTERVAL 500 Frequency of Hello packets DEAD_INTERVAL 2500 Interval to consider a node down TOPOLOGY_INTERVAL 1000 Topology flooding frequency ROUTE_UPDATE_INTERVAL^10000 Frequency of re-building routing table
The parameters in the file are represented one per line. Each line is a variable name, a space, and then an