Subnet Masks
Kite Studio has outgrown one flat network: guests on the Wi-Fi can see the file server, and the printer is drowning in broadcasts. The fix is to split 192.168.10.0 into smaller subnets. Every subnet plan rests on one small tool, the subnet mask, which tells a device which part of an address names the network and which part names the host.
The rule
Mask ones mark the network; mask zeros count the hosts.
A subnet mask is 32 bits, like an IPv4 address: a run of 1s followed by a run of 0s. Where the mask has 1s, the address bits are the network part; where it has 0s, they are the host part.
Address 192.168.10.57 11000000.10101000.00001010.00111001
Mask 255.255.255.0 11111111.11111111.11111111.00000000
Network 192.168.10.0 (keep the bits where the mask is 1)With host bits there are addresses in the subnet, and two are reserved:
- network address — all host bits 0 (
192.168.10.0), the name of the subnet; - broadcast address — all host bits 1 (
192.168.10.255), "everyone on this subnet".
So usable hosts = . Kite Studio's 255.255.255.0 has 8 host bits: 256 addresses, 254 usable, .1 to .254.
A mask octet can only be one of nine values, because the 1s must be continuous from the left:
| 1-bits in the octet | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
|---|---|---|---|---|---|---|---|---|---|
| Octet value | 0 | 128 | 192 | 224 | 240 | 248 | 252 | 254 | 255 |
The shortcut
Learn the ladder by adding halves: 128, +64 = 192, +32 = 224, +16 = 240, +8 = 248, +4 = 252, +2 = 254, +1 = 255. Then, to test whether two hosts share a subnet, AND each address with the mask in the one octet that is not 0 or 255 — the "interesting" octet — and compare the results.
Find the interesting octet
The mask is 255.255.255.192, so only the fourth octet needs work.
The trap is forgetting the minus 2. A subnet with 6 host bits has 64 addresses but only 62 usable hosts.
Drills
Answer fast — trust the rule.
Usable hosts on Kite Studio's 255.255.255.0 network:
Usable hosts with mask 255.255.255.192 (6 host bits):
Which of these is NOT a valid subnet mask octet?
For 192.168.10.57 with mask 255.255.255.0, what is the broadcast address?
With mask 255.255.255.192, are 192.168.10.20 and 192.168.10.57 on the same subnet?
Remember
- Mask ones mark the network; mask zeros count the hosts: usable.
- The ladder: 128, 192, 224, 240, 248, 252, 254, 255.
- Same subnet? AND both addresses with the mask and compare.
