Linkstate protocols SPF algo Henk Smit jan 1999

  • Slides: 40
Download presentation
Link-state protocols SPF algo Henk Smit jan 1999 0131_09 F 7/c 2 1

Link-state protocols SPF algo Henk Smit jan 1999 0131_09 F 7/c 2 1

Summary • The basic ideas of link-state protocols • Dijkstra’s Shortest Path First algorithm

Summary • The basic ideas of link-state protocols • Dijkstra’s Shortest Path First algorithm 2

Summary • The basic ideas of link-state protocols • Dijkstra’s Shortest Path First algorithm

Summary • The basic ideas of link-state protocols • Dijkstra’s Shortest Path First algorithm 3

The basic idea • In a link-state protocol, the network can be viewed as

The basic idea • In a link-state protocol, the network can be viewed as a jigsaw puzzle • Each piece of the puzzle holds one router • Each router creates a packet which represents its own jigsaw piece • These packets are flooded everywhere • Use SPF to put the pieces together 4

About link-state protocols • The jigsaw puzzle LSP for router. B LSP for router.

About link-state protocols • The jigsaw puzzle LSP for router. B LSP for router. A to B to E to C to D to E to A to B LSP for router. E to A to D to B to C LSP for router. D LSP for router. C 5

Link-state protocols • Each router keeps track of its own state • Send and

Link-state protocols • Each router keeps track of its own state • Send and receive hellos to detect neighbors • Keep track of IP and CLNS addresses • interface IP prefixes • maybe inter-area or redistributed prefixes • Each router builds one linkstate packet (LSP) with all own local information • OSPF builds multiple LSAs for inter-area/externals 6

Link-state protocols • All routers exchange copies of all LSPs • via a reliable

Link-state protocols • All routers exchange copies of all LSPs • via a reliable flooding mechanism • Each router stores all LSPs in a database • separate from the routing table • all routers should have exactly the same LSPDB • New LSPs sent only when there’s a change • and additionally periodic refreshes • new LSP will overwrite the old LSP – no partial updates 7

Link-state protocols • By executing Dijkstra’s SPF algorithm, each router ‘composes the jigsaw puzzle’.

Link-state protocols • By executing Dijkstra’s SPF algorithm, each router ‘composes the jigsaw puzzle’. • the topology is calculated as a shortest-path-tree • each router is the root of the SPT it has calculated • From the SPT the RIBs are calculated • No routing loops will occur because • all routers have an identical LSPDB • all info in the LSPDB comes directly from the source – Distance Vector protocols are based on hear-say 8

Each router has the same LSPDB Router. A’s LSPDB lsp. A lsp. D lsp.

Each router has the same LSPDB Router. A’s LSPDB lsp. A lsp. D lsp. B lsp. A Router. E’s LSPDB lsp. E lsp. C Router. B’s LSPDB lsp. E lsp. D lsp. C lsp. E lsp. B lsp. A lsp. C lsp. D lsp. E lsp. C lsp. D Router. C’s LSPDB lsp. A lsp. E lsp. C lsp. D Router. D’s LSPDB 9

Summary • The basic ideas of link-state protocols • Dijkstra’s Shortest Path First algorithm

Summary • The basic ideas of link-state protocols • Dijkstra’s Shortest Path First algorithm • Pseudonodes and Network LSAs • Flooding • Scaling link-state protocols by using areas • inter-area routing is IS-IS 10

Shortest Path First algorithm • Also called Dijkstra’s algorithm • The goal is to

Shortest Path First algorithm • Also called Dijkstra’s algorithm • The goal is to find the topology in the form of a shortest path tree (SPT) • From the SPT we build routing tables • Complexity is independent from position of computing router in the network • makes LS protocols less useful for hub-and-spoke • use distance-vector with default routes and filters Henk Smit jan 1999 11

Shortest Path First algorithm • SPF complexity is O(n log n) • Theoretical complexity

Shortest Path First algorithm • SPF complexity is O(n log n) • Theoretical complexity depends on sorting • ISIS uses quick array sort – causes link metric limitation of 63 • CPU usage in real life depends on other stuff • number of links is important • number of IP routes, stability of adjacencies, etc • flooding is probably more important for scaling Henk Smit jan 1999 12

Shortest Path First algorithm • We maintain three lists (or sets) • Unknown list

