link state routing - École polytechnique fédérale de ...ica · link state routing jean-yves le...

34
Link State Routing Jean-Yves Le Boudec Fall 2009 1 ÉCOLE POLYTECHNIQUE FÉDÉRALE DE LAUSANNE

Upload: dinhdan

Post on 11-Apr-2019

217 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Link State Routing - École Polytechnique Fédérale de ...ica · Link State Routing Jean-Yves Le Boudec Fall 2009 1 ÉCOLE POLYTECHNIQUE FÉDÉRALE DE LAUSANNE. Contents 1. Link

Link State Routing

Jean-Yves Le BoudecFall 2009

1

ÉCOLE POLYTECHNIQUE FÉDÉRALE DE LAUSANNE

Page 2: Link State Routing - École Polytechnique Fédérale de ...ica · Link State Routing Jean-Yves Le Boudec Fall 2009 1 ÉCOLE POLYTECHNIQUE FÉDÉRALE DE LAUSANNE. Contents 1. Link

Contents

1. Link state flooding topology information

finding the shortest paths (Dijkstra)

2. Hierarchical routing with areas3. OSPF

database modelling

neighbor discovery - Hello protocol

database synchronization

link state updates

examples

2

Page 3: Link State Routing - École Polytechnique Fédérale de ...ica · Link State Routing Jean-Yves Le Boudec Fall 2009 1 ÉCOLE POLYTECHNIQUE FÉDÉRALE DE LAUSANNE. Contents 1. Link

1. Link State Routing

Principle of link state routingeach router keeps a topology database of whole network

link state updates flooded, or multicast to all network

routers compute their routing tables based on topologyoften uses Dijkstra’s shortest path algorithm

Used in OSPF (Open Shortest Path First), IS-IS (similar to OSPF)and PNNI (ATM routing protocol)

3

Page 4: Link State Routing - École Polytechnique Fédérale de ...ica · Link State Routing Jean-Yves Le Boudec Fall 2009 1 ÉCOLE POLYTECHNIQUE FÉDÉRALE DE LAUSANNE. Contents 1. Link

(a) Topology Database Synchronization

Neighbouring nodes synchronize before starting any relationshipHello protocol; keep alive

initial synchronization of database

description of all links (no information yet)

Once synchronized, a node accepts link state advertisementscontain a sequence number, stored with record in the database

only messages with new sequence number are accepted

accepted messages are flooded to all neighbours

sequence number prevents anomalies (loops or blackholes)

4

Page 5: Link State Routing - École Polytechnique Fédérale de ...ica · Link State Routing Jean-Yves Le Boudec Fall 2009 1 ÉCOLE POLYTECHNIQUE FÉDÉRALE DE LAUSANNE. Contents 1. Link

Example network

5

n1

A

B

n6

D E

n4

n3

C

n5n2

F

n7

Each router knows directly connected networks

Page 6: Link State Routing - École Polytechnique Fédérale de ...ica · Link State Routing Jean-Yves Le Boudec Fall 2009 1 ÉCOLE POLYTECHNIQUE FÉDÉRALE DE LAUSANNE. Contents 1. Link

Initial routing tables

6

net typen1 Ethern2 P-to-P

A

n1

A

B

n6

D E

n4

n3

C

n5n2

F

n7

net typen6 Ethern5 P-to-P

Dnet typen6 Ethern7 Ether

E

net typen1 Ethern7 Ether

F

net typen1 Ethern4 P-to-Pn5 P-to-P

C

net typen3 Ethern2 P-to-Pn4 P-to-P

B

Page 7: Link State Routing - École Polytechnique Fédérale de ...ica · Link State Routing Jean-Yves Le Boudec Fall 2009 1 ÉCOLE POLYTECHNIQUE FÉDÉRALE DE LAUSANNE. Contents 1. Link

After Flooding

7

rtr net costrtr net costA n1 10A n2 100B n3 10B n2 100B n4 100C n1 10C n4 100C n5 100D n6 10D n5 100E n6 10E n7 10F n1 10F n7 10

