How CIDR Transformed IP Addressing


Before you jump to CIDR, let’s take a deep breath and understand the basics of IP addresses and what they really are.
Imagine you're writing a letter to a friend. You need their house address so the mailman knows where to deliver it, right? The internet works exactly the same way. When your computer wants to talk to another one (like opening a website), it needs to know where to send that message. That “where” is the IP address.
What is an IP Address?
It’s just a number. IP Address have two formats, One being the IPv4 and other being IPv6. For keeping things simple lets only consider IPv4 Addresses.
192.168.1.1
I know it looks like gibberish but let’s break the numbers down, it will start to make sense.
Think of it like this:
The first part of the IP address is like your neighborhood.
The last part is like your house number.
The entire thing helps the internet know exactly where to send stuff.
Each of those four numbers is called an octet (because it represents 8 bits), and the entire address is 32 bits long in IPv4.
The Toy Box Problem
Let’s assume this, you have three toy boxes (A, B, C) and every toy (IP Address, in this case) had to go to one of the three boxes. But the issue was that the boxes were either too big or too small, and eventually toys (IP Addresses) got wasted. i.e Some boxes had too many toys, some had only few. A complete mess.
This was known as Classfull IP addressing.
CIDR For The Rescue.
Continuing with the same analogy, seeing the mess above, someone actually stepped in to fix it (and I’m not making this up). They were called the Internet Engineering Task Force (IETF), and they introduced something called CIDR (Classless Inter-Domain Routing).
They probably looked at the mess and said:
“Let’s stop using fixed-size boxes! Why not use boxes that fit just the right number of toys?”
CIDR gave us a new tool: the slash notation like /24
, /16
, /8
to tell us exactly how many toys (IP addresses) go in each box.
What the Hell is a Slash Notation?
Let’s understand by an example, lets take the /24
for instance. Imagine the IP address is made of 32 switches (bits). CIDR lets us say how many of those switches are for the street (network) and how many are for houses (hosts).
So, /24
means the first 24 switches are fixed for the street, and the last 8 switches can change like house numbers.
32 Switches (Total) - 24 Switches (Street) = 8 Switches (Houses)
That gives you 2^8 = 256 IP Addresses
Now Let’s Deep Dive
Classless Inter-Domain Routing (CIDR) is a method for allocating IP addresses and routing internet traffic more efficiently. Every device whether it’s a server, a laptop, or your phone needs a unique number called an IP address to communicate over the internet.
CIDR came into play to solve the inefficiencies of the old fixed-size IP address system. Instead of handing out addresses in rigid blocks, CIDR allows for flexible allocation, just the right number of IPs depending on the actual need.
This means organizations can better manage their IP address space and reduce wasted addresses, which is crucial as more and more devices come online.
Classful vs Classless Addresses
Classful Addresses
An IPv4 address consists of 32 bits, divided into four 8-bit sections (octets) separated by a full stop, each ranging from 0 to 255. In the original IP allocation model, organizations could purchase addresses based on three main classes:
Class A:
Uses 8 bits for the network prefix.
Example:44.0.0.1
. Here network is 44 and the Host is 0.0.1Class B:
Uses 16 bits for the network prefix.
Example:128.16.0.2
. Here network is 128.16 and the Host is 0.2.Class C:
Uses 24 bits for the network prefix.
Example:192.168.1.100
. Here network is 192.168.1 and the Host is 100
While simple, this model was rigid and wasteful, as organizations often received more IP addresses than they needed.
Classless Addresses (CIDR)
To solve the inefficiencies of classful addressing, the Internet Engineering Task Force (IETF) introduced Classless Inter-Domain Routing (CIDR).
CIDR uses Variable Length Subnet Masking (VLSM), allowing administrators to adjust the split between network and host bits based on real needs, not fixed classes.
A subnet mask identifies which part of the IP address refers to the network, turning all host bits to zero to isolate it.
CIDR appends a slash ( / ) and a number to the IP address, representing how many bits are reserved for the network.
Example:192.0.2.0/24
The first 24 bits (
192.0.2
) are the network addressThe remaining 8 bits are available for hosts
This flexibility allows for efficient use of IP space, enabling organizations to allocate just the right number of addresses per subnet.
Advantages of Using CIDR
With Classless Inter-Domain Routing (CIDR), your organization gains greater control and efficiency in assigning IP addresses and routing data across devices and networks.
Reduce IP Address Wastage
CIDR enables flexible division between the network and host portions of an IP address.
Rather than being limited to fixed block sizes (like in classful addressing), you can allocate only the number of IPs you actually need, reducing wastage.
Additionally, CIDR minimizes the number of entries in the routing table, streamlining data packet routing and improving overall performance.
Transmit Data More Efficiently
CIDR improves how routers group IP addresses into subnets which are smaller, manageable sections of a network.
For example, all devices connected to a router typically belong to the same subnet and share a common IP prefix. CIDR enables:
Easier subnet creation, Consolidation of subnets, More direct data paths, avoiding unnecessary hops
This leads to faster and more efficient data transmission.
- Create a Virtual Private Cloud (VPC)
A Virtual Private Cloud (VPC) is a secure, isolated section of a public cloud where your workloads and data remain protected.
CIDR plays a foundational role in VPCs, assigning IP address ranges that help control traffic flow between devices within the cloud environment.
Conclusion
CIDR is daunting-sounding at first, but essentially, it's simply a more intelligent, more adaptable way of handling IP addresses. We began with understanding what an IP address is such as an address for your computer in the world of the internet and inched our way to how CIDR assists us in structuring, dividing, and effectively utilize such addresses by means of arithmetic and the wonders of binary. Whether you're working with networks, exploring cloud infrastructure, or simply attempting to crack that enigmatic /24, knowing CIDR provides you with a valuable tool to think like a network engineer.
And now that you can go ahead and subnet with confidence!
References
Amazon Web Services (AWS) – What is CIDR?
https://aws.amazon.com/what-is/cidr/Hilda Machando on Medium – CIDR Blocks in AWS: Understanding the Basics and Beyond
https://medium.com/@hildamachando4/cidr-blocks-in-aws-understanding-the-basics-and-beyond-f74506a84b83
Subscribe to my newsletter
Read articles from Shivam (Anirudh) Nandy directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by

Shivam (Anirudh) Nandy
Shivam (Anirudh) Nandy
I break things. A lot. But I fix them even better. I live and breathe open source, especially when it comes to scaling with Kubernetes, pushing the frontiers of Artificial Intelligence, and getting my hands dirty with system-level programming. My journey started deep in Theoretical and Advanced Mathematical Physics, because I couldn’t resist understanding what really happens inside the "brain" of a neural network — spoiler: it’s just math, but it feels like magic. Along the way, I developed an unhealthy obsession with database optimization, squeezing performance like my life depends on it. And if there’s one language that truly speaks to my soul, it’s RUSSSSTTTT — yes, I scream it like that because I love it that much. And of course, I fuel all of this with loud, unapologetic doses of Bengali rock music. It's the perfect background to break things fast, build them better, and maybe scare my neighbors a little.