Question:

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: Dec 30, 2025
  • 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\).
Hide Solution
collegedunia
Verified By Collegedunia

The Correct Option is B, C

Solution and Explanation

Step 1: Compute distance from \(R\) to \(P\).
Using distance vector update rule: \[ \text{Cost}(R \to P \text{ via } N) = \text{Cost}(R \to N) + \text{Cost}(N \to P) \] \[ \begin{aligned} \text{via } X &: 3 + 7 = 10
\text{via } Y &: 2 + 6 = 8
\text{via } Z &: 5 + 5 = 10 \end{aligned} \] Minimum cost to \(P\) is \(8\) via \(Y\). Hence, distance to \(P\) is \(8\), and next hop is \(Y\).

Step 2: Compute distance from \(R\) to \(Q\).
\[ \begin{aligned} \text{via } X &: 3 + 4 = 7
\text{via } Y &: 2 + 6 = 8
\text{via } Z &: 5 + 8 = 13 \end{aligned} \] Minimum cost to \(Q\) is \(7\) via \(X\).

Step 3: Evaluate options.
- (A) Incorrect: distance to \(P\) is \(8\), not \(10\).
- (B) Correct: distance to \(Q\) is \(7\).
- (C) Correct: next hop to \(P\) is \(Y\).
- (D) Incorrect: next hop to \(Q\) is \(X\), not \(Z\).

Step 4: Conclusion.
The correct statements are (B) and (C).

Final Answer: (B), (C)

Was this answer helpful?
0
0

Questions Asked in GATE CS exam

View More Questions