1. Home
cyber security

Learn Cyber Security Tutorial Concepts - From Beginner to Pro

Explore essential cyber security tutorials to safeguard your digital assets and protect data.

  • 28 Lessons
  • 5 Hours
right-top-arrow
5

Distance Vector Routing (DVR) Protocol

Updated on 23/08/2024358 Views

Routing protocols help guide network traffic and are used for sharing information among a network of routers. Distance vector routing protocol is used widely in residential and office settings due to its simplicity. In the DVR algorithm, the best-fit path is chosen according to the periodic updates received by the routers. 

Having worked with routers, I’ve curated this tutorial on distance vector routing protocol to help you gain a basic understanding. So let us understand what they are and how they work. 

What is Distance Vector Routing Protocol? 

Distance vector routing protocol is used for calculating the best-fit path for data transmission among routers. It finds the direction and distance of the vector of the next hop through the information received by the neighbor router. If there are any changes in topology, it is necessary to keep track of it as well as inform the neighboring devices. 

Here are some key points you must be aware of when learning about distance vector routing protocol:

i) Routing pattern: In the DVR protocol, routing data is shared by the nodes only to those that are directly linked with one or several nodes in the network. 

ii) Network information: All the nodes in a network must have information regarding their neighbors. Every node in the network is designed to share information with all the nodes in the network.  

iii) Data sharing: As there is a change in network topology, the nodes share information with the neighbors time and again. 

How it Works 

Let’s say, you decide to start a business. Your goal is going to be to advertise about it. Let the other local businesses know about you and spread the word around. As your business grows, you will keep connecting with your neighboring businesses to form a complete network. This is quite similar to what happens in a DVR set-up. 

Let me explain how the distance vector routing protocol works:

  1. Initializing: When a router is switched on, it creates its routing table with directly connected networks. 
  1. Advertising: Every once in a while, every router sends the entire routing table to the immediate neighbors. 
  1. Updating: In case a router gets a better or shorter path from a neighbor, the routing table is updated accordingly. 
  1. Loop preventing: Some techniques such as ‘hold-down timers’ and ‘route poisoning’ prevent endless loops in routing. 
  1. Converging: As many exchanges between neighbors take place, every router gets an accurate and consistent view of the network. 

Classification of Routing Protocols 

There are three types of distance vector routing protocol: 

Distance Vector Routing Algorithm in Computer Networks 

This protocol selects the best-fit path depending on the hop counts to reach a destination in a specified direction. 

Let’s say that you are traveling from point A to point B. You will surely choose the path that has fewer deviations and fewer pit stops. This will help you save time and energy.  The same idea is used in this process. 

Hop count is every router that is present between the source and the destination network. The path having the least hop count is going to be chosen as the best fit. 

Distance Vector Multicast Routing Protocol (DVMRP)

The DVMRP (Distance Vector Multicast Routing Protocol) is a specific type of distance-vector routing protocol. While traditional distance-vector routing protocols like RIP (Routing Information Protocol) are used for unicast routing, DVMRP is specifically designed for multicast routing. 

Link State Routing Protocol 

Compared to any other distance vector routing protocol, this protocol knows the internet the best. Also known as the shortest path first (SPF) protocol, uses the concept of triggered updates - only a topology change triggers an update. 

Hello, messages, also called keep-alive messages are used for neighbor discovery and recovery. The number of updates shared is equal to the number requested by the neighbor router.  

The Distance Vector Algorithm 

This algorithm is used for finding the shortest route within the network from one node to another. The DVR protocol is used for calculating the best-fit route from the source to the destination. It determines the optimal path based on the number of hops or distance. 

The distance vector routing algorithm is: 

dx(y) = minv{c(x,v) + dv(y)}

Where minv = selecting the smallest distance 

             dx(y) = the smallest distance from x to y

  c(x,v) = cost of node x from all of its neighbors v. 

  dv(y) = Distance between each neighbor from the initial node

Let’s say, you set all the routers and run the DVR algorithm. Every router of that network is going to share information of distance with their neighboring router. When all the information has been gathered from the neighbors, an optimal path is selected and stored in the routing table. 

Applications of Distance Vector Routing Algorithm

Let us understand some applications of distance vector routing algorithm in computer networks: 

  • Small-scale networks: The DVR protocol is used commonly in small-scale networks such as residential or office set-ups. Such a network benefits from the routing information being shared among the neighboring routers, facilitating efficient data transfer. 
  • Limited resource networks: The main feature of DVR protocols is their efficiency and simplicity, which is why it is a perfect match for networks with limited resources. This protocol performs efficiently in places where real-time information transmission is not needed. 

Network Model 

In the given network model, there are three blocks - A, B, and C representing the nodes in the connection. Every connection line has a distance-vector value in the given network. 

How to implement a DVR routing table? 

To create the routing table of the network model given above, you should understand how to implement one in DVR. Let me explain: 

  1. Initial assumption: When implementing the DVR protocol, initially every router starts by assuming that it can reach all destinations directly. This is the basis of creating the routing table. 

At first, the local tables of routers are filled with connections to all the destinations. These represent paths that are assumed to be the best-fit route at first. 

  1. Updating routing table: Routers constantly exchange data with neighbors regarding reachable destinations as well as associated costs. The routing table of routers is adjusted accordingly based on these updates. 

