CIDR Explained with Examples

By | November 26, 2023

What Is CIDR?

CIDR (Classless Inter-Domain Routing) was introduced in 1993 (RCF 1517) replacing the previous generation of IP address syntax – classful networks. CIDR allowed for more efficient use of IPv4 address space and prefix aggregation, known as route summarization or supernetting.

CIDR introduction allowed for:

  • More efficient use of IPv4 address space
  • Prefix aggregation, which reduced the size of routing tables

CIDR allows routers to group routes to reduce the bulk of routing information carried by the core routers. With CIDR, several IP networks appear to network outside the group as a single, larger entity. With CIDR, IP addresses and their subnet masks are written as four octets, separated by periods, followed by a forward slash and a two-digit number that represents the subnet mask e.g.

10.1.1.0/30

172.16.1.16/28

192.168.1.32/27 etc.

CIDR / VLSM Network addressing topology example

A diagram of a computer networkDescription automatically generated

CIDR uses VLSM (Variable Lenght Subnet Masks) to allocate IP addresses to subnetworks according to need rather than class. VLSM allows for subnets to be further divided or subnetted into even smaller subnets. Simply, VLSM is just subnetting a subnet.

With CIDR, address classes (Class A,  B, and C) became meaningless. The network address was no longer determined by the value of the first octet, but assigned prefix length (subnet mask) address space. The number of hosts on a network could now be assigned a specific prefix depending upon the number of hosts needed for that network.

Propagating CIDR supernets or VLSM subnets requires classless Routing Protocols –. A classless routing protocol includes the subnet mask along with the network address in the routing update.

Summary routes determination

Determining the summary route and subnet mask for a group of networks can be done in three easy steps:

  1. To list the networks in binary format.
  2. To count the number of left-most matching bits. This will give you the prefix length or subnet mask for the summarized route.
  3. To copy the matching bits and then add zero bits to the rest of the address to determine the summarized network address.

The summarized network address and subnet mask can now be used as the summary route for this group of networks. Summary routes can be used by both static routes and classless routing protocols. Classful routing protocols can only summarize routes to the default classful mask.

ISPs could now more efficiently allocate address space using any prefix length, ISPs were no longer limited to a- 255.0.0.0 or /8,  255.255.0.0 or /16, or 255.255.255.0 or /24 subnet mask which before the advent of CIDR is known as classful network addresses.

Blocks of IP addresses could be assigned to a network based on the requirements of the customer, ranging from a few hosts to hundreds or thousands of hosts.

 CIDR Advantages

With the introduction of CIDR and VLSM, ISPs could now assign one part of a classful network to one customer and a different part to another customer. With the introduction of VLSM and CIDR, network administrators had to use additional subnetting skills.

The table below  shows the allowed subnet and host IP address for all The Classes

A table of numbers and a numberDescription automatically generated
A table with numbers and a numberDescription automatically generated
A table with numbers and a number on itDescription automatically generated

RFC 1918 – Address Allocation for Private Internets

RFC 1219 – On the Assignment of Subnet Numbers

RFC 932   – Subnetwork addressing scheme

RFC 917   – Internet subnets

In Conclusion, CIDR represents a significant advancement in IP address allocation and routing. Its introduction was key in prolonging the viability of IPv4 by more efficiently managing its limited address space and improving routing scalability and performance. CIDR’s principles are also applicable in IPv6, the latest version of the IP protocol, which addresses IPv4’s limitations by providing a vastly larger address space.

 VLSM IP Addressing Public and Private IP addresses Reserved IP Addresses

 Network Address Translation Dynamic Host Configuration Protocol (DHCP)

How to Configure Static Routes Internet Protocol Version 6 (IPv6)