Title: EE 122: Intradomain routing
1EE 122 Intra-domain routing
- Ion Stoica
- September 30, 2002
( this presentation is based on the on-line
slides of J. Kurose K. Rose)
2Internet Routing
- Internet organized as a two level hierarchy
- First level autonomous systems (ASs)
- AS region of network under a single
administrative domain - ASs run an intra-domain routing protocols
- Distance Vector, e.g., RIP
- Link State, e.g., OSPF
- Between ASs runs inter-domain routing protocols,
e.g., Border Gateway Routing (BGP) - De facto standard today, BGP-4
3Example
Interior router
BGP router
AS-1
AS-3
AS-2
4Intra-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
5Routing
- 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,
6A Link State Routing Algorithm
- Dijkstras 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
7Dijsktras 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
8Example Dijkstras Algorithm
D(B),p(B) 2,A
D(D),p(D) 1,A
Step 0 1 2 3 4 5
D(C),p(C) 5,A
D(E),p(E)
start S A
D(F),p(F)
5
3
5
2
2
1
3
1
2
1
9Example Dijkstras Algorithm
D(B),p(B) 2,A
D(D),p(D) 1,A
Step 0 1 2 3 4 5
D(C),p(C) 5,A 4,D
D(E),p(E) 2,D
start S A AD
D(F),p(F)
5
3
5
2
2
1
3
1
2
1
10Example Dijkstras Algorithm
D(B),p(B) 2,A
D(D),p(D) 1,A
Step 0 1 2 3 4 5
D(C),p(C) 5,A 4,D 3,E
D(E),p(E) 2,D
start S A AD ADE
D(F),p(F) 4,E
5
3
5
2
2
1
3
1
2
1
11Example Dijkstras Algorithm
D(B),p(B) 2,A
D(D),p(D) 1,A
Step 0 1 2 3 4 5
D(C),p(C) 5,A 4,D 3,E
D(E),p(E) 2,D
start S A AD ADE ADEB
D(F),p(F) 4,E
5
3
5
2
2
1
3
1
2
1
12Example Dijkstras Algorithm
D(B),p(B) 2,A
D(D),p(D) 1,A
Step 0 1 2 3 4 5
D(C),p(C) 5,A 4,D 3,E
D(E),p(E) 2,D
start S A AD ADE ADEB ADEBC
D(F),p(F) 4,E
5
3
5
2
2
1
3
1
2
1
13Example Dijkstras Algorithm
D(B),p(B) 2,A
D(D),p(D) 1,A
Step 0 1 2 3 4 5
D(C),p(C) 5,A 4,D 3,E
D(E),p(E) 2,D
start S A AD ADE ADEB ADEBC ADEBCF
D(F),p(F) 4,E
5
3
5
2
2
1
3
1
2
1
14Dijkstras Algorithm Discussion
- Algorithm complexity n nodes
- Each iteration need to check all nodes, w, not
in S - n(n1)/2 comparisons O(n2)
- More efficient implementations possible
O(nlog(n)) - Oscillation possible
- E.g., link cost amount of carried traffic
1
1e
0
0
e
0
1
1
e
initially
15Distance 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
16Example Distance (Routing) Table
1
6
2
8
1
E
2
loop!
loop!
17Routing Table ? Forwarding Table
Outgoing link to use, cost
A B C D
A,1 D,5 D,4 D,2
destination
Forwarding table
Distance (routing) table
18Distance Vector Routing Overview
Each node
- 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
19Distance Vector Algorithm
At all nodes, X
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 /
X
X
X
w
20Distance Vector Algorithm (contd)
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
X
X
V
w
X
X
w
X
w
21Example Distance Vector Algorithm
22Example Distance Vector Algorithm
23Example Distance Vector Algorithm
24Example Distance Vector Algorithm
25Distance Vector Link Cost Changes
- 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)
algorithm terminates
good news travels fast
26Distance Vector Link Cost Changes
- Link cost changes
- Good news travels fast
- Bad news travels slow - count to infinity
problem!
algorithm continues on!
27Distance Vector Poisoned Reverse
- If Z routes through Y to get to X
- Z tells Y its (Zs) distance to X is infinite (so
Y wont route to X via Z) - Will this completely solve count to infinity
problem?
algorithm terminates
28Link State vs. Distance Vector
- Per node message complexity
- LS O(ne) messages n number of nodes e
number of edges - DV O(d) messages where d is nodes degree
- Complexity
- LS O(n2) with O(ne) 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 nodes table used by others error propagate
through network