Chapter5 2021
Chapter5 2021
distance vector
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) }
distance vector
notes: 5 7
4
construct shortest path
tree by tracing 8
predecessor nodes 3
u w y z
ties can exist (can be 2
broken arbitrarily)
3
7 4
v
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 5
2
u 2 1 z
3
1 2
x 1
y
Dijkstra’s algorithm: example (2)
resulting shortest-path tree from u:
v w
u z
x y
1
A 1+e A A A
2+e 0 0 2+e 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 C 0 1
C 1+e C 0
1
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
Chapter 5: outline
5.1 introduction
5.2 routing protocols
link state
distance vector
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
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
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
from
y 2 0 1 y 2 0 1 7
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
Distance vector: link cost changes
link cost changes: 1
node detects local link cost change 4
y
1
updates routing info, recalculates x z
distance vector 50
if DV changes, notify neighbors
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.
Distance vector: link cost changes
link cost changes: 60
node detects local link cost change 4
y
1
bad news travels slow - “count to x z
infinity” problem! 50
44 iterations before algorithm
stabilizes: see text
poisoned reverse:
If Z routes through Y to get to X :
Z tells Y its (Z’s) distance to X is infinite (so Y won’t route to X via Z)
will this completely solve count to infinity problem?
Distance Vector: link cost increases
Dy(x) = min{c(y,x) + Dx(x), c(y,z) + Dz(x)}
= min{60+0 , 1+5} = 6
node y table
cost to when y detects
cost to
x y z
x y z
y 4 0 1
y 6 0 1
from
x 0 4 5
from
x
z 5 1 0
z
node z table
cost to cost to
x y z x y z
z 5 1 0 z 7 1 0
from
y 4 0 1 from
y
x 0 4 5 x
node x table
cost to 60
Dz(x) = min{c(z,y) + Dy(x), c(z,x) + Dx(x)} y
x y z 4 1
= min{1+6, 50+0} = 7
x 0 4 5 x z
50
from
y 4 0 1
z 5 1 0 Network Layer
Distance Vector: link cost increases
x 0 4 5 y 8 0 1
from
x
from
z 5 1 0 x
z z
node z table
cost to cost to
x y z cost to
x y z x y z
z 5 1 0 z 7 1 0 z 9 1 0
from
y 4 0 1 from y
from
x 0 4 5 y
x x
node x table
cost to 60
Dz(x) = min{c(z,y) + Dy(x), c(z,x) + Dx(x)} y
x y z 4 1
= min{1+8, 50+0} = 9
x 0 4 5 x z
50
from
y 4 0 1
z 5 1 0 Network Layer
Comparison of LS and DV algorithms
message complexity robustness: what happens if
LS: with n nodes, E links, O(nE) router malfunctions?
msgs sent LS:
DV: exchange between neighbors node can advertise incorrect
only link cost
convergence time varies each node computes only its
own table
speed of convergence DV:
LS: O(n2) algorithm requires O(nE) DV node can advertise
msgs
may have oscillations incorrect path cost
each node’s table used by
DV: convergence time varies others
may also have oscillations • error propagate thru
may be routing loops network
count-to-infinity problem
Chapter 5: outline
5.1 introduction
5.2 routing protocols
link state
distance vector
3c
3a 2c
3b 2a
AS3 2b
1c AS2
1a 1b AS1
1d forwarding table
configured by both intra-
and inter-AS routing
Intra-AS Inter-AS algorithm
Routing Routing
algorithm algorithm intra-AS sets entries
Forwarding
for internal dests
table inter-AS & intra-AS sets
entries for external
dests
Inter-AS tasks
suppose router in AS1 AS1 must:
receives datagram 1. learn which dests are
destined outside of AS1: reachable through AS2,
router should forward which through AS3
packet to gateway 2. propagate this
router, but which one? reachability info to 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
Example: setting forwarding table in
router 1d
suppose AS1 learns (via inter-AS protocol) that subnet x
reachable via AS3 (gateway 1c), but not via AS2
inter-AS protocol propagates reachability info to all internal
routers
router 1d determines from intra-AS routing info that its interface
I is on the least cost path to 1c
installs forwarding table entry (x,I)
3c … x
3a
3b
AS3 2c other
1c 2a networks
other 1a 2b
networks 1b AS2
AS1 1d
Example: choosing among multiple ASes
now suppose AS1 learns from inter-AS protocol that subnet
x is reachable from AS3 and from AS2.
to configure forwarding table, router 1d must determine
which gateway it should forward packets towards for dest x
this is also job of inter-AS routing protocol!
3c … x …
3b
3a …
AS3 2c other
1c 2a networks
other 1a 2b
networks 1b AS2
AS1 1d
?
Example: choosing among multiple ASes
now suppose AS1 learns from inter-AS protocol that subnet
x is reachable from AS3 and from AS2.
to configure forwarding table, router 1d must determine
towards which gateway it should forward packets for dest x
this is also job of inter-AS routing protocol!
hot potato routing: send packet towards closest of two
routers.
backbone
area
border
routers
area 3
internal
routers
area 1
area 2
Hierarchical OSPF
two-level hierarchy: local area, backbone.
link-state advertisements only in area
each node has detailed area topology; only know
direction (shortest path) to nets in other areas.
area border routers: “summarize” distances to nets
in own area, advertise to other Area Border routers.
backbone routers: run OSPF routing limited to
backbone.
boundary routers: connect to other AS’s.
Chapter 5: outline
5.1 introduction
5.2 routing protocols
link state
distance vector
2b
2a 2c
∂
1b 3b
2d
1a 1c ∂
3a 3c
AS 2
1d 3d
AS 1 eBGP connectivity AS 3
iBGP connectivity
Establish session on
TCP port 179 AS1
eBGP router
BGP session
Exchange all
eBGP router
active routes
AS2
Exchange incremental
While connection is ALIVE,
updates exchange route UPDATE
messages
BGP message types
Exchanged over TCP connection among two BGP
routers (“peers”)
2d
AS Numbers (ASNs)
ASNs are 4-byte #s now; denote units of routing policy
ASN once was 2-byte before 2007.
AS 4200000000 ~ 4294967294 (94,967,295 ASes) are
reserved for private usage (not visible in the Internet).
• Level 3 Communications, Inc: 1
• MIT: 3
• UCB: 25
• USC: 47
• UCLA: 52
• JPL: 127
The subgraph showing all ASes that have more than 100 neighbors in full
graph of 11,158 nodes. July 6, 2001. Point of view: AT&T route-server
4-48
Path attributes and BGP routes
advertised prefix includes BGP attributes
prefix + attributes = “route”
two important attributes:
AS-PATH: contains ASs through which prefix advertisement
has passed: e.g., AS 67, AS 17
NEXT-HOP: indicates specific internal-AS router to next-hop
AS. (may be multiple links from current AS to next-hop-AS)
Policy-based routing: BGP routers
receive, accept/reject based on “policies”,
and advertise
e.g., never route through AS x
Select best route using Attributes
path advertisement
192.0.2.0/24
pick me! Given multiple
path advertisement path advertisement
routes to the same
192.0.2.0/24 192.0.2.0/24
prefix, a BGP router
pick me! pick me! must pick at most one
“best route”
192.0.2.0/24
pick me! (Note: it could reject
path advertisement
them all!)
4-50
Route selection criteria in BGP
Select route based on:
1. local preference value: policy decision
2. shortest AS-PATH
3. closest NEXT-HOP router
4. ……
2d
2d
gateway router may learn about multiple paths to
destination:
AS1 gateway router 1c learns path AS2,AS3,X from 2a
AS1 gateway router 1c learns path AS3,X from 3a
Based on policy, AS1 gateway router 1c chooses path
AS3,X, and advertises path within AS1 via iBGP
Another example: How AS path is formed
135.207.0.0/16 AS 1129
AS Path = 1755 1239 7018 6341
Global Access
135.207.0.0/16
AS 1755 135.207.0.0/16
AS Path = 1129 1755 1239 7018 6341
AS Path = 1239 7018 6341 Ebone
135.207.0.0/16
AS Path = 1239 3549 7018 6341
AS7018 135.207.0.0/16
135.207.0.0/16 AS Path = 3549 7018 6341
AS Path = 6341
AT&T
AS 6341 135.207.0.0/16
AS 3549
AT&T Research AS Path = 7018 6341 Global Crossing
135.207.0.0/16
Prefix Originated Network Layer 5-54
An Example of BGP Routing Table
show ip bgp
BGP table version is 111849680, local router ID is 203.62.248.4
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal
Origin codes: i - IGP, e - EGP, ? - incomplete
. . .
*>i192.35.25.0 134.159.0.1 50 0 16779 1 701 703 i
*>i192.35.29.0 166.49.251.25 50 0 5727 7018 14541 i
*>i192.35.35.0 134.159.0.1 50 0 16779 1 701 1744 i
*>i192.35.37.0 134.159.0.1 50 0 16779 1 3561 i
*>i192.35.39.0 134.159.0.3 50 0 16779 1 701 80 i
*>i192.35.44.0 166.49.251.25 50 0 5727 7018 1785 i
*>i192.35.48.0 203.62.248.34 55 0 16779 209 7843 225 225 225 225 225 i
*>i192.35.49.0 203.62.248.34 55 0 16779 209 7843 225 225 225 225 225 i
*>i192.35.50.0 203.62.248.34 55 0 16779 3549 714 714 714 i
*>i192.35.51.0/25 203.62.248.34 55 0 16779 3549 14744 14744 14744 14744 14744 14744 14744
14744 i
. . .
Data by 5/13/2021
BGP table size: 881264 prefixes
# of ASes in routing system: 71490
# of ASes announcing only one prefix: 25059
Largest number of prefixes announced by an AS:
8563
AS8151: Uninet S.A. de C.V., MX
In the US, VIASAT-SP-BACKBONE (AS7155) has
4027 prefixes; CableOne (AS11492) has 4771
prefixes; Amazon-2 (AS16509) has 5135 prefixes
Source: https://www.cidr-report.org/as2.0/
Source: https://www.cidr-report.org/as2.0/
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
dest interface recall: 1a, 1b, 1c learn about dest X via iBGP from 1c:
… … “path to X goes through 1c”
X 1 1d: OSPF intra-domain routing: to get to 1c,
… … forward over outgoing local interface 1
BGP, OSPF, forwarding table entries
Q: how does router set forwarding table entry to distant prefix?
AS3 3b
AS1 1b
1
3a 3c
1a 2 1c
AS2 2b 3d X
1d
2a 2c
2d
dest interface recall: 1a, 1b, 1c learn about dest X via iBGP from 1c:
… … “path to X goes through 1c”
X 2 1d: OSPF intra-domain routing: to get to 1c,
… … forward over outgoing local interface 1
1a: OSPF intra-domain routing: to get to 1c,
forward over outgoing local interface 2
BGP route selection
BGP router may learn about more than 1
route to destination AS, selects route based
on:
1. local preference value attribute: policy
decision
2. shortest AS-PATH
3. closest NEXT-HOP router: hot potato routing
4. additional criteria
Hot Potato Routing
AS3 3b
AS1 1b
3a 3c
1a 1c
AS2 2b 3d X
1d 112
AS3,X
152
AS1,AS3,X 2a 263 2c
201
OSPF link weights
2d
Y
A advertises path AW to B
B advertises path BAW to X
Should B advertise path BAW to C?
No way! B gets no “revenue” for routing CBAW since neither W nor C
are B’s customers
B wants to force C to route to w via A
B wants to route only to/from its customers!
Why different Intra-, Inter-AS routing ?
policy:
inter-AS: admin wants control over how its traffic
routed, who routes through its net.
intra-AS: single admin, so no policy decisions needed
scale:
hierarchical routing saves table size, reduced update
traffic
performance:
intra-AS: can focus on performance
inter-AS: policy may dominate over performance
Chapter 5: outline
5.1 introduction 5.5 The SDN control
5.2 routing protocols plane
link state 5.6 ICMP: The Internet
distance vector Control Message
Protocol
5.3 intra-AS routing in the
Internet: OSPF 5.7 Network management
and SNMP
5.4 routing among the ISPs:
BGP
3 probes 3 probes
3 probes
Network Layer: Control Plane 5-67
Chapter 5: summary
we’ve learned a lot!
approaches to network control plane
per-router control (traditional)
logically centralized control (software defined networking)
traditional routing algorithms
implementation in Internet: OSPF, BGP
Internet Control Message Protocol