CIDR (Classless Inter-Domain Routing) is a method introduced in 1993 by the IETF to improve IPv4 address allocation and reduce address waste.
Before CIDR, IPv4 used a classful addressing system, where networks were limited to three fixed prefix sizes:Class A → fixed /8 prefix
Class B → fixed /16 prefix
Class C → fixed /24 prefix
This rigid structure led to significant address waste, especially when organizations received far more addresses than needed.
In 1985, subnetting was introduced, allowing Class A, B, and C networks to be divided into smaller segments.
For example, a Class A network could be split into Class B– or Class C–sized blocks.To visualize this evolution, look at Figure 1 below.
It shows how IPv4 moved from Classes, to Subnetting, and finally to CIDR.
Figure 1 – IPv4 evolution: classes, subnetting, CIDR.
Even with subnetting, one limitation remained:
you still couldn’t choose any prefix length. Networks were always tied to /8, /16, or /24 based on their original class.CIDR removed these restrictions in 1993 by eliminating address classes entirely.
From that point on, networks could use any prefix length such as /20, /21, /27, or /30 making IPv4 addressing far more flexible and efficient.Answer the question below
What does CIDR mean?
The prefix length is the number that appears after the slash in an IPv4 address, such as /24 in 198.51.100.0/24.
It tells you how many bits are used for the network portion of the address.The remaining bits form the host portion, which identifies devices inside the network.
Examples:
/24→ 24 network bits, 8 host bits/25→ 25 network bits, 7 host bits/30→ 30 network bits, 2 host bits
The prefix length also maps directly to the subnet mask:
/24= 255.255.255.0/25= 255.255.255.128/26= 255.255.255.192
CIDR uses this notation because it lets you create networks of any size, instead of being limited by class-based boundaries.
Answer the question below
What does the prefix length indicate?
Every IPv4 address is divided into two logical parts:
Network portion → identifies the network
Host portion → identifies devices inside that network
The prefix length defines exactly where this separation occurs.
For example, in 198.51.100.0/24:
The first 24 bits are the network portion
The remaining 8 bits are the host portion
You can see this division clearly in the diagram below.

Figure 2 – IPv4 198.51.100.0/24 with subnet mask, showing network and host bits.
All devices in this network share the same first 24 bits.
Only the host bits change to create unique IP addresses.This separation is essential because CIDR works by adjusting how many bits belong to the network and how many remain for hosts.
Answer the question below
In a /24 network, how many bits are used for hosts?
CIDR gives you full control over the size of your networks by letting you adjust the prefix length.
When you increase the prefix length (for example from /24 to /25 or /26):More bits are used for the network portion
Fewer bits remain for hosts
You create more subnets
Each subnet supports fewer devices
This flexibility is what makes CIDR far more efficient than the old classful system.
CIDR also lets you calculate exactly how many usable hosts each subnet can provide.
Use the formula below:
Figure 3– Formula for usable IP addresses.
Where:
n = number of host bits = (32 − prefix length)
The subtraction of 2 removes the network and broadcast addresses
This calculation helps you choose a subnet size that fits your requirements without wasting address space.
Answer the question below
If a /24 network becomes a /25, how many bits are used for the network portion?
Let’s apply the formula to the network
198.51.100.0/24
Figure 4 – Calculating usable addresses with a /24 subnet mask.
The prefix length is /24.
So:n = 32 − 24 = 8 host bits
2⁸ − 2 = 254 usable hosts
Now let’s see how increasing the prefix length (/25, /26, /27…) changes the number of usable addresses.
Examples of Prefix Length and Usable Addresses
Now, let’s apply the formula step by step for different prefix lengths.
Answer the question below

Figure 5 – Calculating usable addresses with a /25 subnet mask.
With a /25 prefix, 25 bits are for the network and 7 bits for hosts.
2⁷ − 2 = 126 usable IP addresses.Answer the question below

Figure 6 – Calculating usable addresses with a /26 subnet mask.
A /26 prefix uses 26 bits for the network, leaving 6 host bits.
2⁶ − 2 = 62 usable IP addresses.Answer the question below

Figure 7 – Calculating usable addresses with a /27 subnet mask.
Here, /27 leaves 5 host bits.
2⁵ − 2 = 30 usable IP addresses.Answer the question below

Figure 8 – Calculating usable addresses with a /28 subnet mask.
With /28, only 4 host bits remain.
2⁴ − 2 = 14 usable IP addresses.Answer the question below

Figure 9 – Calculating usable addresses with a /29 subnet mask.
A /29 leaves 3 host bits.
2³ − 2 = 6 usable IP addresses.Answer the question below

Figure 10 – Calculating usable addresses with a /30 subnet mask.
With /30, only 2 host bits remain.
2² − 2 = 2 usable IP addresses.Answer the question below
Traditionally used for point-to-point links between two devices, but also valid for very small subnets.

Figure 11 – Calculating usable addresses with a /31 subnet mask.
A /31 leaves 1 host bit.
Normally, 2¹ − 2 = 0 would give no usable addresses, but RFC 3021 allows 2 usable IPs for point-to-point links.
Both addresses can be assigned since network and broadcast addresses are not required in this context.This results in exactly 2 usable IP addresses, making /31 a more address-efficient option than /30 for point-to-point connections.
Answer the question below

Figure 12 – Calculating usable addresses with a /32 subnet mask.
With /32, there are 0 host bits.
Normally, applying the formula gives 2⁰ − 2 = −1, which would mean no usable addresses.
This is an exception because /32 represents a single IP address.
It is typically used for loopbacks, host routes, or identifying a specific device.Answer the question below
Understanding CIDR theory is essential, but for your CCNA exam, you also need to know how to apply it to real subnetting scenarios.
CIDR allows us to take an initial network and divide it into smaller, well-sized networks that match specific needs.
Let’s look at an example question:

Figure 13 – Subnetting 198.51.100.0/24 into four offices.
You are given the network
198.51.100.0/24and need to create four separate networks for four offices, each with a specific number of hosts.At this point, you might think:
“That’s a good question, but so far, we’ve only seen how to take bits from the host portion and give them to the network portion to make smaller networks.”
Here’s the important part:
With CIDR, we use that same idea of adjusting the prefix length, but now we have a clear objective:Make sure each subnet has enough addresses for its hosts.
Avoid wasting addresses by preventing subnets that are larger than necessary.
We will learn exactly how to size subnets with CIDR in the next lesson by using step-by-step examples and a simple, repeatable method.
For now, keep in mind:
CIDR is the tool that lets you precisely adjust the prefix length so you can create multiple subnets that match requirements while reducing address waste.Answer the question below
CIDR (Classless Inter-Domain Routing)
CIDR lets you size IPv4 networks precisely by choosing the right prefix length instead of wasting addresses with fixed classes. In this lesson you will plan subnets step by step and validate usable hosts with confidence.