project 5
play

Project 5 Soumya Basu Department of Computer Science Cornell - PowerPoint PPT Presentation

Project 5 Soumya Basu Department of Computer Science Cornell University September 18, 2015 Administrivia Project 5 is due on November 18 Will be implementing a Link State routing protocol The Five Parts Connecting two nodes


  1. Project 5 Soumya Basu Department of Computer Science Cornell University September 18, 2015

  2. Administrivia • Project 5 is due on November 18 • Will be implementing a Link State routing protocol

  3. The Five Parts • Connecting two nodes • Dijkstra’s algorithm • Flooding • Link State Routing • (Optional) Application!

  4. Part 0 • Read the skeleton code • You will need to interact with most of it

  5. Connecting two nodes • Need to read up on the socket API calls • Important functions: • socket, fcntl, setsockopt, bind • Use man pages to see the options • Not many lines of code • Format: C<IPaddr:port>

  6. Dijkstra’s Algorithm infty infty 2 5 7 3 0 8 infty 1 5 infty

  7. Dijkstra’s Algorithm 5 infty 2 5 7 3 0 8 8 1 5 1

  8. Dijkstra’s Algorithm 5 infty 2 5 7 3 0 8 8 1 5 1

  9. Dijkstra’s Algorithm 5 4 2 5 7 Because 3 6 < 8 0 8 6 1 5 1

  10. Dijkstra’s Algorithm 5 4 2 5 7 3 0 8 6 1 5 1

  11. Dijkstra’s Algorithm 5 4 2 5 7 Because 3 6 < 4+7 0 8 6 1 5 1

  12. Dijkstra’s Algorithm 5 4 2 5 7 3 0 8 6 1 5 1

  13. Dijkstra’s Algorithm Because 4 < 5 + 2 5 4 2 5 7 3 0 8 6 1 5 1

  14. Dijkstra’s Algorithm 5 4 2 5 7 3 0 8 6 1 5 1

  15. Dijkstra’s Algorithm 5 4 2 5 7 3 0 8 6 1 5 1

  16. Flooding • How do you figure out the link state? • Broadcast! • You only have point-to-point though… • Gossip protocol • G<srcIP:srcPort>/counter/payload\n • Payload will change

  17. Flooding • Naive implementation: • When you hear a message, tell EVERYONE! A A B C B C

  18. Flooding • Broadcast storms are not good… • We make two optimizations: • Don’t tell the person that sent you the message • Don’t spread around messages you’ve seen already

  19. Flooding A B C

  20. Flooding A B C

  21. Flooding A B C

  22. Flooding • Can we do even better? • Yes, but this is good enough! • What to flood? • Your connection state every time it changes • A new connection, a dead connection, etc. • Gossip payload: “;<addr1:port1>;<addr2:port2>…”

  23. Link State Routing • You have most of the pieces already! • When you see a message, send it along the Dijkstra tree • Most of the work here is the send message implementation • Send format: S<dstIP:dstPort>/TTL/payload\n • Make sure to decrement TTL

  24. Optional Applications • Mapping IP addresses to names (DNS) • Anything else you want!

Recommend


More recommend