Subnetting has a reputation as the topic where networking students go to suffer — binary maths, magic tables, tears before certification. Strip the exam theatrics away, though, and the underlying idea is genuinely simple: a subnet is a decision about where to draw the line between "neighbourhood" and "house number" inside an IP address.
The line in the address
An IPv4 address is 32 bits. Some number of those bits, reading from the left, identify the network; the rest identify the host (the device) within it. The notation /24 — as in 192.168.1.0/24 — says exactly one thing: the first 24 bits are the network part. That leaves 8 bits for hosts, and 8 bits can count to 256, so a /24 contains 256 addresses (two of which are reserved — the network's own name and its broadcast address — leaving 254 usable). If you've ever noticed home networks always seem to be 192.168.1.something with the last number changing per device, congratulations: you've already internalised a /24. The first three numbers are the street; the last is the door.
Moving the line
Everything else in subnetting is just sliding that boundary:
- Move it left (a /16): fewer bits for network, more for hosts — one enormous street with ~65,000 doors.
- Move it right (a /26): more network bits, fewer host bits — smaller streets of 64 addresses each, and you get four of them out of what was one /24.
Each step right halves the subnet size and doubles the count. That single doubling relationship replaces most of the tables people memorise: /25 is half of a /24 (128 addresses), /26 half again (64), /27 half again (32). You can walk the whole scale from one anchor point.
The subnet mask (that 255.255.255.0 string) is just the same information in an older costume — 255 means "this byte is all network," 0 means "all host." 255.255.255.0 is /24. One fact, two notations, and modern practice overwhelmingly favours the slash.
Why anyone slices networks at all
Because a device can only talk directly to devices in its own subnet — everything else must go via a router. That constraint is a feature: it lets you put servers, staff, guests, and CCTV in separate subnets, then control and inspect the traffic between them at the router or firewall. Sound familiar? It's the same segmentation instinct as VLANs, earlier on this trail — VLANs draw the boundary at layer 2, subnets draw it at layer 3, and in real networks the two are usually paired one-to-one: each VLAN gets its own subnet. Subnetting isn't maths homework. It's the addressing half of network design.