CIDR (Classless Inter-Domain Routing) is a method for allocating and routing IP addresses more efficiently.
It replaces the old classful addressing system, which was too rigid and caused waste of IP address space.
CIDR introduces the prefix length notation (e.g., /24) to define how many bits belong to the network portion of an address.
- What is CIDR?
- Why Was CIDR Introduced?
- CIDR Notation
- CIDR Prefix and Host Capacity
- CIDR vs Classful Addressing
- CIDR in Routing
- CIDR and Subnetting
- Examples of CIDR
- Advantages of CIDR
- Further Reading
CIDR allows networks to be defined with any prefix length, not just fixed class boundaries (Class A, B, C).
- Example: Instead of being forced to use a Class C (
255.255.255.0or/24), you can use/27or/29depending on your needs.
This flexibility avoids wasting addresses and enables more efficient routing.
Before CIDR, IP addresses were divided into classes:
- Class A: 16 million hosts (wasted for small networks).
- Class B: 65,534 hosts (still very large).
- Class C: 254 hosts (often too small).
This rigid system caused:
- IP address exhaustion – huge blocks wasted.
- Routing table explosion – too many entries in global routers.
CIDR solved both problems by:
- Allowing variable-length prefixes.
- Supporting route aggregation (summarizing multiple routes into one).
CIDR uses slash notation to indicate the number of network bits.
Example:
192.168.1.0/24→ 24 bits network, 8 bits host.192.168.1.0/26→ 26 bits network, 6 bits host.
| CIDR Prefix | Subnet Mask | Network Bits | Host Bits | Usable Hosts |
|---|---|---|---|---|
| /8 | 255.0.0.0 | 8 | 24 | 16,777,214 |
| /16 | 255.255.0.0 | 16 | 16 | 65,534 |
| /24 | 255.255.255.0 | 24 | 8 | 254 |
| /26 | 255.255.255.192 | 26 | 6 | 62 |
| /30 | 255.255.255.252 | 30 | 2 | 2 |
Formula:
- Usable hosts =
(2^host bits) - 2
Classful addressing:
- Fixed blocks: Class A (/8), Class B (/16), Class C (/24).
- Wasteful: a small company could only get 65,000 addresses even if it needed 500.
CIDR addressing:
- Flexible prefix length (e.g.,
/22,/28). - Networks sized according to need.
- Aggregation reduces routing complexity.
Routers use CIDR for route summarization (also called supernetting).
Example:
- Instead of listing:
192.168.0.0/24192.168.1.0/24192.168.2.0/24192.168.3.0/24
We can aggregate them as:
192.168.0.0/22
This shrinks routing tables, improving efficiency and speed.
- Subnetting breaks a large block into smaller subnets.
- CIDR generalizes this by allowing any prefix length.
- CIDR is sometimes called “supernetting” when combining multiple networks.
So, subnetting and CIDR are two sides of the same coin:
- Subnetting = dividing networks.
- CIDR = combining or flexibly defining them.
-
Small Office Network
- Need ~50 hosts.
/26gives 62 usable hosts → perfect.
-
ISP Aggregation
- ISP owns
200.10.0.0 – 200.10.15.255. - Instead of advertising 16 Class C routes, ISP announces:
200.10.0.0/20
- ISP owns
- Efficient use of IPv4 space.
- Delayed IPv4 exhaustion.
- Smaller routing tables.
- Flexibility: networks can be exactly as large as needed.
- Foundation for modern IP routing and internet backbone.