Which one of the following CIDR prefixes exactly represents the range of IP addresses 10.12.2.0 to 10.12.3.255?
Topic-wise GATE CS PYQs with verified steps
GATE CSE 2024 Set 2 · Q38
Time
Select one answerSingle correct
Solution
Official answer: A) 10.12.2.0/23
CIDR NotationWe are given the IP address range:
Start IP: 10.12.2.0
End IP: 10.12.3.255
Total number of addresses:
The range covers two /24 subnets (10.12.2.0/24 and 10.12.3.0/24), which gives:
Host bits and Prefix length: Since , the number of host bits is . The prefix length is:
Network Prefix Alignment: Converting the third octet to binary:
For a prefix, the first 7 bits of the 3rd octet are fixed as network bits (), and the last bit is a host bit. Thus, the base network address is:
Hence, the correct prefix is 10.12.2.0/23, which corresponds to option (A).
Try the question first, then check your work.
Examiner trap
Count the total number of IP addresses in the given range to find the number of host bits , then calculate the prefix length as .
This CIDR Notation previous year question is Q38 of the GATE CSE 2024 Set 2 paper. Find more GATE CSE PYQs on CIDR Notation in Computer Networks, or browse all GATE CSE PYQs.
Free diagnostic
Take the 20-minute diagnostic: the 3 topics that cost you the most marks, and a rank range. Or sit 5 related CIDR Notation PYQs now with no account.
An official question by email at 7 AM IST, with a link to its verified solution. Unsubscribe in one click.
CIDR Notation has 7 GATE CSE PYQs across 7 papers from 2022 to 2026. 2 of them are 2-mark MCQs like this one, and it is the only one in GATE CSE 2024 Set 2.
How GATE tests CIDR NotationIndependent practice explanation verified by the GateAI team. GATE is conducted by the IITs; question text follows the official paper.