Distance Vector Routing (DVR) Protocol - GeeksforGeeks

06 Nov, 2019
A distance-vector routing (DVR) protocol requires that a router inform its neighbors of topology changes periodically. Historically known as the old ARPANET routing algorithm (or known as Bellman-Ford algorithm).
Bellman Ford Basics – Each router maintains a Distance Vector table containing the distance between itself and ALL possible destination nodes. Distances,based on a chosen metric, are computed using information from the neighbors’ distance vectors.
Information kept by DV router -
Each router has an IDAssociated with each link connected to a router, 
there is a link cost (static or dynamic).Intermediate hops
Distance Vector Table Initialization -Distance to itself = 0Distance to ALL other routers = infinity number.

Each router has an ID
Associated with each link connected to a router, 
there is a link cost (static or dynamic).
Intermediate hops
Distance to itself = 0
Distance to ALL other routers = infinity number.
Distance Vector Algorithm –
A router transmits its distance vector to each of its neighbors in a routing packet.Each router receives and saves the most recently received distance vector from each of its neighbors.A router recalculates its distance vector when:It receives a distance vector from a neighbor containing different information than before.It discovers that a link to a neighbor has gone down.
A router transmits its distance vector to each of its neighbors in a routing packet.
Each router receives and saves the most recently received distance vector from each of its neighbors.
A router recalculates its distance vector when:It receives a distance vector from a neighbor containing different information than before.It discovers that a link to a neighbor has gone down.
It receives a distance vector from a neighbor containing different information than before.
It discovers that a link to a neighbor has gone down.
The DV calculation is based on minimizing the cost to each destination
Dx(y) = Estimate of least cost from x to y 
C(x,v) =  Node x knows cost to each neighbor v
Dx   =  [Dx(y): y ∈ N ] = Node x maintains distance vector
Node x also maintains its neighbors' distance vectors
– For each neighbor v, x maintains Dv = [Dv(y): y ∈ N ]

Note –
From time-to-time, each node sends its own distance vector estimate to neighbors.
When a node x receives new DV estimate from any neighbor v, it saves v’s distance vector and it updates its own DV using B-F equation:Dx(y) = min { C(x,v) + Dv(y), Dx(y) } for each node y ∈ N

Dx(y) = min { C(x,v) + Dv(y), Dx(y) } for each node y ∈ N

Example – Consider 3-routers X, Y and Z as shown in figure. Each router have their routing table. Every routing table will contain distance to the destination nodes.Consider router X , X will share it routing table to neighbors and neighbors will share it routing table to it to X and distance from node X to destination will be calculated using bellmen- ford equation.
 Dx(y) = min { C(x,v) + Dv(y)} for each node y ∈ N

As we can see that distance will be less going from X to Z when Y is intermediate node(hop) so it will be update in routing table X.Similarly for Z also –
Finally the routing table for all –Advantages of Distance Vector routing –
It is simpler to configure and maintain than link state routing.Disadvantages of Distance Vector routing –It is slower to converge than link state.It is at risk from the count-to-infinity problem.It creates more traffic than link state since a hop count change must be propagated to all routers and processed on each router. Hop count updates take place on a periodic basis, even if there are no changes in the network topology, so bandwidth-wasting broadcasts still occur.For larger networks, distance vector routing results in larger routing tables than link state since each router must know about all other routers. This can also lead to congestion on WAN links.Note – Distance Vector routing uses UDP(User datagram protocol) for transportation.GATE CS Corner QuestionsPracticing the following questions will help you test your knowledge. All questions have been asked in GATE in previous years or in GATE Mock Tests. It is highly recommended that you practice them.GATE CS 2011, Question 52GATE CS 2011, Question 53GATE CS 2010, Question 54GATE CS 2010, Question 55GATE IT 2005, Question 28GATE CS 2014 (Set 1), Question 33GATE IT 2008, Question 65GATE CS 2014 (Set 2), Question 65References –Distance vector routing – wikipediawww.eecs.yorku.caThis article is contributed by Akash Sharan. If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.My Personal Notes
arrow_drop_upSave
Disadvantages of Distance Vector routing –
It is slower to converge than link state.
It is at risk from the count-to-infinity problem.
It creates more traffic than link state since a hop count change must be propagated to all routers and processed on each router. Hop count updates take place on a periodic basis, even if there are no changes in the network topology, so bandwidth-wasting broadcasts still occur.
For larger networks, distance vector routing results in larger routing tables than link state since each router must know about all other routers. This can also lead to congestion on WAN links.
Note – Distance Vector routing uses UDP(User datagram protocol) for transportation.
GATE CS Corner Questions
Practicing the following questions will help you test your knowledge. All questions have been asked in GATE in previous years or in GATE Mock Tests. It is highly recommended that you practice them.
GATE CS 2011, Question 52GATE CS 2011, Question 53GATE CS 2010, Question 54GATE CS 2010, Question 55GATE IT 2005, Question 28GATE CS 2014 (Set 1), Question 33GATE IT 2008, Question 65GATE CS 2014 (Set 2), Question 65
GATE CS 2011, Question 52
GATE CS 2011, Question 53
GATE CS 2010, Question 54
GATE CS 2010, Question 55
GATE IT 2005, Question 28
GATE CS 2014 (Set 1), Question 33
GATE IT 2008, Question 65
GATE CS 2014 (Set 2), Question 65
References –
Distance vector routing – wikipediawww.eecs.yorku.ca
This article is contributed by Akash Sharan. If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.
HarshithPvs
Computer Networks
GATE CS
Computer Networks
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
Differences between IPv4 and IPv6
Socket Programming in Python
Caesar Cipher in Cryptography
UDP Server-Client implementation in C
Socket Programming in Java
ACID Properties in DBMS
Types of Operating Systems
Normal Forms in DBMS
Page Replacement Algorithms in Operating Systems
Cache Memory in Computer Organization