Field guide · Networking & wireless
Subnetting, Explained
Subnetting is one idea repeated: move the line between the network part of an address and the host part, and everything else follows. This walks the prefix bit by bit, in binary and in decimal, so the arithmetic stops being something you look up. Includes a worked example of carving a site into VLAN-sized blocks.
Diagram
Where the numbers come from, and the meaning behind them.
The first 24 bits are fixed — they name the network. The remaining 8 are free, and every combination of them is one address inside it. That is the whole idea; everything below is a consequence of it.
255.255.255.0
The same line, in dotted decimal.
256
2 to the power of 8.
254
Total minus the network and broadcast addresses.
10.20.0.1 – 10.20.0.254
What you can assign.
Moving the line one place right takes a bit from the host part and gives it to the network part. One block becomes two, each with half the addresses. Repeat that and you have subnetting — there is no second idea.
10.20.0.0/25
10.20.0.1 – 10.20.0.126
126 usable
10.20.0.128/25
10.20.0.129 – 10.20.0.254
126 usable
Sizing real blocks rather than learning the shape of it? The subnet calculator does the same arithmetic against whatever you type, and splits a block into equal parts in one step.
Prefix slash 24. Mask 255.255.255.0. 254 usable hosts, from 10.20.0.1 to 10.20.0.254. Network address 10.20.0.0.Questions
Questions people actually ask
- What does the /24 in an IP address mean?
- It is the prefix length: how many of the address's 32 bits identify the network. A /24 fixes the first 24 bits, leaving 8 bits for hosts — 256 addresses, 254 of them assignable once the network and broadcast addresses are taken.
- How do I work out how many hosts a subnet holds?
- Two to the power of the remaining bits, minus two. A /26 leaves 6 host bits, so 2⁶ = 64 addresses and 62 usable. The two subtracted are the network address and the broadcast address, neither of which can be assigned to a device.
- Why do /31 and /32 not follow that rule?
- A /32 is a single address — a host route or a loopback. A /31 is a special case defined by RFC 3021 for point-to-point links, where the two addresses are both usable because a point-to-point link has no need for a broadcast address.
- What is the difference between a subnet mask and a prefix?
- They are the same information written two ways. 255.255.255.0 and /24 both say the first 24 bits are the network. The mask is the older dotted-decimal form; the prefix is CIDR notation and is what modern equipment expects.
Other guides
Related guides
- 01
The OSI Model, Layer by Layer
Seven layers, what each does, and how they hand off. - 02
Active Directory, Explained
Forests, domains, roles, and how a login really works. - 03
Writing a Switch Configuration
From factory default to a switch you would hand over. - 04
VLANs and Trunking
Access, trunk, tagged, native — and which one is the security hole. - 05
Spanning Tree and Switching Loops
Why one patch cord can take a whole floor down in seconds. - 06
Reading a Traceroute
Which loss is real, and whose network it is in.
Book the work
We do this work
as well as document it
Anyone who can use a subnet calculator but would rather understand what it is doing, or is carving up address space for the first time.
- Free guides
- No sign-up
- Nothing tracked
- Written on the job