CS FundamentalsVery hardProduct company interview · GATE level

Five routers use distance-vector routing with link costs A-B = 1, B-C = 2, C-D = 1, D-E = 3, A-E = 12, A-D = 7 and B-D = 5. Initially each router knows only the costs of its own links. In each round all routers simultaneously send their current vectors to their neighbours and then all recompute. What is A's distance to E after exactly two rounds?

  1. A. 9
  2. B. 10
  3. C. 7
  4. D. 12

Correct answer: A. 9

After r rounds a router knows the best path of at most r + 1 hops. Start: A-E = 12 (1 hop). After round 1 (2 hops): A-D-E = 7 + 3 = 10. After round 2 (3 hops): A-B-D-E = 1 + 5 + 3 = 9. Only after round 3 does A learn the true shortest path A-B-C-D-E = 1 + 2 + 1 + 3 = 7, which needs 4 hops. So after two rounds the entry is 9; 7 is the converged value, and 10 is the value one round earlier.

More Computer Networks questions

Exams that ask this topic