28
EE 122: Intra-domain routing Ion Stoica September 30, 2002 (* this presentation is based on the on-line slides of J. Kurose & K. Rose)

EE 122: Intra-domain routing

  • Upload
    efia

  • View
    42

  • Download
    4

Embed Size (px)

DESCRIPTION

EE 122: Intra-domain routing. Ion Stoica September 30, 2002. (* this presentation is based on the on-line slides of J. Kurose & K. Rose). Internet Routing. Internet organized as a two level hierarchy First level – autonomous systems (AS’s) - PowerPoint PPT Presentation

Citation preview

Page 1: EE 122:  Intra-domain routing

EE 122: Intra-domain routing

Ion Stoica

September 30, 2002

(* this presentation is based on the on-line slides of J. Kurose & K. Rose)

Page 2: EE 122:  Intra-domain routing

[email protected] 2

Internet Routing

Internet organized as a two level hierarchy First level – autonomous systems (AS’s)

- AS – region of network under a single administrative domain

AS’s run an intra-domain routing protocols- Distance Vector, e.g., RIP

- Link State, e.g., OSPF

Between AS’s runs inter-domain routing protocols, e.g., Border Gateway Routing (BGP)

- De facto standard today, BGP-4

Page 3: EE 122:  Intra-domain routing

[email protected] 3

Example

AS-1

AS-2

AS-3

Interior router

BGP router

Page 4: EE 122:  Intra-domain routing

[email protected] 4

Intra-domain Routing Protocols

Based on unreliable datagram delivery Distance vector

- Routing Information Protocol (RIP), based on Bellman-Ford

- Each neighbor periodically exchange reachability information to its neighbors

- Minimal communication overhead, but it takes long to converge, i.e., in proportion to the maximum path length

Link state- Open Shortest Path First Protocol (OSPF), based on Dijkstra

- Each network periodically floods immediate reachability information to other routers

- Fast convergence, but high communication and computation overhead

Page 5: EE 122:  Intra-domain routing

[email protected] 5

Routing

Goal: determine a “good” path through the network from source to destination

- Good means usually the shortest path

Network modeled as a graph- Routers nodes

- Link edges

• Edge cost: delay, congestion level,…

A

ED

CB

F

2

2

13

1

1

2

53

5

Page 6: EE 122:  Intra-domain routing

[email protected] 6

A Link State Routing Algorithm

Dijkstra’s algorithm Net topology, link costs known

to all nodes

- Accomplished via “link state broadcast”

- All nodes have same info Compute least cost paths from

one node (‘source”) to all other nodes

Iterative: after k iterations, know least cost path to k closest destinations

Notations c(i,j): link cost from node i

to j; cost infinite if not direct neighbors

D(v): current value of cost of path from source to destination v

p(v): predecessor node along path from source to v, that is next to v

S: set of nodes whose least cost path definitively known

Page 7: EE 122:  Intra-domain routing

[email protected] 7

Dijsktra’s Algorithm

1 Initialization: 2 S = {A};3 for all nodes v 4 if v adjacent to A 5 then D(v) = c(A,v); 6 else D(v) = ;7 8 Loop 9 find w not in S such that D(w) is a minimum; 10 add w to S; 11 update D(v) for all v adjacent to w and not in S: 12 D(v) = min( D(v), D(w) + c(w,v) );13 // new cost to v is either old cost to v or known 14 // shortest path cost to w plus cost from w to v 15 until all nodes in S;

Page 8: EE 122:  Intra-domain routing

[email protected] 8

Example: Dijkstra’s Algorithm

Step012345

start SA

D(B),p(B)2,A

D(C),p(C)5,A

D(D),p(D)1,A

D(E),p(E) D(F),p(F)

A

ED

CB

F

2

2

13

1

1

2

53

5

Page 9: EE 122:  Intra-domain routing

[email protected] 9

Example: Dijkstra’s Algorithm

Step012345

start SA

AD

D(B),p(B)2,A

D(C),p(C)5,A4,D

