CIDR stands for Classless InterDomain Routing. But to explain what it is, we require some more context.
IP Addresses demystified
An IP address e.g.
220.127.116.11 consist of a network part and a host part. The network part is the same for the whole network. The IP address you see here is actually a decimal representation of four 8-bit numbers
255.255.255.255 represents the binary address
The IP address above might be a part of the network with ip range:
18.104.22.168. This would make
52.212.73 the network part and
201 the host part. In such a range
22.214.171.124 represents the network address and
126.96.36.199 is the broadcast address, broadcasting events to all hosts in the network.
We could also say that for the network above the Network Mask is
255.255.255.0 which means that the first 24 bits are fixed for this network. Which is true because those bits are represented by the network part
52.212.73. So 8 bits are variable (host part) in this network
You might already feel that there is always a fixed part which is the same for all hosts in the network, followed by a variable part of bits. For the example
188.8.131.52 we could say that
52.212.73 is the fixed network part and
201 is the host part. As we have seen if the range is
184.108.40.206. the last bit can very from 0 to 255. That is from 0000 0000 to 1111 1111. Which means 8 bits are flexible, so 24 bits are fixed.
That is why we can also write the range
220.127.116.11. as the CIDR block
18.104.22.168/24 meaning that 24 bits are fixed for the network part and 8 bits are variable for the host part. And that is what the CIDR block means.
22.214.171.124/26 refers to which IP range and which Network Mask?
There are 26 fixed bits in this network address and 6 variable bits (32 – 6)
The CIDR above refers to a range
126.96.36.199 ( which are 64 address, 64 being 26 )
In binary that is
To find the network mask mark that the
10011000.00000010.10001000.00 part is fixed.
That are 26 fixed bits. Which means that we represent the network mask by 26 bits set to 1 -> Network Mask:
What is the Network Mask and CIDR representation of the network range:
This range in binary is
From this we see that the constant part (network part) of these IPs is
00110100.11010100.01001, which is 21 bits long.
-> The network mask is
-> CIDR representation
CIDR to IPv4 Conversion : https://www.ipaddressguide.com/cidr
IP range to CIDR: https://www.ipconvertertools.com/iprange2cidr
IP to binary: https://www.browserling.com/tools/ip-to-bin