DevNet Associate (DEVASC) v1.0Network FundamentalsHard
A network automation engineer is developing a Python script to manage IP addresses on a network device. The script needs to perform a calculation to determine the number of assignable host addresses within a given subnet. If a subnet is defined as 172.16.1.0/27, how many usable host IP addresses are available?
- A62
- B14
- C126
- D30
Show answer & explanationAnswer & explanation
Correct answer: D. 30
A /27 subnet means there are 27 network bits. Total bits are 32, so host bits = 32 - 27 = 5. The total number of addresses in the subnet is 2^5 = 32. From these, two addresses are reserved (network address and broadcast address), leaving 32 - 2 = 30 usable host IP addresses.
Why the other options are wrong
- A. 62 usable hosts corresponds to a /26 subnet (2^6 - 2).
- B. 14 usable hosts corresponds to a /28 subnet (2^4 - 2).
- C. 126 usable hosts corresponds to a /25 subnet (2^7 - 2).
Usable Host Calculation
The number of usable host IP addresses in a subnet is calculated by taking 2 to the power of the number of host bits, minus 2 (for the network and broadcast addresses).
- Host bits are 32 minus the CIDR prefix length.
- Network address is the first address in the subnet.
- Broadcast address is the last address in the subnet.
Memory trick: Hosts Count: 'Two to the Power of Host Bits, Minus Two'