CS FundamentalsHardGATE CS (PYQ pattern)

Switches B1..B5 (bridge ID = number) are connected by point-to-point links: B1-B2 (cost 38), B1-B3 (cost 38), B1-B4 (cost 38), B1-B5 (cost 4), B2-B4 (cost 38), B2-B5 (cost 38), B3-B4 (cost 38), B3-B5 (cost 38). Classic spanning tree runs: the lowest ID is root; each non-root switch picks the port with the lowest path cost to the root as its root port (ties: lower neighbour ID); on each link the end whose switch has the lower cost to the root (ties: lower ID) is the designated port, and any other port that is not a root port is blocked. How many ports are blocked?

  1. A. 5
  2. B. 3
  3. C. 0
  4. D. 4

Correct answer: D. 4

Costs to the root: {1: 0, 2: 38, 3: 38, 4: 38, 5: 4}. Root ports: {2: 1, 3: 1, 4: 1, 5: 1}. Every link that is not part of the resulting tree has exactly one blocked port: 8 links - 4 tree links = 4.

More Computer Networks questions

Exams that ask this topic