GATE 2022 CS – Question 55
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?
Practise this question in The GATE Grind →
Show answer and explanation
Correct answer: (A) 12.20.164.0/20; (B) 12.20.164.0/22; (D) 12.20.168.0/22
Explanation
Work in the third octet (the first two octets are 12.20).
The four subnets cover:
- 12.20.164.0/22: third octet 164–167
- 12.20.166.0/23: 166–167
- 12.20.168.0/23: 168–169
- 12.20.170.0/23: 170–171
Together they span third octet **164–171**.
- **(A) 12.20.164.0/20.** A /20 has a block of 16 in the third octet, so the real network is 160–175. This contains every subnet. **Valid.**
- **(C) 12.20.164.0/21.** A /21 has a block of 8, so the real network is 160–167. It misses 168–171. **Not valid.**
- **(B) 12.20.164.0/22** covers exactly 164–167 and **(D) 12.20.168.0/22** covers exactly 168–171. Used together they aggregate the whole table exactly, so both are valid as a collective set.
Answer: A, B, D.
More IPv4: Addressing, CIDR, Fragmentation and NAT questions
- GATE 2021 CS (CS1) Q55
- GATE 2020 CS Q25
- GATE 2020 CS Q48
- GATE 2019 CS Q38
- GATE 2018 CS Q64
- GATE 2015 CS (CS1) Q26
All IPv4: Addressing, CIDR, Fragmentation and NAT questions →