DISTANCE VECTOR ROUTING
Distance Vector Routing Algorithm
The Distance Vector Routing algorithm generates the routing tables for each router.
The steps of the algorithm are as follows.
STEP 01:
Each router prepares its routing table using the knowledge of its immediate neighbor.
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.
To understand these steps, we will consider the internetwork as shown below.
Initially, the routing tables were empty.
The first step states that Each router prepares its routing table using the knowledge of its immediate neighbor.
The routing tables will get updated based on the knowledge of the distance of routers directly connected to it.
Consider the A’s routing table.
The image below shows the A’s routing table after executing the first step.
The first row states that to transmit the data from A to A, it needs a distance of 0. The router to which the data has to be transmitted is A itself.
The second row states that to transmit the data from A to B, it needs a distance of 12. The router to which the data has to be transmitted is through B.
The third row states that to transmit the data from A to C, it needs a distance of 9. The router to which the data has to be transmitted is through C.
The fourth row states that to transmit the data from A to C, it needs a distance of 4. The router to which the data has to be transmitted is through D.
The image below shows the routing tables on each router after the first step execution.
In the second step of the distance vector routing, each router will exchange its distances with the neighboring router.
For better understanding, we will consider only the router A and check how the routing table at A will get updated.
The image below shows the details on router A after sharing the distance vectors.
With the new details obtained from the neighboring routers, we will update the routing table at A.
The router A to B’s distance with the new distances is shown below.
From the above possibilities, we have to consider the shortest distance.
In our case it from A->C + C->B = 10. The next hop is through C.
The router A to C’s distance with the new distances is shown below.
The shortest distance is from A->D + D->B = 6. The next hop is through D.
The router A to D’s distance with the new distances is shown below.
The shortest distance is from A->D + D->D = 4. The next hop is through D.
The new updated routing table at A is shown below.
The number of times the second step iterates is n – 2 times. The value of n is the number of routers.
Comments
Post a Comment