CS 456 Spring 2013 - Assignment 2

(Version: Jun 20 10:00:17)

Due Date: Tuesday, July 30, 2013, 23:59 - no late submission!

In this assignment, you must implement a variant of distance vector routing called Path Vector Routing in a simulated network node. Path vector routing is very similar to distance vector, but with one modification: route advertisements contain the full path to the destination. Using this information, nodes can determine whether using a neighbour's announcement would result in a routing loop. You can implement your solution in any programming language, provided it can be executed in the linux.student.cs environment.

Configuration and communication between nodes is simulated by reading and writing files. Complex setups can be executed by a script. Your task is to design and implement a program that performs path vector route computation. Each invocation of the routing program performs one complete routing table computation at one node. The program is invoked with a parameter determining the node identity. Each program run completes, before another one is started. Multiple consecutive invocations of the routing program with the same or different node identities simulate the operation of multiple routers. There is no concurrency between multiple runs, but to simulate asynchronous execution, no particular execution order of program invocations can be assumed.

Details

During each invocation, the program reads input from files, computes its routing table, and writes the output to a table file. Multiple invocations and indirect communication via files simulate asynchronous execution of and communication between multiple nodes - with the intention of reducing the overall complexity of the assignment. The detailed operation of your program is as follows (see further below for details of file naming):

  1. Read own table file to obtain current routing table.
  2. Read edge file, but only use information about local links.
  3. Read table files from direct neighbours, if available, and treat as announcements.
  4. Compute new routing table using the Bellman-Ford algorithm while avoiding loops by using the path vectors.
  5. Store new routing table in own table file.
  6. Terminate.

The network graph file specifies undirected edges (i.e. duplex links) between network nodes and their costs. It must be named edges in the current working directory. It contains one edge specification per line as

<node1> <node2> <cost>
for a link between <node1> and <node2> with an positive integer cost <cost>. The file can also contain empty lines to structure the contents for readability. The edge file might be changed between program runs to simulate changes in the network topology.

Table File

A node's routing table file must be named table.X in the current working directory, where 'X' is replaced with the node's integer identifier, e.g., table.1 for Node 1. Each node learns from the edge file to which other nodes it has direct links and reads those table files, if they are available. The table file must contain lines of the following format:
<destination> <path cost> <node1> <node2> <node3> ...
where <destination> is the destination node and <path cost> is the total cost of the path. Node <node1> is the next hop neighbour towards this destination, <node2> the next hop along the path, and so on, up to the last hop before the destination.

Transient Loops

Because nodes do not necessarily execute synchronously (in any particular order), transient loops are still possible with path vector routing, even if alternative paths are available. Construct a scenario where a loop is formed and later resolved by using an alternative path. Prepare two edge files and a script (shell, perl, etc.) that executes nodes and puts the edge files in place to demonstrate the loop scenario.

Procedures

What to hand in

Evaluation

The assignment is to be done individually. Your program must work in the linux.student.cs environment. Your program should not silently crash under any circumstances. At the very least, all fatal errors should lead to an error message indicating the location in the source code before termination. Marks will be assigned as follows:

Submission Instructions

After you have completed testing your code, hand it in using the dropbox feature of the Learn environemnt. Combine all files into a zip/tar/gzip/bzip2 archive with any of the following corresponding names: a2.{zip,tgz,tbz}. Make sure to execute 'make clean' before handing in and do not include temporary or object files. Late submissions are not permitted.

Example

The following shows an sample edge file along with the resulting table files after a sufficient number of executions.

edges
1 2 3
1 3 23
2 3 2
3 4 5
table.1
2 3
3 5 2
4 10 2 3
table.2
1 3
3 2
4 7 3
table.3
1 5 2
2 2
4 5
table.4
1 10 3 2
2 7 3
3 5