COSC 450: Computer Networks
Homework Assignment #3
Due: 3/31/2009
For the third homework assignment, you are to write a Java program to simulate a simplified OSPF router. Your program should be run simultaneously on three different machines in the lab to simulate three different routers. All of the routers are in the same area of the autonomous system. Use Figure 6.8 of the book for the network topology, except the router R2 is the area boundary router and the "Rest of the Internet" is the backbone of the AS. You may assume the following restrictions and simplifcations:
Your program should read its network information from a file (which will be different for each router) and generate an initial graph and routing table. The program will then send out a Hello message. Upon receipt of a Hello message, your router will share its information with a neighboring router using Link State update packets. As it receives Link State update packets, it will propagate them to the other routers and also update its graph and routing table. The link state information should expire in the given interval unless refreshed and the graph and table should be changed accordingly.
In addition, the router should randomly simulate changes in connectivity for the networks to which it is connected and to itself. That is, at random times, network connections should drop or go back up, and the router should incorporate the appropriate changes. Periodically, the router itself should go down. That change should be noted by the neighboring routers (after the dead interval). Simulate a router going down by having your program sleep for a period of time, rather than ending the program. When the router goes back up, remember to send out a new Hello message.
There is no need to simulate network traffic - just simulate network events such as links and routers going down and back up.
Each time an event happens that changes a router's table, your program should print out that event and print out the new table.