Network Fundamentals · Topic 14 of 17
IPv4 Subnetting Practice: Find the Subnet
Five worked IPv4 subnetting problems with every step shown: find the network, broadcast and host range, cross octet boundaries and check a gateway.
- 5 min
- Block size is 256 minus the mask value in the interesting octet.
- The network address is the largest multiple of the block size that fits the address.
- The broadcast address is the next network minus 1.
What it is
Subnetting is a skill you learn by working problems, so this page gives you five with every step shown.
The first four problems ask for the same four answers: the network address, the broadcast address, the usable host range and the number of usable hosts. The method is the block size method from the IPv4 addressing page.
Cover the answer, work the steps on paper, then compare.
How it works
Every problem uses the same five steps, whatever the prefix.
- Write the mask in dotted decimal.
- Find the interesting octet, the first one that is neither 255 nor 0.
- Block size is 256 minus the mask value in that octet.
- List the multiples of the block size. The largest multiple that does not exceed the address in that octet is the network address.
- The broadcast address is the next network address minus 1. Usable hosts run from network plus 1 to broadcast minus 1.
The number of usable hosts is 2 to the power of the host bits, minus 2.
| Prefix | Interesting octet | Mask value | Block size |
|---|---|---|---|
| /25 | 4th | 128 | 128 |
| /26 | 4th | 192 | 64 |
| /27 | 4th | 224 | 32 |
| /28 | 4th | 240 | 16 |
| /20 | 3rd | 240 | 16 |
| /22 | 3rd | 252 | 4 |
When the prefix is /17 to /23, the interesting octet is the third, and the fourth octet is all host bits: the network ends in .0 and the broadcast ends in .255.
Problem 1: 172.16.45.200/27
A /27 is 255.255.255.224, so the interesting octet is the fourth and the block size is 256 minus 224, which is 32.
The multiples of 32 are 0, 32, 64, 96, 128, 160, 192 and 224. The largest that does not exceed 200 is 192.
- Network: 172.16.45.192
- Broadcast: next network 224, minus 1, gives 172.16.45.223
- Usable range: 172.16.45.193 to 172.16.45.222
- Usable hosts: 5 host bits, so 32 minus 2 is 30
Problem 2: 10.1.77.130/25
A /25 is 255.255.255.128, block size 128. The blocks start at 0 and 128, and 130 falls in the block that starts at 128.
- Network: 10.1.77.128
- Broadcast: 10.1.77.255
- Usable range: 10.1.77.129 to 10.1.77.254
- Usable hosts: 7 host bits, so 128 minus 2 is 126
Problem 3: 192.168.5.77/22
A /22 is 255.255.252.0. Now the interesting octet is the third, and the block size is 256 minus 252, which is 4.
The multiples of 4 in the third octet go 0, 4, 8, and so on. The address has 5 in that octet, so the network starts at 4. The fourth octet is all host bits, so it becomes 0.
- Network: 192.168.4.0
- Broadcast: next network is 192.168.8.0, minus 1, gives 192.168.7.255
- Usable range: 192.168.4.1 to 192.168.7.254
- Usable hosts: 10 host bits, so 1,024 minus 2 is 1,022
The host 192.168.5.77 is not at the start or end of its block, but the subnet still spans four third-octet values, 4 to 7. Answering 192.168.5.0 is the classic slip.
Problem 4: 10.200.150.9/20
A /20 is 255.255.240.0, so the interesting octet is the third and the block size is 16. The multiples are 0, 16, 32, up to 144 and 160. The largest that does not exceed 150 is 144.
- Network: 10.200.144.0
- Broadcast: next network is 10.200.160.0, minus 1, gives 10.200.159.255
- Usable range: 10.200.144.1 to 10.200.159.254
- Usable hosts: 12 host bits, so 4,096 minus 2 is 4,094
Problem 5: do these hosts share a subnet?
Host A is 192.168.20.70/28 and host B is 192.168.20.78/28. A's gateway is set to 192.168.20.79.
A /28 is 255.255.255.240, block size 16. The blocks are 0, 16, 32, 48, 64, 80. Address 70 falls in the block that starts at 64, so the network is 192.168.20.64 and the broadcast is 192.168.20.79.
- Host B, at 78, is in the same block, so A and B share a subnet.
- The usable range is .65 to .78, so .79 is the broadcast address, and it cannot be a gateway.
What to remember for the exam
Eight points sum up the method.
- Block size is 256 minus the mask value in the interesting octet.
- The network address is the largest multiple of the block size that fits the address.
- The broadcast address is the next network minus 1.
- Usable hosts are 2 to the host bits, minus 2.
- For /17 to /23, work in the third octet and leave the fourth as .0 and .255.
- A host and its gateway must sit inside the same usable range.
- The first and last address of a subnet are never host addresses.
- To sanity check, broadcast minus network equals the block size minus 1 in the interesting octet.
Common mistakes
These four slips account for most wrong answers.
Using the wrong octet. A /20 changes the third octet, not the fourth.
Forgetting to subtract 2. A /27 has 32 addresses but only 30 usable hosts.
Rounding the network up instead of down. The network is the multiple at or below the address.
Accepting the broadcast address as a gateway. It looks like a normal address but never works as one.
Check yourself
Try these three, then click a question to reveal its answer.
What are the network and broadcast addresses of 10.9.200.17/21?
The network is 10.9.200.0 and the broadcast is 10.9.207.255.
What is the usable range of 192.168.3.100/26?
192.168.3.65 to 192.168.3.126.
Is 172.20.15.1 usable as a host in 172.20.8.0/21?
Yes, because the usable range is 172.20.8.1 to 172.20.15.254.
Topic 14 of 17 in Network Fundamentals
Test yourself on Network Fundamentals
The full Cisco CCNA 200-301 question bank has 1,206 questions, with timed practice exams and an explanation for every answer.
This study guide is independent and is not affiliated with, endorsed by, or sponsored by Cisco. Vendor names, certification names and exam codes are trademarks of their respective owners and are used for identification only.