Shortest Path First algorithm • We maintain three lists (or sets) • Unknown list • all nodes start on this list • TENTative list • all nodes we are currently examining • also called candidate list • PATHS list • all nodes to which we have calculated final paths • also called known list Henk Smit jan 1999 13

Shortest Path First algorithm • We execute N steps • typically N is the

Shortest Path First algorithm • We execute N steps • typically N is the number of nodes in the network • At each step we move one node to PATHS • During the first step we move ourself to PATHS • During the next steps we find the node that has the shortest path amongst all nodes on TENT, and move it from TENT to PATHS • At each step we find all neighbors reachable from that node and move them to the TENT list Henk Smit jan 1999 14

Shortest Path First algorithm • Special actions • after each step we clean up

Shortest Path First algorithm • Special actions • after each step we clean up the TENT list • if a node is directly connected to us, search the first-hop info in the adjacency database • if a node is not directly connected to us, copy the first-hop info from the parent(s) • for each node on TENT, maintain the cost to get there from the root, and the first-hop info • if parallel paths, maintain multiple first-hops Henk Smit jan 1999 15

A network rtr. Z rtr. F 3 2 5 rtr. B 3 5 2

A network rtr. Z rtr. F 3 2 5 rtr. B 3 5 2 12 12 2 4 rtr. W Rtr. R rtr. C rtr. K 5 rtr. S 3 3 7 8 3 5 4 rtr. D 2 4 rtr. Q 5 3 rtr. A 16

The link-state database LSP Z IS: 3 C IS: 3 D LSP C IS:

The link-state database LSP Z IS: 3 C IS: 3 D LSP C IS: 2 B IS: 8 D LSP F IS: 5 B IS: 12 R IS: 5 B IS: 12 W IS: 2 K LSP B IS: 2 C IS: 2 R IS: 5 F LSP D IS: 3 A IS: 8 C IS: 3 R IS: 4 A LSP R IS: 3 D IS: 7 A IS: 3 W IS: 2 B IS: 12 F LSP A IS: 3 D IS: 4 D IS: 7 R IS: 3 W IS: 5 Q LSP K IS: 4 S IS: 2 F LSP W IS: 3 R IS: 3 A IS: 12 F IS: 5 S IS: 2 Q LSP S IS: 4 Q IS: 5 W IS: 4 K LSP Q IS: 5 A IS: 2 W IS: 4 S 17

The adjacency database Neighbor rtr. D rtr. R rtr. W rtr. Q Interface serial

The adjacency database Neighbor rtr. D rtr. R rtr. W rtr. Q Interface serial 0 serial 1 serial 2 serial 3 serial 4 serial 5 Cost 3 4 7 3 5 5 18

Shortest Path First example • Initial situation • TENT: empty • PATHS: empty •

Shortest Path First example • Initial situation • TENT: empty • PATHS: empty • Unknown: A B C D F K Q R S W Z Henk Smit jan 1999 19

Shortest Path First example • First iteration • Move ourself (rtr. A) to PATHS

Shortest Path First example • First iteration • Move ourself (rtr. A) to PATHS • Move neighbors of rtr. A to TENT • find first-hop info in adjacency database • TENT: D cost 3 via S 0, R cost 7 via S 2, W cost 3 via S 3, Q cost 5 via S 4 or S 5 • PATHS: A • Unknown: B C F K S Z Henk Smit jan 1999 20

PATHS and TENT rtr. Z rtr. F 3 2 5 rtr. B 3 5

PATHS and TENT rtr. Z rtr. F 3 2 5 rtr. B 3 5 2 12 12 2 4 rtr. W Rtr. R rtr. C rtr. K 5 rtr. S 3 3 7 8 3 5 4 rtr. D 2 4 rtr. Q 5 3 rtr. A 21

Shortest Path First example • Second iteration • Move rtr. D to PATHS •

Shortest Path First example • Second iteration • Move rtr. D to PATHS • Move neighbors of rtr. D to TENT • rtr. C and rtr. R, found better path to rtr. R, ignore rtr. A • TENT: W cost 3 via S 3, Q cost 5 via S 4/S 5, C cost 11 via S 0, R cost 6 via S 0 • PATHS: A, D cost 3 via S 0 • Unknown: B F K S Z Henk Smit jan 1999 22

PATHS and TENT rtr. Z rtr. F 3 2 5 rtr. B 3 5

