GATE CS 2024 Set 2 — Question 38

MCQ+2 / -0.67EasySubnetting & CIDRNetwork Layer: AddressingComputer Networks

Computer Networks → Network Layer: Addressing → Subnetting & CIDR

Last updated

Question

Which one of the following CIDR prefixes exactly represents the range of IP addresses 10.12.2.0 to 10.12.3.255?
A.
10.12.2.0/23
B.
10.12.2.0/24
C.
10.12.0.0/22
D.
10.12.2.0/22

Correct answer

(A) 10.12.2.0/23

Solution

The range of IP addresses is from 10.12.2.0 to 10.12.3.255.
Let's look at the binary representation of the third octet, as the first two octets (10.12) are constant.
  • 2 in binary: 00000010
  • 3 in binary: 00000011
The range covers exactly these two values in the third octet, and for each value, the fourth octet ranges from 0 to 255. This corresponds to combining two consecutive /24 blocks: 10.12.2.0/24 and 10.12.3.0/24.
Comparing the binary of the third octet:
00000010
00000011
The first 7 bits are identical (0000001).
Total prefix length = 8 (1st octet) + 8 (2nd octet) + 7 (3rd octet) = 23 bits.
The network address is the lowest address in the block: 10.12.2.0.
Thus, the CIDR prefix is 10.12.2.0/23.

More questions on Network Layer: Addressing

Practice GATE CS PYQs with adaptive difficulty

Timed practice, skill tracking, and AI explanations — free to start.

Start practicing free