Documente Academic
Documente Profesional
Documente Cultură
Chapter 5 Routing
Text: Walrand & Parakh, 2010
Steven Low
CMS, EE, Caltech
Warning
These notes are not self-contained,
probably not understandable,
unless you also were in the lecture
Lecture outline
Inter-domain routing
BGP
Intra-domain routing
Shortest path algortihms
Coding
FEC, network coding
What is routing?
Choose red or blue.
Internet
How to route?
Two layers of routing:
1. Choose which AS?
- BGP
2. How to route inside an AS?
- OSPF
Internet
A
Simplify routing
Choose AS: ignore details inside AS
Inside AS: only details inside AS
A typical configuration
Example
BGP policy at Berkeley:
1. If possible, avoid AT&T
2. Choose path with smallest #hops
3. Alphabetical
Berkeley decision:
use path Sprint-Verizon-MIT to reach MIT
(MIT, Verizon---MIT)
AT&T
(MIT, AT&T---MIT)
Sprint
(MIT, NA)
Berkeley
(MIT, NA)
(MIT, Verizon---MIT)
(MIT, Verizon---AT&T---MIT)
AT&T
(MIT, AT&T---MIT)
(MIT, AT&T---Verizon---MIT)
Sprint
(MIT, Sprint---Verizon---MIT)
(MIT, Sprint---AT&T---MIT)
Berkeley
(MIT, Berkeley---AT&T---MIT)
(MIT, Verizon---MIT)
AT&T
(MIT, AT&T---MIT)
Sprint
(MIT, Sprint---Verizon---MIT)
Berkeley
Example
BGP policy to reach D:
1. Prefer 2-hop path to 1-hop
2. Avoid 3-hop paths
Oscillation:
Every node will alternate between choosing an 1hop path and 2-hop path
Some questions
Q1: Why not 3-level, or N-level, routing?
Q2: How can a source ensure that its
packets follow the inter-domain path it
wants?
Q3: In BGP, can one prevent a domain
from lying and funneling all traffic
through itself in order eavesdrop?
Lecture outline
Inter-domain routing
BGP
Intra-domain routing
Shortest path algortihms
Coding
FEC, network coding
Shortest-path algorithm
Input: graph G (V , E ),
link costs dij (d ij if (i, j ) E)
Execution: algorithm run at each node
Output:
Dijkstra: shortest-path tree rooted at the node
Bellman-Ford: next hop to all destinations from the node
(entries in forwarding table)
Notation:
D (i ) : min cost to reach node i from x
x
predx(i) : parent node of i (for Dijkstra)
nextx(i) : next hop to i from x (for Bellman-Ford)
Dijkstra algorithm
Init: Dx (i ) d xi , Dx ( x) 0, R {x}, predx(i) = null
Each node x sends dxi to all other nodes i
while R V do
*
i
Dx (i )
{ arg min
iR
R R {i * }
*
j
N
(
i
)\R
for all
{ if Dx ( j ) Dx (i * ) d i* j then
Dx ( j ) Dx (i * ) d i* j
pred(j) =
}if
}for
}while
i*
Dijkstra algorithm
Init: Dx (i ) d xi , Dx ( x) 0, R {x}, predx(i) = null
Each node x sends dxi to all other nodes i
while R V do
*
i
Dx (i )
{ arg min
iR
R R {i * }
*
j
N
(
i
)\R
for all
{ if Dx ( j ) Dx (i * ) d i* j then
Dx ( j ) Dx (i * ) d i* j
pred(j) =
}if
}for
}while
i*
Dijkstra algorithm
Bellman-Ford algorithm
Init: Dx (i ) d xi , Dx ( x) 0, R {x}, predx(i) = null
{
for all destination nodes i
{
Dx (i) : min dxj Dj (i)
jN( x)
nextx(i) =
}for
}
until no change
Bellman-Ford algorithm
Consider the calculations at all nodes
to reach node D
Every node has access to distance
estimates from neighbors to D
Assume synchronous operation
iteration
DA(D)
nextA(D)
DB(D)
nextB(D)
Inf
Inf
Inf
3
4
DC(D)
nextC(D)
DE(D)
nextE(D)
DF(D)
nextF(D)
Inf
Speed of convergence
Disjstra: above implementation takes O(|V|2); can be
reduced using heap
BF: can converge slowly and have routing loops during
transient; count-to-infinity problem (can be solved using
poisoned reverse)
No clear winner
Both are used on Internet
RIP: distance-vector protocol
OSPF: link-state protocol (meant to be successor to RIP)
Count-to-infinity problem
Example
Link between B & C fails
A and B will not realize it, a routing route is created and their cost
estimate to C keeps going up
A solution: poisoned reverse: instead of telling B its true cost (2)
to reach C, A tells B that its cost to reach C is infinity because A
uses B to reach C.
Lecture outline
Inter-domain routing
BGP
Intra-domain routing
Shortest path algortihms
Coding
FEC, network coding
Header of
Ck
Ck
FEC: example
: received pkt
C C1,C3,C5,C6
C1 P1
C3 P1 P2 P3
C5 P4
C3 C3 C1 P2 P3
C C3,C5, C6
P P1
C6 P3 P4
FEC: example
: received pkt
Decoding:
C C1,C3,C5,C6
C1 P1
C3 P1 P2 P3
C5 P4
C3 C3 C1 P2 P3
C C3,C5, C6
P P1
C6 P3 P4
FEC: example
: received pkt
Decoding:
C C1,C3,C5,C6
C1 P1
C3 P1 P2 P3
C5 P4
C3 C3 C1 P2 P3
C C3,C5, C6
P P1
C6 P3 P4
FEC: example
: received pkt
Decoding:
C C3,C5,C6
C3 P2 P3
P P1
C5 P4
C6 P3 P4
C6 C6 C5 P3
C C3,C6
P P1, P4
FEC: example
: received pkt
Decoding:
C C3,C5,C6
C3 P2 P3
P P1
C5 P4
C6 P3 P4
C6 C6 C5 P3
C C3,C6
P P1, P4
FEC: example
: received pkt
Decoding:
C C3,C5,C6
C3 P2 P3
P P1
C5 P4
C6 P3 P4
C6 C6 C5 P3
C C3,C6
P P1, P4
FEC: example
: received pkt
Decoding:
C C3,C6
C3 P2 P3
P P1, P4
C6 P3
C3 C3 C6 P2
C C6
P P1, P3, P4
FEC: example
: received pkt
Decoding:
C C3,C6
C3 P2 P3
P P1, P4
C6 P3
C3 C3 C6 P2
C C6
P P1, P3, P4
FEC: example
: received pkt
Decoding:
C C3,C6
C3 P2 P3
P P1, P4
C6 P3
C3 C3 C6 P2
C C3
P P1, P3, P4
FEC: example
: received pkt
Decoding:
C C3
P P1, P2 , P4
C3 P3
C
P P1, P2 , P3, P4
FEC: example
: received pkt
Decoding:
C C3
P P1, P2 , P4
C3 P3
C
P P1, P2 , P3, P4
link rate = R
on every link
multicast to
both Y & Z
throughput = 1.5R
throughput = 2R