A n1 10A n2 100B n3 10B n2 100B n4 100C n1 10C n4 100C n5 100D n6 10D n5 100E n6 10E n7 10F n1 10F n7 10

The local metric information is flooded to all routersAfter convergence, all routers have the same information

n1

A

B

n6

D E

n4

n3

C

n5n2

F

n7

Page 8: Link State Routing - École Polytechnique Fédérale de ...ica · Link State Routing Jean-Yves Le Boudec Fall 2009 1 ÉCOLE POLYTECHNIQUE FÉDÉRALE DE LAUSANNE. Contents 1. Link

(b) Topology graph

8

Arrows routers-to-nets with a given metricexcept P-to-P, stub, and external networks

From nets to routers, metric = 0

A

B

C

D

F

E

100

10 10

10

10

100100

n1

100 n6

n7

n3

100

10

100

1010

10

0

0

0

0

0 0

externalnetwork

54

0

stub network

point to pointlink

broadcastnetwork

externalnetwork

Page 9: Link State Routing - École Polytechnique Fédérale de ...ica · Link State Routing Jean-Yves Le Boudec Fall 2009 1 ÉCOLE POLYTECHNIQUE FÉDÉRALE DE LAUSANNE. Contents 1. Link

(b) Path ComputationPerformed locally, based on topology databaseComputes one or several best paths to every destination from this nodeBest Path = shortest for OSPFOSPF uses Dijkstra’s shortest path

the best known algorithm for centralized operation

Paths are computed independently at every nodesynchronization of databases guarantees absence of persistent loops

every node computes a shortest path tree rooted at self

9

Page 10: Link State Routing - École Polytechnique Fédérale de ...ica · Link State Routing Jean-Yves Le Boudec Fall 2009 1 ÉCOLE POLYTECHNIQUE FÉDÉRALE DE LAUSANNE. Contents 1. Link

Simplified graph

10

Only arrows with metrics between routersEvery node executes the shortest path computation on the graph – same graph, but different sources

A

B

C

D

F

E

100

10

10

10

10

10

100 100

Page 11: Link State Routing - École Polytechnique Fédérale de ...ica · Link State Routing Jean-Yves Le Boudec Fall 2009 1 ÉCOLE POLYTECHNIQUE FÉDÉRALE DE LAUSANNE. Contents 1. Link

Dijkstra’s Shortest Path AlgorithmThe nodes are 0...N and the algorithm computes best paths from node 0c(i,j) is the cost of (i,j), pred(i) is the predecessor of node i on the tree M being builtm(j) is the distance from node 0 to node j.

as Bellman-Ford, works for any min-plus algebra11

m(0) = 0; M = {0};for k=1 to N {

find (i0, j0) that minimizes m(i) + c(i,j), with i in M, j not in M

m(j0) = m(i0) + c(i0, j0)pred(j0) = i0M = M ∪ {j0}

}

m(0) = 0; M = {0};for k=1 to N {

find (i0, j0) that minimizes m(i) + c(i,j), with i in M, j not in M

m(j0) = m(i0) + c(i0, j0)pred(j0) = i0M = M ∪ {j0}

}

Page 12: Link State Routing - École Polytechnique Fédérale de ...ica · Link State Routing Jean-Yves Le Boudec Fall 2009 1 ÉCOLE POLYTECHNIQUE FÉDÉRALE DE LAUSANNE. Contents 1. Link

Example: Dijkstra at A

12

A

B

C

D

F

E

100

10

10

10

10

10

100 100

init: M = { A }

step 1:i0=Aj0=Cm(C)=10

M = {A, C}

m(A)=0 m(C)=10

Page 13: Link State Routing - École Polytechnique Fédérale de ...ica · Link State Routing Jean-Yves Le Boudec Fall 2009 1 ÉCOLE POLYTECHNIQUE FÉDÉRALE DE LAUSANNE. Contents 1. Link

Example: Dijkstra at A

13

A

B

C

D

F

E

100

10

10

10

10

10

100 100

i0=Aj0=Fm(F)=10M = {A,C,F}

