Consider a computer network using the distance vector routing algorithm in its…

2021

Consider a computer network using the distance vector routing algorithm in its network layer. The partial topology of the network is shown below.

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, and Z as 3, 2 and 5, respectively. Router R gets routing vectors from its neighbours that indicate that the distance to router P from routers X, Y and Z are 7, 6 and 5, respectively. The routing vector also indicates that the distance to router Q from routers X, Y and Z are 4, 6 and 8 respectively. Which of the following statement(s) is/are correct with respect to the new routing table o R, after updation during this iteration?

  1. A.

    The distance from R to P will be stored as 10.

  2. B.

    The distance from R to Q will be stored as 7.

  3. C.

    The next hop router for a packet from R to P is Y.

  4. D.

    The next hop router for a packet from R to Q is Z.

Attempted by 96 students.

Show answer & explanation

Correct answer: B, C

Key insight: a router updates its distance to a destination by taking the minimum of (cost to neighbour + neighbour's advertised cost to that destination).

  • Compute costs from R to P via neighbours:

    • via X: 3 + 7 = 10

    • via Y: 2 + 6 = 8

    • via Z: 5 + 5 = 10

    Choose the minimum: 8 via Y. So R should store distance 8 to P with next hop Y.

  • Compute costs from R to Q via neighbours:

    • via X: 3 + 4 = 7

    • via Y: 2 + 6 = 8

    • via Z: 5 + 8 = 13

    Choose the minimum: 7 via X. So R should store distance 7 to Q with next hop X.

Final routing entries (after this iteration): R -> P: distance 8, next hop Y; R -> Q: distance 7, next hop X.

A video solution is available for this question — log in and enroll to watch it.

Explore the full course: Gate Guidance By Sanchit Sir