Classless Inter-Domain Routing (CIDR)
Classless Inter-Domain Routing (CIDR) is also called sometimes supernetting. CIDR is a way to allow more flexible allocation of IP addresses than was possible with the original system of IP address classes. With Classless Inter-Domain Routing the number of available Internet IP addresses was significantly increased, which along with use of Network Address Translation (NAT), has extended the useful life of IPv4 addressing.
IP addresses were assigned in four major address classes, A,B,C and D. Each of these address classes allocates one portion of the 32bit IP address format to identify a network gateway. The first 8bits for class A, the first 16bits for class B, and the first 24bits for class C. The remainder identify the hosts on that network. Class A – 16 million addresses, Class B – 65535 addresses and 254 addresses in Class C. The addresses on Class D identify multicast domains.
To understand the issues with the class system, imagine that one of the most regularly used classes was Class B. An organization that needed more than 254 networked devices would often get a Class B license, even though it would have less than 65534 hosts. This resulted in most of the block of addresses allocated going unused. This inflexibility of the class system created IPv4 address pool exhaustion.
Classless Inter-Domain Routing reduced the issue of wasted IP address space by providing a more flexible way to specify network addresses in routers. Classless Inter-Domain Routing lets one routing table entry represent an aggregation of networks that exist in the forward path that do not need to be specified on that particular gateway. This is much like how the telephone system uses area codes to channel calls toward a certain part of the network. This aggregation of networks in a single IP address is sometimes referred to as a supernet.
Using Classless Inter-Domain Routing, each IP address has a network prefix that identifies one or several network gateways. The length of the network prefix in IPv4 Classless Inter-Domain Routing is also specified as part of the address and varies depending on the number of bits needed, rather than any arbitrary class assignment structure.
A route or destination IP address that describes many possible destinations has a shorter prefix and is said to be less specific. On the other hand a longer prefix describes a destination gateway. Routers are required to use the most specific or longest prefix in the routing table when forwarding packets. Classless Inter-Domain Routing was originally defined in IETF RFC 4632.