m(A)=0 m(C)=10 m(F)=10

Page 14: Link State Routing - École Polytechnique Fédérale de ...ica · Link State Routing Jean-Yves Le Boudec Fall 2009 1 ÉCOLE POLYTECHNIQUE FÉDÉRALE DE LAUSANNE. Contents 1. Link

Example: Dijkstra at A

14

A

B

C

D

F

E

100

10

10

10

10

10

100 100

i0=Fj0=Em(E)=20M = {A,C,F,E}

m(A)=0 m(C)=10 m(F)=10

m(F)=20

Page 15: Link State Routing - École Polytechnique Fédérale de ...ica · Link State Routing Jean-Yves Le Boudec Fall 2009 1 ÉCOLE POLYTECHNIQUE FÉDÉRALE DE LAUSANNE. Contents 1. Link

Example: Dijkstra at A

15

A

B

C

D

F

E

100

10

10

10

10

10

100 100

i0=Ej0=Dm(D)=40M = {A,C,F,E,D}

m(A)=0 m(C)=10 m(F)=10

m(E)=20m(D)=30

Page 16: Link State Routing - École Polytechnique Fédérale de ...ica · Link State Routing Jean-Yves Le Boudec Fall 2009 1 ÉCOLE POLYTECHNIQUE FÉDÉRALE DE LAUSANNE. Contents 1. Link

Example: Dijkstra at A

16

A

B

C

D

F

E

100

10

10

10

10

10

100 100

i0=Aj0=Bm(B)=100M = {A,C,F,E,D,B}

m(A)=0 m(C)=10 m(F)=10

m(E)=20m(D)=30m(B)=100

Page 17: Link State Routing - École Polytechnique Fédérale de ...ica · Link State Routing Jean-Yves Le Boudec Fall 2009 1 ÉCOLE POLYTECHNIQUE FÉDÉRALE DE LAUSANNE. Contents 1. Link

Routing table of A

17

net nextn1 directn2 directn3 Bn4 Cn5 Cn6 Fn7 F

A

n1

A

B

n6

D E

n4

n3

C

n5n2

F

n7

Page 18: Link State Routing - École Polytechnique Fédérale de ...ica · Link State Routing Jean-Yves Le Boudec Fall 2009 1 ÉCOLE POLYTECHNIQUE FÉDÉRALE DE LAUSANNE. Contents 1. Link

Test Your Understanding

Q1: Run Dijkstra at CQ2: What are the routing tables at C

solution

18

Page 19: Link State Routing - École Polytechnique Fédérale de ...ica · Link State Routing Jean-Yves Le Boudec Fall 2009 1 ÉCOLE POLYTECHNIQUE FÉDÉRALE DE LAUSANNE. Contents 1. Link

LS: SummaryAll nodes compute their own topology database

represents the whole network

strongly synchronized

All nodes compute their best path tree to all destinationsRouting tables are built from the tree

used for next hop routing only

LS versus DVLS avoids convergence problems of DV

supports flexible cost definitions; can be used for routing ATM connections

LS is much more complex

19

Page 20: Link State Routing - École Polytechnique Fédérale de ...ica · Link State Routing Jean-Yves Le Boudec Fall 2009 1 ÉCOLE POLYTECHNIQUE FÉDÉRALE DE LAUSANNE. Contents 1. Link

2. Divide large networks Why divide large networks?Cost of computing routing tables

update when topology changes

SPF algorithmn routers, k linkscomplexity O(n*k)

size of DB, update messages grows with the network size

Use hierarchical routing to limit the scope of updates and computational overhead

divide the network into several areas

independent route computing in each area

inject aggregated information on routes into other areas

We explain hierarchical routing the OSPF wayIS-IS does things a bit differently

20

Page 21: Link State Routing - École Polytechnique Fédérale de ...ica · Link State Routing Jean-Yves Le Boudec Fall 2009 1 ÉCOLE POLYTECHNIQUE FÉDÉRALE DE LAUSANNE. Contents 1. Link

Hierarchical Routing

