What is classless inter-domain routing (CIDR)?

Before classless inter-domain routing (CIDR) was introduced, the IP addresses were structured based on classful addressing. However, classful addressing caused a lot of wastage of the hosts due to its rigid architecture.

To resolve this issue, the IP addresses required flexibility over the number of host IDs assigned to the network. Therefore, CIDR was introduced. It is also referred to as classless addressing.

Representation

CIDR is a 32-bit long address in which a number is appended, representing the number of bits that signify the network ID.

For example, 20.10.60.115/8 means that 8 bits of the address are for the network while the remaining 24 are for host addresses, as shown in the illustration below:

The CIDR notation representation

Properties of CIDR

Here are the properties of CIDR that need to be fulfilled for a valid address:

  • The IP addresses in a block are continuous.

  • The first address of a block should be divisible by the number of addresses of a block.

  • The size of the block should be in the power of 2.

New on Educative
Learn to Code
Learn any Language as a beginner
Develop a human edge in an AI powered world and learn to code with AI from our beginner friendly catalog
🏆 Leaderboard
Daily Coding Challenge
Solve a new coding challenge every day and climb the leaderboard

Free Resources

Copyright ©2025 Educative, Inc. All rights reserved