CIDR is an acronym for Classless Inter-Domain Routing and is how IP addresses are allocated. IP addresses have 2 parts which are the network prefix and the host identifier. The network prefix denotes which network or subnet the IP address belongs to while the host identifier specifies which interface of a host on the network.
More efficient allocation of IP addresses
The previously used classful network addressing (Class A, Class B & Class C) only allows the network prefix in one or more 8-bit group which often are not fully utilized. This
CIDR was introduced to allow for more efficient allocation of IP address ranges. With the CIDR, you can have an arbitrary-length prefixes via the use of variable-length subnet masking (VLSM).
The CIDR notation consists of the IP address then a forward slash followed by a decimal number denoting how many bits are in the network prefix.
The IPv4 block 126.96.36.199/22 represents the 1,024 IPv4 addresses from 188.8.131.52 to 184.108.40.206.
The IPv6 block 2001:db8::/48 represents the block of IPv6 addresses from 2001:db8:0:0:0:0:0:0 to 2001:db8:0:ffff:ffff:ffff:ffff:ffff.
IPv6 local area networks
Unlike the IPv4 local area networks (LAN) which uses variable length network prefixes, IPv6 local area networks uses 64-bit prefixes. Using 64-bit network prefixes means each IPv6 LAN has a total of 18,446,744,073,709,551,616 IPv6 addresses. If the IPv6 range allocated to the organization is /48, the remaining bits until the 64th bit will be used for subnetting purposes. In this case, 16 bits are available to denote the subnets which comes to a total of 65,536 LANs.
Benefits of CIDR
CIDR has many benefits compared to the classful network addressing that was in use previously.
- Due to the variable-length subnet masking, you can allocate IP addresses in multiples of 2’s. This can make better use of the IP address range that was allocated as more subnets can be created within that one range.
- A smaller number of routing entries can be used to represent a large number of networks.
- With the CIDR’s hierarchical design, details of lower-level, smaller networks can be hidden from routers when traffic is moving between large groups of networks.