Question

Which one of the following CIDR prefixes exactly represents the range of IP addresses 10.12.2.0 to 10.12.3.255?

Choose one option
Official answer and solution
Official answer
A
From
Official GATE 2024 answer key

Solution

Compare the binary representations of the third and fourth octets of 10.12.2.0 and 10.12.3.255.

Writing the last two octets in binary:

  • 10.12.2.0 =10.12.00000010.00000000= \texttt{10.12.00000010.00000000}
  • 10.12.3.255 =10.12.00000011.11111111= \texttt{10.12.00000011.11111111}

The first 8+8+7=238 + 8 + 7 = 23 bits (10.12.0000001_) are identical across the entire range, while the remaining 32−23=932 - 23 = 9 bits vary through all 29=5122^9 = 512 combinations from all 0s to all 1s. Thus the exact CIDR prefix is 10.12.2.0/23.

Final answer

Option (A)

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

Source

Paper
GATE 2024 Computer Science and Information Technology - Set 2 (CS2)
Question
38 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.