Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
What is CIDR and how it works?
Classless Inter-Domain Routing (CIDR) is a method for allocating IP addresses and routing internet traffic more efficiently than the traditional classful addressing system. CIDR allows network administrators to create custom-sized networks by specifying exactly how many bits are used for the network portion of an IP address.
Unlike classful addressing (Class A, B, C), CIDR eliminates the rigid boundaries of predefined address classes, enabling more flexible and efficient use of IP address space. This approach significantly reduces IP address wastage by allocating only the exact number of addresses needed.
How CIDR Works
CIDR uses slash notation to represent networks. The format is x.y.z.w/n, where x.y.z.w is the network address and n represents the number of bits used for the network portion.
192.168.1.0/24
In this example, the first 24 bits identify the network, leaving 8 bits (32-24=8) for host addresses, allowing for 254 usable host addresses (28-2).
Properties of CIDR Blocks
-
Continuous addresses − All IP addresses in a CIDR block are sequential and contiguous.
-
Power of 2 sizing − Block sizes must be powers of 2 (e.g., 4, 8, 16, 32, 64, 128, 256).
-
Divisible first address − The first IP address in the block must be evenly divisible by the block size.
CIDR vs Classful Addressing
| Aspect | Classful Addressing | CIDR |
|---|---|---|
| Network sizes | Fixed (Class A: /8, Class B: /16, Class C: /24) | Variable (/8 to /30) |
| IP efficiency | High wastage due to fixed sizes | Minimal wastage with custom sizing |
| Routing table size | Larger, more entries | Smaller through aggregation |
Advantages
-
Efficient IP utilization − Reduces IP address wastage by allowing custom network sizes.
-
Route aggregation − Multiple networks can be summarized into fewer routing table entries.
-
Flexible subnetting − Supports Variable Length Subnet Masking (VLSM) for optimal network design.
Disadvantages
-
Complex routing − Route determination is more complex compared to simple classful lookup tables.
-
Increased processing − Routers require more processing power for longest prefix matching.
-
Learning curve − Network administrators need additional training to understand CIDR concepts.
Conclusion
CIDR revolutionized IP addressing by providing flexible, efficient allocation of IP addresses through variable-length subnet masking. While it introduces some complexity in routing, CIDR's benefits in reducing IP wastage and enabling route aggregation make it essential for modern internet infrastructure.
