CIDR - Classless Inter Domain Routing

CIDR - Classless Inter Domain Routing

CIDR stands for Classless Inter-Domain Routing. It is a method for allocating IP addresses and routing Internet Protocol packets. CIDR was introduced in 1993 to replace the previous classful network addressing architecture.

What is CIDR?

CIDR allows for more flexible allocation of IP address space than the traditional Class A, B, and C network classes. Instead of being limited to /8, /16, or /24 networks, CIDR allows any prefix length from /1 to /30 (for IPv4).

CIDR Notation

CIDR notation is written as an IP address followed by a slash and a number. For example:

  • 192.168.1.0/24 - This represents a network with 256 IP addresses
  • 10.0.0.0/8 - This represents a network with over 16 million IP addresses
  • 172.16.0.0/12 - This represents a network with over 1 million IP addresses

The number after the slash (/) indicates how many bits are used for the network portion of the address. The remaining bits are used for the host portion.

Benefits of CIDR

Address Conservation

CIDR allows for more efficient use of IP address space by eliminating the waste inherent in classful addressing. Organizations can receive address allocations that more closely match their actual needs.

Route Aggregation

CIDR enables route aggregation (also called route summarization or supernetting). Multiple routes can be combined into a single route announcement, reducing the size of routing tables and improving network performance.

Flexible Subnetting

Network administrators can create subnets of any size needed, rather than being limited to the fixed sizes of classful networks.

CIDR Block Examples

Here are some common CIDR blocks and their characteristics:

/30 - 4 IP addresses (2 usable for hosts)
/29 - 8 IP addresses (6 usable for hosts)
/28 - 16 IP addresses (14 usable for hosts)
/27 - 32 IP addresses (30 usable for hosts)
/26 - 64 IP addresses (62 usable for hosts)
/25 - 128 IP addresses (126 usable for hosts)
/24 - 256 IP addresses (254 usable for hosts)
/23 - 512 IP addresses (510 usable for hosts)
/22 - 1,024 IP addresses (1,022 usable for hosts)
/21 - 2,048 IP addresses (2,046 usable for hosts)
/20 - 4,096 IP addresses (4,094 usable for hosts)

Calculating CIDR Ranges

To calculate the range of IP addresses in a CIDR block:

  1. Determine the network bits (the number after the /)
  2. Calculate the host bits (32 - network bits for IPv4)
  3. Calculate the total addresses (2^host bits)
  4. Subtract 2 for network and broadcast addresses to get usable host addresses

For example, with 192.168.1.0/26:

  • Network bits: 26
  • Host bits: 32 - 26 = 6
  • Total addresses: 2^6 = 64
  • Usable host addresses: 64 - 2 = 62
  • Address range: 192.168.1.0 to 192.168.1.63

CIDR and Routing

CIDR is essential for modern Internet routing. It allows Internet Service Providers (ISPs) and network operators to:

  • Aggregate multiple smaller networks into larger route announcements
  • Reduce the number of routes in global routing tables
  • Improve routing efficiency and convergence times
  • Implement hierarchical addressing schemes

Conclusion

CIDR is a fundamental concept in modern networking that enables efficient IP address allocation and routing. Understanding CIDR notation and calculations is essential for network administrators and anyone working with IP networks. It provides the flexibility needed to design and manage networks of any size while conserving precious IP address space.