Professional Documents
Culture Documents
Network Layer:
Control Plane
Copyright® 1996-2020, J.F Kurose and K.W. Ross, All Rights Reserved
Computer Networking: A
Top-Down Approach
8th edition
Jim Kurose, Keith Ross
Pearson, 2020
Network layer control plane: our goals
▪understand principles ▪ instantiation, implementation
behind network control on the Internet:
plane: • OSPF, BGP
• traditional routing algorithms • OpenFlow, ODL and ONOS
Copyright® 1996-2020, J.F Kurose and K.W. Ross, All Rights Reserved
Routing
Algorithm
control
Copyright® 1996-2020, J.F Kurose and K.W. Ross, All Rights Reserved
plane
data
plane
values in arriving
packet header
0111 1
2
3
Remote Controller
control
plane
Copyright® 1996-2020, J.F Kurose and K.W. Ross, All Rights Reserved
data
plane
CA
CA CA CA CA
values in arriving
packet header
0111 1
2
3
physical physical
congested”
▪ routing: a “top-10” networking
application
transport
network
challenge! enterprise
network
link
physical
7
8 Loop
9 find w not in N' such that D(w) is a minimum
10 add w to N'
11 update D(v) for all v adjacent to w and not in N' :
12 D(v) = min ( D(v), D(w) + cw,v )
13 /* new least-path-cost to v is either old least-cost-path to v or known
14 least-cost-path to w plus direct-cost from w to v */
15 until all nodes in N'
Network Layer: 5-13
Dijkstra’s algorithm: an example
v w x y z
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
Copyright® 1996-2020, J.F Kurose and K.W. Ross, All Rights Reserved
4 uxyvw 4,y
5 uxyvwz
Initialization (step 0): For all a: if a adjacent to u then D(a) = cu,a
5
3
find a not in N' such that D(a) is a minimum
v w 5 add a to N'
2
u 2 1 z update D(b) for all b adjacent to a and not in N' :
3 D(b) = min ( D(b), D(a) + ca,b )
1 2
x 1
y
v 3 w
2 5
u 2 1 z
3
1 2
x y
Copyright® 1996-2020, J.F Kurose and K.W. Ross, All Rights Reserved
5 uwxvyz v
notes:
▪ construct least-cost-path tree by tracing predecessor nodes
▪ ties can exist (can be broken arbitrarily)
Network Layer: 5-16
Dijkstra’s algorithm: discussion
algorithm complexity: n nodes
▪ each of n iteration: need to check all nodes, w, not in N
▪ n(n+1)/2 comparisons: O(n2) complexity
▪ more efficient implementations possible: O(nlogn)
Copyright® 1996-2020, J.F Kurose and K.W. Ross, All Rights Reserved
message complexity:
▪ each router must broadcast its link state information to other n routers
▪ efficient (and interesting!) broadcast algorithms: O(n) link crossings to disseminate a
broadcast message from one source
▪ each router’s message crosses O(n) links: overall message complexity: O(n2)
a 2+e
a a 2+e a
1 1+e 0 0 2+e 0
d b d 1+e 1 b d 0 0
b d 1+e 1 b
0 0
e 1 0 1 1 1 0
1 0
c c 0 1 c 1+e 1 0 1
1 c
e e e
e
v 5 cu,x + Dx(z),
2
u 2 1 z cu,w + Dw(z) }
3
1 2
= min {2 + 5,
x 1
y 1 + 3,
5 + 3} = 4
Dx(z) = 3
node achieving minimum (x) is
next hop on estimated least-
cost path to destination (z)
Network Layer: 5-21
Distance vector algorithm
key idea:
▪ from time-to-time, each node sends its own distance vector estimate
to neighbors
▪ when x receives new DV estimate from any neighbor, it updates its
Copyright® 1996-2020, J.F Kurose and K.W. Ross, All Rights Reserved
g h i
1 1
a b c
8 1
t=1 1 1
All nodes:
Copyright® 1996-2020, J.F Kurose and K.W. Ross, All Rights Reserved
▪ receive distance
vectors from
neighbors d e f
▪ compute their new 1 1
local distance
vector
▪ send their new 1 1 1
local distance
vector to neighbors
g h i
1 1
a
compute compute
b compute
c
8 1
t=1 1 1
All nodes:
Copyright® 1996-2020, J.F Kurose and K.W. Ross, All Rights Reserved
▪ receive distance
vectors from
neighbors d
compute compute
e compute
f
▪ compute their new 1 1
local distance
vector
▪ send their new 1 1 1
local distance
vector to neighbors
g
compute h
compute compute
i
1 1
a b c
8 1
t=1 1 1
All nodes:
Copyright® 1996-2020, J.F Kurose and K.W. Ross, All Rights Reserved
▪ receive distance
vectors from
neighbors d e f
▪ compute their new 1 1
local distance
vector
▪ send their new 1 1 1
local distance
vector to neighbors
g h i
1 1
a b c
8 1
t=2 1 1
All nodes:
Copyright® 1996-2020, J.F Kurose and K.W. Ross, All Rights Reserved
▪ receive distance
vectors from
neighbors d e f
▪ compute their new 1 1
local distance
vector
▪ send their new 1 1 1
local distance
vector to neighbors
g h i
1 1
compute
a compute
b compute
c
2 1
t=2 1 1
All nodes:
Copyright® 1996-2020, J.F Kurose and K.W. Ross, All Rights Reserved
▪ receive distance
vectors from
neighbors compute
d compute
e compute
f
▪ compute their new 1 1
local distance
vector
▪ send their new 1 1 1
local distance
vector to neighbors
g
compute compute
h compute
i
8 1
a b c
8 1
t=2 1 1
All nodes:
Copyright® 1996-2020, J.F Kurose and K.W. Ross, All Rights Reserved
▪ receive distance
vectors from
neighbors d e f
▪ compute their new 1 1
local distance
vector
▪ send their new 1 1 1
local distance
vector to neighbors
g h i
1 1
…. and so on
g h i
1 1
g h i
1 1
from b computes:
d b(a}} = 1 + 8 = 9
Dc(a) = min{cc,b+D e f
DV in c:
Dc(b) = min{cc,b+Db(b)} = 1 + 0 = 1
Dc(a) = 9
Dc(d) = min{cc,b+Db(d)} = 1+ ∞ = ∞ Dc(b) = 1
Dc(e) = min{cc,b+Db(e)} = 1 + 1 = 2 Dc(c) = 0
Dc(d) = 2
Dc(f) = min{cc,b+Db(f)} = 1+ ∞ = ∞
Dc(e) = ∞
Dc(g) = min{cc,b+Db(g)} = 1+ ∞ = ∞ * Check out the online interactive
Dc(f) = ∞ exercises for more examples:
Dc(h) = min{cbc,bg+Db(h)} = 1+ ∞ = ∞ h Dc(g) = ∞ i http://gaia.cs.umass.edu/kurose_ross/interactive/
Dc(i) = min{cc,b+Db(i)} = 1+ ∞ = ∞ Dc(h) = ∞
Dc(i) = ∞
Network Layer: 5-35
DV in b:
Distance vector example: computation Db(a) = 8 Db(f) = ∞
Db(c) = 1 Db(g) = ∞
Db(d) = ∞ Db(h) = ∞ DV in e:
DV in d: Db(e) = 1 Db(i) = ∞
De(a) = ∞
Dc(a) = 1 De(b) = 1
Dc(b) = ∞ a De(c) = ∞
b c
Dc(c) = ∞ 8 1 De(d) = 1
Dc(d) = 0 De(e) = 0
t=1 Dc(e) = 1
Dc(f) = ∞ 1
Q: what is new DV computed in e at
1t=1?
De(f) = 1
De(g) = ∞
▪ e receives DVs Dc(g) = 1 De(h) = 1
Copyright® 1996-2020, J.F Kurose and K.W. Ross, All Rights Reserved
t=2
c’s state at t=0 may now influence distance
t=2 vector computations up to 2 hops away, i.e.,
d e f
at b and now at a, e as well 1 1
c’s state at t=0 may influence distance vector
t=3 computations up to 3 hops away, i.e., at b,a,e
1 1 1 t=3
and now at d,f,h as well
c’s state at t=0 may influence distance vector
t=4 computations up to 4 hops away, i.e., at g i
1
h 1
b,a,e, d, f, h and now at g,i as well t=4
Distance vector: link cost changes
1
link cost changes: y
4 1
▪ node detects local link cost change x z
50
▪ updates routing info, recalculates local DV
▪ if DV changes, notify neighbors
Copyright® 1996-2020, J.F Kurose and K.W. Ross, All Rights Reserved
y computes “my new cost to x will be 6, via z); notifies z of new cost of 6 to x.
• z learns that path to x via y has new cost 6, so z computes “my new cost to x
will be 7 via y), notifies y of new cost of 7 to x.
• y learns that path to x via z has new cost 7, so y computes “my new cost to x
will be 8 via y), notifies z of new cost of 8 to x.
• z learns that path to x via y has new cost 8, so z computes “my new cost to x
will be 9 via y), notifies y of new cost of 9 to x.
…
▪ see text for solutions. Distributed algorithms are tricky!
Network Layer: 5-39
Comparison of LS and DV algorithms
message complexity robustness: what happens if router
LS: n routers, O(n2) messages sent malfunctions, or is compromised?
DV: exchange between neighbors; LS:
convergence time varies • router can advertise incorrect link cost
• each router computes only its own
Copyright® 1996-2020, J.F Kurose and K.W. Ross, All Rights Reserved
intra-AS
3c
routing3a inter-AS routing intra-AS
2c
3b 2a routing
2b
1c
intra-AS
AS3
1a routing 1b AS2
1d
AS1
3c
3a other
2c networks
3b 2a
2b
1c
AS3
other 1a 1b AS2
networks
1d
AS1
reach, to rest of Internet: “I am here, here is who I can reach, and how”
▪ BGP provides each AS a means to:
• eBGP: obtain subnet reachability information from neighboring ASes
• iBGP: propagate reachability information to all AS-internal routers.
• determine “good” routes to other networks based on reachability information
and policy
2a ∂
2c
1b 3b
2d
Copyright® 1996-2020, J.F Kurose and K.W. Ross, All Rights Reserved
1a 1c ∂
3a 3c
AS 2
1d 3d
AS 1 eBGP connectivity AS 3
logical iBGP connectivity
2d
▪ AS2 router 2c receives path advertisement AS3,X (via eBGP) from AS3 router 3a
▪ based on AS2 policy, AS2 router 2c accepts path AS3,X, propagates (via iBGP) to all
AS2 routers
▪ based on AS2 policy, AS2 router 2a advertises (via eBGP) path AS2, AS3, X to
AS1 router 1c
Network Layer: 5-54
BGP path advertisement (more)
AS 3 3b
AS 1 1b AS3,X 3a 3c
AS3,X
AS3,X
1a 1c AS 2 3d X
2b
AS3,X
1d AS3, X
AS2,AS3,X 2a 2c
Copyright® 1996-2020, J.F Kurose and K.W. Ross, All Rights Reserved
2d
2d
dest interface ▪ recall: 1a, 1b, 1d learn via iBGP from 1c: “path to X goes through 1c”
… …
1c 1 ▪ at 1d: OSPF intra-domain routing: to get to 1c, use interface 1
X 1 ▪ at 1d: to get to X, use interface 1
… …
2d
dest interface
… … ▪ recall: 1a, 1b, 1d learn via iBGP from 1c: “path to X goes through 1c”
1c 2
▪ at 1d: OSPF intra-domain routing: to get to 1c, use interface 1
X 2
… … ▪ at 1d: to get to X, use interface 1
▪ at 1a: OSPF intra-domain routing: to get to 1c, use interface 2
▪ at 1a: to get to X, use interface 2
Network Layer: 5-58
Why different Intra-, Inter-AS routing ?
policy:
▪ inter-AS: admin wants control over how its traffic routed, who
routes through its network
▪ intra-AS: single admin, so policy less of an issue
Copyright® 1996-2020, J.F Kurose and K.W. Ross, All Rights Reserved
scale:
▪ hierarchical routing saves table size, reduced update traffic
performance:
▪ intra-AS: can focus on performance
▪ inter-AS: policy dominates over performance
2d
OSPF link weights
ISP only wants to route traffic to/from its customer networks (does not want
to carry transit traffic between other ISPs – a typical “real world” policy)
▪ 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: 5-61
BGP: achieving policy via advertisements (more)
B provider
x network
w A legend:
C y customer
network:
Copyright® 1996-2020, J.F Kurose and K.W. Ross, All Rights Reserved
ISP only wants to route traffic to/from its customer networks (does not want
to carry transit traffic between other ISPs – a typical “real world” policy)
▪ A,B,C are provider networks
▪ x,w,y are customer (of provider networks)
▪ x is dual-homed: attached to two networks
▪ policy to enforce: x does not want to route from B to C via x
▪ .. so, x will not advertise to B a route to C
Network Layer: 5-62
BGP route selection
▪ router may learn about more than one route to destination
AS, selects route based on:
1. local preference value attribute: policy decision
2. shortest AS-PATH
Copyright® 1996-2020, J.F Kurose and K.W. Ross, All Rights Reserved
Routing
Algorithm
control
Copyright® 1996-2020, J.F Kurose and K.W. Ross, All Rights Reserved
plane
data
plane
values in arriving
packet header
0111 1
2
3
Remote Controller
control
plane
Copyright® 1996-2020, J.F Kurose and K.W. Ross, All Rights Reserved
data
plane
CA
CA CA CA CA
values in arriving
packet header
0111 1
2
3
“programming” routers
• centralized “programming” easier: compute tables centrally and distribute
• distributed “programming” more difficult: compute tables as result of
distributed algorithm (protocol) implemented in each-and-every router
▪ open (non-proprietary) implementation of control plane
• foster innovation: let 1000 flowers bloom
Specialized
Operating or or
Copyright® 1996-2020, J.F Kurose and K.W. Ross, All Rights Reserved
System
Windows Linux MAC OS
Specialized Open Interface
Hardware
Microprocessor
u 2 1
3 z
1
2
x y
Copyright® 1996-2020, J.F Kurose and K.W. Ross, All Rights Reserved
u 2 1
3 z
1
2
x y
Copyright® 1996-2020, J.F Kurose and K.W. Ross, All Rights Reserved
u 2 1
3 z
1
2
x y
Copyright® 1996-2020, J.F Kurose and K.W. Ross, All Rights Reserved
control
plane
Copyright® 1996-2020, J.F Kurose and K.W. Ross, All Rights Reserved
data
plane
CA 2. control, data
CA CA CA CA
plane separation
1: generalized “flow-based”
forwarding (e.g., OpenFlow)
Network Layer: 5-73
Software defined networking (SDN)
network-control applications
Data-plane switches: …
routing
▪ fast, simple, commodity switches load
access
implementing generalized data-plane control balance
forwarding (Section 4.4) in hardware control
Copyright® 1996-2020, J.F Kurose and K.W. Ross, All Rights Reserved
plane
▪ flow (forwarding) table computed, northbound API
(e.g., OpenFlow)
southbound API
• defines what is controllable, what is not
▪ protocol for communicating with data
plane
controller (e.g., OpenFlow)
SDN-controlled switches
Network Layer: 5-74
Software defined networking (SDN)
network-control applications
SDN controller (network OS): …
routing
▪ maintain network state access load
information control balance
tolerance, robustness
SDN-controlled switches
Network Layer: 5-75
Software defined networking (SDN)
network-control applications
network-control apps: …
routing
▪ “brains” of control: implement access load
control functions using lower- control balance
data
plane
SDN-controlled switches
Network Layer: 5-76
Components of SDN controller
routing access load
control balance
…
Copyright® 1996-2020, J.F Kurose and K.W. Ross, All Rights Reserved
network-wide state
management : state of
statistics flow tables
SDN
networks links, switches,
Network-wide distributed, robust state management
controller
services: a distributed database Link-state info host info … switch info
• controller-to-switch
• asynchronous (switch to controller)
• symmetric (misc.)
▪ distinct from OpenFlow API
• API used to specify generalized
forwarding actions
at switch
▪ port status: inform controller of a
change on a port.
statistics
3 … flow tables
2 SDN controller receives OpenFlow
message, updates link status info
…
Copyright® 1996-2020, J.F Kurose and K.W. Ross, All Rights Reserved
4 5
network
graph
RESTful
API
… intent 5 link state routing app interacts
3 … with flow-table-computation
statistics flow tables component in SDN controller,
…
Copyright® 1996-2020, J.F Kurose and K.W. Ross, All Rights Reserved
REST/RESTCONF/NETCONF APIs
Enhanced Basic Network Functions
Services
Copyright® 1996-2020, J.F Kurose and K.W. Ross, All Rights Reserved
northbound
Northbound API
▪ control apps separate
REST API Intent abstractions, from controller
protocols
▪ intent framework: high-
level specification of
Copyright® 1996-2020, J.F Kurose and K.W. Ross, All Rights Reserved
3 probes
• 1st set has TTL =1, 2nd set has TTL=2, etc. arrives at destination host
▪ datagram in nth set arrives to nth router: ▪ destination returns ICMP
• router discards datagram and sends source “port unreachable”
ICMP message (type 11, code 0) message (type 3, code 3)
• ICMP message possibly includes name of ▪ source stops
router & IP address
▪ when ICMP message arrives at source: record RTTs
Network Layer: 4-89
Network layer: “control plane” roadmap
▪ introduction
▪ routing protocols
▪ intra-ISP routing: OSPF
▪ routing among ISPs: BGP
Copyright® 1996-2020, J.F Kurose and K.W. Ross, All Rights Reserved
request
PDU Trap
message type 4 type Enterprise Agent Type
Specific Time
Name Value ….
Addr code stamp
4 (0-7)
SNMP PDU
…
<rpc>
<rpc-reply>
Copyright® 1996-2020, J.F Kurose and K.W. Ross, All Rights Reserved
…
…
<rpc>
<rpc-reply>
…
…
<notification>
…
…
<rpc>
<rpc-reply>
…
…
Session close: <close-session>
Network Layer: 5-99
Selected NETCONF Operations
NETCONF Operation Description
<get-config> Retrieve all or part of a given configuration. A device may have multiple
configurations.
<get> Retrieve all or part of both configuration state and operational state data.
Copyright® 1996-2020, J.F Kurose and K.W. Ross, All Rights Reserved
change a configuration
from
from
cost to y
Copyright® 1996-2020, J.F Kurose and K.W. Ross, All Rights Reserved
Dy() x y z 2 1
Dx(y) = min{cx,y + Dy(y), cx,z+ Dz(y)}
x ∞ ∞ ∞ = min{2+0 , 7+1} = 2 x z
7
from
y 2 0 1
z ∞∞ ∞
cost to
Dz() x y z
x ∞∞ ∞
from
y ∞∞ ∞
z 7 1 0
time Network Layer: 5-106
Distance vector: another example
cost to cost to cost to
Dx() 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
from
y 2 0 1
z ∞∞ ∞ z 7 1 0 z 3 1 0
cost to cost to y
Copyright® 1996-2020, J.F Kurose and K.W. Ross, All Rights Reserved
cost to
Dy() x y z x y z x y z 2 1
x ∞ ∞ ∞ x 0 2 7 x 0 2 3
x z
7
from
from
y 2 0 1 y 2 0 1
from
y 2 0 1
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 Network Layer: 5-107