Chapter 5 Network ControlPlane
Chapter 5 Network ControlPlane
Routing
Algorithm
control
plane
data
plane
Remote Controller
control
plane
data
plane
CA
CA CA CA CA
N = set of routers = { u, v, w, x, y, z }
E = set of links ={ (u,w), (u,v), (u,x), (v,x), (v,w), (x,w), (x,y), (w,y), (w,z), (y,z) }
notes: 5
4
7
construct shortest path
8
tree by tracing
predecessor nodes u
3 w y z
ties can exist (can be 2
broken arbitrarily) 3
7 4
v
Network Layer: Control 5-16
Plane
Dijkstra’s algorithm: example
(step1)D(v) D(w) D(x) D(y) D(z)
Step N' p(v) p(w) p(x) p(y) p(z) C(u,x) = 5, C(u,w) = 3,
0 u 7,u 3,u 5,u ∞ ∞ C(u,v) = 7 are shortest
paths from node u to
nodes x, w, v
x
9
notes: 5
4
7
construct shortest path
8
tree by tracing
predecessor nodes u
3 w y z
ties can exist (can be 2
broken arbitrarily) 3
D(w) = 3, smaller than
D(v) = 7 and D(x) = 5, to 7 4
add node w to N’ next v
Network Layer: Control 5-17
Plane
Dijkstra’s algorithm: example
(step 2)
D(v) D(w) D(x) D(y) D(z) C(u,w) + C(w,v) = 3+3 = 6,
Step N' p(v) p(w) p(x) p(y) p(z) C(u,w) + C(w,y) = 3+8 = 11
0 u 7,u 3,u 5,u ∞ ∞ are NEW shortest paths from
1 uw 6,w 11,w node u to nodes v and y
New path C(u,w) + C(w,x) =
3+4 = 7 > C(u,x) = 5, NOT
considered
x
9
notes: 5
4
7
construct shortest path
8
tree by tracing
predecessor nodes u
3 w y z
ties can exist (can be 2
broken arbitrarily) 3
D(x) = 5, smaller than
7 4
D(v) = 6 and D(y) = 11,
to add node x to N’ next v
Network Layer: Control 5-18
Plane
Dijkstra’s algorithm: example
(step 3)
D(v) D(w) D(x) D(y) D(z) C(u,x) + C(x,z) = 5+9 = 14
Step N' p(v) p(w) p(x) p(y) p(z) is NEW shortest path
0 u 7,u 3,u 5,u ∞ ∞ from node u to z
1 uw 6,w 11,w New path C(u,x) + C(x,y)
2 uwx 14,x = 5+7 = 12 > C(u,y) =
C(u,w) + C(w,y) = 11, NOT
considered
x
9
notes: 5
4
7
construct shortest path
8
tree by tracing
predecessor nodes u
3 w y z
ties can exist (can be 2
broken arbitrarily) 3
D(v) = 6, smaller than
7 4
D(y) = 11 and D(z) = 14,
to add node v to N’ next v
Network Layer: Control 5-19
Plane
Dijkstra’s algorithm: example
(step 4)
D(v) D(w) D(x) D(y) D(z)
Step N' p(v) p(w) p(x) p(y) p(z)
0 u 7,u 3,u 5,u ∞ ∞ C(u,w) + C(w,v) + C(v,y) =
3+3+4 = 10 is NEW shortest
1 uw 6,w 11,w
path from node u to y
2 uwx 14,x
3 uwxv 10,v
x
9
notes: 5
4
7
construct shortest path
8
tree by tracing
predecessor nodes u
3 w y z
ties can exist (can be 2
broken arbitrarily) 3
D(y) = 10, smaller than
7 4
D(z) = 14, to add node y
to N’ next v
Network Layer: Control 5-20
Plane
Dijkstra’s algorithm: example
(step 5)
D(v) D(w) D(x) D(y) D(z)
Step N' p(v) p(w) p(x) p(y) p(z) C(u,w) + C(w,y) + C(v,y)
0 u 7,u 3,u 5,u ∞ ∞ + C(y,z) = 3+3+4+2 = 12
is NEW shortest path
1 uw 6,w 11,w
from node u to z
2 uwx 14,x
3 uwxv 10,v
4 uwxvy 12,y
x
9
notes: 5
4
7
construct shortest path
8
tree by tracing
predecessor nodes u
3 w y z
ties can exist (can be 2
broken arbitrarily) 3
D(z) = 12, now the only
7 4
unvisited node, finally
to add node z to N’ v
Network Layer: Control 5-21
Plane
Dijkstra’s algorithm: example
(step 6)
D(v) D(w) D(x) D(y) D(z)
Step N' p(v) p(w) p(x) p(y) p(z)
0 u 7,u 3,u 5,u ∞ ∞
1 uw 6,w 11,w
2 uwx 14,x
No more new edges,
3 uwxv 10,v algorithm terminates
4 uwxvy 12,y
5 uwxvyz x
9
notes: 5
4
7
construct shortest path
8
tree by tracing
predecessor nodes u
3 w y z
ties can exist (can be 2
broken arbitrarily) 3
7 4
v
Network Layer: Control 5-22
Plane
Dijkstra’s algorithm: another
example
Step N' D(v),p(v) D(w),p(w) D(x),p(x) D(y),p(y) D(z),p(z)
0 u 2,u 5,u 1,u ∞ ∞
1 ux 2,u 4,x 2,x ∞
2 uxy 2,u 3,y 4,y
3 uxyv 3,y 4,y
4 uxyvw 4,y
5 uxyvwz
5
3
v w
2 5
u 2 1 z
3
1
2
x y
1
Network Layer: Control 5-23
Plane
Dijkstra’s algorithm: another
example
Step N' D(v),p(v) D(w),p(w) D(x),p(x) D(y),p(y) D(z),p(z)
0 u 2,u 5,u 1,u ∞ ∞
1 ux 2,u 4,x 2,x ∞
2 uxy 2,u 3,y 4,y
3 uxyv 3,y 4,y
4 uxyvw 4,y
5 uxyvwz
C(u,x) = 1, C(u,w) = 5, 5
C(u,v) = 2 are shortest
paths from node u to 3
nodes x, w, v v w
2 5
D(x) = 1, smaller u 2 1 z
than D(v) = 2 3
and D(w) = 5, to 1
2
add node x to N’ x y
1
next
Network Layer: Control 5-24
Plane
Dijkstra’s algorithm: another
example
Step N' D(v),p(v) D(w),p(w) D(x),p(x) D(y),p(y) D(z),p(z)
0 u 2,u 5,u 1,u ∞ ∞
11 1 ux 2,u 4,x 2,x ∞
2 uxy 2,u 3,y 4,y
3 uxyv 3,y 4,y
4 uxyvw 4,y
5 uxyvwz
C(u,x) + C(x,w) = 4, New path C(u,x) +
5 C(x,v) = 1+2 = 3 >
C(u,x) + C(x,y) = 2 are
NEW shortest paths C(u,v) = 2, NOT
3 considered
from node u to w, y v w
2 5
D(v) = 2, D(y) = 2 u 2 1 z
both smaller than 3
D(w) = 4, to add 1
2
node y to N’ x y
1
(randomly chosen
Network Layer: Control 5-25
to break tie) Plane
Dijkstra’s algorithm: another
example
Step N' D(v),p(v) D(w),p(w) D(x),p(x) D(y),p(y) D(z),p(z)
0 u 2,u 5,u 1,u ∞ ∞
1 ux 2,u 4,x 2,x ∞
2 uxy 2,u 3,y 4,y
3 uxyv 3,y 4,y
4 uxyvw 4,y
5 uxyvwz
C(u,x)+C(x,y)+C(y,w)=3
C(u,x)+C(x,y)+C(y,z)=4 5
are NEW shortest
paths from u to w, z 3
v w
2 5
D(v) = 2, smaller u 2 1 z
than D(z) = 4 3
and D(w) = 3, to 1
2
add node v to N’ x y
1
next
Network Layer: Control 5-26
Plane
Dijkstra’s algorithm: another
example
Step N' D(v),p(v) D(w),p(w) D(x),p(x) D(y),p(y) D(z),p(z)
0 u 2,u 5,u 1,u ∞ ∞
1 ux 2,u 4,x 2,x ∞
2 uxy 2,u 3,y 4,y
3 uxyv 3,y 4,y
4 uxyvw 4,y
5 uxyvwz C(v,w) = 3 too large
5 to provide a new
shortest path.
3 Table unchanged
v w
2 5
D(w) = 3, u 2 1 z
smaller than 3
D(z) = 4, to add 1
2
node w to N’ x y
1
next
Network Layer: Control 5-27
Plane
Dijkstra’s algorithm: another
example
Step N' D(v),p(v) D(w),p(w) D(x),p(x) D(y),p(y) D(z),p(z)
0 u 2,u 5,u 1,u ∞ ∞
1 ux 2,u 4,x 2,x ∞
2 uxy 2,u 3,y 4,y
3 uxyv 3,y 4,y
4 uxyvw 4,y
5 uxyvwz C(w,z) = 5 too large
5 to provide a new
shortest path.
3 Table unchanged
v w
2 5
D(z) = 4, now
the only u
unvisited node,
2 1 z
3
finally to add 1
node z to N’ 2
x y
1
Network Layer: Control 5-28
Plane
Dijkstra’s algorithm: another
example
Step N' D(v),p(v) D(w),p(w) D(x),p(x) D(y),p(y) D(z),p(z)
0 u 2,u 5,u 1,u ∞ ∞
1 ux 2,u 4,x 2,x ∞
2 uxy 2,u 3,y 4,y
3 uxyv 3,y 4,y
4 uxyvw 4,y
5 uxyvwz
5 No more new edges,
algorithm terminates
3
v w
2 5
u 2 1 z
3
1
2
x y
1
Network Layer: Control 5-29
Plane
Dijkstra’s algorithm,
discussion
algorithm complexity: n nodes
each iteration: need to check all nodes, w,
not in N
n(n+1)/2 comparisons: O(n2)
more efficient implementations possible:
O(nlogn)
oscillations possible:
e.g., support link cost equals amount of
A 1+e
1 carried A A 2+e A
traffic:
2+e 0 0 2+e 0
D 0 0 B D 1+e 1 B D B D 1+e 1 B
0 0
0 e 0 0
1
C 1 C 0 1
C 1+e C 0
1 1 1 1 1 1
e e e e
given these costs, given these costs, given these costs,
initially find new routing…. find new routing….find new routing….
resulting in new costs resulting in new cost
resulting in new costs
Network Layer: Control 5-30
Chapter 5: outline
5.1 Introduction
5.2 Routing algorithms:
link state (Dijkstra’s algorithm)
distance vector (Dynamic
Programming)
5.3 intra-domain routing in the Internet:
Open Shortest Path First (OSPF)
5.4 inter-domain routing among the
ISPs:
Border Gateway Protocol (BGP)
Network Layer: Control 5-
Plane 31
Distance vector algorithm
Bellman-Ford equation (dynamic
programming)
let
dx(y) := cost of least-cost path from x to
y
then v
from
from
y ∞∞ ∞ y 2 0 1
z ∞∞ ∞ z 7 1 0
node y cost to
table x y z y
2 1
x ∞ ∞ ∞
x z
from
y 2 0 1 7
z ∞∞ ∞
node z cost to
table x y z
x ∞∞ ∞
from
y ∞∞ ∞
z 7 1 0
time
Network Layer: Control 5-39
Plane
Dx(z) = min{c(x,y) +
Dx(y) = min{c(x,y) + Dy(y), c(x,z) + Dz(y)}
= min{2+0 , 7+1} = 2 Dy(z), c(x,z) + Dz(z)}
= min{2+1 , 7+0} = 3
node x cost to cost to Dz(x) = Dx(z) = 3
table x y z x y z x y z
x 0 2 7 x 0 2 3 x 0 2 3
from
from
y ∞∞ ∞ y 2 0 1 y 2 0 1
from
z ∞∞ ∞ z 7 1 0 z 3 1 0
node y cost to cost to cost to
table x y z x y z x y z y
2 1
x ∞ ∞ ∞ x 0 2 7 x 0 2 3 x z
from
y 2 0 1 y 2 0 1 7
from
y 2 0 1
from
z ∞∞ ∞ z 7 1 0 z 3 1 0
x ∞∞ ∞ x 0 2 7 x 0 2 3
from
from
y 2 0 1 y 2 0 1
from
y ∞∞ ∞
z 7 1 0 z 3 1 0 z 3 1 0
time
Dz(x) = Dx(z) = 3 Network Layer: Control 5-40
Plane
Dx(z) = min{c(x,y) +
Dx(y) = min{c(x,y) + Dy(y), c(x,z) + Dz(y)}
= min{2+0 , 7+1} = 2 Dy(z), c(x,z) + Dz(z)}
= min{2+1 , 7+0} = 3
node x cost to cost to cost to Dz(x) = Dx(z) = 3
table x y z x y z x y z
x 0 2 7 x 0 2 3 x 0 2 3
from
from
y ∞∞ ∞ y 2 0 1 y 2 0 1
from
z ∞∞ ∞ z 7 1 0 z 3 1 0
node y cost to cost to cost to
table x y z x y z x y z y
2 1
x ∞ ∞ ∞ x 0 2 7 x 0 2 3 x z
from
y 2 0 1 y 2 0 1 7
from
y 2 0 1
from
z ∞∞ ∞ z 7 1 0 z 3 1 0
x ∞∞ ∞ x 0 2 7 x 0 2 3
from
from
y 2 0 1 y 2 0 1
from
y ∞∞ ∞
z 7 1 0 z 3 1 0 z 3 1 0
time
Dz(x) = Dx(z) = 3 Network Layer: Control 5-41
Plane
Distance vector: link cost
changes
link cost changes: 1
node detects local link cost y
4 1
change
updates routing info,
x z
50
recalculates
distance vector
if DV changes, notify
“good t0 : y detects link-cost change, updates its DV, informs its
neighbors
news neighbors.
travels t1 : z receives update from y, updates its table, computes new
fast” least cost to x , sends its neighbors its DV.
t2 : y receives z’s update, updates its distance table. y’s least costs
do not change, so y does not send a message to z.
3c
3a 2c
3b 2a
AS3 2b
1c AS2
1a 1b AS1
1d forwarding table
configured by both
intra- and inter-AS
Intra-AS Inter-AS routing algorithm
Routing
algorithm
Routing
algorithm
• intra-AS routing
determine entries
Forwarding
table
for destinations
within AS
• inter-AS & intra-AS
determine entries
for external
Network Layer: Control 5-48
Plane
Inter-AS tasks
suppose router in AS1 must:
AS1 receives 1. learn which dests
datagram destined are reachable
outside of AS1: through AS2, which
• router should through AS3
forward packet to 2. propagate this
gateway router, reachability info to
but which one? all routers in AS1
job of inter-AS routing!
3c
3a
3b
AS3 2c other
1c 2a networks
other 1a 2b
networks 1b AS2
AS1 1d
boundary router
backbone router
backbone
area (OSPF routing)
border
routers
area 3
internal
routers
area 1 (OSPF
(OSPF area 2 routing)
routing)
(OSPF
routing) Network Layer: Control 5-53
Plane
Hierarchical
OSPF
two-level hierarchy: local areas, backbone
area
• link-state (OSPF) advertisements only in
local areas; one or more area border
routers are responsible for routing
packets to outside the area
• one OSPF area in the AS is configured to
be the backbone area, routing traffic
between the other areas in the AS. The
backbone always contains all area
border routers in the AS
area border routers: “summarize”
distances to nets in own area, advertise to
other area border routers. Network Layer: Control 5-54
Plane
Hierarchical
OSPF Other AS’es
boundary router
backbone router
backbone
area (OSPF routing)
border
routers
area 3
internal
routers
area 1 (OSPF
(OSPF area 2 routing)
routing)
(OSPF
routing) Network Layer: Control 5-55
Plane
OSPF advanced features
(Optional)
for each link, multiple cost metrics for
different service networks:
• e.g., satellite link cost set low for best
effort service; high for real-time service
• considering balancing the choice of
different service networks
integrated unicast and multi-cast support:
• Allow source to efficiently send OSPF
advertisements to a group of
destinations in a single transmission
2b
2a 2c
∂
1b 3b
2d
1a 1c ∂
3a 3c
AS 2
1d 3d
AS 1 eBGP connectivity AS 3
iBGP connectivity
2d
Network Layer: Control 5-60
Plane
BGP policy-based routing
Policy-based routing:
• gateway receiving route advertisement uses
import policy to accept/decline path (e.g.,
never route through AS Y).
2d
2d
AS3 3b
AS1 1b AS3,X
1 AS3,X
3a 3c
1a 2 1c
local link AS2 2b 3d X
interfaces 2 1d 1 AS3,X
at 1a, 1d AS2,AS3,X
2a 2c
physical link
2d
AS3 3b
AS1 1b
1
3a 3c
1a 2 1c
AS2 2b 3d X
1d
2a 2c
2d
Y
Suppose an ISP only wants to route traffic to/from its customer
networks (does not want to carry transit traffic between other ISPs)
A,B,C: provider networks (routes for their own
customers only)
X,W,Y: customers (of provider networks)
A advertises path Aw to B and to C
B chooses not to advertise BAw to C:
B gets no “revenue” for routing CBAw, since none of C,
A, w are B’s customers
C does not learn about CBAw path
C will route CAw (not using B) to get to w
Network Layer: Control 5-69
Plane
BGP: achieving policy via
advertisements
legend: provider
B network
X
W A
customer
C network: