Question:medium

Consider a computer network using the distance vector routing algorithm in its network layer. The partial topology of the network is as shown. 
The objective is to find the shortest-cost path from the router \(R\) to routers \(P\) and \(Q\). Assume that \(R\) does not initially know the shortest routes to \(P\) and \(Q\). Assume that \(R\) has three neighbouring routers denoted as \(X\), \(Y\), and \(Z\). During one iteration, \(R\) measures its distance to its neighbours \(X, Y, Z\) as \(3, 2,\) and \(5\), respectively. Router \(R\) gets routing vectors from its neighbours that indicate: - Distance to router \(P\) from \(X, Y, Z\) are \(7, 6,\) and \(5\), respectively. - Distance to router \(Q\) from \(X, Y, Z\) are \(4, 6,\) and \(8\), respectively. 

Which of the following statement(s) is/are correct with respect to the new routing table of \(R\), after update during this iteration?

Show Hint

In distance vector routing, always add the link cost to a neighbour and choose the minimum total cost; the neighbour giving the minimum becomes the next hop.
Updated On: Feb 2, 2026
  • The distance from \(R\) to \(P\) will be stored as \(10\).
  • The distance from \(R\) to \(Q\) will be stored as \(7\).
  • The next hop router for a packet from \(R\) to \(P\) is \(Y\).
  • The next hop router for a packet from \(R\) to \(Q\) is \(Z\).
Show Solution

The Correct Option is B, C

Solution and Explanation

To solve this problem, we need to apply the distance vector routing algorithm. Router \(R\) will calculate the cost to routers \(P\) and \(Q\) using the distance vectors received from its neighbors \(X\), \(Y\), and \(Z\). Here's the step-by-step calculation:

  1. Determine the cost from \(R\) to \(P\) using each neighbor's vector:
    • Via \(X\): Cost = Distance to \(X\) + Distance from \(X\) to \(P\) = \(3 + 7 = 10\)
    • Via \(Y\): Cost = Distance to \(Y\) + Distance from \(Y\) to \(P\) = \(2 + 6 = 8\)
    • Via \(Z\): Cost = Distance to \(Z\) + Distance from \(Z\) to \(P\) = \(5 + 5 = 10\)
    The shortest cost to \(P\) is \(8\) via \(Y\).
  2. Determine the cost from \(R\) to \(Q\) using each neighbor's vector:
    • Via \(X\): Cost = Distance to \(X\) + Distance from \(X\) to \(Q\) = \(3 + 4 = 7\)
    • Via \(Y\): Cost = Distance to \(Y\) + Distance from \(Y\) to \(Q\) = \(2 + 6 = 8\)
    • Via \(Z\): Cost = Distance to \(Z\) + Distance from \(Z\) to \(Q\) = \(5 + 8 = 13\)
    The shortest cost to \(Q\) is \(7\) via \(X\).

Using these calculations, we can conclude the following for the new routing table of \(R\):

  • The distance from \(R\) to \(Q\) will be stored as \(7\).
  • The next hop router for a packet from \(R\) to \(P\) is \(Y\).

This corresponds with the correct options:

  • The distance from \(R\) to \(Q\) will be stored as \(7\).
  • The next hop router for a packet from \(R\) to \(P\) is \(Y\).
Was this answer helpful?
0