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
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.
More Operating Systems and Computer Networks questions
- Consider a counting semaphore S initialized to 7. If 12 wait(S) (P) operations and 8 signal(S) (V) operations are…
- A paged virtual memory system uses a single-level page table in main memory (access time 100 ns) and a Translation…
- A point-to-point link has a bandwidth of 1 Mbps, a one-way propagation delay of 20 ms, and uses 1,000-bit data frames…
- Three processes P1, P2, and P3 arrive at times 0 ms, 1 ms, and 2 ms with CPU burst times of 8 ms, 4 ms, and 2 ms…
- A system has 4 processes (P1..P4) and a single resource type. Each process has a maximum claim of 4 units (Max = [4…
- A TCP connection has a Maximum Segment Size (MSS) of 1 KB and an initial congestion window (cwnd) of 1 KB, with…
- For the page reference string 1, 2, 3, 4, 1, 2, 5, 1, 2, 3, 4, 5 with 3 initially empty page frames, how many page…
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.