routing and forwarding - polito

62
© see page 2 Routing - 1 ROUTING AND FORWARDING Mario Baldi www.baldi.info

Upload: others

Post on 22-Feb-2022

16 views

Category:

Documents


0 download

TRANSCRIPT

© see page 2Routing - 1

ROUTINGAND FORWARDING

Mario Baldiwww.baldi.info

© see page 2Routing - 2

Copyright NoticeCopyright NoticeThis set of transparencies, hereinafter referred to as slides, isprotected by copyright laws and provisions of InternationalTreaties. The title and copyright regarding the slides (including,but not limited to, each and every image, photography, animation,video, audio, music and text) are property of the authors specifiedon page 1.The slides may be reproduced and used freely by research institutes,schools and Universities for non-profit, institutional purposes. Insuch cases, no authorization is requested.Any total or partial use or reproduction (including, but not limitedto, reproduction on magnetic media, computer networks, and printedreproduction) is forbidden, unless explicitly authorized by theauthors by means of written license.Information included in these slides is deemed as accurate at thedate of publication. Such information is supplied for merelyeducational purposes and may not be used in designing systems,products, networks, etc. In any case, these slides are subject tochanges without any previous notice. The authors do not assume anyresponsibility for the contents of these slides (including, but notlimited to, accuracy, completeness, enforceability, updated-ness ofinformation hereinafter provided).In any case, accordance with information hereinafter included mustnot be declared.In any case, this copyright notice must never be removed and must bereported even in partial uses.

© see page 2Routing - 3

Routing

Determine a paththrough the network

for packets

© see page 2Routing - 4

Advance packets throughthe network

Includes a routingdecision

Forwarding

© see page 2Routing - 5

Forwardingand Routing

A

C

B

D

FEF

B,D

C,D

,FC

,A,B

,D

E,A,B

B,D

A,B

F

A,C,E,F

A,B

C,D

,F

A,C,E,F1. Routing(proactive)

B

B B

2. Forwarding(on‐the‐flyrouting)

© see page 2Routing - 6

Proactive Routing

Independent of actualtraffic

Determine reachabledestinations

Compute best route Commonly referred

to as “routing”

© see page 2Routing - 7

On-the-fly Routing

Realized when handlingeach packet

Based on local informationRouting/forwarding tableOutput of proactiverouting or signaling

A.k.a. route

© see page 2Routing - 8

On-the-fly Routing Algorithms

Routing by Network Address Label Swapping Source Routing

Each protocol architectureadopts one or more

© see page 2Routing - 9

Forwarding Phases

Routing (on-the-fly) Output port selection Possibly next-hopselection

Switching: transferto output port

Transmission

© see page 2Routing - 10

A Proactive Routing Algorithm Classification

Non-adaptive algorithms(static)

Adaptive algorithms(dynamic)

© see page 2Routing - 11

NON-ADAPTIVE ROUTING

© see page 2Routing - 12

Non-adaptiveAlgorithms

Fixed Directory routing AKA static routing Manual configuration

(Selective) floodingand derivates

© see page 2Routing - 13

FixedDirectoryRouting

B C DA

RoutingTable of BA,E C,D 

RoutingTable of A

B,D E,C ↓

RoutingTable of DA,B,C,E 

RoutingTable of CA,B D E ↓

ERoutingTable of EA,B C,D 

© see page 2Routing - 14

Pros and Cons

Administratorhas full control

Error prone It does not adapt

to topology changes

© see page 2Routing - 15

BackupRoute LoadBalancing

B C DA

RoutingTable of BA,E,C,DC,D,E,A

RoutingTable of BA,E,C,DC,D,E,A

RoutingTable of A

B,D,C,EE,C,B,D ↓

RoutingTable of A

B,D,C,EE,C,B,D ↓

RoutingTable of DA,B,C,E 

RoutingTable of DA,B,C,E 

RoutingTable of CA,B D 

E,A,B ↓

RoutingTable of CA,B D 

E,A,B ↓

ERoutingTable of EA,B C,D,B

RoutingTable of EA,B C,D,B

© see page 2Routing - 16

Static vs. Dynamic

CoreDynamicrouting

EdgeStatic routing

The only way to the

rest of network

Small routing tables

Multiple alternative routes

© see page 2Routing - 17

DYNAMICROUTING

© see page 2Routing - 18

Adaptive Algorithms

Centralized Routing Isolated Routing Distributed Routing Distance Vector Link State

© see page 2Routing - 19

Centralized Routing

Routing Control Center(RCC)

Calculates and distributesrouting tables

Needs informationfrom all nodes

