Computer Networking Basics
In the network 192.168.5.0/26, how many IP addresses can be assigned to hosts (end devices or router interfaces)?
- A64
- B30
- C62
Show answer and explanation
Answer: C. 62
/26 means a 26-bit network part, so the host part is 32 − 26 = 6 bits and there are 2^6 = 64 addresses. Of these, the network address with the host part all 0s (192.168.5.0) and the broadcast address with it all 1s (192.168.5.63) cannot be assigned to hosts, leaving 64 − 2 = 62. In general, a prefix length of n gives 2^(32 − n) − 2 assignable addresses. The subnet mask for /26 is 255.255.255.192.
- A. This does not subtract the network and broadcast addresses.
- B. This is the /27 case (5 host bits): 2^5 − 2 = 30.
- C. Correct. 2^6 − 2 = 62.