CIDR Notation Explained
Complete guide to CIDR notation - what it is, why it replaced IP classes, and how to read network prefixes.
What is CIDR?
CIDR (Classless Inter-Domain Routing) is a method for describing IP networks using a slash followed by a number. The number after the slash tells you how many bits are used for the network portion of the address. For example, in 192.168.1.0/24, the "/24" means the first 24 bits identify the network, and the remaining 8 bits identify individual hosts within that network.
192.168.1.0/24
, the network is 192.168.1.0 and there are 254 usable host addresses
(192.168.1.1 through 192.168.1.254).Why CIDR Replaced IP Classes
The old class system (Class A, B, C) was too rigid and wasteful. It only allowed networks of fixed sizes: - Class A: 16 million addresses (way too big for most needs) - Class B: 65,536 addresses (often too big) - Class C: 256 addresses (often too small) CIDR lets you create networks of any size by choosing exactly how many network bits you need.
How to Read CIDR Notation
The number after the slash is the "prefix length" - it counts the network bits from left to right: - /8 = 8 network bits (24 host bits) - /16 = 16 network bits (16 host bits) - /24 = 24 network bits (8 host bits) - /30 = 30 network bits (2 host bits)
Common Examples
Prefix Length Reference Table
Prefix | Subnet Mask | Usable Hosts | Typical Use |
---|---|---|---|
/8 | 255.0.0.0 | 16,777,214 | ISP allocation |
/16 | 255.255.0.0 | 65,534 | Large enterprise |
/20 | 255.255.240.0 | 4,094 | Medium business |
/24 | 255.255.255.0 | 254 | Small office/home |
/25 | 255.255.255.128 | 126 | Small subnet |
/26 | 255.255.255.192 | 62 | Point-to-point |
/30 | 255.255.255.252 | 2 | Router links |
/32 | 255.255.255.255 | 1 | Single host |
Key Points to Remember
- Smaller prefix numbers = bigger networks (more hosts)
- Larger prefix numbers = smaller networks (fewer hosts)
- /24 is the most common size for small networks
- IPv6 commonly uses /64 for end-user networks
- CIDR allows efficient use of IP address space