Why /20 feels harder
With prefixes from /17 to /23, the network part ends in the 3rd octet. The whole 4th octet is host bits. The method doesn't change, but you must do the block-size step in the 3rd octet, then fill the 4th octet with 0 (network) or 255 (broadcast).
Example 1: /20, a campus building
A campus gives each building a /20. A wireless controller logs a client at 172.16.45.10/20. Which building block is it in, and what is its broadcast address?
Show the worked answer
| Step | Working |
|---|---|
| 1. Find the interesting octet | /20 = 255.255.240.0. The 3rd octet is neither 255 nor 0: its mask value is 240. |
| 2. Block size | 256 − 240 = 16. In the 3rd octet, subnets start at …, 16, 32, 48, 64, …. |
| 3. Network | 45 falls in the block that starts at 32. The 4th octet becomes 0. Network: 172.16.32.0 |
| 4. Broadcast | The next block starts at 48, so this one ends at 47. The 4th octet becomes 255. Broadcast: 172.16.47.255 |
| 5. Usable range and hosts | 172.16.32.1 to 172.16.47.254: 212 − 2 = 4,094 hosts |
The trap: answering 172.16.45.0. That treats the address as a /24. With a /20, the 3rd octet moves in steps of 16, so 45 belongs to the block 32–47.
Example 2: /20, another block
A firewall rule allows 10.20.128.0/20. A server at 10.20.130.5 is blocked. Is the server inside the allowed range?
Show the worked answer
| Step | Working |
|---|---|
| 1. Find the interesting octet | /20 = 255.255.240.0. The 3rd octet is neither 255 nor 0: its mask value is 240. |
| 2. Block size | 256 − 240 = 16. In the 3rd octet, subnets start at …, 112, 128, 144, 160, …. |
| 3. Network | 130 falls in the block that starts at 128. The 4th octet becomes 0. Network: 10.20.128.0 |
| 4. Broadcast | The next block starts at 144, so this one ends at 143. The 4th octet becomes 255. Broadcast: 10.20.143.255 |
| 5. Usable range and hosts | 10.20.128.1 to 10.20.143.254: 212 − 2 = 4,094 hosts |
Yes: 130 is in the block 128–143, so the server is inside 10.20.128.0/20. The rule is not the cause; look elsewhere (for example the rule's order, or the return path).
Example 3: /27, servers
A server VLAN uses /27s. A new server is set to 192.168.10.75/27. Which subnet is it in, and which addresses can its gateway use?
Show the worked answer
| Step | Working |
|---|---|
| 1. Find the interesting octet | /27 = 255.255.255.224. The 4th octet is neither 255 nor 0: its mask value is 224. |
| 2. Block size | 256 − 224 = 32. In the 4th octet, subnets start at 0, 32, 64, 96, 128, 160, 192, 224. |
| 3. Network | 75 falls in the block that starts at 64. Network: 192.168.10.64 |
| 4. Broadcast | The next block starts at 96, so this one ends at 95. Broadcast: 192.168.10.95 |
| 5. Usable range and hosts | 192.168.10.65 to 192.168.10.94: 25 − 2 = 30 hosts |
The gateway must be one of .65 to .94. A gateway of .62, for example, is in the previous block (.32–.63) and would not work.
Example 4: /27, the top block
10.0.0.250/27: which subnet, and what is special about it?
Show the worked answer
| Step | Working |
|---|---|
| 1. Find the interesting octet | /27 = 255.255.255.224. The 4th octet is neither 255 nor 0: its mask value is 224. |
| 2. Block size | 256 − 224 = 32. In the 4th octet, subnets start at 0, 32, 64, 96, 128, 160, 192, 224. |
| 3. Network | 250 falls in the block that starts at 224. Network: 10.0.0.224 |
| 4. Broadcast | The next block starts at 256, so this one ends at 255. Broadcast: 10.0.0.255 |
| 5. Usable range and hosts | 10.0.0.225 to 10.0.0.254: 25 − 2 = 30 hosts |
It is the last /27 in the octet, so its broadcast is .255. The next block would start at 256, which doesn't exist in this octet.
Traps to watch for
- /20 answered as /24. If the mask has a 3rd octet below 255, the 4th octet is all host bits.
- Broadcast ending in .255 for the wrong reason. In a /20 the broadcast ends in .255, but the 3rd octet is the end of the block (47 in Example 1), not the address's own 3rd octet.
- Counting /20 hosts as 24 − 2. The host bits are 32 − 20 = 12, across two octets: 212 − 2 = 4,094.
Check yourself
What is the network address of 172.16.45.10/20?
What is the broadcast address of 10.20.130.5/20?
Two servers are 192.168.10.62/27 and 192.168.10.65/27. Are they in the same subnet?
How many usable hosts does a /20 have?
Practise
The subnetting practice drill on Medium (/16 to /30) mixes 3rd- and 4th-octet questions like these.
Learn more: Network, Broadcast and Usable Hosts