Week13 Routing Protocols
Week13 Routing Protocols
Computer Networks
Week 13: Routing Protocols
link frame Hl Hn Ht Mi Hl Hn Ht Mi
link
physical physical
“Intermediate nodes”
source destination
Deliver packages from host to host
Header: Hn Routing table/ ICMP protocols/routing protocol
ICMP protocol IP addressing: NAT, dynamic
12-2024 IT005–Computer Networks Week 14: 2
Link Layer
Ha M Ha M
application application
message
M1 M2 … Mn M2 M1 … Mn
transport transport
segment Ht Mi … Ht
Mi
link frame Hl Hn Ht Mi Hl Hn Ht Mi
link
physical physical
“Physical medium”
source destination
Header: Hl NIC “name”: MAC
ARP protocol IP > MAC (ARP table)
12-2024 IT005–Computer Networks Week 14: 3
Network layer attacks
(Reviews)
o Resource IP spoofing and revert path filtering (RPF)
• Checks IP address of incoming packets is reachable via the interface
they came from (check routing table) Source IP:
How many consecutive 1’s network part192.168.1.100?
of the
address.
10.45.0.0/16
10.45.80.141/32
Local
Interface IP
127.0.0.0
/8 directly
Localhos reachable
t
224.0.0.0/4
Multicast
255.255.255.25
5/32
Broadcast
12-2024 IT005–Computer Networks Week 14: 4
Network layer: control plane outline
introduction
routing protocols
link state
distance vector
intra-ISP routing: OSPF
routing among ISPs: BGP
SDN control plane network management,
Internet Control Message configuration
Protocol • SNMP
• NETCONF/YANG
Routing
Algorithm
control
plane
data
plane
values in arriving
packet header
0111 1
2
3
Remote Controller
control
plane
data
plane
CA
CA CA CA CA
values in arriving
packet header
0111 1
2
3
D(t): (minimum) distance from source to destination t! p(v): predecessor node along path from source to v
12-2024 IT005–Computer Networks Week 14: 16
Dijkstra’s algorithm: an example
5
D(w),p(w)
3 5,u
v w 5
2
4,x
u 2 1 z 3,y
3
1 2 3,y
x 1
y
5 uwxvyz v
notes:
construct least-cost-path tree by tracing predecessor nodes
ties can exist (can be broken arbitrarily)
12-2024 IT005–Computer Networks Week 14: 18
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)
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 0
a 2+e a
1 1+e 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 0
c 0 1 1
c 1+e 1 1 0 0 1
c 1 c
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 costs resulting in new costs
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
a b c
8 1
t=1 1 1
All nodes:
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:
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:
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:
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:
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 compute
h compute
i
8 1
a b c
8 1
t=2 1 1
All nodes:
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
computation Db(a) = 8
Db(c) = 1
Db(f) = ∞
Db(g) = ∞
Dc(a) = ∞
Dc(b) = 1
DV in a: Db(d) = ∞ Db(h) = ∞ Dc(c) = 0
Da(a)=0 Db(e) = 1 Db(i) = ∞ Dc(d) = ∞
Da(b) = 8 Dc(e) = ∞
Da(c) = ∞ a b c Dc(f) = ∞
8 1
Da(d) = 1 Dc(g) = ∞
t=1 Da(e) = ∞
Da(f) = ∞ 1 1
Dc(h) = ∞
Dc(i) = ∞
b receives DVs Da(g) = ∞ DV in e:
from a, c, e Da(h) = ∞ De(a) = ∞
Da(i) = ∞ De(b) = 1
d e f De(c) = ∞
1 1
De(d) = 1
De(e) = 0
De(f) = 1
1 1 1
De(g) = ∞
De(h) = 1
De(i) = ∞
g h i
1 1
t=1 Da(e) = ∞
Da(f) = ∞ 1 1
Dc(h) = ∞
Dc(i) = ∞
b receives DVs Da(g) = ∞ DV in e:
from a, c, e, Da(h) = ∞ De(a) = ∞
computes: e
Da(i) = ∞ De(b) = 1
d e f De(c) = ∞
1
Db(a) = min{cb,a+Da(a), cb,c +Dc(a), cb,e+De(a)} = min{8,∞,∞} =8 1
De(d) = 1
Db(c) = min{cb,a+Da(c), cb,c +Dc(c), c b,e +De(c)} = min{∞,1,∞} = 1
De(e) = 0
Db(d) = min{cb,a+Da(d), cb,c +Dc(d), c b,e +De(d)} = min{9,2,∞} = 2 De(f) = 1
1 1 1
Db(e) = min{cb,a+Da(e), cb,c +Dc(e), c b,e +De(e)} = min{∞,∞,1} = 1 De(g) = ∞
Db(f) = min{cb,a+Da(f), cb,c +Dc(f), c b,e +De(f)} = min{∞,∞,2} = 2
DV in b: De(h) = 1
Db(g) = min{cb,a+Da(g), cb,c +Dc(g), c b,e+De(g)} = min{∞, ∞, ∞} = ∞ Db(a) = 8 Db(f) =2 De(i) = ∞
g h 1Db(c) = 1 Db(g)i = ∞
1 ∞, 2} = 2
Db(h) = min{cb,a+Da(h), cb,c +Dc(h), c b,e+De(h)} = min{∞,
Db(d) = 2 Db(h) = 2
Db(i) = min{cb,a+Da(i), cb,c +Dc(i), c b,e+De(i)} = min{∞, ∞, ∞} = ∞ Db(e) = 1 Db(i) = ∞
12-2024 IT005–Computer Networks Week 14: 36
Distance vector example:
DV in b: DV in c:
computation Db(a) = 8 Db(f) = ∞
Dc(a) = ∞
Dc(b) = 1
Db(c) = 1 Db(g) = ∞
DV in a: Db(d) = ∞ Db(h) = ∞ Dc(c) = 0
Da(a)=0 Db(e) = 1 Db(i) = ∞ Dc(d) = ∞
Da(b) = 8 Dc(e) = ∞
Da(c) = ∞ a b c Dc(f) = ∞
8 1
Da(d) = 1 Dc(g) = ∞
t=1 Da(e) = ∞
Da(f) = ∞ 1 1
Dc(h) = ∞
Dc(i) = ∞
c receives DVs Da(g) = ∞ DV in e:
from b Da(h) = ∞ De(a) = ∞
Da(i) = ∞ De(b) = 1
d e f De(c) = ∞
1 1
De(d) = 1
De(e) = 0
De(f) = 1
1 1 1
De(g) = ∞
De(h) = 1
De(i) = ∞
g h i
1 1
t=1 1 1
Dc(h) = ∞
Dc(i) = ∞
c receives DVs
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(f) = min{cc,b+Db(f)} = 1+ ∞ = ∞ Dc(d) = 2
Dc(g) = min{cc,b+Db(g)} = 1+ ∞ = ∞ Dc(e) = ∞ * Check out the online interactive
Dc(f) = ∞ exercises for more examples:
g b(h)} = 1+ ∞ = ∞
Dc(h) = min{cbc,b+D h i http://gaia.cs.umass.edu/kurose_ross/interactive/
Dc(g) = ∞
Dc(i) = min{cc,b+Db(i)} = 1+ ∞ = ∞
Dc(h) = ∞
12-2024 IT005–Computer Networks Dc(i) = ∞ Week 14: 38
Distance vector example:
DV in b:
computation Db(a) = 8
Db(c) = 1
Db(f) = ∞
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 b c De(c) = ∞
Dc(c) = ∞ 8 1
De(d) = 1
Dc(d) = 0
t=1 Dc(e) = 1
1
Q: what is new DV computed in e at
1t=1?
De(e) = 0
De(f) = 1
e receives DVs Dc(f) = ∞
De(g) = ∞
from b, d, f, h Dc(g) = 1
De(h) = 1
Dc(h) = ∞
De(i) = ∞
Dc(i) = ∞ d compute
e f DV in f:
1 1
DV in h: Dc(a) = ∞
Dc(a) = ∞ Dc(b) = ∞
Dc(b) = ∞ Dc(c) = ∞
Dc(c) = ∞ 1 1 1
Dc(d) = ∞
Dc(d) = ∞ Dc(e) = 1
Dc(e) = 1 Dc(f) = 0
Dc(f) = ∞ g h i Dc(g) = ∞
1 1
Dc(g) = 1 Dc(h) = ∞
Dc(h) = 0 Dc(i) = 1
12-2024 IT005–Computer Networks Week 14: 39
Distance vector: state information
diffusion
Iterative communication, computation steps diffuses information through network:
t=0 c’s state at t=0 is at c only
a b c
8 1
c’s state at t=0 has propagated to b, and
t=1 may influence distance vector computations
up to 1 hop away, i.e., at b 1 1 t=1
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 c,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 b,a,e, g h i
c, f, h and now at g,i as well 1 1
t=4
12-2024 IT005–Computer Networks Week 14: 40
Distance vector: link cost changes
link cost changes:
node detects local link cost change 1
y
4 1
updates routing info, recalculates local DV
x z
if DV changes, notify neighbors 50
• y sees direct link to x has new cost 60, but z has said it has a path at cost of 5. So
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!
intra-AS
3c
routing3a inter-AS routing intra-AS
2c
3b 2a routing
2b
1c
AS3 intra-AS
1a routing 1b AS2
1d
AS1
3c
3a other
2c
3b 2a networks
2b
1c
AS3
other 1a 1b AS2
networks
1d
AS1
2b
2a 2c
∂
1b 3b
2d
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
12-2024 IT005–Computer Networks Week 14: 57
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
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”
… …
at 1d: OSPF intra-domain routing: to get to 1c, use interface 1
1c 2
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
12-2024 IT005–Computer Networks Week 14: 61
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
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
A,w
B provider
x network
w A legend:
A,w C y customer
network:
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
B provider
x network
w A legend:
C y customer
network:
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
12-2024 IT005–Computer Networks Week 14: 65
BGP route selection
Routing
Algorithm
control
plane
data
plane
values in arriving
packet header
0111 1
2
3
Remote Controller
control
plane
data
plane
CA
CA CA CA CA
values in arriving
packet header
0111 1
2
3
Ap Ap Ap Ap Ap Ap Ap Ap Ap Ap
Specialized App
p p p p p p p p p p
Application
s Open Interface
Specialized
Operating or or
System
Windows Linux MAC OS
Specialized Open Interface
Hardware
Microprocessor
5
3
2 v w 5
u 2
3
1 z
1
2
x 1 y
u 2
3
1 z
1
2
x 1 y
u 2
3
1 z
1
2
x 1 y
control
plane
data
plane
1: generalized “flow-based”
forwarding (e.g., OpenFlow)
12-2024 IT005–Computer Networks Week 14: 76
Software defined networking (SDN)
Data-plane switches: network-control
applications
fast, simple, commodity switches …
routing
implementing generalized data-plane load
access
forwarding (Section 4.4) in hardware control balance
flow (forwarding) table computed, control
plane
installed under controller supervision northbound API
SDN-controlled switches
12-2024 IT005–Computer Networks Week 14: 77
Software defined networking (SDN)
SDN controller (network OS): network-control
maintain network state applications
…
routing
information load
access
interacts with network control control balance
SDN-controlled switches
12-2024 IT005–Computer Networks Week 14: 78
Software defined networking (SDN)
network-control
network-control apps: applications
…
routing
“brains” of control: implement load
access
control functions using lower- control balance
data
plane
SDN-controlled switches
12-2024 IT005–Computer Networks Week 14: 79
Components of SDN controller
routing access load
control balance
statistics
3 … flow tables
2 SDN controller receives OpenFlow
message, updates link status info
Link-state info host info … switch info
2 3 Dijkstra’s routing algorithm
OpenFlow … SNMP
application has previously registered
to be called when ever link status
changes. It is called.
1
4 Dijkstra’s routing algorithm access
s2 network graph info, link state info
s1
s4 in controller, computes new
s3 routes
12-2024 IT005–Computer Networks Week 14: 84
SDN: control/data plane interaction
example
Dijkstra’s link-state
routing
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,
Link-state info host info … switch info
which computes new flow tables
2 needed
OpenFlow … SNMP
6 controller uses OpenFlow to
6
install new tables in switches
1 that need updating
s2
s1
s4
s3
12-2024 IT005–Computer Networks Week 14: 85
OpenDaylight (ODL) controller
Traffic
Engineering Firewalling Load Balancing … Network Orchestrations and Applications
Northbound API
REST/RESTCONF/NETCONF APIs
Enhanced Basic Network Functions
Services
Topology Switch Stats
AAA … processing mgr. mgr.
Forwarding Host
… rules mgr. Tracker
Service Abstraction Layer:
config. and
Service Abstraction
interconnects internal,
operational data messaging
store Layer (SAL) external applications
and services
OpenFlow NETCONF SNMP OVSDB … Southbound API
Traffic
Engineering Firewalling Load Balancing … Network Applications
Northbound API control apps separate
northbound
REST API Intent abstractions, from controller
protocols
intent framework: high-
hosts paths flow rules topology
level specification of
service: what rather
devices links statistics
ONOS
distributed
than how
core considerable emphasis
on distributed core:
packet southbound
device link host flow
abstractions, service reliability,
OpenFlow Netconf OVSDB protocols replication performance
Southbound API scaling
introduction
routing protocols
intra-ISP routing: OSPF
routing among ISPs: BGP
SDN control plane
Internet Control Message network management,
Protocol configuration
• SNMP
• NETCONF/YANG
3 probes 3 probes
3 probes
Managed device:
Managing server: agent data equipment with manageable,
application, typically managing configurable hardware,
with network server/controller
software components
managers (humans) in data managed device
the loop Data: device “state”
agent data configuration data,
Network agent data
operational data,
management managed device device statistics
protocol: used by managed device
managing server to query,
agent data
configure, manage device;
agent data
used by devices to inform
managing server of data, managed device
events. managed device
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>
…
…
<rpc>
<rpc-reply>
…
…
<notification>
…
…
<rpc>
<rpc-reply>
…
…
Session close: <close-session>
12-2024 IT005–Computer Networks Week 14: 102
Selected NETCONF Operations
note message id
change a configuration
from
from
y 2 0 1
z ∞∞ ∞
cost to
Dz() x y z
x ∞∞ ∞
from
y ∞∞ ∞
z 7 1 0
time
12-2024 IT005–Computer Networks Week 14: 109
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 y 2 0 1
from
z ∞∞ ∞ z 7 1 0 z 3 1 0
y 2 0 1 y 2 0 1
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
12-2024 IT005–Computer Networks Week 14: 110