A large OSPF domain can be configured into areasone backbone area (area 0)

non backbone areas (areas numbered other than 0)

All inter-area traffic goes through area 0strict hierarchy

Inside one area: link state routing as seen earlierone topology database per area

21area 0

B1X3

X1

X4A1area 2area 1

X1

X3X4 B2A2

Page 22: Link State Routing - École Polytechnique Fédérale de ...ica · Link State Routing Jean-Yves Le Boudec Fall 2009 1 ÉCOLE POLYTECHNIQUE FÉDÉRALE DE LAUSANNE. Contents 1. Link

Principles Routing method used in the higher level:

distance vectorno problem with loops - one backbone area

Mapping of higher level nodes to lower level nodesarea border routers (inter-area routers) belong to both areas

Inter-level routing informationsummary link state advertisements (LSA) from other areas are injected into the local topology databases

22

Page 23: Link State Routing - École Polytechnique Fédérale de ...ica · Link State Routing Jean-Yves Le Boudec Fall 2009 1 ÉCOLE POLYTECHNIQUE FÉDÉRALE DE LAUSANNE. Contents 1. Link

Example

Assume networks n1 and n2 become visible at time 0. Show the topology databases at all routers

solution

23

area 0

B1X4

X1

X3A1area 2area 1

X2

X6X5 B2A2

n1

n2

10

10

10

66

666

6

10

1010

Page 24: Link State Routing - École Polytechnique Fédérale de ...ica · Link State Routing Jean-Yves Le Boudec Fall 2009 1 ÉCOLE POLYTECHNIQUE FÉDÉRALE DE LAUSANNE. Contents 1. Link

HintsAll routers in area 2 propagate the existence of n1 and n2, directly attached to B1 (resp. B2). Draw the topology database in area 2.

Area border routers X4 and X6 belong to area 2, thus they can compute their distances to n1 and n2

Area border routers X4 and X6 inject their distances to n1 and n2 into the area 0 topology database (item 3 of the principle). The corresponding summary link state record is propagated to all routers of area 0. Draw now the topology database in area 0.

All routers in area 0 can now compute their distance to n1 and n2, using their distances to X4 and X6, and using the principle of distance vector (item 1 of the principle). Do the computation for X3 and X5.

Area border routers X3 and X5 inject their distances to n1 and n2 into the area 1 topology database (item 3 of the principle). Draw now the topology database in area 1.

24

Page 25: Link State Routing - École Polytechnique Fédérale de ...ica · Link State Routing Jean-Yves Le Boudec Fall 2009 1 ÉCOLE POLYTECHNIQUE FÉDÉRALE DE LAUSANNE. Contents 1. Link

CommentsDistance vector computation causes none of the RIP problems

strict hierarchy: no loop between areas

External and summary LSA for all reachable networks are present in all topology databases of all areas

most LSAs are externalcan be avoided in configuring some areas as terminal: use defaultentry to the backbone

Area partitions require specific supportpartition of non-backbone area is handled by having the area 0 topology database keep a map of all area connected components

partition of backbone cannot be repaired; it must be avoided; can be handled by backup virtual area 0 links through non backbone area

25

Page 26: Link State Routing - École Polytechnique Fédérale de ...ica · Link State Routing Jean-Yves Le Boudec Fall 2009 1 ÉCOLE POLYTECHNIQUE FÉDÉRALE DE LAUSANNE. Contents 1. Link

*Example of issue : partitioned backbone

No connectivity between areas via backbone There is a route through Area 2Virtual link

X4 and X6 configure a virtual link through Area 2

virtual link entered into the database, metric = sum of links

26

area 0

B1X4

X1

X3A1area 2area 1

X2

X6X5 B2A2

n1

n2

10

10

10

6∞

66∞

6

10

1010

Page 27: Link State Routing - École Polytechnique Fédérale de ...ica · Link State Routing Jean-Yves Le Boudec Fall 2009 1 ÉCOLE POLYTECHNIQUE FÉDÉRALE DE LAUSANNE. Contents 1. Link