PATHS and TENT rtr. Z rtr. F 3 2 5 rtr. B 3 5 2 12 12 2 4 rtr. W Rtr. R rtr. C rtr. K 5 rtr. S 3 3 7 8 3 5 4 rtr. D 2 4 rtr. Q 5 3 rtr. A 23

Shortest Path First example • Third iteration • Move rtr. W to PATHS, neighbors

Shortest Path First example • Third iteration • Move rtr. W to PATHS, neighbors of rtr. W to TENT • F and S, found more equal-cost paths to R and Q • TENT: Q cost 5 via S 4/S 5/S 3, C cost 11 via S 0, R cost 6 via S 0/S 3, S cost 8 via S 3, F cost 15 via S 3 • PATHS: A, D cost 3 via S 0, W cost 3 via S 3 • Unknown: B K Z Henk Smit jan 1999 24

PATHS and TENT rtr. Z rtr. F 3 2 5 rtr. B 3 5

PATHS and TENT rtr. Z rtr. F 3 2 5 rtr. B 3 5 2 12 12 2 4 rtr. W Rtr. R rtr. C rtr. K 5 rtr. S 3 3 7 8 3 5 4 rtr. D 2 4 rtr. Q 5 3 rtr. A 25

Shortest Path First example • Fourth iteration • Move rtr. Q to PATHS, neighbors

Shortest Path First example • Fourth iteration • Move rtr. Q to PATHS, neighbors of rtr. Q to TENT • found worse path (9 vs 8) to S. A W already known • TENT: C cost 11 via S 0, R cost 6 via S 0/S 3, S cost 8 via S 3, F cost 15 via S 3 • PATHS: A, D cost 3 via S 0, W cost 3 via S 3, Q cost 5 via S 4/S 5/S 3 • Unknown: B K Z Henk Smit jan 1999 26

PATHS and TENT rtr. Z rtr. F 3 2 5 rtr. B 3 5

PATHS and TENT rtr. Z rtr. F 3 2 5 rtr. B 3 5 2 12 12 2 4 rtr. W Rtr. R rtr. C rtr. K 5 rtr. S 3 3 7 8 3 5 4 rtr. D 2 4 rtr. Q 5 3 rtr. A 27

Shortest Path First example • Fifth iteration • Move rtr. R to PATHS, neighbors

Shortest Path First example • Fifth iteration • Move rtr. R to PATHS, neighbors of rtr. R to TENT • new path to B, worse to F. A D W already known • TENT: C cost 11 via S 0, S cost 8 via S 3, F cost 15 via S 3, B cost 8 via S 0/S 3 • PATHS: A, D cost 3 via S 0, W cost 3 via S 3, Q cost 5 via S 4/S 5/S 3, R cost 6 via S 0/S 3 • Unknown: K Z Henk Smit jan 1999 28

PATHS and TENT rtr. Z rtr. F 3 2 5 rtr. B 3 5

PATHS and TENT rtr. Z rtr. F 3 2 5 rtr. B 3 5 2 12 12 2 4 rtr. W Rtr. R rtr. C rtr. K 5 rtr. S 3 3 7 8 3 5 4 rtr. D 2 4 rtr. Q 5 3 rtr. A 29

Shortest Path First example • Sixth iteration • Move rtr. S to PATHS, neighbors

Shortest Path First example • Sixth iteration • Move rtr. S to PATHS, neighbors of rtr. S to TENT • new path to K. Q W already known • TENT: C cost 11 via S 0, F cost 15 via S 3, B cost 8 via S 0/S 3, K cost 12 via S 3 • PATHS: A, D cost 3 via S 0, W cost 3 via S 3, Q cost 5 via S 4/S 5/S 3, R cost 6 via S 0/S 3, S cost 8 via S 3 • Unknown: Z Henk Smit jan 1999 30

PATHS and TENT rtr. Z rtr. F 3 2 5 rtr. B 3 5

PATHS and TENT rtr. Z rtr. F 3 2 5 rtr. B 3 5 2 12 12 2 4 rtr. W Rtr. R rtr. C rtr. K 5 rtr. S 3 3 7 8 3 5 4 rtr. D 2 4 rtr. Q 5 3 rtr. A 31

Shortest Path First example • Seventh iteration • Move rtr. B to PATHS, neighbors

