/
CIDR Notation

CIDR Notation

Class Inter-Domain Routing was introduced in 1993 to replace classful addressing

Instead of using the subnet masking technique, we can write an oblique (/) followed by a number sequence e.g, /24

The number denotes the number of bits in the mask starting from the left.

So the following

int ipAddress = 0xB9A80502; // 185.168.5.2 int subClass = ipAddress & 0xFF000000; System.out.println( Integer.toBinaryString(subClass));

Could be denoted as 185.168.5.2/8 as an alternative to 255.0.0.0, a Class A address

Calculating the CIDR

Look at the value in the Subnet mask

  • 255.255.255.0

Count the number of bits across all the octets, in the example above, this would be 3 x 8 = 24, so the subnet mask using CIDR would be 192.168.5.5/24

Related content