Professional Documents
Culture Documents
06 - CN-Network Layer - Part II
06 - CN-Network Layer - Part II
06 - CN-Network Layer - Part II
v 3 w
2 5
u 2 z
1
3
1 2
x y
1
graph:
= set of routers
set of links
5
v 3 w
2 5
u 2 z cost could always be 1, or
3 1 inversely related to bandwidth
1 x y 2
1
cost of path
Q: global or decentralized
Q: static or dynamic?
information?
Static:
Global:
routes change slowly over
all routers have complete topology
time
and link cost info
Example: Link State (LS)
Dynamic:
routes change more quickly
algorithms
periodic update
Decentralized:
in response to link cost
router knows physically-connected
notes: 5
4
7
construct shortest path tree 8
by tracing predecessor
nodes u 3 w y z
2
ties can exist (can be broken
3
arbitrarily) 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
1
2
3
4
5
5
v 3 w
2 5
u 2 z
3 1
1 x 2
y
1
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
v 3 w
2 5
u 2 z
3 1
1 x 2
y
1
Dijkstra’s algorithm: example (2)
resulting shortest-path tree from u:
v w
u z
x y
Solution to Oscillations:
One solution
mandate that link costs not depend on the amount of traffic
carried— an unacceptable solution since one goal of routing is
to avoid highly congested (for example, high-delay) links.
Second solution
not all routers run the LS algorithm at the same time.
Chapter 4: outline
4.5 routing
4.1 introduction
algorithms
link state
4.2virtual circuit and datagram networks
distance vector
4.3 what’s inside a router
hierarchical routing
4.4 IP: Internet Protocol
4.6 routing in the Internet
datagram format
RIP
IPv4 addressing
OSPF
ICMP
BGP
IPv6
4.7 broadcast and multicast routing
Distance vector algorithm
5 clearly,
v 3 w
2 5
u 2 z B-F equation says:
3 1
1 x y 2
1
key idea:
from time-to-time, each node sends its own distance vector
estimate to neighbors
when x receives new DV estimate from neighbor, it
updates its own DV using B-F equation:
𝐷 𝑥( 𝑦)←𝑚𝑖𝑛 𝑣 {𝑐(𝑥 , 𝑣)+𝐷 𝑣 (𝑦 )} 𝑓𝑜𝑟 𝑒𝑎𝑐h 𝑛𝑜𝑑𝑒 𝑦 ∊ 𝑁
under minor, natural conditions, the estimate converge to the
actual least cost
Distance vector algorithm
from
y ∞∞ ∞ y 2 0 1
from
z ∞∞ ∞ z 7 1 0
node y cost to
table x y z y
2 1
x ∞ ∞ ∞ x z
y 2 0 1 7
from
z ∞∞ ∞
node z cost to
table x y z
x ∞∞ ∞
y ∞∞ ∞
from
z 71 0
time
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
y ∞∞ ∞ y 2 0 1
from
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 y
x y z 2 1
x ∞ ∞ ∞ x 0 2 7 x 0 2 3 x z
y 2 0 1 y 2 7
from
from
0 1 y 2 0 1
from
z ∞∞ ∞ z 7 1 0 z 3 1 0
table x y z x y z x y z
x ∞∞ ∞ x 0 2 7 x 0 2 3
from
y 2 y 2 0 1
from
y ∞∞ ∞ 0 1
from
z 71 0 z 3 1 0 z 3 1 0
time
Distance vector: link cost changes
60
link cost changes: 4
y
1
node detects local link cost change x z
50
bad news travels slow - “count to infinity” problem!
44 iterations before algorithm stabilizes: see text
At t0:
60
y
Distance vector: link cost changes4 1
x z
50
At t1:
Node y informs z of its new distance vector
Now there is a routing loop —in order to get to x
• y routes through z, and z routes through y.
After t1:
Dz(x) = min{50 + 0,1 + 6} = 7.
At t2:
Node z informs y of its new distance vector
60
y
Distance vector: link cost changes4 1
x z
50
After t2:
In a similar manner, after receiving z’s new distance vector, y
determines Dy(x) = 8 and sends z its distance vector. z then
determines Dz(x) = 9 and sends y its distance vector, and so on.
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)
Chapter 4: outline
4.5 routing
4.1 introduction
algorithms
link state
4.2virtual circuit and datagram networks
distance vector
4.3 what’s inside a router
hierarchical routing
4.4 IP: Internet Protocol
4.6 routing in the Internet
datagram format
RIP
IPv4 addressing
OSPF
ICMP
BGP
IPv6
4.7 broadcast and multicast routing
Hierarchical routing
Administrative autonomy
internet = network of networks
each network admin may want to control routing in its own network
gateway router:
at “edge” of its own AS has link to router in another AS
Interconnected ASes
Suppose AS1 learns (via inter-AS protocol) that subnet x reachable via AS3
(gateway 1c), but not via AS2
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
AS1 1d AS2
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
3c … x …
3b
3a …
AS3 2c other
1c 2a networks
other 1a 2b
networks 1b
AS1 1d AS2
?
Example: choosing among multiple ASes
boundary router
backbone router
backbone
area
border
routers
area 3
internal
area 1 routers
area 2
Hierarchical OSPF
3c
BGP
3a message
3b
AS3 2c other
1c 2a networks
other 1a 2b
networks 1b
AS1 1d AS2
BGP basics: distributing path information
eBGP session
3a iBGP session
3b
AS3 2c other
1c 2a networks
other 1a 2b
networks 1b
AS1 1d AS2
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)
gateway router receiving route advertisement uses
import policy to accept/decline
e.g., never route through AS x
policy-based routing
BGP route selection
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
BGP routing policy
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