Introduction
Routing
Routing in the Internet
Distance Vector Routing
Information Protocol (RIP) is a
simple protocol of the distance vector
family
They are often referred to as BellmanFord protocols -- based on the shortest
path algorithm invented by R. E. Bellman
Internet RIP was developed as a
component of the Berkeley UNIX
Distance Vector Routing
Consider
a simple network
Each node is identified by its address -represented A, B, ....
Suppose the network is powered up
simultaneously -- cold start
the
nodes need to remember their addresses
identify the links to which they are attached
Distance Vector Routing
A node broadcasts distance vector to all its
neighbors on all the local links
Other nodes will receive this information -enlarge their knowledge of the network
Final table on A will look like:
Distance Vector Routing
Distance Vector Routing
What if a link breaks?
Assume that after the routing tables have
been computed, link 1 suddenly breaks
Distance Vector Routing
The
distance vector algorithm will update
the routing tables -- As routing table after
convergence:
Distance Vector Routing
Distance Vector Routing
The Bouncing Effect:
Assume that all link costs are not uniform and
equal to 1 -- e.g., link 5 has cost 10, while others
1
Assume that link #2 breaks -- this is immediately
noticed by B -- updating the distance to C to
infinity
Distance Vector Routing
Suppose
before B sends its distance
vectors to neighbors, A sends its own
distance vectors to B and D
Distance Vector Routing
The message will have
no effect on D
B will add 1 to As
advertised cost of 2 to
reach C and update its
value to 3 which is lower
than INF
B advertises this value to
A and E
Creates a loop: packets
bound to C will reach B
and then bounce back
and forth between B and
A until TTL expires
Distance Vector Routing
A
round of update messages increase
the cost by 2 units when there is a loop
involved
In this case, the loop will be broken when
the distance between E and C as given by
the routing table exceeds 10
During the intermediate states -- when
loops occur -- packets will accumulate and
congest the corresponding links
Distance Vector Routing
Counting to Infinity:
Consider following situation:
link
#1 fails -- routing tables updated
link #6 fails -- A & D are isolated from the
other nodes
Distance Vector Routing
D noticed the link failure and updates its routing
table
Distance Vector Routing
If
A transmits first its last distance vector
given by
A: A =0, B = 3, D = 3, C = 3, E = 3 (link #s
shown)
Table @ D will be updated to:
If D transmits its new value to A the algorithm
will converge immediately -- no problem
Distance Vector Routing
A
loop is created
Because B, C, and E are isolated -- no
chance to converge to naturally to a stable
state
At each exchange, distances to B, C, and
E increases by 2
This process is called -- counting to infinity
-- can be stopped by a convention that
represents a large distance as infinity
Distance Vector Routing
Nodes
send different versions updates on
different outgoing links
Simple form:
nodes
omit from messages information about
destination routed on the link
Split
Distance Vector Routing
Split horizon:
Bouncing effect and the long time taken
for counting to infinity are undesirable
features of distance vector protocols
Split horizon is one of the technique
investigated to address this problem
Idea: if A is routing packets to X via B, B
should not try to reach X through A
A
should not announce to B that X is a short
distance away from A
Distance Vector Routing
Not
all forms of loops are eliminated by
split horizon
After link failure between D & E, routing
tables at B, C, and E include following
entries:
horizon with poisonous reverse:
will
include all destinations in the distance
message but will set the corresponding
distance to INF
this will kill loops with two hops
Distance Vector Routing
E
notices the failure of the link and sends
an advertisement message on links 4 and
5 -- distance to D is INF
Message reaches B but not C (lost)
Distance Vector Routing
If
C advertises with poisonous reverse
advertise
INF distance to E on link 5 and a
distance of 2 on link 2
will update its table and advertise
INF
on link 2 and distance of 3 on link 4
Distance Vector Routing
Triggered updates:
Issue: when to send update to neighbors?
Implementations of DV rely on regular
sending of distance vectors
Triggered updates -- nodes should send
messages as soon as they notice a
change in their routing tables
Triggered updates can speed up the loop
resolution even when counting to infinity
RIP Version 1
RIP
is one distance vector protocol
RIP is an internal gateway protocol (IGP)
used
within an autonomous system (AS) -- a
network of relatively limited size
By
default, RIP uses hop count as the
distance between 1 to 15, 16 is INF
RIP packets are carried over IP/UDP -uses UDP port 520 for emission and
reception
RIP Version 1
Packets are normally sent as broadcasts
Packets sent every 30 seconds or faster incase of
triggered updates
If route not refreshed for 180s set to INF
Message format:
RIP Version 1
RIP processing:
RIP process on reception of a response -updates its routing table
if
entry is not present and if received message
is not INF, add it, init the metric to received
value, set next router to message sender,
start timer
Open Shortest Path First
(OSPF)
RIP Version 1
if
entry is present with a larger metric, update
the metric to received value, set next router to
message sender, start timer
if entry is present and next router is message
sender, update metric if it differs from stored
value, restart the timer
Link state protocols are based on a distributed
map concept
all nodes have a network map regularly updated
Issues:
how the maps are represented
how updates are flooded to the network nodes
why the map updates must be secured
how networks can split and then rejoin
why shortest path first?
OSPF
Principle:
OSPF
each node maintains a complete copy of the network
map
performs a complete computation of the best routes
from this local map
Each record has been inserted by one station
that is responsible for it
If we send a packet from A to C, we rely on
computations by A and B
A send on link #1 to B; B sends on link #2 to C
OSPF
Flooding protocol:
A routing protocol should adapt the routes
according to network changes
Database should be updated after each change
OSPF
Flooding algorithm:
receive
the message; look record in database
record not present add it to database
broadcast the message
else if record found & database record # is
lower, replace record with new value
broadcast msg.
else if record found & database record # is
higher, transmit the database value in a new
message through the incoming interface
else if both record #s are equal do nothing
if
OSPF
After
the flooding process following is the
database:
OSPF
Bringing up adjacencies:
Consider the example where we had two failures:
Failure of link #6 will be detected by D and E
They can transmit this new information to their
connected neighbors only
After executing the flooding, we have two versions of the
database
OSPF
Two
databases will evolve differently
flooding cannot across
Suppose link #2 fails one version of the
database (I.e., on in A & D) will not detect
for
routing this is not important it will be
done correctly
Suppose
records
link #1 becomes operational:
describing link #1 will be corrected
records describing links #2 and #6 may be
incoherent
OSPF
It
is necessary to ensure that both sides
end up having aligned databases
known
as bringing up adjacencies in OSPF
two parties should synchronize and keep only
the most up-to-date version of each record
Most
records may have similar copies
inefficient to send the records
data
description packets are sent link
identifiers and version numbers
routers compare their version numbers and
build a interesting records packet router
requests copies of interesting records
OSPF
In
OSPF, we need to protect distributed
routing database against corruption
OSPF includes a number of protections:
flooding
procedures include hop-by-hop ACKs
link state record protected by timers
removed if not refreshed on time
records are protected by checksum
messages can be authenticated by password
database description packets are transmitted
in a secure fashion
OSPF
Why is link state protocol better?
fast, loopless convergence
support for precise, if needed multiple
metrics
support of multiple paths to a destination
separate representation of external routes
OSPF
OSPF
Fast loopless convergence:
Triggered updates may not require more
messages than flooding protocol but
multiple updates may be needed to correct
the routing tables
Most important is the loopless property of
OSPF
Loops can cause congestion and prolong
the loop duration makes OSPF better
Support for multiple metrics:
It is difficult for distance vector protocol to
support fine-grained metrics it is not
impossible!
In OSPF, it is possible to have fine-grained
variation and also support several metrics
in parallel
best route definition is arbitrary:
largest
throughput
delay
lowest cost
best reliability
lowest
10
OSPF
OSPF
Handling
different metrics with link state
algorithm requires:
documenting
several metrics for each link
computing different routing tables for each
metric
presenting the selected metric in packets
link #1 T1 satellite link
link #2 & #3 T1 terrestrial links
link #4 & #5 64 kbps terrestrial links
satellite links have long delays (275 ms) and
terrestrial links have a short delays (10 ms)
OSPF
Path
D, C, A, B throughput 1.5 Mbps
and delay 295 ms
Path D, E, B throughput 64 Kbps and
delay 20 ms
OSPF
When
throughput metric is used, D, C, A,
B path is chosen
When delay metric is used D, E, B path is
chosen
It is necessary to make consistent
decisions
if
D routes a packet to B to C based on
throughput
C should use throughput for routing this
packet otherwise it may route it back to D!
routing loop
solution: packet should indicate what metric
should be used
11
OSPF
Multiple paths:
Almost equivalent paths exists for a given source
and destination pair
Two paths from A to E: one via B and via D
RIP chooses one arbitrarily because there is only
one next hop entry in the routing table
OSPF
Analysis
has shown that splitting traffic
over two paths is more efficient
Simple improvement give us a list of
shortest paths to a destination
Splitting traffic between several paths has
downsides too e.g., with TCP flows
packets
routed along different paths
can arrive out-of-order at the destination
can trigger retransmissions
OSPF
External Routes:
So far only the internal routes problem
was considered
network is generally connected through
one or several external gateways to
other networks
When there is only one gateway to the
external world the situation is simple
have default route
OSPF..
When
there are multiple gateways
default route solution is very inefficient
it
usually picks the nearest external gateway
even though another gateway would have
been quicker to destination
OSPF has gateway link state records to
support this
12
OSPF
OSPF
is a link state protocol follows the
general theory of such protocols
distributed
database
a flooding procedure
definition of adjacency
special records for external routes
OSPF
OSPF
routers in the same network share
a database composed of link state
records
These records are used
represent
compute
For
network topology
the shortest path
example:
summary
for IP network
for border router
external routes
summary
OSPF
Link
state advertisement header:
13