Computer Networking Basics
You want to fit 500 hosts in one subnet. Of the subnets that can do this, which is the smallest (has the longest prefix)?
- A/24
- B/22
- C/23
Show answer and explanation
Answer: C. /23
A subnet with prefix length n can hold 2^(32 − n) − 2 hosts. /24 has 8 host bits, giving 2^8 − 2 = 254 hosts, which is not enough. /23 has 9 host bits, giving 2^9 − 2 = 510 hosts, enough for 500. /22 gives 2^10 − 2 = 1022 hosts, which also fits but uses about twice the addresses needed. The subnet mask for /23 is 255.255.254.0; for example, 10.0.2.0/23 covers 10.0.2.0 to 10.0.3.255.
- A. It holds only 2^8 − 2 = 254 hosts.
- B. It holds 1022 hosts, but it is larger than /23, not the smallest.
- C. Correct. 2^9 − 2 = 510 hosts; it is the smallest subnet that fits 500.