0% found this document useful (0 votes)
960 views38 pages

3.distance Vector Routing

Distance vector routing is a routing algorithm where each router maintains a routing table with the best known distance to reach each destination network and the next-hop router to use. The tables are updated periodically as routers exchange routing information with their neighbors, calculating new distances using the Bellman-Ford equation. This allows each router to dynamically learn the optimal paths throughout the network to send packets.

Uploaded by

Divya K.S
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
960 views38 pages

3.distance Vector Routing

Distance vector routing is a routing algorithm where each router maintains a routing table with the best known distance to reach each destination network and the next-hop router to use. The tables are updated periodically as routers exchange routing information with their neighbors, calculating new distances using the Bellman-Ford equation. This allows each router to dynamically learn the optimal paths throughout the network to send packets.

Uploaded by

Divya K.S
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 38

Distance Vector Routing

Prepared by
Divya K S
Adi Shankara Institute of Engineering & Technology
Kalady
Dynamic routing algorithm

Two dynamic algorithms are the most popular

1. Distance vector routing and

2. Link state routing

2
Distance Vector Routing (DVR)
• Algorithms operate by having each router maintain a table
(i.e, a vector) giving the best known distance to each
destination and which line to use to get there.
• These tables are updated by exchanging information with
the neighbors
• Other names:
• distributed Bellman-Ford routing algorithm
• Ford-Fulkerson algorithm
• original ARPANET routing algorithm used in Internet under
the name RIP (Routing Information Protocol)

3
Routing Algorithms - DVR
• In DVR, each router maintains a routing table containing one
entry for each router in the subnet.

• This entry contains two parts:


• the preferred outgoing line to use for that destination

• an estimate of the time or distance to that destination

• The metric used might be


• number of hops,

• time delay in milliseconds,

• total number of packets queued along the path, or

• something similar 4
Distance vector Routing
• The starting assumption for distance vector routing is that each node
knows the cost of the link to each of its directly connected
neighbours.
• Distance to other nodes are assigned to an infinite cost
Steps
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
•This step is repeated for (n-2) times if there are n routers in the network.
•After this, routing tables converge / become stable.
Distance Vector Routing Example-

• Consider-
• There is a network consisting of 4 routers.
• The weights are mentioned on the edges.
• Weights could be distances or costs or delays.
Step-01:
Each router prepares its routing table using its local knowledge.

• At Router A-
Step-02:

• Each router exchanges its distance vector obtained in Step-01 with its
neighbors.
• After exchanging the distance vectors, each router prepares a new routing
table by updating the distance based on the following equation
• Let dx(y) be the cost of the least-cost path from node x to node y.
• The least costs are related by Bellman-Ford equation,
• dx(y) = minv{c(x,v) + dv(y)}
• where,
• dx(y)= The least distance from x to y
c(x,v)= Node x's cost from each of its neighbour v
dv(y)= Distance from neighbor to node y
minv= selecting shortest distance.
• Cost of reaching destination B from router A = min { 2+0 , 1+7 } = 2 via
B.
• Cost of reaching destination C from router A = min { 2+3 , 1+11 } = 5
via B.
• Cost of reaching destination D from router A = min { 2+7 , 1+0 } = 1 via
D.
New routing table at router B is-
Step-03:

• Each router exchanges its distance vector obtained in Step-02 with its
neighboring routers.
• After exchanging the distance vectors, each router prepares a new
routing table.

Important Notes-

• In Distance Vector Routing,


• Only distance vectors are exchanged.
• “Next hop”values are not exchanged.
• While preparing a new routing table-
• A router takes into consideration only the distance vectors it has obtained from its neighboring
routers.
• It does not take into consideration its old routing table.
• The algorithm is called so because-
• It involves exchanging of distance vectors between the routers.
• Distance vector is nothing but an array of distance
• Routing tables are prepared total (n-1) times if there are n routers in the given network.
• This is because shortest path between any 2 nodes contains at most n-1 edges if there are n nodes in
the graph.
• Distance Vector Routing suffers from count to infinity problem.
• For more details:
• https://www.gatevidyalay.com/distance-vector-routing-routing-algorit
hms/
Count to infinity problem
• The main issue with Distance Vector Routing (DVR) protocols is
Routing Loops which causes Count to Infinity Problem.
• Routing loops usually occur when any interface goes down or two-
routers send updates at the same time
• Consider the diagram shown below
Count to infinity problem
• In the figure ,B will know that it can get to C at a cost of 1, and A will know that it
can get to C via B at a cost of 2

• If the link between B and C is disconnected, then B will know that it


can no longer get to C via that link and will update the distance as infinity.
• Before it can send any updates it’s possible that it will receive an
update from A which will be advertising that it can get to C at a cost
of 2.
Count to infinity problem
• B can get to A at a cost of 1, so it will update a route to C via A at a
cost of 3.
• A will then receive updates from B later and update its cost to 4.
• They will then go on feeding each other bad information toward
infinity which is called as Count to Infinity problem
• Solution for Count to Infinity problem:
1. Route Poisoning:
2. Split horizon
• ANS: Going via B gives (11, 6, 14, 18, 12, 8).
• Going via D gives (19, 15, 9, 3, 9, 10).
• Going via E gives (12, 11, 8, 14, 5, 9).
• Taking the minimum for each destination except C gives (11, 6, 0, 3, 5,
8).
• The outgoing lines are (B, B, -, D, E, B).
Going via B gives (14, 9, 17, 21, 15, 11) Going via D gives (22,
18, 12, 6, 15, 16) Going via E gives (10, 9, 6, 12, 3, 7) Taking the
minimum for each destination except F gives (10, 9, 6, 6, 3, -)
The outgoing lines are (E, B, E, D, E, -)

You might also like