D(D),p(D)1,A

D(E),p(E)

2,D

D(F),p(F)

A

ED

CB

F

2

2

13

1

1

2

53

5

Page 10: EE 122:  Intra-domain routing

[email protected] 10

Example: Dijkstra’s Algorithm

Step012345

start SA

ADADE

D(B),p(B)2,A

D(C),p(C)5,A4,D3,E

D(D),p(D)1,A

D(E),p(E)

2,D

D(F),p(F)

4,E

A

ED

CB

F

2

2

13

1

1

2

53

5

Page 11: EE 122:  Intra-domain routing

[email protected] 11

Example: Dijkstra’s Algorithm

Step012345

start SA

ADADE

ADEB

D(B),p(B)2,A

D(C),p(C)5,A4,D3,E

D(D),p(D)1,A

D(E),p(E)

2,D

D(F),p(F)

4,E

A

ED

CB

F

2

2

13

1

1

2

53

5

Page 12: EE 122:  Intra-domain routing

[email protected] 12

Example: Dijkstra’s Algorithm

Step012345

start SA

ADADE

ADEBADEBC

D(B),p(B)2,A

D(C),p(C)5,A4,D3,E

D(D),p(D)1,A

D(E),p(E)

2,D

D(F),p(F)

4,E

A

ED

CB

F

2

2

13

1

1

2

53

5

Page 13: EE 122:  Intra-domain routing

[email protected] 13

Example: Dijkstra’s Algorithm

Step012345

start SA

ADADE

ADEBADEBC

ADEBCF

D(B),p(B)2,A

D(C),p(C)5,A4,D3,E

D(D),p(D)1,A

D(E),p(E)

2,D

D(F),p(F)

4,E

A

ED

CB

F

2

2

13

1

1

2

53

5

Page 14: EE 122:  Intra-domain routing

[email protected] 14

Dijkstra’s Algorithm: Discussion

Algorithm complexity: n nodes- Each iteration: need to check all nodes, w, not in S

- n*(n+1)/2 comparisons: O(n**2)

- More efficient implementations possible: O(n*log(n))

Oscillation possible- E.g., link cost = amount of carried traffic

A

D

C

B

1 1+e

e0

e

1 1

0 0

initially

A

D

C

B2+e 0

001+e 1

… recomputerouting

A

D

C

B0 2+e

1+e10 0

… recompute

A

D

C

B2+e 0

e01+e 1

… recompute

Page 15: EE 122:  Intra-domain routing

[email protected] 15

Distance Vector Routing Algorithm

Iterative: continues until no nodes exchange info Asynchronous: nodes need not exchange info/iterate in lock

step! Distributed: each node communicates only with directly-

attached neighbors Routing (distance) table data structure – each router maintains

- Row for each possible destination

- Column for each directly-attached neighbor to node

