Question

Consider routing table of an organization’s router shown below:

Subnet Number Subnet Mask Next Hop
12.20.164.0 255.255.252.0 R1
12.20.170.0 255.255.254.0 R2
12.20.168.0 255.255.254.0 Interface 0
12.20.166.0 255.255.254.0 Interface 1
default R3

Which of the following prefixes in CIDR notation can be collectively used to correctly aggregate all of the subnets in the routing table?

Choose every correct option
Official answer and solution
Official answer
B and D
From
Official GATE 2022 answer key

Solution

Identify the IP address ranges of each subnet and combine them into minimal CIDR supernet blocks.

Let us determine the IP ranges for each subnet in the routing table:

  1. 12.20.164.0 / 255.255.252.0 (/22): Covers third octet range 164164 to 167167 (12.20.164.0 - 12.20.167.255).
  2. 12.20.166.0 / 255.255.254.0 (/23): Covers third octet range 166166 to 167167 (this is already subsumed within the /22 above).
  3. 12.20.168.0 / 255.255.254.0 (/23): Covers third octet range 168168 to 169169 (12.20.168.0 - 12.20.169.255).
  4. 12.20.170.0 / 255.255.254.0 (/23): Covers third octet range 170170 to 171171 (12.20.170.0 - 12.20.171.255).

Together, the entries span third octet values from 164164 to 171171 (8 contiguous /24 blocks):

  • The range 164..167164..167 has binary prefix 101001xx, which forms the /22 prefix 12.20.164.0/22 (Option B).
  • The range 168..171168..171 has binary prefix 101010xx, which forms the /22 prefix 12.20.168.0/22 (Option D).

Together, 12.20.164.0/22 and 12.20.168.0/22 precisely cover the entire set of subnets without including any outside addresses. Hence, Options (B) and (D) collectively aggregate all subnets.

Final answer

Options (B), (D)

Common trap

Aggregating into 12.20.164.0/21, which is not aligned on an 8-block boundary (a /21 starting at 164 is invalid because 164 is not divisible by 8).

The answer is the one in the official GATE answer key. The solution is this site's own explanation.

Source

Paper
GATE 2022 Computer Science and Information Technology (CS)
Question
55 of 65
Section
Computer Science and Information Technology

Report an error in this question

GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.