04 — SUBNET MASKS
How devices know who's on their network.
Estimated 12 minutes.
Who's on my network?
When a device wants to send a packet, it has to ask one question first: "Is the destination on my network, or somewhere else?" The subnet mask is how it answers that question.
A second number, always.
Every device with an IP also has a subnet mask. They come as a pair. You'll see it written like 255.255.255.0, or in shorthand like /24.
The mask in bits.
Where the mask has 1s, that part of the IP is the network. The 0s are the device.
Reading the mask.
255 in any spot means "all 8 bits are network." 0 means "all 8 bits are device." So 255.255.255.0 says: the first 3 numbers identify the network, the last number identifies the device on it.
CIDR — the slash.
Engineers write masks as a slash followed by the count of network bits. /24 means 24 bits of network. It's the same as 255.255.255.0 — just shorter.
Drag the slider.
Move the slider and watch the mask, the network bits, and the host count change in real time. Try a couple of prefixes — see what /16, /30, and /32 do.
Common masks.
The mask sets how many devices can fit on the network.
Same network or not?
192.168.1.10 with /24 wants to talk to 192.168.1.200. Same network?
- Yes — same /24
- No — different
- Need a router
Different network = needs a router.
If the network bits don't match, a device can't reach the destination directly. It hands the packet to its default gateway — usually a router — and lets that router figure out where to send it next.
Try the rule.
For each pair, decide: same network, or not?
Mismatched masks = trouble.
If two devices have the same IP range but different masks, they may disagree about whether they're on the same network. One thinks "yes, talk directly." The other thinks "no, send through a router." Packets vanish. This is a classic plant-floor headache.
How big is /16?
A /16 network has roughly how many usable addresses?
- ~250
- ~65,000
- ~16 million
Picking a mask.
Small cell with under 250 devices? Use /24. Mid-size facility? /16 gives you room. Point-to-point link between two devices? /30 wastes nothing. Match the mask to how many devices need to share a network.
One last check.
Device A: 10.0.5.10 /16. Device B: 10.0.250.99 /16. Can they talk directly?
- Yes
- No
You can size and read any subnet.
- A subnet mask splits an IP into network bits and device bits.
- /24 = 255.255.255.0 = ~250 devices. /16 = ~65,000.
- Same network = talk directly. Different = needs a router.
- Mismatched masks between devices = silent failures.
Lesson 04 complete.
- You can read any subnet mask.
- You know what /24, /16, /30 mean.
- You can decide if two IPs share a network.