© see page 2Routing - 20

Centralized Routing

Optimizes performance

Simplifies troubleshooting

Significant network loadin proximity of RCC

© see page 2Routing - 21

Centralized Routing

RCC is single pointof failure

RCC is bottleneck

Not suitable for highlydynamic networks

© see page 2Routing - 22

Isolated Routing

Each node decidesindependently

No exchange of information E.g., Backward Learning IEEE 8O2.1D bridges

© see page 2Routing - 23

Distributed Routing

Routers co-operatein exchanging connectivity information

Each router decides independently, but coherently

Combines advantages of isolated and centralized

routing

© see page 2Routing - 24

DISTANCEVECTOR ROUTING

ALGORITHM

© see page 2Routing - 25

Basic Principle

A

C

FE

2. A at dist 0and E at 1(from A1)

2. F at 0 andE at 1 (from

F1)

A1

F1

4. C at 0, A at 1(from C1), F at 1

(from C2), and E at 2 (from C1 and C2,

same dist)C1

C21. E at dist

0

3. A at 0 andE at 1

3. F at 0 andE at 1

© see page 2Routing - 26

Distance Vector

List of reachabledestinations (all!)

Distance from announcingrouter

Generated by each router Received from neighbors

© see page 2Routing - 27

Sample Scenario

A B

ED

Loc (A)A, 0

DV (B)A, 1B, 0C, 1D, 1E, 1

DV (D)A, 1B, 1C, 2D, 0E, 1

Routing informationstored by A

C

© see page 2Routing - 28

Distance VectorMergingand Generation

A B

ED

Loc (A) DV (B) DV (D)

A1

ROUT. TABLE (A)

A, 1B, 0

C, A1, 2C, 1D, 1

B, 1C, 2D, 0

A, 0B, A1, 1

CA2

E, 1 E, 1

A, 1 A, local, 0

D, A2, 1E, A2, 2

DV (A)

A, 0B, 1C, 2D, 1E, 2

Received from line A1Received from line A2

© see page 2Routing - 29

A B

ED

C

Loc (A) DV (B) DV (D) ROUT. TABLE (A)

A, 1B, 0C, 1D, 1

B, 1C, 2D, 0

A, 0

E, 1 E, 1

A, 1 A, local, 0

D, A2, 1E, A2, 2

DV (A)

A, 0B, 2C, 3D, 1E, 2

B, A2, 2C, A2, 3

Topology ChangeA1

A2

© see page 2Routing - 30

Example: Cold Start

A B

ED

A1

CA2

B1B2

B4

B3C1

C2E1

E2

E3

D1

D3D2

RT (A)A,loc,0

RT (B)B,loc,0

RT (C)C,loc,0

A sends its DV

B and D send their DVs

RT (D)D,loc,0

RT (E)E,loc,0

RT (A)A,loc,0

RT (B)A,B1, 1B,loc,0

RT (D)A,D1, 1D,loc,0

RT (C)C,loc,0

RT (E)E,loc,0

RT (A)A,loc,0B,A1, 1D,A2, 1

RT (B)A,B1, 1B,loc,0D,B2, 1

RT (D)A,D1, 1B,D2, 1D,loc,0

RT (C)A,C1 ,2B,C1 ,1C,loc,0

RT (E)A,E2, 2B,E2, 1D,E1, 1E,loc,0

All send their DVs. . .

RT (A)A,loc,0B,A1, 1C,A1, 2D,A2, 1E,A2, 2

RT (B)A,B1, 1B,loc,0C,B4, 1D,B2, 1E,B3, 1

RT (D)A,D1, 1B,D2, 1C,D2, 2D,loc,0E,D3, 1

RT (C)A,C1 ,2B,C1 ,1C,loc,0D,C2, 2E,C2, 1

RT (E)A,E2, 2B,E2, 1C,E3, 1D,E1, 1E,loc,0

© see page 2Routing - 31

Issues

Several problems Black Hole Count to infinity Bouncing Effect (loop)

Instability

© see page 2Routing - 32

Count to InfinityA BA1 CB1 B2 C1

Loc (B)B, 0

DV (A)A, 0B, 1C, 2

DV (C)A, 2B, 1C, 0

IS B:Loc (C)C, 0

DV (B)A, 1B, 0C, 1

RT (B)A,B2 ,3B,loc,0C,B2 ,1

RT (C)A,C1 ,2B,C1 ,1C,loc,0

RT (C)A,C1 ,4B,C1 ,1C,loc,0

RT (B)A,B2 ,5B,loc,0C,B2 ,1

Loc (C)C, 0

