Subnetting and CIDR
Dividing IP address space into subnets and the Classless Inter-Domain Routing notation that replaced rigid classful addressing.

Subnetting splits a block of IP addresses into smaller, administratively separate networks called subnets. The original IPv4 design used fixed classes — A, B, and C — which wasted enormous address ranges, so in 1993 classless routing (CIDR, Classless Inter-Domain Routing) replaced them. CIDR expresses any block as an address followed by a prefix length: 192.168.1.0/24 denotes the 256 addresses whose first 24 bits are fixed, 192.168.1.0 through 192.168.1.255.
The subnet mask is the prefix written in dotted form: /24 is 255.255.255.0, /16 is 255.255.0.0, /28 is 255.255.255.240. The network address is the block's lowest address (all host bits zero) and the broadcast address the highest (all host bits one), so a /28 block of 16 addresses provides 14 usable host addresses. Subnetting is why an organization can carve one purchased block into per-department or per-VLAN networks while still advertising a single route to the internet.
| Prefix | Mask | Addresses | Usable hosts |
|---|---|---|---|
| /24 | 255.255.255.0 | 256 | 254 |
| /28 | 255.255.255.240 | 16 | 14 |
| /30 | 255.255.255.252 | 4 | 2 |
Routers use the longest-prefix-match rule: when several routes match a destination, the most specific one wins, which is what allows both a /8 summary and a /30 point-to-point link to coexist. Subnetting shrinks broadcast domains (fewer hosts receive each broadcast), improves security by isolating traffic, and is the backbone of how the Domain Name System addresses and the TCP networks actually route packets. IPv6 removes the need for address conservation but keeps the same prefix notation, e.g. 2001:db8::/32.
Tags
ip addressing networking routing subnetting