Classless Inter Domain Routing (CIDR)

Last Updated : 10 Jan, 2026

CIDR(Classless Inter Domain Routing) is a method of IP address allocation and routing that allows more efficient use of IP addresses. Unlike traditional class-based addressing, CIDR allocates IP addresses based on a network prefix rather than a fixed class (A, B, or C).

CIDR Notation: a.b.c.d/n

  • n = number of bits in the network prefix.
  • Example: 192.168.1.0/24 first 24 bits are the network, and the remaining 8 bits are the host ID.

Why CIDR?

Classful addressing wastes IP addresses:

ClassIPs AvailableHostsExample Wastage
A2²⁴2²⁴ - 2Too large for small orgs
B2¹⁶2¹⁶ - 2Wastes 49,150 hosts for 214 needed
C2⁸2⁸ - 2Small networks only

Problem: Organizations often need a number of hosts that do not match class sizes, leading to wastage.
Solution: CIDR allows flexible block allocation matching exact requirements.

Rules for Forming CIDR Blocks

  • All IPs must be contiguous.
  • Block size must be a power of 2 (2ⁿ) simplifies network division.
  • First IP of block divisible by block size least significant bits of host ID should be 0.

Example: If the Block size is 25 then, Host Id will contain 5 bits and Network will contain 32 - 5 = 27 bits. 
CIDR Block

First IP address of the Block must be evenly divisible by the size of the block. in simple words, the least significant part should always start with zeroes in Host Id. Since all the least significant bits of Host Id is zero, then we can use it as Block Id part.

Example: Check whether 100.1.2.32 to 100.1.2.47 is a valid IP address block or not?

  • All the IP addresses are contiguous.
  • Total number of IP addresses in the Block = 16 = 24.
  • 1st IP address: 100.1.2.00100000 Since, Host Id will contains last 4 bits and all the least significant 4 bits are zero. Hence, first IP address is evenly divisible by the size of the block.

All three rules are followed by this Block. Hence, it is a valid IP address block.

Advantages of CIDR

  • Efficient IP usage: Minimizes IPv4 address wastage.
  • Flexible allocation: Supports networks of any size.
  • Improved routing: Aggregates addresses for faster, simpler routing.
  • Lower administrative overhead: Easier IP and network management.

Disadvantages of CIDR

  • Complexity: CIDR is more complex to implement and manage compared to traditional class-based addressing.
  • Compatibility Issues: Some older network devices may not support CIDR.
  • Security Concerns: Implementing security measures like firewall rules and access control lists can be more difficult.
Comment

Explore