DV (B)A, 3B, 0C, 1

B sends DV

Loc (B)B, 0

DV (C)A, 4B, 1C, 0

C sends DV

Count to Infinity!

IS C:

© see page 2Routing - 33

Bouncing Effect

A BA1 CB1 B2 C1

Loc (B)B, 0

DV (A)A, 0B, 1C, 2

DV (C)A, 2B, 1C, 0

IS B:Loc (C)C, 0

DV (B)A, 1B, 0C, 1

RT (B)A,B2 ,3B,loc,0C,B2 ,1

RT (C)A,C1 ,2B,C1 ,1C,loc,0

RT (C)A,C1 ,4B,C1 ,1C,loc,0

Loc (C)C, 0

DV (B)A, 3B, 0C, 1

B sends its DV

IS C:

© see page 2Routing - 34

Issues

Partial solutions Split Horizon Path Hold Down Route Poisoning

© see page 2Routing - 35

Split Horizon“If C reaches destination A through B, it is useless for B trying to reach A

through C”

A BA1 CB1 B2 C1

Loc (B)B, 0

DV (A)A, 0

DV (C)C, 0D, 1

IS B:RT (B)B,loc,0C,B2 ,1D,B2, 2

DC2 D1

DV (CC1)C, 0D, 1

DV (CC2)A, 2B, 1C, 0

© see page 2Routing - 36

Split Horizon Prevents loops between twonodes

Speeds up convergence “Personalized” DVs toneighbors DV of C to B does not

contain destinationsreached through B

In actual implementations,route has to expire

© see page 2Routing - 37

Split Horizon on Mesh

A B

CD

A1 B1

B2C1

C2

D1B3

D2

Loc (B)B, 0

DV (A)A, 0

DV (C)C, 0D, 1

IS B:RT (B)B,loc,0C,B2 ,1D,B3, 1

DV (D)C, 1D, 0

RT (D)A,D1, 2B,D1, 1C,D2, 1D,loc,0

Loc (D)D, 0

DV (B)A, 1B, 0C, 1

IS D:DV (C)A, 2B, 1C, 0

RT (C)A,C1, 2B,C1, 1C,loc,0D,C2, 1

Loc (C)C, 0

DV (B)A, 1B, 0D, 1

IS C:DV (D)A, 2B, 1D, 0

RT (C)A,C2, 3B,C1, 1C,loc,0D,C2, 1

RT (D)A,D2, 3B,D1, 1C,D2, 1D,loc,0

Loc (C)C, 0

DV (B)B, 0D, 1

IS C:DV (D)A, 2B, 1D, 0

Loc (D)D, 0

DV (B)B, 0C, 1

IS D:DV (C)A, 2B, 1C, 0

B sends its DV

© see page 2Routing - 38

B2C1

Split Horizon on Mesh

A B

CD

A1 B1

C2

D1B3

D2

Loc (B)B, 0

DV (C)A, 3C, 0D, 1

IS B:DV (D)A, 3C, 1D, 0

Loc (C)C, 0

DV (B)B, 0D, 1

IS C:DV (D)B, 1D, 0

Loc (D)D, 0

DV (B)B, 0C, 1

IS D:DV (C)B, 1C, 0

RT (C)A,C2, 3B,C1, 1C,loc,0D,C2, 1

Loc (C)C, 0

DV (B)B, 0D, 1

IS C:DV (D)A, 2B, 1D, 0

RT (D)A,D2, 3B,D1, 1C,D2, 1D,loc,0

Loc (D)D, 0

DV (B)B, 0C, 1

IS D:DV (C)A, 2B, 1C, 0

RT (B)A,B3, 4B,loc,0C,B2 ,1D,B3, 1

RT (C)B,C1, 1C,loc,0D,C2, 1

RT (D)B,D1, 1C,D2, 1D,loc,0

(from the previous slide)

C and D send their DVs

© see page 2Routing - 39

Path Hold DownIf link L fails, all destinations reachable through link L are

considered unreachable for a certain period of timeI.e., no routes to them are

computedA BA1 CB1 B2 C1

Loc (B)B, 0

DV (A)A, 0B, 1C, 2D, 3

DV (C)A, 2B, 1C, 0D, 1

IS B:RT (B)B,loc,0C,B2 ,1D,B2, 2

DC2 D1

Quarantine!Loc (C)C, 0

DV (B)B, 0C, 1D, 2

DV (D)A, 3B, 2C, 1D, 0

IS C:RT (C)A,C2, 4B,C1, 1C,loc,0D,C2, 1

Count to Infinity!

