What Is CIDR? A Beginner’s Guide to Classless Inter-Domain Routing 

5 min read
2 October 2024

Learn all about CIDR and how essential it is for today's Internet.

Classless inter-domain routing

Quick Learnings:

  • CIDR allows flexible IP address allocation by enabling subnetting at various points, preventing the waste associated with fixed class-based systems (A, B, C) and making optimal use of the limited IPv4 address space.
  • By aggregating multiple IP addresses into a single block (supernetting), CIDR significantly reduces the size of routing tables. This helps routers perform faster and manage network traffic more efficiently.
  • Although IPv6 has vastly more addresses than IPv4, CIDR principles still apply, enabling efficient address allocation and routing within the large IPv6 address space.

Classless Inter-Domain Routing (CIDR) is a method for efficiently allocating Internet Protocol (IP) addresses, improving upon the older classful network addressing system. Introduced by the Internet Engineering Task Force (IETF) in 1993, CIDR was created to prevent the rapid exhaustion of IPv4 addresses and reduce the size of routing tables

This article will explore key aspects of CIDR, including what it is, how it works, and the advantages it offers. If you want to understand more about Classless Inter-Domain Routing, keep reading. 

How Does CIDR Work? 

At the core of CIDR is variable-length subnet masking (VLSM). This allows network administrators to divide IP address space into subnets of different sizes. Each subnet contains a specific number of hosts, determined by how many IP addresses it can hold. 

For example, a CIDR IP address may look like this: 192.168.10.0/24. This address consists of two parts: 

  • Network prefix (192.168.10.0): The first part identifies the network. 
  • Suffix (/24): This indicates how many bits are used for the network portion. 

Network and host portions of one IPv4 address.
Network and Host portions of the IPv4 address

IPv4 addresses are 32-bits long. In the example /24 means the first 24 bits represent the network, while the remaining 8 bits are for host addresses within that network. This flexibility allows for more efficient use of IP addresses compared to the older, rigid classful system. 

What are CIDR Blocks? 

CIDR blocks represent groups of IP addresses that have the same network prefixes and number of bits. Combining CIDR blocks that share a network prefix into a larger routing network is called supernetting, the single most important trait of CIDR.

IP addresses with an identical address prefix in their binary notation and the same number of bits are always a part of the same CIDR block. What separates large blocks from smaller ones is the length of the prefix. A short prefix indicates more addresses that make up a bigger block, while the longer prefix indicates a smaller block with fewer IP addresses. 

The Internet Assigned Numbers Authority (IANA) takes care of the assignment of the larger blocks to Regional Internet Registries (RIRs). In turn, RIRs create smaller blocks to assign them to Local Internet Registries (LIRs). These blocks of IP addresses are then further divided into individual addresses dedicated to end-users. 

The internet service provider (ISP) is in charge of assigning blocks to an end-user for their private network. That said, organizations and individuals using multiple ISPs may obtain provider-independent blocks directly from RIRs or LIRs. 

What is CIDR notation?

CIDR blocks are groups of IP addresses that share the same network prefix and have a specified number of bits. CIDR allows multiple blocks to be aggregated into a single larger block, a process called supernetting

For example, multiple small networks like 192.168.0.0/24 and 192.168.1.0/24 can be combined into a larger block, such as 192.168.0.0/23, using CIDR. This reduces the number of routing table entries required, making network routing more efficient. 

How Is CIDR Notation Used? 

CIDR notation simplifies the representation of IP addresses and their associated routing information. An IPv4 address is a 32-bit address, traditionally written in a dotted-decimal format like 192.168.0.1. In binary form, this address could look like 11000000.10101000.00000000.00000001.  

The CIDR suffix (/24 in this case) tells us that the first 24 bits are for the network prefix, and the remaining 8 bits are for hosts. This approach provides flexibility, allowing networks to be divided into smaller subnets as needed without wasting IP addresses. 

In contrast, the older class-based system rigidly assigned a fixed number of bits to network and host portions, which often led to inefficient use of IP space. 

Why Use CIDR? 

