Routing Protocols
Routing Protocols
Network Layer –
Routing Protocol Routing
Protocol
Popular routing protocols
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 e
compute 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 i
compute
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
g h i
1 1
g h i
1 1
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-22
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
from b, d, f, h Dc(h) = ∞ De(i) = ∞
Dc(i) = ∞
d compute
e f DV in f:
DV in h: 1 1
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) = ∞ Dc(g) = ∞
Dc(g) = 1 g h i Dc(h) = ∞
1 1
Dc(h) = 0 Dc(i) = 1
Dc(i) = 1 Network Layer: 5-23
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
1 1
c, 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
▪ updates routing info, recalculates local DV 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.
…
▪ Distributed algorithms are tricky!
Network Layer: 5-26
Split Horizon
• Split horizon is a method used by distance vector protocols
to prevent network routing loops.
• The basic principle is simple: Never send routing information
back in the direction from which it was received.
• Instead of flooding the table through each interface, each
node sends only part of its table through each interface
• E.g. node B thinks that the optimum route to reach X is via A,
it does not need to advertise this piece of information to A.
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? 34
Link state routing
• Link state routing has a different philosophy from that of
distance vector routing.
• In link state routing, each node in the domain has the entire
topology of the domain—the list of nodes and links, how they
are connected including the type, cost (metric), and the
condition of the links (up or down)—the node can use the
Dijkstra algorithm (single source shortest path) to build a routing
table.
• OSPF (Open Shortest path First)
-> Each Node shares the link state packet to all the nodes in the network.
TCP/IP Protocol Suite 38
Concept of Link state routing
43
Interconnected ASs
forwarding table configured by intra-
and inter-AS routing algorithms
▪ intra-AS routing determine entries for
Intra-AS Inter-AS
Routing Routing
intra-AS
3
routing
c 3a 2
intra-AS
3b 2a routing
c 2
1
AS3 intra-AS
inter-AS b
crouting1
1a routing AS2
1
b AS1
d
44
Inter-AS routing: a role in intradomain forwarding
▪ suppose router in AS1 receives datagram destined
outside of AS1: AS1 inter-domain routing must:
1. learn which destinations reachable
• router should forward packet to through AS2, which through AS3
gateway router in AS1, but which 2. propagate this reachability info to all
one? routers in AS1
3
3a other
2
3b c 2a networks
c 2
1
AS3 b
other 1a c 1 AS2
networks
1
b AS1
d
45
Hierarchical OSPF
▪ two-level hierarchy: local area, backbone.
• link-state advertisements flooded only in area, or backbone
• each node has detailed area topology; only knows direction to reach
other destinations
area border routers: boundary router:
“summarize” distances to connects to other ASes
backbone
destinations in own area, backbone router:
advertise in backbone runs OSPF limited
to backbone
local routers:
• flood LS in area only area
• compute routing within 3
area
internal
• forward packets to outside routers
area
via area border router
1 area
46
2
Routing Protocol – BGP
Popular routing protocols
IGP EGP
• Multihomed AS
– More than one connection to other AS, but it is
still only a source or sink for data traffic – BGP
can be used for routing (path manipulation).
• Transit AS (ISPs)
– Multihomed AS that also allows transient
traffic – BGP for routing
TCP/IP Protocol Suite 49
Path Vector Routing
• Distance vector and link state routing are both interior routing protocols. They
can be used inside an autonomous system.
• Distance vector routing is subject to instability if there is more than a few hops
in the domain of operation.
• Link state routing needs a huge amount of resources to calculate routing tables.
It also creates heavy traffic because of flooding.
• There is a need for a third routing protocol which we call path vector routing.
• A national map can tell us the road to each city and the distance
to be traveled if we choose a particular route; an international
map can tell us which cities exist in each country and which
countries should be passed before reaching that city.