1 / 16

The Project

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. Server. R 2. R 5. R 4. R 0. R 3. R 7. R 8. R 1. R 6. Your Router. R 0.

Télécharger la présentation

The Project

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

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 Server R2 R5 R4 R0 R3 R7 R8 R1 R6

  2. Your Router R0 • 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. LAN

  3. Phases The project will be completed in two phases: • You will receive an update message from the server, based on which you will construct your routing table using Dijkstra algorithm. • After the first phase is done, you move into phase II.

  4. Phase I In Phase I, you will do the following: • 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. • 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 NxNmatrix. All valid costs will be positive integers (or zero), determining thecostto 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 R5 R3 10 18 R7 63 62 R0 R4 12 R2 17 1 12 68 28 47 R1 64 R6

  12. Dijkstra Algorithm • The running result for the algorithm. • How can we construct next hop table from this?

  13. Routing Table

  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?

More Related