What the prefix length actually says
CIDR notation such as 192.168.1.0/24 states how many leading bits identify the network, leaving the rest to identify hosts. A /24 fixes 24 bits and leaves 8, giving 256 addresses. Each additional bit halves the block: /25 is 128 addresses, /26 is 64, and so on.
Two addresses in each block are conventionally unusable. The all-zeros host address identifies the network itself, and the all-ones address is the broadcast address, so usable hosts number 2ʰ − 2. A /24 provides 254 usable addresses, and a /30 — four addresses — provides just two, which is why /30 was long the standard for point-to-point links.
RFC 3021 permits /31 for point-to-point links specifically, where the broadcast concept is meaningless because there are only two endpoints. That yields two usable addresses from two, halving address consumption on router links. A /32 represents a single host and is used for loopbacks and specific-host routes.
Subnetting without wasting addresses
Splitting a network means borrowing bits from the host portion. Dividing a /24 into four subnets requires two extra bits, producing four /26 blocks of 62 usable hosts each. Borrowing three bits gives eight /27 blocks of 30 hosts.
Fixed-size subnetting wastes addresses whenever segments differ in size, which they almost always do. Variable-length subnet masking allocates each segment only what it needs — a /26 for an office of 50 machines, a /30 for a router link — and it is what makes efficient use of a limited range possible.
Blocks must be aligned to their own size, which is the constraint people most often violate. A /26 can begin at .0, .64, .128 or .192 and nowhere else. Starting one at .50 is not a valid subnet, even though it looks like it should work, and equipment will reject it.
Private ranges, NAT and IPv6
RFC 1918 reserves three ranges for private use: 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16. They are not routed on the public internet, which is why home and office networks use them behind network address translation. Note that the 172 range is a /12 — 172.16.0.0 to 172.31.255.255 — not the whole 172 space, a boundary frequently misremembered.
Two other ranges are worth recognising: 127.0.0.0/8 for loopback, and 169.254.0.0/16 for link-local addresses, which a machine self-assigns when DHCP fails. An interface showing a 169.254 address means no DHCP server answered, and that diagnosis alone resolves a great many connectivity problems.
IPv6 changes the arithmetic entirely. A standard /64 subnet holds roughly 1.8 × 10¹⁹ addresses, so subnetting is about hierarchy and routing rather than conservation, and the convention is to allocate a /64 to every network segment regardless of size. Sites typically receive a /48 or /56, leaving ample room to delegate.