Ctrl + K
Network8 min read

CIDR Explained

Understand CIDR notation, subnet prefixes, IP address allocation and how Classless Inter-Domain Routing improves network efficiency.

Published: 2026-08-07

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/16

Understanding 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.

CIDRNetwork BitsHost Bits
/8824
/161616
/24248
/32320

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.

FeatureClassful AddressingCIDR
Network sizesFixedFlexible
Address efficiencyLowerHigher
Routing scalabilityLimitedImproved
Modern usageObsoleteStandard

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.

CIDRSubnet Mask
/8255.0.0.0
/16255.255.0.0
/24255.255.255.0
/32255.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.
šŸ’” Think of the CIDR prefix as defining the size of the network rather than the number of devices currently connected to it.
āš ļø Do not confuse the CIDR prefix with the number of usable host addresses. Some addresses within a subnet are reserved for network and broadcast purposes in IPv4.

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.

CIDRTotal AddressesUsable IPv4 Hosts
/3042
/2986
/281614
/24256254

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/23

Subnetting 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.

ProtocolExample Prefix
IPv4192.168.1.0/24
IPv62001:db8::/64

Common CIDR Prefixes

CIDRTypical Usage
/32Single IPv4 address
/30Point-to-point links
/24Typical LAN subnet
/16Large enterprise network
/8Very 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.

šŸ’” Learning common prefix lengths such as /24, /16 and /30 makes it much easier to read network diagrams, firewall rules and cloud networking configurations.
āš ļø Avoid choosing subnet sizes that are significantly larger than necessary. Oversized networks waste address space and can make network management more difficult.

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.
šŸ’” Memorizing a few common prefixes such as /32, /30, /24, /16 and /8 makes it much easier to understand routing tables, firewall rules and cloud networking configurations.
āš ļø Incorrect CIDR ranges can unintentionally expose resources or prevent legitimate communication. Always verify subnet calculations before deploying network changes in production.

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.