18-Distance Vector Routing Protocols-30-09-2024
18-Distance Vector Routing Protocols-30-09-2024
ANUSHA N
Routing Requires Knowing Network
2
Distance Vector Algorithm Overview
• Each router starts with a distance table consisting of the value “0” for itself
and the value “infinity” for every other destination
• Each router will transmit its distance vector to each of its neighbors
whenever the information changes (as well as when a link to a neighbor
first comes up)
• Each router saves the most recently received distance vector from each of
its neighbors, and calculate its own distance vector, based on minimizing
the cost to each destination
Distance Vector Algorithm
iterative:
Distance Table data structure
◼ continues until no nodes
exchange info. ◼ each node has its own
◼ self-terminating: no ◼ row for each possible destination
“signal” to stop ◼ column for each directly-attached
neighbor to node
asynchronous:
◼ example: in node X, for dest. Y via
◼ nodes need not
neighbor Z:
exchange info/iterate in
lock step!
distributed: distance from X to
X = Y, via Z as next hop
◼ each node D (Y,Z)
communicates only with Z
= c(X,Z) + minw{D (Y,w)}
directly-attached
neighbors
Distance Routing: Overview
Iterative, asynchronous: Each node:
each local iteration caused
by:
◼ local link cost change wait for (change in local link
◼ message from neighbor: its cost of msg from neighbor)
least cost path change from
neighbor
recompute distance table
Distributed:
◼ each node notifies neighbors
only when its least cost path if least cost path to any dest
to any destination changes has changed, notify neighbors
– neighbors then notify their
neighbors if necessary
Distance Vector Routing Algorithm
22.7
Distance Vector Routing Algorithm
• Step-01:
• Each router prepares its routing table.
By their local knowledge, each router knows about
– All the routers present in the network
– Distance to its neighboring routers
• Step-02:
• Each router exchanges its distance vector with its neighboring
routers.
• Each router prepares a new routing table using the distance
vectors it has obtained from its neighbors.
22.8
Figure 22.14 Distance vector routing tables
22.9
Figure 22.15 Initialization of tables in distance vector routing
22.10
Note
22.11
Figure 22.16 Updating in distance vector routing
22.12
Distance Table: An Example
1
B C
7
A 8 2
1
E D
2
Modeling a Network
• Modeled as a graph
• Routers nodes 5
• Link edges 3
• Possible edge costs B C
5
2
• Hop
• Delay A 2 1 F
3
• Congestion level 1
• …. 2
D E
1
• Goal of Routing
• Determine “good” path from source to destination
• “Good” usually means the lowest “cost” path
• Where cost is usually hop-count or latency
14
Examples to solve
Examples to solve
Examples to solve
Examples to solve
Examples to solve
Examples to solve
Examples to solve
Examples to solve
Examples to solve
Examples to solve
Examples to solve
Count to Infinity Problem
Count to Infinity Problem
B thinks it can reach C via A and updates its
table
Solution to Count to infinity
• Split Horizon
• Split Horizon and Poison Reverse
Solution to Count to infinity
• Split Horizon
• In this strategy, instead of flooding the table through each interface, each
node sends only part of its table through each interface.
• If, according to its table, node B thinks that the optimum route to reach C
is via A, it does not need to advertise this piece of information to A; the
information has come from A (A already knows).
• Taking information from node A, modifying it, and sending it back to node A
creates the confusion.
• In our scenario, node B eliminates the last line of its routing table before it
sends it to A.
• In this case, node A keeps the value of infinity as the distance to C.
• Later when node A sends its routing table to B, node B also corrects its
routing table.
• The system becomes stable after the first update: both node A and B know
that C is not reachable.
Solution to Count to infinity
• Split Horizon and Poison Reverse
• Using the split horizon strategy has one drawback.
• Normally, the distance vector protocol uses a timer, and if there is no
news about a route, the node deletes the route from its table.
• When node B in the previous scenario eliminates the route to C from
its advertisement to A, node A cannot guess that this is due to the
split horizon strategy (the source of information was A) or because B
has not received any news about X recently.
• The split horizon strategy can be combined with the poison reverse
strategy.
• Node B can still advertise the value for C, but if the source of
information is A, it can replace the distance with infinity as a warning:
"Do not use this value; what I know about this route comes from
you."