Fishnet Assignment 2: Distance Vector Routing

Out: Wednesday, Jan 23, 2002.

Due: Thursday, Feb 7, 2002 at 5 p.m.

CSE/EE461 Winter 2002; Anderson.

In this assignment, you will work in teams of two to develop a Fishnet node that forwards echo request and reply packets across the Fishnet using routing tables that you maintain. The program you write builds on your solution to the first Fishnet assignment by forwarding packets according to a routing table instead of randomly. The goal of this assignment is for you to understand distance vector routing.

  1. What You Need To Write

Write a C program called hw2.c that implements the Fishnet echo protocol and a distance vector routing protocol, as described below. Continue to bear in mind the Robustness Principle: "Be conservative in what you send and liberal in what you accept." This specification may leave some points ambiguous; do what you think is best as long as your program can interoperate with the sample solution and other nodes, and document the design decisions you make.

fish_debug(FISH_DEBUG_ROUTING, "Periodic update\n")

to print a debugging message. Then age the information in the routing table and send routing updates to all neighbors, as described below.

  1. Step-by-Step Development Instructions

You can go about building your program in any fashion you prefer. Here is a suggested set of steps to develop the required functionality. We have omitted the steps up through and including starting the fishhead, which remain as previously.

  1. Start with hw1.c by copying it to the new file hw2.c. You may split the program’s functionality between multiple source files; either use #include to directly include the other .c files in hw2.c, or modify the Makefile.
  2. Leave the program performing random forwarding and add the code for the periodic routing timer. Look at fish.h to see the timer API calls. When the timer fires, send a routing update message with one advertisement (for the node itself) to all neighbors and print the required messages. Test this by running both a two and three node network and seeing that routing updates are exchanged.
  3. Define the structure for a routing table entry and add the routing table. Change the random forwarding routine to forward using the routing table and print out the forwarding related messages. Test this so far by running a two-node network. You should not be able to send any non-routing messages (they should all be dropped because there is nothing in the routing table).
  4. Write the code to add routes learned from advertisements to the routing table and to send routing updates that encode the information in the table. Test this with a two and three node network. You should see routes added at each node for the other nodes, and forwarding should have begun to work.
  5. Write the code to handle the remaining routing update cases. Test your program on a two-node network. Routes should be added, and refreshed too.
  6. Write the code to age entries in the routing table and expire them when they get old. Test this with a two node network by letting routing stabilize and killing one node. The other node should eventually expire its route to the killed node.
  7. At this stage you have a complete program and should try joining the class network and doing the turnin cases.

  1. Turn In and Discussion Questions

To prepare for turnin, you need to join the class network, gather the output of your program running the test cases below, and answer four discussion questions:

  1. Describe distance vector routing in no more than three sentences.
  2. Run a three-node network, with each node A, B, and C running in a separate window. Wait until the routing tables have stabilized and send one packet from A to B. Then kill node C (with a ^C) and wait for the routing tables to stabilize. Try sending from A to C and observe the result. Now restart node C, wait for the routing to stabilize, and try sending again. Capture the entire output of the three sessions using, for example, script. To deal with the typing input while your program is producing output, you may want to cut and paste the "send" command.
  3. What happens after the node C fails and why? Describe the general progression of your output for nodes A and B in no more than three sentences.

  4. Run a three-node chain network by starting the fishhead with the argument
    "—topology chain" and then starting nodes A, B, and C in that order. Node B should be in the middle of the chain. Wait until the routing tables have stabilized. Then kill node C and wait for the routing tables to stabilize. Capture the entire output of the three sessions using, for example, script.
  5. What happens after the node C fails and why? Describe the general progression of your output for nodes A and B in no more than three sentences.

  6. Question: The implementation we have specified ages routes before sending updates. Instead we could send updates and then age routes. Which scheme is better and why? Hint: consider the first test case (with a triangle topology). You may want to try changing your code to see the effect.

You should turn in one copy per team of electronic and paper material as usual:

  1. Join the class Fishnet at jimbo:7777 and try to keep this node running after your submission. Also, join the class network and send a message to node 1, the bulletin board node, as in assignment 1.
  2. One or more C files containing the source code of your solution, and the Makefile if you modified it. The main file should be named hw2.c. Submit this electronically using the turnin program on the Linux servers.
  3. One stapled paper writeup with your names and sections that contains:
    1. A printout of the source code you submitted electronically.
    2. A printout of the output from the test cases described above.
    3. Short answers to the discussion questions above.

—END—