Home CCNA Classless Inter-Domain Routing (CIDR) Explained
CCNA

Classless Inter-Domain Routing (CIDR) Explained

Bit-Alignment Diagram Showing Four Network Addresses In Binary, With Matching Leftmost Bits Highlighted In Green And Differing Bits In Red, Producing A /21 Summary Result

The IETF introduced CIDR in September 1993, through a set of RFCs. RFC 1519 laid out the core addressing and aggregation strategy. RFC 1518 described the overall architecture. RFC 1517 explained why the change was needed in the first place. Together, they replaced the old classful addressing system. RFC 1519 was later obsoleted by RFC 4632 in 2006, which now serves as the current reference. It’s a good habit to know which RFC actually defines a concept, versus which one just motivates it. That distinction matters more than it might seem.

Classful addressing is obsolete today. CIDR is what replaced it, and it’s what every modern network actually runs on, whether the engineers running it think about CIDR by name or not.

Why CIDR Replaced Classful Addressing

Under CIDR, a network’s address is determined by its subnet mask. Not by the first octet’s value, the way classful addressing worked. The subnet mask defines the network prefix, sometimes written as a slash and a number: /16, /17, /25, /30, and so on.

Before CIDR, ISPs were stuck handing out fixed blocks. Class A, B, or C. Nothing in between. That meant a customer needing 500 addresses either got a wasteful Class B block of 65,536 addresses, or had to juggle multiple Class C blocks instead.

CIDR fixed this. ISPs can now assign a block sized to match actual need. A few hosts, or a few thousand. It also cuts down routing table size, through two related techniques: route summarization and supernetting.

Route Summarization and Supernetting

Route summarization, also called prefix aggregation, combines multiple routes into one. Instead of advertising five separate networks, a router can advertise a single summary route that covers all five. One summary static route can change several specific static route statements, cutting a routing table down significantly.

Supernetting is a specific case of summarization. It’s what you’re doing whenever the summary mask ends up shorter than the traditional classful mask for those addresses with a smaller mask than the classful boundary would suggest. Every supernet is a route summary. Not every route summary is a supernet, though. Summarizing several Class C-sized blocks into one shorter-mask block is supernetting. Summarizing subnets that already share a longer prefix isn’t necessarily.

How to Calculate a Summary Route

The process is mechanical, once you know the steps:

  1. Convert every network address to binary.
  2. Count the matching bits, starting from the left. Stop at the first bit where the networks disagree.
  3. That bit count is your new prefix length.
  4. Copy the matching bits. Set everything after them to zero. That’s your summarized network address.

It sounds abstract until you run through a real example.

Worked Example

Picture a small topology: Router1 connects to Router0, and Router1 also connects out to four other routers, each advertising its own network:

  • Router2: 172.16.0.0/23
  • Router3: 172.16.2.0/24
  • Router4: 172.16.3.0/24
  • Router5: 172.16.4.0/22

Convert the third octet of each network to binary:

172.16.00000000.0  (172.16.0.0/23)
172.16.00000010.0  (172.16.2.0/24)
172.16.00000011.0  (172.16.3.0/24)
172.16.00000100.0  (172.16.4.0/22)

Line them up, and the first 21 bits match across all four. Beyond that, they diverge. That gives us a /21 summary:

Binary Route Summarization Classless Inter-Domain Routing (Cidr) Explained
Classless Inter-Domain Routing (Cidr) Explained 4

172.16.0.0/21

That single route covers every address from 172.16.0.0 through 172.16.7.255. Every one of the four original networks fits inside it, with no overlap into address space that doesn’t belong to them.

Configuring the Summary Route

Say Router0 originally had four separate static routes pointing at Router1, one for each downstream network:

Router0(config)#ip route 172.16.0.0 255.255.254.0 10.10.10.1
Router0(config)#ip route 172.16.2.0 255.255.255.0 10.10.10.1
Router0(config)#ip route 172.16.3.0 255.255.255.0 10.10.10.1
Router0(config)#ip route 172.16.4.0 255.255.252.0 10.10.10.1

Remove all four, and replace them with a single summary route instead:

Router0(config)#no ip route 172.16.0.0 255.255.254.0 10.10.10.1
Router0(config)#no ip route 172.16.2.0 255.255.255.0 10.10.10.1
Router0(config)#no ip route 172.16.3.0 255.255.255.0 10.10.10.1
Router0(config)#no ip route 172.16.4.0 255.255.252.0 10.10.10.1
Router0(config)#ip route 172.16.0.0 255.255.248.0 10.10.10.1

Same reachability. One route instead of four. Verify with show ip route afterward, and you’ll see the single /21 entry doing the job all four used to do.

CIDR and Routing Protocols

Classful routing protocols don’t handle this gracefully. They automatically apply the default classful mask to any network they advertise, whether that’s actually correct or not. If the topology above used a classful protocol, Router0 would install 172.16.0.0/16 instead, a much broader (and less precise) route than the actual /21 summary.

That’s why VLSM and supernetting both require classless routing protocols. RIPv2, OSPF, and EIGRP all qualify. They advertise the actual subnet mask alongside every network, instead of assuming a classful default. RIPv1 doesn’t, which is part of why it’s rarely used today. A classful protocol also won’t include a supernet route in its updates at all, even a manually configured static one, since a supernet by definition doesn’t fit the classful mold it expects.

