GATE Computer Science · Operating Systems and Computer Networks · medium

An organization is allocated the CIDR block 192.168.16.0/22. How many usable host IPv4 addresses are available in this block (excluding the network address and directed broadcast address)?

Published · Last updated · checked before publication — how we verify questions

Options

  • A510 usable host addresses calculated from 9 host bits (2^9 - 2)
  • B1,022 usable host addresses calculated from 10 host bits (2^10 - 2)Correct answer
  • C1,024 usable host addresses including the network and broadcast IDs
  • D2,046 usable host addresses calculated from 11 host bits (2^11 - 2)

Answer: B. 1,022 usable host addresses calculated from 10 host bits (2^10 - 2)

A CIDR prefix of /22 means the first 22 bits identify the network and the remaining 32 - 22 = 10 bits identify hosts within the block. The block therefore contains 2^10 = 1,024 addresses, running from 192.168.16.0 to 192.168.19.255. Two of these are reserved by convention: the network address, where all host bits are 0 (192.168.16.0), and the directed broadcast address, where all host bits are 1 (192.168.19.255). That leaves 1,024 - 2 = 1,022 usable host addresses. The general rule is usable hosts = 2^(32 - prefix) - 2, valid for prefixes up to /30. The most common trap is stopping at the total block size and forgetting to subtract the two reserved addresses. Another is miscounting host bits by one, for example by confusing /22 with /23 or /21.

Why the other options are wrong

  • A. 510 usable host addresses calculated from 9 host bits (2^9 - 2) — 510 is 2^9 - 2, which is the usable host count for a /23 prefix with 9 host bits. The block here is a /22 with 10 host bits, so this undercounts by half.
  • C. 1,024 usable host addresses including the network and broadcast IDs — 1,024 is the total number of addresses in the /22 block, including the network and directed broadcast addresses. The question asks only for usable host addresses, so those two must be subtracted.
  • D. 2,046 usable host addresses calculated from 11 host bits (2^11 - 2) — 2,046 is 2^11 - 2, which is the usable host count for a /21 prefix with 11 host bits. It overcounts by a factor of two for a /22 block.

All Operating Systems and Computer Networks questions and the topic overview →

GATE is a mark of the Indian Institute of Science and the Indian Institutes of Technology. PrepIQ Hub is not affiliated with, endorsed by, or sponsored by the GATE Committee.