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?
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:
12.20.164.0 / 255.255.252.0(/22): Covers third octet range to (12.20.164.0-12.20.167.255).12.20.166.0 / 255.255.254.0(/23): Covers third octet range to (this is already subsumed within the /22 above).12.20.168.0 / 255.255.254.0(/23): Covers third octet range to (12.20.168.0-12.20.169.255).12.20.170.0 / 255.255.254.0(/23): Covers third octet range to (12.20.170.0-12.20.171.255).
Together, the entries span third octet values from to (8 contiguous /24 blocks):
- The range has binary prefix
101001xx, which forms the /22 prefix12.20.164.0/22(Option B). - The range has binary prefix
101010xx, which forms the /22 prefix12.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.
Options (B), (D)
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.