Presentation is loading. Please wait.

Presentation is loading. Please wait.

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.

Similar presentations


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:

1 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

2 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

3 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.

4 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.

5 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.

6 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”.

7 The third string is a denition of IP range, telling you which router is serving what range of IP addresses. Example: “0.0.0.0-1.1.1.1 1.1.1.1-2.2.2.2 2.2.2.2-3.3.3.3”.

8 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?

9 Example routing update “8” “0, 1, 12, -1, -1, 18, -1, 63, -20, 0, 28, -12, -24, 12, 64, 62, -11, 68, 0, -15, 17, 10, 47, -24, 75, 33, 50, 0, 70, 54, 66, -19, 6, 17, 56, 56, 0, 65, 68, 0, 18, -1, 30, 5, -13, 0, 28, 12, 27, -4, 72, 32, 43, 6, 0, 6, 9, 63, 32, -11, 13, -3, 17, 0” “0.0.0.0-32.0.0.0 32.0.0.0-64.0.0.0 64.0.0.0-96.0.0.0 96.0.0.0-128.0.0.0 128.0.0.0-160.0.0.0 160.0.0.0- 192.0.0.0 192.0.0.0-224.0.0.0 224.0.0.0- 255.255.255.255”

10 Cost matrix (re-written) [0, 1, 12, -1, -1, 18, -1, 63, -20, 0, 28, -12, -24, 12, 64, 62, -11, 68, 0, -15, 17, 10, 47, -24, 75, 33, 50, 0, 70, 54, 66, -19, 6, 17, 56, 56, 0, 65, 68, 0, 18, -1, 30, 5, -13, 0, 28, 12, 27, -4, 72, 32, 43, 6, 0, 6, 9, 63, 32, -11, 13, -3, 17, 0]

11 Connection and cost for the first 3 rows R0R0 R5R5 R7R7 R2R2 R1R1 1 12 18 63 28 12 R6R6 64 62 68 R4R4 17 10 47 R3R3

12 Dijkstra Algorithm The running result for the algorithm. How can we construct next hop table from this? Packet destined to Router Previous Router 0N/A 10 20 35 42 51 65 75

13 Routing Table Packet destined to Router Previous RouterNext-hop Router 0N/A0 101 202 351 422 511 651 751

14 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”.

15 Phase II

16 One more thing… How to determine which router an IP address belongs to?


Download ppt "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."

Similar presentations


Ads by Google