Subnetting in practice
Why this matters
Subnetting is the one skill on this exam that is genuinely a skill rather than a fact. You cannot recognise your way through it — you either can work out that 192.168.4.100/26 is in the 192.168.4.64 subnet with a broadcast of 192.168.4.127, or you cannot.
It is also under time pressure, which is why the previous binary lesson exists. This one starts with the address classes, because the exam still names them and because they explain why CIDR looks the way it does, and then gets to method.
The lesson
The five address classes
Before CIDR, the leading bits of an address determined its class, and the class determined the network/host split.
Class A. First bit 0, so first octet 1–126. Default mask 255.0.0.0 (/8): 8 network bits, 24 host bits. 126 possible networks, about 16.7 million hosts each. Intended for very large organisations.
Note the gap: 127 is missing, because 127.0.0.0/8 is reserved for loopback. An exam question may offer 127 as a Class A address; it is not one in practice.
Class B. First bits 10, so first octet 128–191. Default mask 255.255.0.0 (/16): 16 network bits, 16 host bits. About 16,000 networks of 65,534 hosts.
Class C. First bits 110, so first octet 192–223. Default mask 255.255.255.0 (/24): 24 network bits, 8 host bits. About 2 million networks of 254 hosts. This is the size most small networks use, which is why 192.168.x.x feels familiar.
Class D. First bits 1110, first octet 224–239. Multicast. Not divided into network and host portions at all — the whole address identifies a group. OSPF's 224.0.0.5 lives here.
Class E. First octet 240–255. Reserved and experimental. Never assigned to hosts. If an option offers a 240-range address as a host address, it is wrong.
The ranges are worth memorising as first-octet boundaries: 1–126, 128–191, 192–223, 224–239, 240–255, with 127 carved out for loopback.
Why classes stopped mattering
Classful addressing wasted enormous quantities of address space. An organisation with 500 hosts was too big for a Class C's 254 and so received a Class B's 65,534, throwing away 65,000 addresses. Multiply that across the 1990s and IPv4 exhaustion arrives decades early.
CIDR replaced the fixed boundary with an explicit prefix length, so that organisation gets a /23 — 510 hosts — and nothing is stranded.
Classes survive in three places the exam cares about: the default masks, which some equipment still assumes; the multicast range; and the vocabulary, because people still say "a Class C network" meaning a /24.
The method that works under pressure
Every subnetting question is one of a few shapes, and all of them fall to the same observation: a subnet's size is a power of two, and its boundaries are multiples of that size.
Work in the interesting octet — the one where the mask is neither 255 nor 0.
Step 1. Find the block size. Block size = 256 − (the mask value in the interesting octet).
- /26 → mask 255.255.255.192 → block size 256 − 192 = 64
- /27 → mask 255.255.255.224 → block size 32
- /28 → mask 255.255.255.240 → block size 16
- /30 → mask 255.255.255.252 → block size 4
Step 2. Count in blocks from zero. For a /26, the subnets start at .0, .64, .128, .192. For a /27: .0, .32, .64, .96, .128, .160, .192, .224.
Step 3. Place the address. Find the largest block start that is not greater than the host address. That is the network address.
Step 4. The broadcast is the next block start minus one. Usable hosts are everything between the network and broadcast addresses.
Worked: 192.168.4.100/26. Block size 64. Boundaries: 0, 64, 128, 192. 100 falls between 64 and 128, so:
- Network:
192.168.4.64 - Broadcast:
192.168.4.127 - Usable:
.65to.126 - Hosts: 2^6 − 2 = 62
Worked: 10.20.30.200/28. Block size 16. Boundaries: 192, 208. 200 falls between them, so:
- Network:
10.20.30.192 - Broadcast:
10.20.30.207 - Usable:
.193to.206— 14 hosts
The numbers to have memorised
These make the method fast, and they are only eight values:
| Prefix | Mask (last octet) | Block | Usable hosts |
|---|---|---|---|
| /24 | 0 | 256 | 254 |
| /25 | 128 | 128 | 126 |
| /26 | 192 | 64 | 62 |
| /27 | 224 | 32 | 30 |
| /28 | 240 | 16 | 14 |
| /29 | 248 | 8 | 6 |
| /30 | 252 | 4 | 2 |
| /31 | 254 | 2 | (point-to-point, special case) |
Note the two columns are the same sequence read in opposite directions. If you can reconstruct 128, 192, 224, 240, 248, 252 you have the whole table.
"How many subnets" questions
The other common shape: you have 192.168.1.0/24 and need six subnets of at least 25 hosts each.
Work from the host requirement, because hosts are the harder constraint. 25 hosts needs 2^h − 2 ≥ 25, so h = 5 gives 30 usable — enough. 32 − 5 = /27.
Then check the subnet count: a /24 split into /27s gives 2^3 = 8 subnets. Eight is at least six, so /27 satisfies both requirements.
The trap is answering with the mask that exactly meets the subnet count while failing the host count, or the reverse. Check both.
Borrowing bits
The formal framing, since the exam sometimes uses it: subnetting means borrowing bits from the host portion and giving them to the network portion. Each bit borrowed doubles the subnet count and halves the hosts per subnet.
Starting from a /24 and borrowing 3 bits gives a /27: 2^3 = 8 subnets, 2^5 − 2 = 30 hosts each. The total is always conserved, minus the two addresses lost per subnet — which is the real cost of subnetting heavily, and why a network of /30 links throws away half its addresses.
Practise what you just read
1. A host is configured as 192.168.4.100/26. Which network address does that host belong to?
Select one
Show answer
D. A /26 gives a block size of 256 minus 192, which is 64, so boundaries fall at .0, .64, .128 and .192. The address .100 sits between 64 and 128, making the network 192.168.4.64. Find the largest boundary not greater than the host address.
2. For a host configured as 192.168.4.100/26, what is the broadcast address of its subnet?
Select one
Show answer
B. The broadcast address is always the next block start minus one. With a block size of 64 the host sits in the block beginning at .64, the next begins at .128, so the broadcast is .127. Usable addresses run from .65 through .126, which is 62 hosts.
3. An address begins with a first octet of 230. Which class does it belong to, and what is it used for?
Select one
Show answer
A. Class D covers first octets 224 through 239 and is multicast. It is not divided into network and host portions at all, because the whole address identifies a group. Class E is 240 to 255 and is reserved, never assigned to hosts.
5 more questions on this objective are part of the full course.
Hands-on labs
Part of the free CompTIA Network+ N10-009 course — 44 lessons and 74 hands-on labs.