3. The OSPF ProtocolOSPF (Open Shortest Path First)

IETF standard for internal routing

used in large networks (ISPs)

Link State protocol + Hierarchical

27

Page 28: Link State Routing - École Polytechnique Fédérale de ...ica · Link State Routing Jean-Yves Le Boudec Fall 2009 1 ÉCOLE POLYTECHNIQUE FÉDÉRALE DE LAUSANNE. Contents 1. Link

*OSPF Components

On top of IP (protocol type = 89)Multicast

224.0.0.5 - all routers of a link

224.0.0.6 - all designated and backup routers

Sub-protocolsHello to identify neighbors, elect a designated and a backup router

Database description to diffuse the topology between adjacent routers

Link State to request, update, and ack the information on a link (LSA - Link State Advertisement)

28

Page 29: Link State Routing - École Polytechnique Fédérale de ...ica · Link State Routing Jean-Yves Le Boudec Fall 2009 1 ÉCOLE POLYTECHNIQUE FÉDÉRALE DE LAUSANNE. Contents 1. Link

*TOS and metric

TOSmapping of 4 IP TOS bits to a decimal integer

0 - normal service

2 - minimize monetary cost

4 - maximize reliability

8 - maximize throughput

16 - minimize delay

Metrictime to send 100 Mb over the interface

C = 108/bandwidth

1 if greater than 100 Mb/s

can be configured by administrator

29

Page 30: Link State Routing - École Polytechnique Fédérale de ...ica · Link State Routing Jean-Yves Le Boudec Fall 2009 1 ÉCOLE POLYTECHNIQUE FÉDÉRALE DE LAUSANNE. Contents 1. Link

*OSPF - summary

OSPF vs. RIPmuch more complex, but presents many advantages

no count to infinityno limit on the number of hops (OSPF topologies limited by Network and Router LSA size (max 64KB) to O(5000) links)less signaling traffic (LS Update every 30 min)advanced metriclarge networks - hierarchical routing

most of the traffic when change in topologybut periodic Hello messagesin RIP: periodic routing information traffic

drawbackdifficult to configure

30

Page 31: Link State Routing - École Polytechnique Fédérale de ...ica · Link State Routing Jean-Yves Le Boudec Fall 2009 1 ÉCOLE POLYTECHNIQUE FÉDÉRALE DE LAUSANNE. Contents 1. Link

Solutions

31

Page 32: Link State Routing - École Polytechnique Fédérale de ...ica · Link State Routing Jean-Yves Le Boudec Fall 2009 1 ÉCOLE POLYTECHNIQUE FÉDÉRALE DE LAUSANNE. Contents 1. Link

Test Your Understanding

Q1: Run Dijkstra at CA: (final step)Q2: What are the routing tables at C

32

A

B

C

D

F

E

100

10

10

10

10

10

100 100

m(F)=10m(C)=0m(A)=10

m(F)=20m(D)=30m(B)=100

Page 33: Link State Routing - École Polytechnique Fédérale de ...ica · Link State Routing Jean-Yves Le Boudec Fall 2009 1 ÉCOLE POLYTECHNIQUE FÉDÉRALE DE LAUSANNE. Contents 1. Link

Test Your Understanding

Q2: What are the routing tables at CA:

33

net nextn1 directn2 An3 Bn4 directn5 directn6 Fn7 F

C

n1

A

B

n6

D E

n4

n3

C

n5n2

F

n7

back

Page 34: Link State Routing - École Polytechnique Fédérale de ...ica · Link State Routing Jean-Yves Le Boudec Fall 2009 1 ÉCOLE POLYTECHNIQUE FÉDÉRALE DE LAUSANNE. Contents 1. Link

Solution

34

area 0

B1X4

X1

X3A1area 2area 1

X2

X6X5 B2A2

n1

n2

10

10

10

66

666

6

n1

n2

area 2 topology database

area 0 topology database

n1, d=10n2, d=16

n1, d=16n2, d=10

n1, d=28n2, d=22

n1, d=22n2, d=16

10

1010

area 1 topology database

back