Classless IP Addressing

  • Classless IP addressing makes the allocation of IP addresses more flexible, which is also known as classless interdomain routing (CIDR).
  • In Classless IP addressing, the CIDR block contains the required number of IP Addresses as demanded by the user.

CIRD BLOCK Contains a required number of IP Addresses as demanded by the user. Whenever 

 Purpose of Classless Addressing

There were two major problems with Classful IP addressing

  • Wastage of IP Addresses: As there are almost 1-crore host IP addresses in class A. But these are too many hosts’ IP addresses for a single organization. So, it is a waste of IP addresses.
  • No Flexibility: If any user requires almost 1000 IP addresses, then there is no class of networking that will provide an exact 1000 IP addresses even after subnetting. If Class A provides 1000 IP addresses after submitting them to that organization, then there is still a high chance of wastage of remaining IP addresses. So, it does not provide the flexibility.

Solution of Classful Problem

Subnetting in Classless IP addressing is used for network flexibility. It provides the exact number of IP addresses that one organization or network requires.

Notation of CIDR

CIDR IP Addresses look like the following

a.b.c.d / n

  • Where “n” bits represent the identification of the network.
  • The remaining bits (if IPv4, then 32-n) are used for hosts in the network.

Example of Classless IP addressing 

An example of a CIDR IP Address is given below

90.10.12.20 / 26

 Where,

  • 26 bits represent the network.
  • The remaining bits (6 out of 32 in IPv4) are used for the identification of hosts in the network.

Rules For Creating CIDR Block

  • Rule-01: All the IP Addresses in the classless address must be contiguous
  • Rule-02: The number of IP addresses (for hosts) in a CIRD block must be in the power of 2 (i.e., 21, 22, 23, 24 and so on).
  • Rule-03: The first IP Address of the block in CIDR must be divisible by the size of the block.
Rule 3 Explanation: Any binary pattern of IP is divisible by 2n if and only if its least “n” significant bits are 0.

Examples: Consider a binary pattern of an IP address 100.2.3.64

01100100.00000010.00000011.01000000

  • The above IP is divisible by either 21, 22 23, 24,25or 26  Because its least 6 significant bits are zero.
  • It is divisible by 26since its least significant 6 bits are zero.
  • The above IP is not divisible by 27becuase its least 7 significant bits are not zero.

So, if the size of the CIDR Block is 21,  22, 23, 24,25, and 26 then Rule 3 is valid for above IP otherwise if size of CIRD Block is greater than 27 then Rule 3 in not valid for above IP.

Examples of Classless IP Addressing

Example: Consider a classless IP address of 21.11.40.35 / 28. Find out the range of IP Addresses in the CIDR block or classless block.

Solution

  • 28 bits are used for network identification.
  • The remaining 4 bits are used for the host’s identification in the classless

Given CIDR IP Address may be represented as

00010101.00001011.00101000.00100011 / 28

So,

  • First IP Address = 00010100.00001010.00011110.00100000= 20.10.30.32
  • Last IP Address = 00010100.00001010.00011110.00101111= 20.10.30.47

Put all Host bits to zero for the first IP, and put all host bits to “1” for the Last IP of the Network.

Note: The direct broadcast IP address of a network is always the last IP of that Network.

Thus, Range of IP Addresses = [21.11.40.32 , 21.11.40.47]

Now Check all Three rules of the CIRD block

  • Rule 01: All IPs are contiguous ( 21.11.40.32 to 21.11.40.47). So, Rule 1 is satisfied.
  • Rule 02: Range ( 21.11.40.32 to 21.11.40.47) contains 16 IPs, which is the Power of 2. So, Rule 2 is satisfied.
  • Rule 03: According to the third rule, the First IP must be divisible by network size. As the Network Size is 24 and the last 4 bits of the first IP are Zero. So, it is divisible. Hence, Rule 3 is also satisfied.

As all 3 rules are valid, the classless block with 16 IPs is Valid.