GATE / CS ARCHIVE

GATE CSE 2021 SET 2 / QUESTION 45

GATE CSE 2021 Set 2 Q45

Computer Networks · Routing Algorithms · Full GATE CSE 2021 Set 2 paper

GATE 2021 Set 2, Q45 2 marks · MSQ
Report issue

Routing Algorithms

Question 45, GATE 2021: Distance-vector routing: R→X,Y,Z link costs 3,2,5. Advertised distances X,Y,Z→P are 7,6,5; to Q are 4,6,8. Update R. A P distance 10; B Q distance 7; C P next hop Y; D Q next hop Z.
Tap to enlarge
Select all that apply
Answer & solution

Official answer: B; C

Bellman-Ford updates R-to-P with min(3+7, 2+6, 5+5)=8, reached through Y. For Q it uses min(3+4, 2+6, 5+8)=7, reached through X. Hence B, C, not A or D.

The update formula is D_R(v)=min_N(c(R,N)+D_N(v)). For P the three candidates are 10,8,10; for Q they are 7,8,13. Store both the minimum cost and its minimizing neighbor. Choosing the neighbor with the cheapest direct link alone would pick Y for both and be wrong for Q.

Original paper, page 82 · Answer key