All guides

How Subnets Divide a Network Into Neighbourhoods

One number, two jobs

An IP address is really two addresses fused: the leading bits name the network, the trailing bits name the device on that network. A subnet mask is the stencil that separates them, a row of ones over the network part and zeros over the device part. The mask 255.255.255.0 says the first three bytes are the network and the last byte is the device, giving 256 addresses per network. CIDR notation compresses the same idea into a count: /24 means 24 network bits. Subnetting is choosing that split deliberately, carving a big allocation into smaller networks sized for a floor of an office, a department, a guest Wi-Fi, or a single link between two routers.

Why bother carving networks up

Separate subnets contain problems. Broadcast traffic, the network equivalent of shouting, stays inside its own subnet, so a thousand devices do not all hear every shout. Security improves because firewalls can police the borders between subnets: the guest network reaches the internet but not the file server, the cameras cannot see the accounts laptops. Organisation improves too, since an address alone tells an engineer where a device lives. And addresses stop being wasted: a link between two routers needs only a /30 with two usable addresses, not a whole /24. The trade off is planning. Subnets must not overlap, and growing a subnet that was sized too small means renumbering, which nobody enjoys.

Reading a subnet at a glance

Given any address and prefix, four figures describe the subnet. The network address is the first, with all device bits zero, and it names the subnet itself. The broadcast address is the last, with all device bits one. Usable hosts live between them, which is why the usable count is the total minus two, the rule behind the classic /24 giving 254 hosts. The subnet calculator here works all of this out from any address and prefix, including the mask and wildcard, and flags private and special ranges. Try your own home address, probably something like 192.168.1.42 with a /24, and you will see your whole home network described on one screen. If you run a home network, you already own a subnet, most likely a /24 handed to you by the router. Everything in this guide applies to it: the router sits at one address, its DHCP service lends the rest, and the broadcast address hums quietly underneath the printer discovery and screen sharing that just work. Knowing the shape of your own subnet is the difference between poking at network problems and diagnosing them, and it starts with the four figures the calculator lays out.

Try the calculator

The free tool that goes with this guide:

Calculate a subnet