CIDR (Classless inter-domain routing) is a method of public IP address assignment. It was introduced in 1993 by Internet Engineering Task Force with the following goals:
- to deal with the IPv4 address exhaustion problem
- to slow down the growth of routing tables on Internet routers
Before CIDR, public IP addresses were assigned based on the class boundaries:
- Class A – the classful subnet mask is /8. The number of possible IP addresses is 16,777,216 (2 to the power of 24).
- Class B – the classful subnet mask is /16. The number of addresses is 65,536
- Class C – the classful subnet mask is /24. Only 256 addresses available.
Some organizations were known to have gotten an entire Class A public IP address (for example, IBM got all the addresses in the 9.0.0.0/8 range). Since these addresses can’t be assigned to other companies, there was a shortage of available IPv4 addresses. Also, since IBM probably didn’t need more than 16 million IP addresses, a lot of addresses were unused.
To combat this, the classful network scheme of allocating the IP address was abandoned. The new system was classsless – a classful network was split into multiple smaller networks. For example, if a company needs 12 public IP addresses, it would get something like this: 190.5.4.16/28.
The number of usable IP addresses can be calculated with the following formula:
2 to the power of host bits – 2
In the example above, the company got 14 usable IP addresses from the 190.5.4.16 – 190.5.4.32 range because there are 4 host bits and 2 to the power of 4 minus 2 is 14 The first and the last address are the network address and the broadcast address,,respectively. All other addresses inside the range could be assigned to Internet hosts.