CS FundamentalsVery hardGATE CS

A router has routes for the following prefixes, all pointing to the same next hop: 172.16.0.0/24, 172.16.1.0/24, 172.16.2.0/24, 172.16.3.0/25, 172.16.3.128/26, 172.16.3.192/26, 172.16.4.0/23, 172.16.6.0/24, 172.16.7.0/24, 172.16.8.0/22, 172.16.12.0/23, 172.16.14.0/24 and 172.16.15.128/25. What is the minimum number of prefixes needed to represent exactly the same set of addresses?

  1. A. 6
  2. B. 5
  3. C. 4
  4. D. 8

Correct answer: B. 5

Merging only exactly adjacent, aligned blocks gives ['172.16.0.0/21', '172.16.8.0/22', '172.16.12.0/23', '172.16.14.0/24', '172.16.15.128/25'], i.e. 5 prefixes. The first eight /24 blocks merge into 172.16.0.0/21, but 172.16.8.0/22, 172.16.12.0/23, 172.16.14.0/24 and 172.16.15.128/25 cannot merge further because 172.16.15.0/25 is missing.

More Computer Networks questions

Exams that ask this topic