When routers receive new data from their neighbors, they compare this information with the existing data in their tables. In case a neighbor offers a more efficient way to a particular destination, the local table of the routers is updated to reflect the better route. 

Solving Network Model 

Let me explain the distance vector routing in computer networks.

First step:

To solve the network model, we need to create the routing table for all the routers. 

Router A: 

This router sends routing data to nodes B and C. There its routing table looks like this: 

Destination 

Vector 

Hop 

0

1

Router B: This router shares data with A and C. Its routing table looks like the following: 

Destination 

Vector 

Hop 

1

0

2

C

Router C: This router shares data with A and B. Its routing table looks like the following: 

Destination 

Vector 

Hop 

5

2

0

C  

Second step

In the second step, we have to update the nodes. 

In the first case, we can see that distance will be less traveling from A to C when B is the intermediate node. So the updated router A table is: 

Destination 

Vector 

Hop 

0

1

Similarly for C also, the updated table will look like the following:             

Destination 

Vector 

Hop 

3

2

0

C  

This example demonstrates that, in distance vector routing, the shortest path is always chosen. 

Advantages of Distance Vector Routing Protocol 

There are several advantages of distance vector routing algorithms in computer networks. Some of these are as follows: 

  • Simplicity: This routing protocol is relatively easy to understand and implement. It is ideal for small networks with limited resources. 
  • Flexibility: It is a flexible routing algorithm that can use different metrics like hop count or delay for choosing the best path
  • Low overhead: Since routers are only exchanging information with their immediate neighbors, this routing algorithm requires minimal overhead. 
  • Scalability: The DVR algorithm can easily be scaled to accommodate a growing network. New routers can easily be added to the network and the distance vectors are updated accordingly. 
  • Compatibility: Some DVR protocols like RIP and IGRP, widely used by router vendors, are compatible with a variety of network devices. 

Disadvantages of Distance Vector Routing Protocol 

Even though there are many advantages of distance vector routing in computer networks, there are also certain limitations. Some of these are as follows: 

  • Limited security: This protocol lacks a built-in security feature, which could make these networks vulnerable to attacks. 
  • Limited accuracy: This routing protocol uses only one metric - like hop count - for determining the best-fit path. It leads to suboptimal paths. 
  • Limited feasibility in larger networks: The DVR protocol is not suited for large networks since it relies on periodic updates from all routers. In a large setting, this could cause a high overhead.

Summing up 

The distance vector routing protocol is an example of the dynamic protocol. Used for calculating the shortest path from one router to another, this routing protocol is widely used due to its flexibility and low overhead. 

If you are looking to expand your career and boost your employability, I will recommend you check out the certified courses offered by upGrad. The courses are designed according to the current market and are taught by experienced professionals.

Frequently Asked Questions 

  1. What is the distance vector routing algorithm used for?

The distance vector routing algorithm is used to find the best path in a network to reach a destination. In this algorithm, routers share information about their connected neighbors to determine the shortest path. 

  1. What are the 3 types of routing protocols?

The three types of routing protocols are as follows: 

  • Distance vector routing protocol 
  • Link state routing protocol 
  • Advanced distance vector routing protocol 
  1. What is an example of distance vector routing?

An example of distance vector routing is Routing Information Protocol (RIP). 

  1. Is distance vector routing dynamic?

Yes, distance vector routing is a dynamic routing algorithm. Every router in this algorithm computes the distance between itself and each possible destination. 

  1. Is OSPF a distance vector protocol?

OSPF (Open Shortest Path First) protocol is not a type of distance vector protocol. Rather it is an example of a link-state routing protocol.

  1. What are the advantages of distance vector routing?

The primary advantage of the DVR algorithm is that it is easy to implement and does not need many resources. 

  1. What is the limitation of distance vector routing?

The primary drawback of the DVR protocol is that it needs time for the changes in a network to move through the network. 

  1. What algorithm does distance vector use?

Distance vector routing uses the Bellman-Ford algorithm for calculating the best route. This has been discussed in the article above. 

  1. What is the difference between distance vector and link state?

Distance vector routing protocol has a slower convergence time in comparison to link state routing. 

  1. Is BGP a distance vector protocol?

BGP or Border Gateway Protocol is sometimes classed under distance vector routing protocol, however, it is sometimes also classified as a path vector routing protocol.

image

mukesh

Working with upGrad as a Senior Engineering Manager with more than 10+ years of experience in Software Development and Product Management.

Get Free Career Counselling
form image
+91
*
By clicking, I accept theT&Cand
Privacy Policy
image
Join 10M+ Learners & Transform Your Career
Learn on a personalised AI-powered platform that offers best-in-class content, live sessions & mentorship from leading industry experts.
right-top-arrowleft-top-arrow

upGrad Learner Support

Talk to our experts. We’re available 24/7.

text

Indian Nationals

1800 210 2020

text

Foreign Nationals

+918045604032

Disclaimer

upGrad does not grant credit; credits are granted, accepted or transferred at the sole discretion of the relevant educational institution offering the diploma or degree. We advise you to enquire further regarding the suitability of this program for your academic, professional requirements and job prospects before enr...