© see page 2Routing - 40

Path Hold Down High convergence time forthe examined node (evenwith an alternative path)

The router that noted thefault may not participateto any loop at least untilthe timeout of Hold Downtimer

© see page 2Routing - 41

React on Cost IncreaseRouting loops happen when

routes have increasing costs

Cost-increasing routes inDVs are not used Two subsequent

advertisements show a costincrease

Possibly with Path Hold Down Might block routes with

legitimate cost increase

© see page 2Routing - 42

Route PoisoningAn invalid route is

advertised at infinite distance

Instead of just omitting it It would have to expire Faster convergence time E.g., when link fails orcost increases

It can substitute orcomplement Path Hold Down

© see page 2Routing - 43

Split Horizon with Poisonous Reverse More aggressive No theoretical advantages Practically, no need towait for route expiration

A BA1 CB1 B2 C1

Loc (B)B, 0

DV (A)A, 0B, infC, infD, inf

DV (C)A, infB, infC, 0D, 1

IS B:RT (B)B,loc,0C,B2 ,1D,B2, 2

DC2 D1

DV (CC1)A, infB, infC, 0D, 1

DV (CC2)A, 2B, 1C, 0

D, inf

© see page 2Routing - 44

The Bottom LineRouters do not knowthe network topology

Based on distance vectorsB cannot distinguish

A B C

A B C

© see page 2Routing - 45

Advantages

Simple to implement Protocols simple to deploy Very little

configuration

© see page 2Routing - 46

Shortcomings

Exponential worst casecomplexity and convergencetime O(n2) to O(n3)

© see page 2Routing - 47

Shortcomings

Convergence limitedby slower linksand routers set pace

Complex tuning

© see page 2Routing - 48

Shortcomings

Complex troubleshooting Large routing traffic

(and storage)

Not suitable for large complex networks

© see page 2Routing - 49

Path VectorEliminates routing loops

IS A:

A BA1 CB1 B2 C1 DC2 D1

Loc (A)A, 0

PV (B)A, 1, [B]B, 0, [-]C, 1, [B]D, 2, [B,C]

PV (C)A, 1 [C]B, 1, [B]C, 0, [-]D, 1, [D]

RT (A)A, loc, 0B, A1, 1C, A2, 1D, A2, 2

PV (A)A, 0, [-]B, 1, [A]C, 1, [A]D, 2, [A,C]

A2

© see page 2Routing - 50

LINK STATE ROUTING ALGORITHM

© see page 2Routing - 51

Basic PrinciplesA

C

FE

1. I, nodeE, connectto A and F

2. I, node A,connect to E

and C

3. I, node F,connect to E and 

C

E F

A

E

C

F

A

E

C

F

A

© see page 2Routing - 52

Basic Principles

Information on the stateof each link Link state

A local map Sent by each node

to all other nodes Selective flooding

© see page 2Routing - 53

Basic Principles

Nodes build a network map The same on all nodes

Each node computes routeson the map Dijkstra (shortest pathfirst) algorithm

© see page 2Routing - 54

Link State DatabaseA B

ED

LS (A)B, 1D, 1

LS (B)A, 1C, 1D, 1E, 1

LS (D)A, 1B, 1E, 1

Stored by each router

C

LS (C)B, 1E, 1

LS (E)B, 1C, 1D, 1

© see page 2Routing - 55

Dijkstra Algorithm

Low complexity

L log (N)L: number of linksN: number of nodes

Shortest Path First

© see page 2Routing - 56

Shortest Path First The next node “nearest” tothe root is identified

Its path is inserted intothe routing table

© see page 2Routing - 57

ExampleBA

C D

E

2

1 3

3

2

3

root PATHTEMP

F

2

2)BA

C D

E F

3)BA

C D

E F

4)BA

C D

E F

5)BA

C D

E F

6)BA

C D

E F

BA

C D

E F

7)BA

C D

E F

8)BA

C D

E F

9)BA

C D

E F

10)

1)

© see page 2Routing - 58

Rapid Convergence

LSs spread quickly No intermediateprocessing

© see page 2Routing - 59

Limited Routing Traffic and Storage

Link states are small Fast and efficientneighbor greeting

© see page 2Routing - 60

Other Advantages

It rarely generates loops Simple to understandand troubleshoot All nodes haveidentical databases

© see page 2Routing - 61

Shortcoming

High implementationcomplexity Selective flooding First implementationtook several years

Protocols with complexconfiguration

© see page 2Routing - 62

Link State GenerationIn principle: when thereis a topology change

Actual protocols: LS aregenerated periodicallyIncreased reliability