Why This Actually Matters

It’s easy to treat summarization as a minor cleanup step. It isn’t, once a network grows. Every route in a routing table costs router CPU time and memory to process, and costs a small amount of extra time on every lookup. A router carrying 500,000 unsummarized routes behaves very differently than one carrying 50,000 well-summarized ones. The difference shows up in convergence time after a link failure, too, since every route recalculation has more entries to process.

This matters even more at internet scale. Without CIDR and aggressive route summarization, the global routing table would be enormous. It would have grown roughly in step with the number of individual networks on the internet, rather than the much smaller number of aggregated blocks it actually tracks today. CIDR is genuinely one of the reasons the internet’s routing infrastructure held together through IPv4’s explosive growth in the 1990s and 2000s, and it’s still doing that job quietly today, every time a router looks up a destination.

A Common Pitfall: Summarizing Too Loosely

The example above worked cleanly because the four networks lined up into a perfect /21. Real networks aren’t always this tidy.

Say you tried to summarize 172.16.0.0/24 and 172.16.5.0/24 together. Neither is adjacent to the other in a way that produces a clean summary. The best matching prefix might technically be /21, but that /21 block would also include address space you never actually allocated. Anything unused inside that range would get advertised as reachable through this route, even though nothing is actually there.

This is called an overly broad summary, or sometimes just a “leaky” summary. It doesn’t break anything immediately. But it can cause traffic destined for genuinely unreachable addresses to get routed toward you anyway, which then gets silently dropped, or worse, misrouted somewhere unhelpful. Good address planning avoids this. Allocate related networks as contiguous, power-of-two-sized blocks from the start, and summarization stays clean later.

CIDR Prefix Quick Reference

Stepped Bar Chart Showing Cidr Prefixes From /30 To /16, With Bar Width Increasing To Represent Growing Address Counts And Typical Use Cases For Each Size
From Point-To-Point Links To Isp-Scale Allocations
PrefixSubnet MaskAddressesTypical Use
/30255.255.255.2524Point-to-point links
/29255.255.255.2488Small server segments
/27255.255.255.22432Small office subnet
/24255.255.255.0256Standard LAN subnet
/22255.255.252.01,024Larger site or campus block
/21255.255.248.02,048Summarized multi-subnet block
/16255.255.0.065,536Large enterprise or ISP allocation

Notice the pattern: every step down in prefix length doubles the address count. That’s the same binary logic behind the summarization math above, just running in the opposite direction. Summarizing shrinks the prefix and grows the covered range. Subnetting does the reverse.

Conclusion

CIDR replaced rigid classful blocks with flexible, subnet-mask-based addressing. That flexibility is what makes route summarization and supernetting possible, which in turn keeps routing tables manageable at any scale, from a small branch office to the global internet. Once you can do the binary math by hand, in a worked example, choosing the right summary route in a real network becomes a lot less mysterious. Practice a few examples yourself, ones that don’t line up as cleanly as our /21 did. That’s where the real skill shows up, and where a leaky summary starts to become obvious before it ever reaches a production network.

FAQs

What is Classless Inter-Domain Routing (CIDR)?

CIDR is the addressing system that replaced classful IP addressing, introduced by the IETF in September 1993. It uses subnet masks, written as prefix lengths like /24 or /21, instead of a fixed class boundary to define where a network’s address ends and its host addresses begin. This lets ISPs and organizations assign address blocks sized to actual need, rather than forcing everyone into rigid Class A, B, or C sizes.

What are the benefits of CIDR?

CIDR reduces wasted address space, since blocks can be sized precisely instead of rounded up to the nearest class. It also shrinks routing tables through summarization and supernetting, which reduces the memory and CPU load on every router carrying those routes. On top of that, it enabled VLSM support in classless routing protocols like OSPF and EIGRP, letting a single network use multiple subnet sizes instead of one fixed mask throughout.

How does route summarization work in CIDR?

Convert every network address you want to summarize into binary, then count the matching bits starting from the left, stopping at the first point where the addresses disagree. That bit count becomes your new prefix length, and copying the matching bits while zeroing out the rest gives you the summarized network address. A well-chosen summary route can replace many individual routes with one, as long as the underlying networks were allocated as contiguous blocks in the first place.

What is supernetting in CIDR?

Supernetting is route summarization where the resulting mask ends up shorter than the traditional classful mask would have been for those addresses. Every supernet is technically a route summary, but not every route summary counts as a supernet specifically. It becomes especially useful for ISPs aggregating many customer blocks, or for combining several smaller networks that would otherwise need separate routing table entries.

How is CIDR used in static routing?

A summary static route can replace several individual static routes pointing to the same next-hop, as long as the destination networks summarize cleanly into one block. In practice, this means removing the individual ip route entries and replacing them with a single entry using the calculated summary prefix, verified afterward with show ip route. This keeps the routing table smaller and the configuration easier to read, without losing any actual reachability. Just double-check your summary isn’t reaching further than intended. A summary that’s technically correct but too broad can quietly advertise reachability to address space you never actually allocated, which causes its own set of headaches down the line.

Avatar Of Muhammad Khattak
Muhammad Khattak

Author

Routing and switching specialist, CCNA certified, with extensive experience in network configuration and troubleshooting. Covers OSPF, EIGRP, VLAN management, and advanced routing concepts.

Related Articles