CIDR Explained
Understand CIDR notation, subnet prefixes, IP address allocation and how Classless Inter-Domain Routing improves network efficiency.
Classless Inter-Domain Routing (CIDR) is the modern method for allocating IP addresses and defining network boundaries. Introduced to replace the older class-based addressing system, CIDR makes IP address allocation far more efficient and significantly reduces the size of Internet routing tables.
Today, CIDR notation is used throughout enterprise networks, cloud platforms, home routers and Internet infrastructure. Understanding CIDR is essential for anyone working with networking, system administration, DevOps or cloud computing.
What Is CIDR?
CIDR stands for Classless Inter-Domain Routing. Instead of assigning addresses using fixed network classes such as Class A, B and C, CIDR allows networks of almost any size by specifying how many bits belong to the network portion of an IP address.
CIDR Notation
CIDR notation combines an IP address with a slash followed by a prefix length. The prefix indicates how many bits identify the network, while the remaining bits identify individual host addresses.
192.168.1.0/24
10.0.0.0/8
172.16.0.0/16Understanding the Prefix Length
The number following the slash specifies the number of network bits. A larger prefix creates a smaller network with fewer available host addresses, while a smaller prefix represents a larger network.
| CIDR | Network Bits | Host Bits |
|---|---|---|
| /8 | 8 | 24 |
| /16 | 16 | 16 |
| /24 | 24 | 8 |
| /32 | 32 | 0 |
CIDR vs Classful Addressing
Before CIDR, IPv4 addresses were divided into fixed classes with predefined network sizes. This often wasted large numbers of addresses because organizations received networks much larger than necessary. CIDR eliminated these rigid classes by allowing flexible network sizes that better match actual requirements.
| Feature | Classful Addressing | CIDR |
|---|---|---|
| Network sizes | Fixed | Flexible |
| Address efficiency | Lower | Higher |
| Routing scalability | Limited | Improved |
| Modern usage | Obsolete | Standard |
Subnet Masks and CIDR
CIDR prefixes correspond directly to subnet masks. For example, a /24 prefix is equivalent to the subnet mask 255.255.255.0, while /16 corresponds to 255.255.0.0. Both representations describe the same network boundary.
| CIDR | Subnet Mask |
|---|---|
| /8 | 255.0.0.0 |
| /16 | 255.255.0.0 |
| /24 | 255.255.255.0 |
| /32 | 255.255.255.255 |
Why CIDR Matters
CIDR dramatically improved Internet scalability by reducing address waste and allowing routers to aggregate multiple networks into larger routing prefixes. Without CIDR, today's Internet routing infrastructure would be significantly less efficient.
- Efficient IP address allocation.
- Smaller routing tables.
- Flexible network sizes.
- Improved Internet scalability.
- Simplified subnetting.
Calculating Available Hosts
The number of available host addresses depends on the number of host bits remaining after the network prefix. As the prefix length increases, fewer bits remain for hosts, resulting in smaller networks.
| CIDR | Total Addresses | Usable IPv4 Hosts |
|---|---|---|
| /30 | 4 | 2 |
| /29 | 8 | 6 |
| /28 | 16 | 14 |
| /24 | 256 | 254 |
Network Address and Broadcast Address
In IPv4 subnets, the first address identifies the network itself, while the last address is reserved as the broadcast address. These two addresses cannot normally be assigned to hosts, which is why the number of usable addresses is usually two fewer than the total number of addresses in the subnet.
CIDR Aggregation (Route Summarization)
One of CIDR's greatest advantages is route aggregation, also known as route summarization. Multiple smaller networks can be represented by a single larger prefix, allowing Internet routers to maintain significantly smaller routing tables and improving routing efficiency across large networks.
192.168.0.0/24
192.168.1.0/24
ā
192.168.0.0/23Subnetting with CIDR
CIDR makes subnetting flexible by allowing administrators to divide larger address blocks into smaller networks of almost any practical size. This enables efficient allocation of IP addresses for departments, offices, cloud environments and virtual private networks.
CIDR in Cloud Platforms
Cloud providers such as AWS, Azure and Google Cloud rely heavily on CIDR notation when creating virtual networks, defining subnets and configuring routing rules. Understanding CIDR is therefore an essential networking skill for cloud engineers and DevOps professionals.
CIDR and IPv6
CIDR is used with IPv6 as well as IPv4. Although IPv6 provides an enormous address space, prefix lengths remain essential for defining network boundaries. Common IPv6 prefixes include /64 for local networks and /48 for organizational allocations.
| Protocol | Example Prefix |
|---|---|
| IPv4 | 192.168.1.0/24 |
| IPv6 | 2001:db8::/64 |
Common CIDR Prefixes
| CIDR | Typical Usage |
|---|---|
| /32 | Single IPv4 address |
| /30 | Point-to-point links |
| /24 | Typical LAN subnet |
| /16 | Large enterprise network |
| /8 | Very large network allocation |
When to Use CIDR
CIDR should be used whenever IP addresses, routing or subnetting are involved. It is the standard addressing method for modern IPv4 and IPv6 networks, replacing the outdated class-based addressing model in virtually all real-world deployments.
Common Mistakes
CIDR notation is straightforward once understood, but it is easy to make mistakes when calculating subnet sizes or interpreting prefix lengths. Incorrect CIDR configurations can lead to routing problems, overlapping networks or insufficient address space for connected devices.
- Confusing the prefix length with the number of available hosts.
- Using overlapping CIDR ranges.
- Allocating networks that are much larger than necessary.
- Forgetting about reserved network and broadcast addresses in IPv4.
- Miscalculating subnet boundaries.
- Assuming CIDR applies only to IPv4.
Best Practices
- Plan your IP addressing scheme before deployment.
- Allocate only the address space your network requires.
- Use route summarization whenever possible.
- Document subnet assignments clearly.
- Validate CIDR ranges before configuring routers or firewalls.
- Use subnet calculators to avoid manual calculation errors.
Frequently Asked Questions
What does /24 mean in CIDR notation?
A /24 prefix means the first 24 bits identify the network, leaving 8 bits for host addresses. In IPv4, this provides 256 total addresses, with 254 typically available for hosts.
Is CIDR used with IPv6?
Yes. IPv6 also uses CIDR notation to define network prefixes. Common IPv6 networks use a /64 prefix, while larger organizational allocations often use prefixes such as /48.
Why did CIDR replace classful addressing?
CIDR allows flexible network sizes instead of fixed address classes, reducing address waste and improving routing efficiency across the Internet.
What is route summarization?
Route summarization, also called route aggregation, combines multiple smaller networks into a single larger CIDR prefix. This reduces the number of routing table entries and improves routing scalability.
How do I calculate the number of hosts in a subnet?
The number of host addresses depends on the remaining host bits after the network prefix. Subnet calculators can perform these calculations automatically and help avoid mistakes.
Helpful Network Tools
A CIDR Calculator computes network addresses, subnet masks and available host ranges, a CIDR Range Expander converts CIDR blocks into individual IP addresses or ranges, a CIDR Range Compressor combines multiple ranges into the smallest possible CIDR blocks, a Subnet Calculator helps design and validate IPv4 and IPv6 subnet layouts, and an IP Range Generator creates sequential address ranges for testing, documentation and network planning.
Conclusion
CIDR is the foundation of modern IP addressing and routing. By replacing inefficient class-based networking with flexible prefix lengths, it enables efficient address allocation, scalable routing and practical subnetting for networks of every size. Whether you're configuring home routers, managing enterprise infrastructure or building cloud environments, understanding CIDR notation is an essential networking skill that simplifies IP planning and improves overall network design.