You are on page 1of 21

Chapter 5

Network Layer:
Control Plane
Computer Networking: A
Top-Down Approach
8th edition
Jim Kurose, Keith Ross
Pearson, 2020
Network layer: “control plane” roadmap
 introduction
 routing protocols
 link state
 distance vector

Network Layer: 5-2


Network-layer functions
 forwarding: move packets from router’s
input to appropriate router output data plane
 routing: determine route taken by
packets from source to destination
control plane

Two approaches to structuring network control plane:


 per-router control (traditional)
 logically centralized control (software defined networking)

Network Layer: 5-3


Per-router control plane
Individual routing algorithm components in each and every
router interact in the control plane

Routing
Algorithm
control
plane

data
plane

values in arriving
packet header
0111 1
2
3

Network Layer: 5-4


Network layer: “control plane” roadmap
 introduction
 routing protocols
 link state
 distance vector
 intra-ISP routing: OSPF
 routing among ISPs: BGP
 SDN control plane
 Internet Control Message
Protocol

Network Layer: 5-5


Routing protocols mobile network
national or global ISP
Routing protocol goal: determine “good”
paths (equivalently, routes), from sending
hosts to receiving host, through network
application
transport
network
of routers link
physical
network network

 path: sequence of routers packets link


physical
link
physical

traverse from given initial source host to network

final destination host link


physical
network
link
physical network
datacenter
 “good”: least “cost”, “fastest”, “least
link
physical network

congested” application
transport
 routing: a “top-10” networking enterprise
network
link

challenge! network physical

Network Layer: 5-6


Graph abstraction: link
costs
5
ca,b: cost of direct link connecting a and b
3
v w 5 e.g., cw,z = 5, cu,z = ∞
2
u 2 1 z
3
1 cost defined by network operator:
2
x 1
y could always be 1, or inversely related
to bandwidth, or inversely related to
congestion
graph: G = (N,E)
N: set of routers = { u, v, w, x, y, z }
E: set of links ={ (u,v), (u,x), (v,x), (v,w), (x,w), (x,y), (w,y), (w,z), (y,z) }

Network Layer: 5-7


Routing algorithm classification
global: all routers have complete
topology, link cost info
• “link state” algorithms
How fast
dynamic: routes change
do routes static: routes change more quickly
change? slowly over time • periodic updates or in
response to link cost
changes
decentralized: iterative process of
computation, exchange of info with neighbors
• routers initially only know link costs to
attached neighbors
• “distance vector” algorithms
global or decentralized information? Network Layer: 5-8
Network layer: “control plane” roadmap
 introduction
 routing protocols
 link state
 distance vector

Network Layer: 5-9


Dijkstra’s link-state routing algorithm
 centralized: network topology, link notation
costs known to all nodes
• accomplished via “link state
 cx,y: direct link cost from node
broadcast” x to y; = ∞ if not direct
neighbors
• all nodes have same info
 D(v): current estimate of cost
 computes least cost paths from one of least-cost-path from source
node (“source”) to all other nodes to destination v
• gives forwarding table for that node  p(v): predecessor node along
path from source to v
 iterative: after k iterations, know
least cost path to k destinations  N': set of nodes whose least-
cost-path definitively known

Network Layer: 5-10


Dijkstra’s link-state routing algorithm
1 Initialization:
2 N' = {u} /* compute least cost path from u to all other nodes */
3 for all nodes v
4 if v adjacent to u /* u initially knows direct-path-cost only to direct neighbors */
5 then D(v) = cu,v /* but may not be minimum cost! */
6 else D(v) = ∞
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-11
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
4 uxyvw 4,y
5 uxyvwz
Initialization (step 0): For all a: if a adjacent to 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

Network Layer: 5-12


Dijkstra’s algorithm: an example
5
3
v w 5
2
u 2 1 z
3
1 2
x 1
y

resulting least-cost-path tree from u: resulting forwarding table in u:


destination outgoing link
v w
v (u,v) route from u to v directly
u z x (u,x)
y (u,x) route from u to all
x y w (u,x) other destinations
x (u,x) via x
Network Layer: 5-13
Dijkstra’s algorithm: another example
v w x y z
D(v), D(w), D(x), D(y), D(z), x
9
Step N' p(v) p(w) p(x) p(y) p(z)

0 u 7,u 3,u 5,u ∞ ∞ 5 7


4
1 uw 6,w 5,u 11,w ∞ 8
2 uwx 6,w 11,w 14,x 3 w z
u y
2
3 uwxv 10,v 14,x
3
4 uwxvy 12,y 7 4

5 uwxvyz v

notes:
 construct least-cost-path tree by tracing predecessor nodes
 ties can exist (can be broken arbitrarily)
Network Layer: 5-14
Network layer: “control plane” roadmap
 introduction
 routing protocols
 link state
 distance vector

Network Layer: 5-15


Distance vector algorithm
Based on Bellman-Ford (BF) equation (dynamic programming):
Bellman-Ford equation

Let Dx(y): cost of least-cost path from x to y.


Then:
Dx(y) = minv { cx,v + Dv(y) }

v’s estimated least-cost-path cost to y


min taken over all neighbors v of x direct cost of link from x to v
Network Layer: 5-16
Bellman-Ford Example
Suppose that u’s neighboring nodes, x,v,w, know that for destination z:
Dv(z) = 5 Dw(z) = 3 Bellman-Ford equation says:
5
Du(z) = min { cu,v + Dv(z),
3 w
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-17
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
own DV using B-F equation:
Dx(y) ← minv{cx,v + Dv(y)} for each node y ∊ N

 under minor, natural conditions, the estimate Dx(y) converge to the


actual least cost dx(y)

Network Layer: 5-18


Distance vector algorithm:
each node: iterative, asynchronous: each local
iteration caused by:
wait for (change in local link  local link cost change
cost or msg from neighbor)  DV update message from neighbor

distributed, self-stopping: each


recompute DV estimates using node notifies neighbors only when
DV received from neighbor its DV changes
 neighbors then notify their
if DV to any destination has neighbors – only if necessary
changed, notify neighbors  no notification received, no
actions taken!

Network Layer: 5-19


Distance vector: example
DV in a:
Da(a)=0
Da(b) = 8
Da(c) = ∞ a b c
8 1
Da(d) = 1

t=0 Da(e) = ∞
Da(f) = ∞ 1 1
Da(g) = ∞
 All nodes have
Da(h) = ∞
distance estimates
Da(i) = ∞ A few asymmetries:
to nearest d e f  missing link
neighbors (only) 1 1
 larger cost
 All nodes send
their local
distance vector to 1 1 1
their neighbors

g h i
1 1

Network Layer: 5-20


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
speed of convergence table
LS: O(n2) algorithm, O(n2) messages DV:
• may have oscillations
• DV router can advertise incorrect path
DV: convergence time varies cost (“I have a really low cost path to
• may have routing loops everywhere”): black-holing
• count-to-infinity problem
• each router’s table used by others:
error propagate thru network

Network Layer: 5-21

You might also like