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

Post on 22-Dec-2015

217 Views

Category:

Documents

2 Downloads

Preview:

Click to see full reader

Transcript

EE 122: Intra-domain routing

Ion Stoica

September 30, 2002

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

istoica@cs.berkeley.edu 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

istoica@cs.berkeley.edu 3

Example

AS-1

AS-2

AS-3

Interior router

BGP router

istoica@cs.berkeley.edu 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

istoica@cs.berkeley.edu 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

istoica@cs.berkeley.edu 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

istoica@cs.berkeley.edu 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;

istoica@cs.berkeley.edu 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

istoica@cs.berkeley.edu 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

istoica@cs.berkeley.edu 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

istoica@cs.berkeley.edu 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

istoica@cs.berkeley.edu 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

istoica@cs.berkeley.edu 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

istoica@cs.berkeley.edu 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

istoica@cs.berkeley.edu 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

istoica@cs.berkeley.edu 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!

istoica@cs.berkeley.edu 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

istoica@cs.berkeley.edu 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:

istoica@cs.berkeley.edu 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:

istoica@cs.berkeley.edu 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

istoica@cs.berkeley.edu 21

Example: Distance Vector Algorithm

X Z

12

7

Y

istoica@cs.berkeley.edu 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

istoica@cs.berkeley.edu 23

Example: Distance Vector Algorithm

X Z

12

7

Y

istoica@cs.berkeley.edu 24

Example: Distance Vector Algorithm

X Z

12

7

Y

istoica@cs.berkeley.edu 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)

istoica@cs.berkeley.edu 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!

istoica@cs.berkeley.edu 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?

istoica@cs.berkeley.edu 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

top related