Beruflich Dokumente
Kultur Dokumente
What is Routing?
A famous quotation from RFC 791
A name indicates what we seek.
An address indicates where it is.
A route indicates how we get there.
-- Jon Postel
Withstand disruptions
Failures, maintenance, and load balancing
Limit packet loss and delay during changes
Modeling a Network
Modeled as a graph
Routers nodes
Link edges
Edge cost
delay
congestion level
2
A
B
2
1
D
5
F
1
E
Goal of Routing
Determine a good path through the network from source to
destination
Good means usually the shortest path
Host A
Host CA
N2
Host B
Host D
N1
E
C
N3
D
N5
E
C
N4
N6
HostEE
N7
INPUT
OUTPUT
Least cost paths from one node (source) to all other nodes
8
Notation
c(i,j): link cost from node i
to j; cost infinite if not
direct neighbors
2
A
B
2
1
D
C
3
5
F
1
E
Dijsktras 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) );
// new cost to v is either old cost to v or known
// shortest-path cost to w plus cost from w to v
13 until all nodes in S;
10
start S
A
5
3
2
A
2
1
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) = !;
11
start S
A
AD
5
2
A
B
2
C
3
5
F
1
E
8 Loop
9
find w not in S s.t. 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 until all nodes in S;
12
start S
A
AD
ADE
5
2
A
2
1
C
3
1
E
8 Loop
9
find w not in S s.t. 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 until all nodes in S;
13
start S
A
AD
ADE
ADEB
5
2
A
B
2
C
3
5
F
1
E
8 Loop
9
find w not in S s.t. 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 until all nodes in S;
14
start S
A
AD
ADE
ADEB
ADEBC
5
2
2
1
8 Loop
9
find w not in S s.t. 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 until all nodes in S;
15
start S
A
AD
ADE
ADEB
ADEBC
ADEBCF
5
2
B
2
C
3
5
F
1
E
8 Loop
9
find w not in S s.t. 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 until all nodes in S;
16
2
1
C
3
5
F
1
E
Destination
Link
(A,B)
(A,D)
(A,D)
(A,D)
(A,D)
Complexity
How much processing does running the Dijkstra
algorithm take?
Assume a network consisting of n nodes
Each iteration: need to check all nodes, w, not in S
n*(n+1)/2 comparisons: O(n2)
More efficient implementations possible: O(n*log(n))
18
Oscillations
Assume link cost = amount of carried traffic
1
2+e A
0
D 1+e 1 B
0
0
C
1+e
D 0 0 B
e
0
C
1
1
e
initially
recompute
routing
A
0
2+e
D
0 0 B
1
1+e
C
recompute
2+e A
0
D 1+e 1 B
e
0
C
recompute
(a)
X
C
(b)
A
B
(c)
X
D
A
B
(d)
D
20
10
Challenges
Packet loss
Out-of-order arrival
Solutions
Acknowledgments and retransmissions
Sequence numbers
21
Transient Disruptions
Detection delay
A node does not detect a failed link immediately
and forwards data packets into a blackhole
Depends on timeout for detecting lost hellos
5
2
A
B
2
C
3
5
F
1
E
22
11
Transient Disruptions
Inconsistent link-state database
Some routers know about failure before others
The shortest paths are no longer consistent
Can cause transient forwarding loops
B
A
F
D
C
F
23
Area 2
Area 1
area
border
router
Area 0
Area 3
Area 4
24
12
5 Minute Break
After the break : Distance Vector Routing
25
Routers update their idea of the best path using info from
neighbors
26
13
Bellman-Ford Algorithm
Named after Richard Bellman and Ford
INPUT
Link costs to each neighbor
OUTPUT
ieee.org
27
Bellman-Ford - Overview
Each router maintains a table
Each node:
Row for each possible destination
Column for each directly-attached
neighbor to node
wait for (change in local link
Entry in row Y and column Z of node X cost or msg from neighbor)
best known distance from X to Y,
via Z as next hop
28
14
D(A, V) = ;
loop:
8 wait (until A sees a link cost change to neighbor V
9
or until A receives update from neighbor V)
10 if (D(A,V) changes by d)
11
for all destinations Y through V do
12
D(A,Y) = D(A,Y) + d
13 else if (update D(V, Y) received from V)
/* shortest path from V to some Y has changed */
14 D(A,Y) = D(A,V) + D(V, Y);
15 if (there is a new minimum for destination Y)
16 send D(A, Y) to all neighbors
17 forever
29
B
7
3
1
D
1
D(A,C)
Node A
D(B,A)
Node B
Dest.
Cost
NextHop
if V adjacent to A
D(A, V) = c(A,V);
else
D(A, V) = ;
NextHop
C
30
15
3
1
Node B
Dest.
Cost
NextHop
D
1
Dest.
13 else if (update D(V, Y) received from V)
14 D(A,Y) = D(A,V) + D(V, Y);
A
15 if (there is a new min. for destination Y)
B
16 send D(A, Y) to all neighbors
17 forever
Node D
Cost NextHop
Cost NextHop
Dest.
31
B
7
3
1
D
1
Node B
Dest.
Cost
NextHop
Dest.
loop:
Node C
Dest.
Cost NextHop
Node D
Cost NextHop
C
32
16
3
1
Node B
Dest.
Cost
NextHop
Dest.
D
1
Node C
loop:
Cost NextHop
Node D
C
33
Message Order: C-->A, B-->A, A-->C, A-->B, C-->D, B-->C, B-->D, C-->B, D-->B, D-->C
Node A
B
7
3
1
D
1
Dest.
Cost
NextHop
loop:
Node D
Cost NextHop
3
Message Order: B-->A, C-->A, A-->C, A-->B, C-->D, B-->C, B-->D, C-->B, D-->B, D-->C 34
17
B
7
3
1
Node B
Dest.
Cost
NextHop
D
1
Node C
loop:
Dest.
Node D
Cost NextHop
3
algorithm terminates
35
Node B D C N
A 4 A
C 1 C
Node C D C N
A 5 B
B 1 B
1
4
D C N
A 1 A
C 1 C
D C N
A 1 A
C 1 C
D C N
A 1 A
C 1 C
D C N
A 5 B
B 1 B
D C N
A 2 B
B 1 B
D C N
A 2 B
B 1 B
50
time
Algorithm terminates
good
news
travels
fast
36
18
Node B D C N
D C N
D C N
D C N
A 4 A
A 6 C
A 6 C
A 8 C
C 1 C
C 1 C
C 1 C
C 1 C
Node C D C N
D C N
D C N
D C N
A 5 B
A 5 B
A 7 B
A 7 B
B 1 B
B 1 B
B 1 B
B 1 B
bad
news
travels
slowly
time
37
60
50
Node B D C N
D C N
D C N
D C N
D C N
A 4 A
A 60 A
A 60 A
A 51 C
A 51 C
C 1 B
C 1
C 1
C 1
C 1
Node C D C N
D C N
A 5 B
A 5 B
A 50
A 50 A
A 50 A
B 1 B
B 1 B
N
B
C
1
N
B
time
Algorithm terminates
38
19
Complexity/Convergence
LS: O(n2) computation
DV: convergence time varies
may be routing loops
count-to-infinity problem
DV:
node can advertise incorrect
path cost
each nodes table used by
others; error propagate
through network
39
Are we done?
No. We still have to take care of:
Scaling to Internet size
Routing policy issues
Next Lecture
Internet scale routing by Prof. Scott Shenker
40
20
Conclusions
Routing is a distributed algorithm
Different from forwarding
React to changes in the topology
Compute the shortest paths
Convergence process
Changing from one topology to another
Transient periods of inconsistency across routers
Backup Slides
To be covered if time permits
Refer to textbook for more information about these
topics
42
21
Configuration change
Link cost change
Periodically
Refresh the link-state information
Typically (say) 30 minutes
Corrects for possible corruption of the data
43
Convergence
Getting consistent routing information to all nodes
E.g., all nodes having the same link-state database
44
22
Convergence Delay
Time elapsed before every router has a consistent
picture of the network
Sources of convergence delay
Detection latency
Flooding of link-state information
Shortest-path computation
Creating the forwarding table
45
Faster flooding
Flooding immediately
Sending link-state packets with high-priority
Faster computation
Faster processors on the routers
Incremental Dijkstra algorithm
46
23
Performance trade-offs
Detection speed
Overhead on link bandwidth and CPU
Likelihood of false detection
47
24