Tony CantaveMy CompTIA Network+ Notes on Subnetting Without the Headache
By Tony Cantave ·
Of everything I studied for CompTIA Network+, subnetting was the topic that slowed me down the most. The concepts are not hard on paper, but the exam expects you to do the math quickly and without mistakes. What finally worked for me was dropping the long binary conversions for most questions and using one simple pattern: the block size. These are the notes I wish I had on day one.
The only table you need to memorize
Every subnet mask in the last octet comes from adding bits from left to right. If you memorize this row, you can answer most questions in your head.
| Prefix | Mask (last octet) | Block size | Usable hosts |
|---|---|---|---|
| /25 | 128 | 128 | 126 |
| /26 | 192 | 64 | 62 |
| /27 | 224 | 32 | 30 |
| /28 | 240 | 16 | 14 |
| /29 | 248 | 8 | 6 |
| /30 | 252 | 4 | 2 |
The block size is 256 minus the mask value in the interesting octet. Usable hosts are 2 raised to the number of host bits, minus 2, because the first address is the network address and the last is the broadcast address.
The block size method
When a question gives you an address and a prefix, I follow the same four steps every time.
- Find the interesting octet. That is the octet where the mask is not 255 or 0.
- Work out the block size: 256 minus the mask value in that octet.
- List the multiples of the block size until you pass the address. The multiple just below or equal to the address is the network address.
- The next multiple minus one is the broadcast address. Everything in between is usable.
Example one: 192.168.10.77/26
A /26 mask is 255.255.255.192, so the interesting octet is the fourth one and the block size is 64. The subnets start at 0, 64, 128 and 192. The address 77 sits between 64 and 128.
So the network address is 192.168.10.64, the broadcast address is 192.168.10.127, and the usable range is 192.168.10.65 through 192.168.10.126. That is 62 hosts, which matches the table.
Example two: 172.16.45.200/20
This one trips people up because the interesting octet is the third one. A /20 mask is 255.255.240.0, so the block size in the third octet is 16. The blocks run 0, 16, 32, 48 and so on, and 45 falls inside the block that starts at 32.
The network address is 172.16.32.0 and the broadcast address is 172.16.47.255. The usable range is 172.16.32.1 through 172.16.47.254. There are 12 host bits, so that is 4,094 usable hosts.
The method is the same. The only change is which octet you are working in.
Working backward from a host count
Exam questions and real network planning often go the other way: you know how many devices you need and you have to pick the prefix. I find the smallest power of 2 that is at least the host count plus 2.
- 50 hosts: 64 is the first power of 2 that fits 52, so use a /26 with 62 usable addresses.
- 10 hosts: 16 fits 12, so use a /28 with 14 usable addresses.
- A link between two routers: a /30 gives exactly 2 usable addresses.
Always leave some room to grow. A small office that has 28 devices today will not have 28 devices next year, and a /27 with 30 usable addresses leaves almost no space.
Checking my answers with Python
While studying, I wrote practice problems on paper and then checked them with Python's built in ipaddress module. It removed any doubt about whether my answer was right, and it took only a few lines.
import ipaddress
def describe(cidr):
net = ipaddress.ip_interface(cidr).network
hosts = list(net.hosts())
print("Network: ", net.network_address)
print("Broadcast:", net.broadcast_address)
print("Usable: ", hosts[0], "to", hosts[-1])
print("Count: ", len(hosts))
describe("192.168.10.77/26")
describe("172.16.45.200/20")Do the problem by hand first, then run the script. If the two answers do not match, go back and find the step where you slipped. That feedback loop taught me more than rereading the chapter.
Habits that made it stick
Write the table from memory every session. Before each study block I wrote the prefix table on a blank sheet. After a few days it takes under a minute, and it gives you a reference you trust for the rest of the session.
Practice in short daily sets. A short set of problems every day works better than one long weekend session. Speed comes from repetition, not from cramming.
Mix the question types. Find the network address, find the broadcast, count the hosts, choose a prefix for a host count. Real questions blend these, so practice should too.
Say the steps out loud. It sounds silly, but talking through "interesting octet, block size, multiples, broadcast" kept me from skipping a step when I was rushing.
Why it still matters to me
Subnetting is not just an exam topic. I still use it when I set up home lab networking, when I read a router configuration, and when I think about how the 10 inch Android screens for Local Flyer Ads should sit on a shop's network without getting in the way of the owner's own devices. Understanding how addresses are divided makes troubleshooting much faster.
If you are studying for Network+ right now, learn the table, use the block size method, and check your work until the pattern feels automatic. It will.
If you run a small business in Connecticut and want to talk about getting your business in front of local customers on a screen inside a busy neighborhood shop, reach out at sales@localflyerads.com.