CIDR - Introduction

Introduction to CIDR method

CIDR is an abbreviation for Classless-Inter Domain Routing. This is one of two main improvements to classful addressing of the IPv4 standard introduced by the IETF (Internet Engineering Task Force) organisation.

When globalisation began in the beginning of 1990, the IPv4 addresses quickly ran out.

Before we go further with this article, we need to refresh knowledge about the IPv version 4 of classful addressing.

IPv4 defines five classes (including three unicasts, one multicast, and one reserved).

Table 1 - IP version 4 with classes and its ranges


Grouped addresses in the mentioned classes can produce some limitations during their allocation into different sizes of subnets. So, this is the main benefit the CIDR method brought to the table. The game has been changed! Now, with the CIDR, the address allocation is relatively efficient. Thus, the CIDR reduces wasted address space and solves the scalability problem! Job done.

Now, to go into more details, I need to introduce three classless method components in order to comprehend a CIDR method:

Subnet mask: is a binary number that separates the network address from the host address. Subnet mask is expressed by slash symbol (/), following the decimal number from 8 to 31. We need to remember that subnet masks can also be expressed in binary numbers or by decimal numbers. Please see table 2 for details.

Figure 1 - Network prefix and host

Figure 2 - Network, subnet and host

Variable-length Subnet Mask: is the method giving the flexibility in creating separated networks called subnets. To be more specific, I would state that the VLSM (Variable-Length Subnet Mask) separates the borrowed host-bits into separated, "produced" subnets. The subnets "are produced" from the borrowed bits, but the overall address size stays constant with 24 bits. Probably, a better explanation will be if I say : the borrowed host bits are replaced with subnet bits. So, nothing is produced but rather changes its function.


Prefix length: refers to continuous bits at the beginning of the IP address representing the network part. The network and subnet components are included in the prefix length. For instance, with a prefix length of 24-bits (/24) the IPv4 mask address sequentially counts 24 bits in the whole 32-bit address: 11111111 11111111 11111111 00000000.

Table 2 - Classful Addressing 

As was previously mentioned in this short article, the IPv4 addressing system uses the class concept to divide addresses into 5 groups (A, B, C, D, and E). 

Group A is based on the first 8-bit octet, Group B is based on the two 16-bit octets, and Group C is based on the three 24-bit octets. 

In Table 2, I demonstrate the classful network in binary and decimal format. In the third column, I convert the binary value of each octet into a decimal number. Finally, in the last column, I added the bits from the network part. For example, in the class "A,” we note a summarised value of 8 bits in the first octet (1+1+1+1+1+1+1+1 = 8-bit). We do this simple arithmetic for the next classes B and C.

Table 3 - Classless Addressing 

The classless concept applied to the IPv4 address is still relatively easy exercise. Just what we need to do is calculate the binary number to the decimal value. For instance, in table 3, in the first row, we are adding all bits with a value of 1 (the same way as we did with table 2, but now we took into consideration all 1's). In total, there are 18 bits continuously counted off 1. Therefore, the prefix mask for this binary mask 11111111 111111111 11000000 00000000 is eighteen (8 + 8 + 2 = 18). 

In summary, an engineer can assign IPv4 addresses in an efficient and highly flexible manner, just using a CIDR. In this place, it is worth repeating all CIDR method benefits. The main benefit is that now using CIDR we can increase the number of networks, which were limited in size with the classful concept. Also, CIDR provides better control over IP address allocation; as a result, we can more efficiently design the network.  

Overall, CDIR is a significant improvement to the old classful method and provides flexibility, scalability, and even improves the security of a network.

Next video : In the next articles (and videos), I will explain IPv4 addressing in more detail with a focus on subnet design.