Classless Interdomain Routing (CIDR) Tutorial With Example

Till now we have covered the classful addressing . We learnt the advantages and disadvantages of classful addressing. We also learnt how to perform subnetting and supernetting in classful addressing. We will now move ahead towards the Classless Interdomain Routing (CIDR).

– The concept of classes is eliminated in CIDR. The IP address is mentioned as a.b.c.d/n ,
where n represents the no of bits present in network id.
– In Classless Interdomain routing, we can ask for the exact no of IP Addresses as per our requirement.
– CIDR could either represent one block or a particular IP address. Here, instead of network id we have block id.

Tutorialwing classless interdomain routing Network ID division

Network ID division

– Example: – / 20
Since 20 bits are network bits, (32-20= 12) bits represent host bits.
Therefore, a total of $2^{12}$ IP Addresses are present.

Rules of forming CIDR blocks

Below are the rules of CIDR block that we use to form any CIDR block –
– All IP Addresses should be contiguous.
– Block size should always b in powers of 2.
– First IP Addresses in the block should be evenly divisible by size of block.

– First IP Address in a block always represents block ID.
– Last IP Address always represents directed broadcast address.

Model Question 1 :

If the block contain 32 IP Addresses. Which of the following will be the first address of the block?
(iii) None

The first address of the network should be divisible by total no of addresses. Therefore (iii) is the answer.

Model Question 2:

If the block contain 1024 IP Addresses. Which of the following will be the first address of the block?

The first address of the network should be divisible by total no of addresses. Since for 1024 addresses we need the entire last octet and two bits from the second last octet, thus in the first address the last octet should be 0 and the second last octet should be divisible by 4. Therefore (iv) is the answer.

Supernettting in CIDR

– Example 1:
If one of the address of a block is If this block is divided into 4 equal sub-blocks, then calculate the range of block and range of sub-blocks.

No. of possible addresses in the block = 232-26 = 26 = 64 IP Addresses
Block ID =
Since the block is to be divided into 4 parts we require 2 bits for the subnet.
Range of block = – (Last octets 01000000-01111111)
Range of sub-blocks:
   – – (Last octets 01000000-01001111)
   – – octets 01010000-01011111)
   – – octets 01100000-01101111)
   – – octets 01110000-01111111)

Variable Length Subnet Masking in CIDR

– Example 1:
An ISP has a block
(a) 1st group has 128 customers, each customer requires 256 IP Addresses.
(b) 2nd group has 64 customers, each customer requires 128 IP Addresses.
(c) 3rd group has 16 customers, each customer requires 64 IP Addresses.
Assign IP Addresses in the given order.


Variable Length Subnet masking Example

CIDR example

Supernetting in CIDR:

– Example 1:
Find the size of the supernet.

Since it satisfies all 3 rules of CIDR it can be supernetted.
Size of entire supernet = 24*28 = 212
How do we check if is divisible by 212?
{32 should be divisible by 24}
{0 should be divisible by 28}
Supernet Mask: 11111111.11111111.11110000.00000000 (}

– Example 2:
Find the size of the supernet.

They are contiguous but not of equal size. Thus, supernetting can’t be applied directly. We can however supernet the last two addresses to get and then the result can be supernetted with first address to get

Hope this gives a clear idea of classless interdomain routing (CIDR). In the next tutorial, we move on to the flow control methods.

Leave a Reply