Classless inter-domain routing
Classless inter-domain routing, or CIDR, was introduced in 1993 to provide a common method for addressing and routing. CIDR was created to allow routing tables to be more properly sized to the usage on their networks, as well as to prevent unnecessary allocation of IPv4 addresses due to the limitations of IPv4’s network prefix system for classifying network sizes.
IPv4 was “classful”, meaning that it divided the IP address space into classes based on their top 3 bits. This matters because it means that, under IPv4, networks would be classified into a particular address space with a given number of networks, which would likely be too small or too large for the particular use case. This classful system was not flexible enough to efficiently allocate the IPv4 address space, so the “classless” concept was developed.
“Classless” was based on VLSM (variable-length subnet masking), which allows for sizing networks based on powers of 2, rather than the simple classes under IPv4’s system.
CIDR is notated using a slash (
/) symbol after the IP address followed by a number which denotes the number of leading
1 bits in the network mask. CIDR notation can be used with IPv4 and IPv6 addresses.
Examples (from the Wikipedia article ↗):
- 192.168.100.14/24 represents the IPv4 address 192.168.100.14 and its associated network prefix 192.168.100.0, or equivalently, its subnet mask 255.255.255.0, which has 24 leading 1-bits.
- the IPv4 block 192.168.100.0/22 represents the 1024 IPv4 addresses from 192.168.100.0 to 192.168.103.255.
- 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.
- ::1/128 represents the IPv6 loopback address. Its prefix length is 128 which is the number of bits in the address.