What is CIDR?

CIDR, short for Classless Inter-Domain Routing, is the modern and more efficient alternative for allocating and routing IP addresses on the internet. It was developed as an alternative to the ‘Classful’ architecture to solve its major limitations:

  • The rapid exhaustion of IPV4 addresses.
  • To mitigate the growth of routing tables.

Why was CIDR Needed?

The primary need for CIDR was to overcome the problems created by and the limitations of the older Classful architecture of IP  allocation. Simply put, this architecture divided the divided the IPv4 address space ( into five classes: A, B, C, D, and E.

Class Network Mask No of Networks Number of Hosts per network IP address range
A 128 16,777,214 –
B 16,384 65,534 –
C 2,097,152 254 –
D N/A N/A N/A –
E N/A N/A N/A –

Each class was reserved for a specific purpose:

  • Class A IP addresses were reserved for Reserved for large organizations, universities, etc.
  • Class B  IP addresses were allocated to medium-sized organizations
  • Class C for smaller networks
  • Class D for multicast communication, and
  • Class E IP addresses were reserved for future use

Take, for example, a small organization that required only 5000 addresses. They would have been assigned a Class B network that can support 65,534 addresses. As a result, a whopping 60,534 addresses remained unused on the network. This rigid system of allocation resulted in inefficient use of IP addresses and faster exhaustion of IPv4 address space.

How Does CIDR Allocation Work Around this Problem?

Classless Inter-Domain Routing is based on the preface that IP addresses can be allocated and routed based on their network prefix rather than their class, which was how IP address allocation was carried out in the previous system. It does this by using the concept of subnetting to divide IP address space into smaller, more manageable blocks.

This means that network prefixes can have variable lengths, ranging from 1 to 32 bits, depending on the size of the network or subnet.

Continuing with the same example as earlier, a /19 CIDR block has 8,192 IP addresses, which is enough for a small organization that requires only 5,000 addresses.

As a result, there is less waste of IP addresses (3192 as opposed to  60,534 in the previous system), and because the organization now is just allocated a smaller number of IP addresses (8192 vs 65,534) routing tables too don’t need to grow as much improving efficiency.

CIDR Notation and Blocks

CIDR notation is a compact way of representing a network prefix and its length. It consists of an IP address followed by a slash (/) and a number that indicates how many bits are used for the network prefix.

For example, means that the first 24 bits of the IP address are used for the network prefix, and the remaining 8 bits are used for the host identifier.

A CIDR block is a contiguous range of IP addresses that share the same network prefix.

For example, is a CIDR block that contains 256 IP addresses, from to CIDR blocks can be subdivided into smaller blocks by increasing the network prefix length. For example, can be divided into two CIDR blocks of /25, each containing 128 IP addresses.

This combination allows for more flexible and efficient allocation and routing of IP addresses, as they can accommodate networks of different sizes and reduce the number of entries in routing tables.

CIDR blocks on the IPV6 standard use 128 bits (compared to the 32 bits of the IPV4 standard) which allows for 340 undecillion unique IP addresses.