- Entry in row Y and column Z of node X distance from X to Y, via Z as next hop

)},({min),(),( wZDZXcZYD Zw

X

Page 16: EE 122:  Intra-domain routing

[email protected] 16

Example: Distance (Routing) Table

A

E D

CB6

8

1

2

1

2

D ()

A

B

C

D

A

1

7

6

4

B

14

8

9

11

D

5

5

4

2

Ecost to destination via

dest

inat

ion

D (C,D)E

c(E,D) + min {D (C,w)}D

w== 2+2 = 4

D (A,D)E

c(E,D) + min {D (A,w)}D

w== 2+3 = 5

D (A,B)E

c(E,B) + min {D (A,w)}B

w== 8+6 = 14

loop!

loop!

Page 17: EE 122:  Intra-domain routing

[email protected] 17

Routing Table Forwarding Table

D ()

A

B

C

D

A

1

7

6

4

B

14

8

9

11

D

5

5

4

2

Ecost to destination via

dest

inat

ion

A

B

C

D

A,1

D,5

D,4

D,2

Outgoing link to use, cost

dest

inat

ion

Distance (routing) table Forwarding table

Page 18: EE 122:  Intra-domain routing

[email protected] 18

Distance Vector Routing: Overview

Each local iteration caused by: - Local link cost change

- Message from neighbor: its least cost path change from neighbor

Each node notifies neighbors only when its least cost path to any destination changes

- Neighbors then notify their neighbors if necessary

wait for (change in local link cost of msg from neighbor)

recompute distance table

if least cost path to any dest

has changed, notify neighbors

Each node:

Page 19: EE 122:  Intra-domain routing

[email protected] 19

Distance Vector Algorithm

1 Initialization: 2 for all adjacent nodes v: 3 D (*,v) = /* the * operator means "for all rows" */ 4 D (v,v) = c(X,v) 5 for all destinations, y 6 send min D (y,w) to each neighbor /* w over all X's neighbors */

XX

Xw

At all nodes, X:

Page 20: EE 122:  Intra-domain routing

[email protected] 20

Distance Vector Algorithm (cont’d)

8 loop 9 wait (until I see a link cost change to neighbor V 10 or until I receive update from neighbor V) 11 12 if (c(X,V) changes by d) 13 /* change cost to all dest's via neighbor v by d */ 14 /* note: d could be positive or negative */ 15 for all destinations y: D (y,V) = D (y,V) + d 16 17 else if (update received from V wrt destination Y) 18 /* shortest path from V to some Y has changed */ 19 /* V has sent a new value for its min D (Y,w) */ 20 /* call this received new value is "newval" */ 21 for the single destination y: D (Y,V) = c(X,V) + newval 22 23 if we have a new min D (Y,w) for any destination Y 24 send new value of min D (Y,w) to all neighbors 25 26 forever

w

XX

XX

X

ww

V

Page 21: EE 122:  Intra-domain routing

[email protected] 21

Example: Distance Vector Algorithm

X Z

12

7

Y

Page 22: EE 122:  Intra-domain routing

[email protected] 22

Example: Distance Vector Algorithm

X Z

12

7

Y

D (Y,Z)X

c(X,Z) + min {D (Y,w)}w=

= 7+1 = 8

Z

D (Z,Y)X

c(X,Y) + min {D (Z,w)}w=

= 2+1 = 3

Y

Page 23: EE 122:  Intra-domain routing

[email protected] 23

Example: Distance Vector Algorithm

X Z

12

7

Y

Page 24: EE 122:  Intra-domain routing

[email protected] 24

Example: Distance Vector Algorithm

X Z

12

7

Y

Page 25: EE 122:  Intra-domain routing

[email protected] 25

Distance Vector: Link Cost Changes

X Z

14

50

Y1

algorithmterminates“good

news travelsfast”

Link cost changes:- Node detects local link cost change

- Updates distance table (line 15)

- If cost change in least cost path, notify neighbors (lines 23,24)

Page 26: EE 122:  Intra-domain routing

[email protected] 26

Distance Vector: Link Cost Changes

X Z

14

50

Y60

algorithmcontinues

on!

Link cost changes- Good news travels fast

- Bad news travels slow - “count to infinity” problem!

Page 27: EE 122:  Intra-domain routing

[email protected] 27

Distance Vector: Poisoned Reverse

X Z

14

50

Y60

algorithmterminates

If Z routes through Y to get to X:- Z tells Y its (Z’s) distance to X is infinite

(so Y won’t route to X via Z)

- Will this completely solve count to infinity problem?

Page 28: EE 122:  Intra-domain routing

[email protected] 28

Link State vs. Distance Vector

Per node message complexity LS: O(n*e) messages; n –

number of nodes; e – number of edges

DV: O(d) messages; where d is node’s degree

Complexity LS: O(n**2) with O(n*e)

messages DV: convergence time varies

- may be routing loops

- count-to-infinity problem

Robustness: what happens if router malfunctions?

LS: - node can advertise incorrect

link cost

- each node computes only its own table

DV:- DV node can advertise

incorrect path cost

- each node’s table used by others; error propagate through network