28 September 2021 | 5 min read

What Is CIDR? Classless Inter Domain Routing For Beginners

Learn all about CIDR and how essential it is for today's Internet.

Classless inter-domain routing

Classless Inter-Domain Routing, or CIDR, is a means of allocating Internet Protocol addresses, also known as host addresses, more efficiently compared to the traditional classful network addressing system. 

The Internet Engineering Task Force brought CIDR to life in 1993 to impede the growth of routing tables and slow down the depletion of IPv4 addresses. 

The main goal of this article is to answer some important questions: What is CIDR? How does it work? What are the main features and advantages? If you’re interested in learning more about Classless Inter-Domain Routing, continue reading.

How does CIDR really work?

The basis of CIDR is variable-length subnet masking (VLSM). This numerical masking sequence allows network administrators to break down an IP address space into subnets of various sizes. Each subnet has a different host count and a limited number of IP addresses. 

A CIDR IP address may look something like this: 123.45.67.89/12. This IP address contains two groups of numbers:

  • Network prefix (123.45.67.89): The binary configuration of a network address   
  • Suffix (/12): The indication of how many bits are in the entire CIDR address

IPv4 addresses are 32-bits long, and while the first 12 bits represent network addresses, the remaining 20 bits represent the available host addresses. It’s worth mentioning that every network, by default, has only one subnet containing all host addresses.

Network and host portions of one IPv4 address.
Network and Host portions of the IPv4 address

Routers that operate on CIDR rely on the destination address to route an information packet towards the gateway. Then, based on the details of the supernet or supernetwork, further unpacking of the address ensues. A router on the supernetwork either uses the most specific network address or the largest one. 

What are CIDR blocks?

CIDR blocks represent groups of IP addresses that have the same network prefixes and number of bits. Combining CIDR blocks that share a network prefix into a larger routing network is called supernetting, the single most important trait of CIDR.

IP addresses with an identical address prefix in their binary notation and the same number of bits are always a part of the same CIDR block. What separates large blocks from smaller ones is the length of the prefix. A short prefix indicates more addresses that make up a bigger block, while the longer prefix indicates a smaller block with fewer IP addresses. 

The Internet Assigned Numbers Authority (IANA) takes care of the assignment of the larger blocks to Regional Internet Registries (RIRs). In turn, RIRs create smaller blocks to assign them to Local Internet Registries (LIRs). These blocks of IP addresses are then further divided into individual addresses dedicated to end-users. 

The internet service provider (ISP) is in charge of assigning blocks to an end-user for their private network. That said, organizations and individuals using multiple ISPs may obtain provider-independent blocks directly from RIRs or LIRs. 

What is CIDR notation?

To explain CIDR notation, we must first review the composition of IP addresses. An IPv4 address is a 32-bit address that has four octets of 8 bits. In its dotted-decimal form, the address looks something like 123.45.67.89. Or 01111011.00101101.01000011.01011001 in its binary form

Considering the typical format of the IP address, some bits specify the gateway router for that network. In other words, they assume the role of a network identifier. The remaining bits act as host identifiers for all systems on that network. 

To put it simply, a network identifier is the network portion of an IP address. A host identifier indicates the numbers that remain available after subnetting an IP address.

For example, Class A uses the first 8 bits for the network identifier, whereas Class B and Class C use 16 and 24 bits, respectively.

Class A, Class B and Class C network and host identifiers in an IPv4 address.
Class A, Class B and Class C network and host identifiers in a 32-bit IPv4 address

A network mask, also known as a netmask, defines the class and range of an IP address.

When discussing the division of a network into further subnets, we refer to subnet masks that come from such division, which only contributes more bits to the network mask. 

For example, the 131.10.55.70 IP address is related to the subnet mask 255.0.0.0. This mask represents /8. Therefore, the CIDR IP address is 131.10.55.70/8.

Why use CIDR?

Reducing the number of routing table entries is just one of the key features that make CIDR effective. To best understand all of the reasons why CIDR holds an upper hand over the classful routing system, we must look at two things. First, the issues related to the classful system. Second, the general advantages of CIDR.

Issues present with class-based IP addressing

The original class-based IP addressing depleted the stock of available IP addresses at an alarming rate. 

There are three classes within the class-based addressing system: 

  • Class A – maximum of 16,777,214 hosts
  • Class B – maximum of 65,534 hosts
  • Class C – maximum of 254 hosts
Subnet masks, address ranges and host numbers of A, B and C classes in a table.
Class A, Class B and Class C specifications

The main problem with this traditional system arises when an organization needs more than 254 host identifiers. That immediately transfers the organization to class B. However, if it doesn’t need all 65,534 host machines but only 5,534, for example, the remaining 60,000 go to waste. 

Advantages of using CIDR

Since CIDR is not restrained by class, it can organize IP addresses into multiple subnets regardless of the IP addresses’ value. Compared to traditional subnetting, CIDR enables routers to reach network traffic destinations much quicker. 

CIDR also allows the amalgamation of subnets into a supernet for more efficient network routing. One routing table entry represents the entire aggregation of networks. Thus, reducing wasted address space and providing a better way of stating network addresses in routers. 

CIDR and subnets

Once ISPs deliver blocks of IP addresses to individual users and their home networks, CIDR further divides them into subnets within an internal network. 

All specific computers and individual devices in the same subnet have the same IP address prefix. The subnet ID of the host ID can distinguish between those devices in a subnet. 

The structure of an IPv4 address before and after subnetting.
Host identifier splits into Subnet ID and Host ID after subnetting

The network’s subnet mask is the binary pattern that begins with a series of 1s and ends with a series of 0s. They determine how many subnets are available in a network. When you use the dot-decimal notation to express the subnet mask, an octet consisting only of 1s (11111111) becomes the number 255. An octet consisting only of 0s (00000000) becomes a single 0.

For example, 11111111.11111111.11111111.00000000 converts to 255.255.255.0

The final subnet of an IP network is 11111111.11111111.11111111.11111111 in the binary representation or 255.255.255.255 in the CIDR notation. This is known as the limited broadcast address.

Before the introduction of CIDR, subnet masks with all 0s and 1s could not be used as they could easily become confused with network identifiers. The introduction of CIDR and its prefixes and suffixes was instrumental in distinguishing the two and creating unique identifiers.

Conclusion

We covered all the important features of a CIDR address and the significance of the technology. We can now view CIDR as an efficient solution to managing and assigning internet protocol addresses, which helps control the exhaustion of IPv4 addresses. 

Furthermore, we learned that with CIDR addressing, a single entry in a routing table is good for a group of networks, which reduces the number of entries in a router and brings much smoother and quicker operation.

Evidently, the world of Internet Protocol and IP addresses is constantly evolving. CIDR, Network Address Translation, and several other measures have been implemented successfully to slow down the depletion of IP addresses; however, the fight against the global IPv4 exhaustion continues.