Chapter 4

CIDR & Subnetting

/24, /28, usable hosts, planning subnets.

Learning objectives

  • Read CIDR notation (/24, /28, etc.)
  • Calculate usable host counts
  • Split a network into subnets for VLANs

CIDR notation

CIDR (Classless Inter-Domain Routing) writes the prefix length after a slash: 192.168.10.0/24 means the first 24 bits are the network; the remaining 8 bits are hosts.

PrefixSubnet maskTotal addressesUsable hosts*
/24255.255.255.0256254
/25255.255.255.128128126
/28255.255.255.2401614
/30255.255.255.25242 (point-to-point links)

*Usable hosts exclude network and broadcast addresses on typical LAN subnets.

Formula

Host bits = 32 − prefix. Total addresses = 2host bits. Usable ≈ total − 2 for /24 and larger LANs.

Worked example — split Workshop Co. /24

Starting network 192.168.10.0/24 (254 hosts). Workshop Co. needs three isolated segments:

VLANSubnetUsable hostsUse
Office192.168.10.0/2662Staff laptops, printers
Shop floor192.168.10.64/2662POS, tool booking kiosk
Cameras192.168.10.128/2730NVR + 4 cameras
Guest Wi‑Fi192.168.20.0/24254Separate /24 on guest VLAN
Overlapping subnets

Two VLANs cannot use the same subnet on the same router without bridging. Guest uses 192.168.20.0/24 deliberately — not overlapping 10.0/26 ranges inside 10.0/24 unless you carve carefully.

Try it yourself — /28 for IoT

Workshop Co. wants a tiny subnet for 8 smart dust-collector sensors. Is /28 enough? What is the network address if carved from 192.168.10.192/28?

Answer

/28 gives 14 usable hosts — enough for 8 sensors plus room to grow. Network: 192.168.10.192, broadcast 192.168.10.207, usable .193–.206.

Spot the mistake

Admin assigns gateway 192.168.10.255 on a /24. What is wrong?

Answer

.255 is the broadcast address on /24 — not valid for a host. Use 192.168.10.1 or another host address in range.

Quick quiz

  1. How many usable hosts in a /26?
  2. What does /24 mean in terms of bits?
  3. Why use a /30?
Answers
  1. 62 usable (64 − 2).
  2. 24 network bits, 8 host bits.
  3. Point-to-point links between routers — only two usable IPs needed.