CIDR offers several advantages over the traditional class-based IP addressing system: 

  • Efficient Use of IP Addresses: The classful system led to IP address waste. For instance, if an organization needed more than 254 hosts, it had to use a Class B address, which allowed over 65,000 hosts—far more than needed. CIDR eliminates this issue by allowing subnetting at any point, optimizing the use of IP addresses. 
  • Reduced Routing Table Size: CIDR reduces the number of entries in a router’s routing table by aggregating multiple IP addresses into a single block. This helps routers operate more efficiently, speeding up network traffic routing. 
  • Simplified Network Management: With CIDR, a single routing table entry can represent a group of IP addresses, streamlining network management and reducing complexity. 

CIDR and IPv6 

While CIDR was instrumental in extending the life of IPv4, the growing demand for IP addresses led to the introduction of IPv6, a newer version of the Internet Protocol that provides a vastly larger address space. IPv6 uses 128-bit addresses compared to IPv4’s 32 bits, virtually eliminating the risk of address exhaustion. 

IPv6 address structure
IPv6 address structure

Even with IPv6, CIDR remains relevant because it continues to offer efficient address allocation and routing, applying to both IPv4 and IPv6 networks. 

CIDR and Subnets 

Once an Internet Service Provider (ISP) allocates a block of IP addresses, CIDR can further divide these addresses into subnets for use within an organization or home network. Devices within the same subnet share the same network prefix, and the remaining bits are used to identify specific hosts. 

The structure of an IPv4 address before and after subnetting.
Host identifier splits into Subnet ID and Host ID after subnetting

Subnet masks, such as 255.255.255.0, indicate how many bits are dedicated to the network versus host portions of the IP address. For example, in 192.168.1.0/24, the subnet mask is 255.255.255.0, meaning the first 24 bits are for the network, and the last 8 bits are for hosts. 

Conclusion

Classless Inter-Domain Routing (CIDR) plays a vital role in managing IP address allocation and reducing the exhaustion of IPv4 addresses. It offers a flexible, efficient solution to both large and small networks, making IP routing and address management far more effective compared to older systems. 

As the world transitions to IPv6, CIDR’s principles continue to provide essential support in maintaining the internet’s growth, ensuring networks are well-organized and IP addresses are used as efficiently as possible. 

In summary, CIDR not only helped slow the depletion of IPv4 addresses but also improved the performance of internet routers and simplified network management. As IP addressing continues to evolve, CIDR remains a cornerstone of modern networking.  

FAQ

What is CIDR (Classless Inter-Domain Routing)?

CIDR (Classless Inter-Domain Routing) is a method for allocating and routing IP addresses more efficiently than the older classful system. CIDR allows networks to be divided into variable-length subnets, optimizing the use of IP addresses and reducing the size of routing tables. 

How does CIDR differ from classful IP addressing?
What is a CIDR block?
Why is CIDR important for IPv4 address management?
What is the role of CIDR in IPv6?

About the author

Ignas Anfalovas

Platform Engineering Manager

Ignas is a Platform Engineering Manager at IPXO with more than 7 years of experience in the IT sector. His expertise includes network design solutions and infrastructure maintenance. After working hours, you will find Ignas in Lithuanian folk-dance classes.
Table of contents

Related reading

a featured image for an article What Is Network Address Translation? A Beginner’s Guide to NAT

What Is Network Address Translation? A Beginner’s Guide to NAT  

Discover why Network Address Translation is important, how it works and what different types of NAT are available.

Read more
A featured image for an article Static vs. Dynamic IP Address: A Comprehensive Guide for 2024
23 September 2024   •   Internet Protocols, IP Insights

Static vs. Dynamic IP Address: A Comprehensive Guide

Learn about static IP and dynamic IP addresses and understand the main differences between the two.

Read more
Internet globe with lines across it to represent IP transit.

What Is IP Transit? A Beginner’s Guide

IP transit is a crucial service, but how does it work? And how does it differ from peering? Continue reading to learn all about this.

Read more

Subscribe to the IPXO email and don’t miss any news!