Shortest Path First example • Seventh iteration • Move rtr. B to PATHS, neighbors of rtr. B to TENT • better paths to C (10 vs 11) and F (13 vs 15) • TENT: C cost 10 via S 0/S 3, F cost 13 via S 0/S 3, K cost 12 via S 3 • PATHS: A, D cost 3 via S 0, W cost 3 via S 3, Q cost 5 via S 4/S 5/S 3, R cost 6 via S 0/S 3, S cost 8 via S 3, B cost 8 via S 0/S 3 • Unknown: Z Henk Smit jan 1999 32

PATHS and TENT rtr. Z rtr. F 3 2 5 rtr. B 3 5

PATHS and TENT rtr. Z rtr. F 3 2 5 rtr. B 3 5 2 12 12 2 4 rtr. W Rtr. R rtr. C rtr. K 5 rtr. S 3 3 7 8 3 5 4 rtr. D 2 4 rtr. Q 5 3 rtr. A 33

Shortest Path First example • Eigth iteration • Move rtr. C to PATHS, neighbors

Shortest Path First example • Eigth iteration • Move rtr. C to PATHS, neighbors of rtr. C to TENT • B and D already known • TENT: F cost 13 via S 0/S 3, K cost 12 via S 3 • PATHS: A, D cost 3 via S 0, W cost 3 via S 3, Q cost 5 via S 4/S 5/S 3, R cost 6 via S 0/S 3, S cost 8 via S 3, B cost 8 via S 0/S 3, C cost 10 via S 0/S 3 • Unknown: Z Henk Smit jan 1999 34

PATHS and TENT rtr. Z rtr. F 3 2 5 rtr. B 3 5

PATHS and TENT rtr. Z rtr. F 3 2 5 rtr. B 3 5 2 12 12 2 4 rtr. W Rtr. R rtr. C rtr. K 5 rtr. S 3 3 7 8 3 5 4 rtr. D 2 4 rtr. Q 5 3 rtr. A 35

Shortest Path First example • Ninth iteration • Move rtr. K to PATHS, neighbors

Shortest Path First example • Ninth iteration • Move rtr. K to PATHS, neighbors of rtr. K to TENT • found worse path to F (14 vs 13), S already known • TENT: F cost 13 via S 0/S 3 • PATHS: A, D cost 3 via S 0, W cost 3 via S 3, Q cost 5 via S 4/S 5/S 3, R cost 6 via S 0/S 3, S cost 8 via S 3, B cost 8 via S 0/S 3, C cost 10 via S 0/S 3, K cost 12 via S 3 • Unknown: Z Henk Smit jan 1999 36

PATHS and TENT rtr. Z rtr. F 3 2 5 rtr. B 3 5

PATHS and TENT rtr. Z rtr. F 3 2 5 rtr. B 3 5 2 12 12 2 4 rtr. W Rtr. R rtr. C rtr. K 5 rtr. S 3 3 7 8 3 5 4 rtr. D 2 4 rtr. Q 5 3 rtr. A 37

Shortest Path First example • Tenth iteration • Move rtr. F to PATHS, neighbors

Shortest Path First example • Tenth iteration • Move rtr. F to PATHS, neighbors of rtr. K to TENT • all neighbors already known, no changes to TENT • TENT: empty • PATHS: A, D cost 3 via S 0, W cost 3 via S 3, Q cost 5 via S 4/S 5/S 3, R cost 6 via S 0/S 3, S cost 8 via S 3, B cost 8 via S 0/S 3, C cost 10 via S 0/S 3, K cost 12 via S 3, F cost 13 via S 0/S 3 • Unknown: Z Henk Smit jan 1999 38

PATHS and TENT rtr. Z rtr. F 3 2 5 rtr. B 3 5

PATHS and TENT rtr. Z rtr. F 3 2 5 rtr. B 3 5 2 12 12 2 4 rtr. W Rtr. R rtr. C rtr. K 5 rtr. S 3 3 7 8 3 5 4 rtr. D 2 4 rtr. Q 5 3 rtr. A 39

Shortest Path First example • Done ! • iteration stops because TENT is empty

Shortest Path First example • Done ! • iteration stops because TENT is empty • we obviously didn’t find a path to Z • we can now calculate routing tables • result: D cost 3 via S 0, W cost 3 via S 3, Q cost 5 via S 4/S 5/S 3, R cost 6 via S 0/S 3, S cost 8 via S 3, B cost 8 via S 0/S 3, C cost 10 via S 0/S 3, K cost 12 via S 3, F cost 13 via S 0/S 3 Henk Smit jan 1999 40