GateAI
Distance Vector and Link-State Routing

GATE CSE 2021 Set 2 · Q45

MSQ2 marksMedium

Time

Consider a computer network using the distance vector routing algorithm in its network layer. The partial topology of the network is as shown below. The objective is to find the shortest-cost path from the router RR to routers PP and QQ. Assume that RR does not initially know the shortest routes to PP and QQ. Assume that RR has three neighbouring routers denoted as XX, YY, and ZZ. During one iteration, RR measures its distance to its neighbours XX, YY, and ZZ as 33, 22, and 55, respectively. Router RR gets routing vectors from its neighbours that indicate that the distance to router PP from routers XX, YY, and ZZ are 77, 66, and 55, respectively. The routing vector also indicates that the distance to router QQ from routers XX, YY, and ZZ are 44, 66, and 88, respectively. Which of the following statement(s) is/are correct with respect to the new routing table of RR, after updation during this iteration?

GATE CSE 2021 Set 2 Q45 diagram

Select all that applyOne or more correct

Pick every correct option

Solution

Step-by-step verified solution

Official answer: B) The distance from R to Q will be stored as 7.; C) The next hop router for a packet from R to P is Y.

Distance Vector and Link-State Routing

In Distance Vector Routing, router RR updates its distance vector to any destination DD using the Bellman-Ford equation:

DR(D)=min⁡v∈{X,Y,Z}{c(R,v)+dv(D)}D_R(D) = \min_{v \in \{X, Y, Z\}} \{ c(R, v) + d_v(D) \}

Given link costs from RR to its neighbors:

  • c(R,X)=3c(R, X) = 3

  • c(R,Y)=2c(R, Y) = 2

  • c(R,Z)=5c(R, Z) = 5

1. For Destination PP:

  • Via neighbor $X$: $c(R, X) + d_X(P) = 3 + 7 = 10$

  • Via neighbor $Y$: $c(R, Y) + d_Y(P) = 2 + 6 = 8$

  • Via neighbor $Z$: $c(R, Z) + d_Z(P) = 5 + 5 = 10$

The minimum cost to reach PP is min⁡(10,8,10)=8\min(10, 8, 10) = 8, and the corresponding next hop is YY.

  • Statement (A) is incorrect (cost is 88, not 1010).

  • Statement (C) is correct (next hop is YY).

2. For Destination QQ:

  • Via neighbor $X$: $c(R, X) + d_X(Q) = 3 + 4 = 7$

  • Via neighbor $Y$: $c(R, Y) + d_Y(Q) = 2 + 6 = 8$

  • Via neighbor $Z$: $c(R, Z) + d_Z(Q) = 5 + 8 = 13$

The minimum cost to reach QQ is min⁡(7,8,13)=7\min(7, 8, 13) = 7, and the corresponding next hop is XX.

  • Statement (B) is correct (stored distance is 77).

  • Statement (D) is incorrect (next hop is XX, not ZZ).

Thus, statements (B) and (C) are correct.

Try the question first, then check your work.

Think the official key or this write-up is wrong?

Report error or challenge

Examiner trap

The misconception this question tests

This Distance Vector and Link-State Routing previous year question is Q45 of the GATE CSE 2021 Set 2 paper. Find more GATE CSE PYQs on Distance Vector and Link-State Routing in Computer Networks, or browse all GATE CSE PYQs.

Free diagnostic

Where do you stand for GATE?

Take the 20-minute diagnostic: the 3 topics that cost you the most marks, and a rank range. Or sit 5 related Distance Vector and Link-State Routing PYQs now with no account.

One GATE CSE PYQ every morning

An official question by email at 7 AM IST, with a link to its verified solution. Unsubscribe in one click.

Distance Vector and Link-State Routing in GATE CSE

Distance Vector and Link-State Routing has 9 GATE CSE PYQs across 8 papers from 2011 to 2025. This is the only 2-mark MSQ among them, and it is the only one in GATE CSE 2021 Set 2.

How GATE tests Distance Vector and Link-State Routing

More from GATE CSE 2021 Set 2

Share this solution

A plain-text card for WhatsApp or Telegram study groups.

GateAI solution cardGATE CSE 2021 Set 2 · Q45 · MSQ

Consider a computer network using the distance vector routing algorithm in its network layer. The partial topology of the network is as 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 of R, after updation during this iteration?

Topic-wise GATE CS PYQs with verified steps

Independent practice explanation verified by the GateAI team. GATE is conducted by the IITs; question text follows the official paper.