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

project 5
SMART_READER_LITE
LIVE PREVIEW

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


slide-1
SLIDE 1

Project 5

Soumya Basu Department of Computer Science Cornell University September 18, 2015

slide-2
SLIDE 2

Administrivia

  • Project 5 is due on November 18
  • Will be implementing a Link State routing protocol
slide-3
SLIDE 3

The Five Parts

  • Connecting two nodes
  • Dijkstra’s algorithm
  • Flooding
  • Link State Routing
  • (Optional) Application!
slide-4
SLIDE 4

Part 0

  • Read the skeleton code
  • You will need to interact with most of it
slide-5
SLIDE 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>
slide-6
SLIDE 6

Dijkstra’s Algorithm

5 8 1 5 3 2 7 infty infty infty infty

slide-7
SLIDE 7

Dijkstra’s Algorithm

5 8 1 5 3 2 7 5 infty 8 1

slide-8
SLIDE 8

Dijkstra’s Algorithm

5 8 1 5 3 2 7 5 infty 8 1

slide-9
SLIDE 9

Dijkstra’s Algorithm

5 8 1 5 3 2 7 5 4 6 1

Because 6 < 8

slide-10
SLIDE 10

Dijkstra’s Algorithm

5 8 1 5 3 2 7 5 4 6 1

slide-11
SLIDE 11

Dijkstra’s Algorithm

5 8 1 5 3 2 7 5 4 6 1

Because 6 < 4+7

slide-12
SLIDE 12

Dijkstra’s Algorithm

5 8 1 5 3 2 7 5 4 6 1

slide-13
SLIDE 13

Dijkstra’s Algorithm

5 8 1 5 3 2 7 5 4 6 1

Because 4 < 5 + 2

slide-14
SLIDE 14

Dijkstra’s Algorithm

5 8 1 5 3 2 7 5 4 6 1

slide-15
SLIDE 15

Dijkstra’s Algorithm

5 8 1 5 3 2 7 5 4 6 1

slide-16
SLIDE 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
slide-17
SLIDE 17

Flooding

  • Naive implementation:
  • When you hear a message, tell EVERYONE!

B A C B A C

slide-18
SLIDE 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

slide-19
SLIDE 19

Flooding

B A C

slide-20
SLIDE 20

Flooding

B A C

slide-21
SLIDE 21

Flooding

B A C

slide-22
SLIDE 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>…”
slide-23
SLIDE 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
slide-24
SLIDE 24

Optional Applications

  • Mapping IP addresses to names (DNS)
  • Anything else you want!