Presentation on theme: "The Project Please read the project’s description first. Each router will have a unique ID, with your router’s ID of 0 Any two connected routers will have."— Presentation transcript:
The Project Please read the project’s description first. Each router will have a unique ID, with your router’s ID of 0 Any two connected routers will have an associated cost between them R0R0 R5R5 R4R4 R2R2 R3R3 R7R7 R1R1 R8R8 R6R6 Server
Your Router Your router is always Router 0. Your router should have a socket, which connects to the test program. The test program will send you two kinds of messages. R0R0 LAN
Phases The project will be completed in two phases: 1.You will receive an update message from the server, based on which you will construct your routing table using Dijkstra algorithm. 2.After the first phase is done, you move into phase II.
Phase I In Phase I, you will do the following: 1.Using the socket, you will receive a routing update from the server which will contain the number of networks, the costs of the links (cost matrix) and the IP range for each router. 2.Based on the cost matrix and the routers directly connected to router 0, using Dijkstra’s algorithm, you will construct the routing table: the next- hop to reach any other router in the network.
First step first As the first step, you will be provided with example networks to practice how Dijkstras algorithm works based on which you can code the algorithm (which is an essential part of the project). Here we provide one example. It is also one of the two test cases.
Format of routing update Based on the project description, using the socket, the server will send you three strings, respectively. The first string is a number (but it is still a string), telling you how many routers there are in the network (including yourself). Example: “3”. The second string is an NxN matrix. All valid costs will be positive integers (or zero), determining thecost to get from Router i to Router j. Example: “0, 1, 2, 3, 0, 4, 5, 6, 0”.
The third string is a denition of IP range, telling you which router is serving what range of IP addresses. Example: “ ”.
An Example In the next few slides, we will go through an example of how to construct the routing table. Assuming that the server sends the routing update as shown in the next slide. We show in the subsequent slide the connections and costs for the first 3 rows. – Can you complete the rest of the network?
Phase II In this phase, the test program will send you several IP addresses. One at a time. You need to first check which router you should forward it to, and then choose the correct next hop. You router can exit after receiving “END”.
One more thing… How to determine which router an IP address belongs to?