CIDR (Classless Inter-Domain Routing or supernetting)

CIDR stands for Classless Inter-Domain Routing. CIDR was developed in the 1990s as a standard scheme for routing network traffic across the Internet.

A CIDR network address looks like this:

192.30.250.00/18

The “192.30.250.00” is the network address itself and the “18” says that the first 18 bits are the network part of the address, leaving the last 14 bits for specific host addresses. CIDR lets one routing table entry represent an aggregation of networks that exist in the forward path that don’t need to be specified on that particular gateway, much as the public telephone system uses area codes to channel calls toward a certain part of the network. This aggregation of networks in a single address is sometimes referred to as a supernet.

CIDR Notation

CIDR specifies an IP address range using a combination of an IP address and its associated network mask. CIDR notation uses the following format –

    xxx.xxx.xxx.xxx/n

where n is the number of (leftmost) ‘1’ bits in the mask. For example,

    192.168.12.0/23

applies the network mask 255.255.254.0 to the 192.168 network, starting at 192.168.12.0. This notation represents the address range 192.168.12.0 – 192.168.13.255. Compared to traditional class-based networking, 192.168.12.0/23 represents an aggregation of the two Class C subnets 192.168.12.0 and 192.168.13.0 each having a subnet mask of 255.255.255.0. In other words,

    192.168.12.0/23 = 192.168.12.0/24 + 192.168.13.0/24

Additionally, CIDR supports Internet address allocation and message routing independent of the traditional class of a given IP address range. For example,

    10.4.12.0/22

represents the address range 10.4.12.0 – 10.4.15.255 (network mask 255.255.252.0). This allocates the equivalent of four Class C networks within the much larger Class A space.

You will sometimes see CIDR notation used even for non-CIDR networks. In non-CIDR IP subnetting, however, the value of n is restricted to either 8 (Class A), 16 (Class B) or 24 (Class C). Examples:

  • 10.0.0.0/8
  • 172.16.0.0/16
  • 192.168.3.0/24

The old Classfull IP Addressing scheme provided for Class A, B and C networks:

Class type Starting bits for the first octet How many networks per Class? How many hosts per network? Range of the first octet
Class A 0 126 (2^24)-2=~16 Million 1-126 127=Loopback
Class B 10 2^14=16384 (2^16)-2=~65000 128-191
Class C 110 2^21=~2 Million (2^8)-2=254 192-223
Class D 1110 224-239
Class E 1111 240-255

The default Subnet Masks for these networks are:

Class type Number of bits used for the Network ID Number of bits used for the Host ID Default Subnet Mask
Class A 8 24 255.0.0.0
Class B 16 16 255.255.0.0
Class C 24 8 255.255.255.0

 

CIDR blocks and number of Host IDs per segment:

CIDR Block Number of Equivalent Class C networks Number of Network ID bits Number of Host ID bits Total number of Host addresses per segment= (2 ^# of Host ID bits) Number of usable Host addresses per segment= (2 ^# of Host ID bits)-2
/27 1/8 Class C 27 5 32 30
/26 1/4 Class C 26 6 64 62
/25 1/2 Class C 25 7 128 126
/24 1 Class C 24 8 256 254
/23 2 Class C 23 9 512 510
/22 4 Class C 22 10 1,024 1,022
/21 8 Class C 21 11 2,048 2,046
/20 16 Class C 20 12 4,096 4,094
/19 32 Class C 19 13 8,192 8,190
/18 64 Class C 18 14 16,384 16,382
/17 128 Class C 17 15 32,768 32,766
/16 256 Class C = 1 Class B 16 16 65,536 65,534
/15 512 Class C = 2 Class B 15 17 131,072 131,070
/14 1024 Class C=4 Class B 14 18 262,144 262,142
/13 2048 Class C=8 Class B 13 19 524,288 524,286