π€ What is CIDR? (Basic Idea)
Earlier, IP addressing used fixed classes:
Class A
Class B
Class C
This caused:
β Huge IP wastage
β Poor flexibility
β Large routing tables
π CIDR was introduced to solve these problems.
π In simple words:
CIDR allows IP addresses to be allocated without fixed classes.
π§ Simple Definition
π CIDR (Classless Inter-Domain Routing) is an IP addressing method that allows flexible allocation of IP addresses using variable-length subnet masks.
π§ Why βClasslessβ?
Because:
CIDR removes Class A, B, C boundaries
Any number of network bits can be used
Addressing becomes flexible and efficient
π This is why CIDR is called classless addressing.
π°οΈ Why CIDR Was Introduced?
CIDR was introduced to:
π Reduce IP address wastage
π¦ Support subnetting & supernetting
π Reduce routing table size
π Support Internet growth
π CIDR is mandatory for modern Internet routing.
π§ Key Concept of CIDR
π Prefix Length Notation
CIDR uses slash ( / ) notation.
π Format:
IP_Address / Prefix_Lengthπ Example:
192.168.1.0 /24π’ What Does /24 Mean?
/24β 24 network bitsRemaining bits β host bits
π IPv4 total bits = 32
Networkbits=24
Hostbits=32 β24 =8π§ CIDR vs Subnet Mask
CIDR:
/24Subnet Mask:
255.255.255.0π Both mean the same thing.
π§© CIDR and Subnet Mask Mapping
CIDR | Subnet Mask |
|---|---|
/8 | 255.0.0.0 |
/16 | 255.255.0.0 |
/24 | 255.255.255.0 |
/26 | 255.255.255.192 |
/30 | 255.255.255.252 |
π§ How CIDR Solves IP Wastage
β Without CIDR (Classful)
Need 1000 hosts:
Class C β only 254 β
Class B β 65,534 β (huge waste)
β With CIDR
Choose exactly what you need:
/22β1022hostsβοΈ No wastage
βοΈ Perfect fit
πͺ CIDR Address Calculation (Step-by-Step)
πΉ Example 1: /26
IP: 192.168.1.0/26Network bits = 26
Host bits = 6
Hosts:
2βΆ β 2 = 62Subnet Mask:
255.255.255.192πΉ Example 2: /30
IP: 10.0.0.0/30Host bits = 2
Hosts:
2Β² β 2 = 2π Used for point-to-point links.
π§ CIDR Block Size (Quick Method)
Block size formula:
256 β subnetmask valueExample:
/26 β255.255.255.192
Block size =256 β192 =64π¦ CIDR Address Range Example
For:
192.168.1.0/26Item | Address |
|---|---|
Network | 192.168.1.0 |
First Host | 192.168.1.1 |
Last Host | 192.168.1.62 |
Broadcast | 192.168.1.63 |
π CIDR & Route Aggregation
CIDR allows supernetting (route aggregation).
Example:
192.168.0.0/24
192.168.1.0/24π Advertised as:
192.168.0.0/23βοΈ Smaller routing table
βοΈ Faster routing
βοΈ Classful vs CIDR Addressing
Feature | Classful | CIDR |
|---|---|---|
Address Classes | Fixed (A, B, C) | No classes |
Flexibility | Low | High |
IP Wastage | High | Very Low |
Routing Table | Large | Small |
Internet Use | β No | β Yes |
π§ CIDR + Subnetting + Supernetting Relationship
Subnetting β Divide network
Supernetting β Combine networks
CIDR β Enables both
π CIDR is the umbrella concept.
π§ Very Important CIDR Memory Table
Prefix | Hosts |
|---|---|
/24 | 254 |
/25 | 126 |
/26 | 62 |
/27 | 30 |
/28 | 14 |
/29 | 6 |
/30 | 2 |
β Advantages of CIDR
Efficient IP utilization
Flexible addressing
Smaller routing tables
Supports Internet scalability
β Limitations of CIDR
Requires good planning
Complex for beginners
Misconfiguration can cause routing issues
π§ Memory Trick
CIDR β Classless
Slash ( / ) β Network bits
Bigger / number β Fewer hosts
β One-Line Summary
πΉ CIDR is a flexible, classless IP addressing method that efficiently allocates IP addresses and supports modern Internet routing.