Download - Distance Vector Protocol
-
8/9/2019 Distance Vector Protocol
1/33
Distance vector routingDistance vector routing
-
8/9/2019 Distance Vector Protocol
2/33
ReferencesReferencesAn Engineering Approach to Computer
Networking
By S. Keshav
Chapter 11 Routing
Tanenbaum5.1.1,5.2.4
-
8/9/2019 Distance Vector Protocol
3/33
Distance vector routingDistance vector routing Two key algorithms
distance vector
link-state
Both assume that each router knows address of each neighbor
cost of reaching each neighbor
Both allow a router to determine global routinginformation by talking to its neighbors
-
8/9/2019 Distance Vector Protocol
4/33
Basic ideaBasic idea Node tells its neighbors its best idea of distance
to everyother node in the network
Node receives these distance vectors from its
neighbors
Updates its notion of best path to each
destination, and the next hop for this destination
Features distributed
adapts to traffic changes and link failures
-
8/9/2019 Distance Vector Protocol
5/33
Distance Vector ProtocolsDistance Vector Protocols Unit of information exchange
vector of distances to destinations
Also called Distributed Bellman-Ford Algorithm
-
8/9/2019 Distance Vector Protocol
6/33
Distance Vector ProtocolsDistance Vector ProtocolsAssumed that each router knows the identity of
every other router in the network
But not the shortest possible path
Each router keeps a Distance Vectorper
destination
Routers periodically exchange the Distance
Vector
On receipt, each router compares the currentdistance and the distance through the neighbor
and updates its routing table
-
8/9/2019 Distance Vector Protocol
7/33
ExampleExample -- initial distancesinitial distances
Info at
node
A
B
C
D
A B C
0 7 ~
7 0 1
~ 1 0
~ ~ 2
Distance to node
D
~
~
2
0E 1 8 ~ 2
1
8
~
20
E
2A
B
E
C
D
7
1
1
2
8
Initially A does not know that C
exists
Each router knows
1. Address of each neighbor2. Cost of reaching each neighbor
-
8/9/2019 Distance Vector Protocol
8/33
E receives Ds routesE receives Ds routes
Info at
node
A
B
C
D
A B C
0 7 ~
7 0 1
~ 1 0
~ ~ 2
Distance to node
D
~
~
2
0E 1 8 ~ 2
1
8
~
20
E
A
B
E
C
D
7
1
1
2
28
-
8/9/2019 Distance Vector Protocol
9/33
E updates cost to CE updates cost to C
A
B
E
C
D
7
1
1
2
28
Info at
node
A
B
C
D
A B C
0 7 ~
7 0 1
~ 1 0
~ ~ 2
Distance to node
D
~
~
2
0E 1 8 4 2
1
8
~
20
E
-
8/9/2019 Distance Vector Protocol
10/33
A receives Bs routesA receives Bs routes
Info at
node
A
B
C
D
A B C
0 7 ~
7 0 1
~ 1 0
~ ~ 2
Distance to node
D
~
~
2
0E 1 8 4 2
1
8
~
20
E
A
B
E
C
D
7
1
1
2
28
-
8/9/2019 Distance Vector Protocol
11/33
A updates cost to CA updates cost to C
A
B
E
C
D
7
1
1
2
28
Info at
node
A
B
C
D
A B C
0 7 8
7 0 1
~ 1 0
~ ~ 2
Distance to node
D
~
~
2
0E 1 8 4 2
1
8
~
20
E
-
8/9/2019 Distance Vector Protocol
12/33
A receives Es routesA receives Es routes
Info at
node
A
B
C
D
A B C
0 7 8
7 0 1
~ 1 0
~ ~ 2
Distance to node
D
~
~
2
0E 1 8 4 2
1
8
~
20
E
A
B
E
C
D
7
1
1
2
28
-
8/9/2019 Distance Vector Protocol
13/33
A updates cost to C and DA updates cost to C and D
A
B
E
C
D
7
1
1
2
28
Info at
node
A
B
C
D
A B C
0 7 5
7 0 1
~ 1 0
~ ~ 2
Distance to node
D
3
~
2
0E 1 8 4 2
1
8
~
20
E
-
8/9/2019 Distance Vector Protocol
14/33
Final distancesFinal distances
Info at
node
A
B
C
D
A B C
0 6 5
6 0 1
5 1 0
3 3 2
Distance to node
D
3
3
2
0E 1 5 4 2
1
5
4
20
E
A
B C
D
7
1
1
2
28
E
-
8/9/2019 Distance Vector Protocol
15/33
Problems with distanceProblems with distance--vector routingvector routing
Problems occur when links go up and down
-
8/9/2019 Distance Vector Protocol
16/33
Final distances after link failureFinal distances after link failure
Info at
node
A
B
C
D
A B C
0 7 8
7 0 1
8 1 0
10 3 2
Distance to node
D
10
3
2
0
E 1 8 9 11
1
8
9
11
0
E
A
B C
D
7
1
1
2
28
E
Info at
node
A
B
C
D
A B C
0 6 5
6 0 1
5 1 0
3 3 2
Distance to node
D
3
3
2
0
E 1 5 4 2
1
5
4
2
0
E
Table reflectingfailure of link ED
-
8/9/2019 Distance Vector Protocol
17/33
Effect of a link failureEffect of a link failure Does the logical table change smoothly?
What is the sequence of messages that are
exchanged to achieve these changes in the table?
How does A find out that the link ED has failed?
A does not know this fact, it ONLY KNOWS
DISTANCES!
A
B C
D
7
1
1
2
28
E
-
8/9/2019 Distance Vector Protocol
18/33
The bouncing effectThe bouncing effect
A
25
1
1
B
C
B
C 2
1
dest cost
A
C 1
1
dest cost
A
B 1
2
dest cost
-
8/9/2019 Distance Vector Protocol
19/33
C sends routes to BC sends routes to B
A
25 1
B
C
B
C 2
1
dest cost
A
C 1
~
dest cost
A
B 1
2
dest cost
-
8/9/2019 Distance Vector Protocol
20/33
B updates distance to AB updates distance to A
A
25 1
B
C
B
C 2
1
dest cost
A
C 1
3
dest cost
A
B 1
2
dest cost
-
8/9/2019 Distance Vector Protocol
21/33
B sends routes to CB sends routes to C
A
25 1
B
C
B
C 2
1
dest cost
A
C 1
3
dest cost
A
B 1
4
dest cost
-
8/9/2019 Distance Vector Protocol
22/33
C sends routes to BC sends routes to B
B
C 2
1
dest cost
A
C 1
5
dest cost
A
B 1
4
dest cost
A
25 1
B
C
How long will this go on?
-
8/9/2019 Distance Vector Protocol
23/33
C sends routes to BC sends routes to B
B
C 2
1
dest cost
A
C 1
dest cost
A
B 1
dest cost
A
25 1
B
C
This is also called Counting-to-Infinity
-
8/9/2019 Distance Vector Protocol
24/33
How are these loops caused?How are these loops caused? When a node computes and distributes a
distance vector
It hides the sequence of operations it used to
compute the vector
-
8/9/2019 Distance Vector Protocol
25/33
SolutionsSolutions
Split horizon B does not advertise route to C
In general
Nodes do not broadcast the same distance vector
on all outgoing links.
Nodes simply omit from their message any
information about destinations routed on that link
Works for two node loops
Does not work for loops with more nodes
-
8/9/2019 Distance Vector Protocol
26/33
Example where split horizon failsExample where split horizon fails
1
11
1
A B
C
D
When link CD breaks, C marks D as
unreachable and reports that to A and B
Suppose A learns it first.
A now thinks best path to D is through B.
A reports a route to D of cost=3 to C.
C thinks D is reachable through A at cost 4
and reports that to B.
B reports a cost 5 to A who reports newcost to C.
etc...
This is count to infinity!
-
8/9/2019 Distance Vector Protocol
27/33
Split Horizon with Poisonous ReverseSplit Horizon with Poisonous Reverse
B does advertise route to C
But puts a negative information
So, that C never uses B for such a destination
-
8/9/2019 Distance Vector Protocol
28/33
Avoiding the Bouncing EffectAvoiding the Bouncing EffectSelect loop-free paths
One way of doing this:
each route advertisement carries entire path
if a router sees itself in path, it rejects the route
Memory Space needed in a router is
proportional to diameter of the network.
-
8/9/2019 Distance Vector Protocol
29/33
Source TracingSource Tracing Augment distance vector to carry
The cost to a destination
The address of the router immediately preceding
the destination.
This information is enough for a source to
construct an entire path.
-
8/9/2019 Distance Vector Protocol
30/33
Computing Implicit PathsComputing Implicit Paths To reduce the space requirements
Propagate for each destination not only the cost
But add another field specifying also its predecessor
can recursively compute the path
space requirements independent of diameter
x
y
z
w
u
v
Destination Preceding Node
s
v u
u w
w z
z y
y y
s y
This is at Node xThis is at Node x
-
8/9/2019 Distance Vector Protocol
31/33
Path to u from x, calculation by xPath to u from x, calculation by x
x
y
z
w
u
v
Destination Preceding Node
s
v u
u w
w z
z y
y y
s y
-
8/9/2019 Distance Vector Protocol
32/33
Loop Freedom at Every InstantLoop Freedom at Every Instant Does avoiding bouncing effect avoid loops?
No! Transient loops are still possible
Why? Because implicit path information may be
stale
Only way to fix this
ensure that you have up-to-date information by
querying.
-
8/9/2019 Distance Vector Protocol
33/33
Periodic vs. Triggered UpdatesPeriodic vs. Triggered Updates Each node sends periodic update messages
even if nothing has changed.
This lets other nodes know that the sender is
alive.
Frequency is several seconds to several
minutes.
Triggered updates happen when a nodechanges its own view of the table.
Trade-off between sensitivity to link failures and
overhead in exchanging routing information