What is classless IP addressing?

Classless addressing, also called Classless Inter-Domain Routing (CIDR), is an improved IP addressing system. It increases the effectiveness of IP address allocation because of the absence of class distribution.

Structure

The CIDR block comprises two parts. These are as follows:

  • Block id is used for the network identification, but the number of bits is not pre-defined as it is in the classful IP addressing scheme.
  • Host id is used to identify the host part of the network.
CIDR block

Notation

CIDR IP addresses look as follows:

In the example above,w,x,y,zw, x, y, z each defines an 8-bit binary number, whilenntells us about the number of bits used to identify the network and is called an IP network prefix or mask.

Rules

Requirements for CIDR are defined below:

  • Addresses should be contiguous.
  • The number of addresses in the block must be in the power of 2.
  • The first address of every block must be divisible by the size of the block.

Block information

Given the following IP address, let's find the network and host bits.

The following illustration gives a clear understanding of the aforementioned IP address scheme:

CIDR block with block and host ids' bits

To find the network and host bits, we will use the stated formula, wherebbrepresents the number of hosts in the network.

This particular case, in whichnnequals 28, represents the block id bits, so subtracting it with 32 leaves us with the total number of hosts expected in the network.

Network address

To find the network address of a particular IP address, apply the AND operation to the IP address with its subnet mask. The subnet mask is obtained by making all the network bits 1 and host bits 0.

Example

To obtain the network address of the classless IP address 200.56.23.41/28, the following steps are needed:

  • Convert the address into binary notation, as follows:
IP address into binary notation
  • Now apply the AND operation on the converted IP address and its subnet mask. The resultant will be the network address in binary format.
Obtain network address in binary format
  • Convert the network address into decimal.
Network address in decimal

Benefits

Following are the benefits of classless IP addressing:

  • Efficient IP address allocations.
  • More balanced use of IP address ranges.
  • More efficient routing.
Copyright ©2024 Educative, Inc. All rights reserved