CIDR notation, which stands for Classless Inter-Domain Routing, is a method for describing and allocating IP addresses and routing Internet Protocol packets. It is also used to describe a subnet for purposes of blocking access to Websites, essentially enabling the blacklisting of certain ISP providers and networks from a Website via network access control lists. Here are some important things to understand about CIDR notation:
IP Address: Every device connected to the internet is assigned a unique IP address. This address is a series of numbers that identifies the device on the network, such as "255.255.5.10".
Subnet Mask: Traditionally, IP addresses were grouped into classes (A, B, C, etc.), and each class had a default subnet mask which determined the network's size. However, this method was inflexible and led to the wasting of IP addresses.
CIDR Notation: CIDR was introduced to provide more efficient and flexible allocation of IP addresses. It does away with the traditional class-based system.
Format: CIDR notation is written as an IP address, followed by a slash, and then a number. For example, 192.168.1.0/24. Here, 192.168.1.0 is the start of the IP address range, and 24 (which is the number after the slash) is the subnet mask indicating the subnet size in CIDR notation.
Subnet Mask in CIDR: The number after the slash represents the number of consecutive binary digits in the subnet mask (1's and 0's notation). For example, '/24' means the first 24 bits of the subnet mask are fixed, and the remaining bits are variable. This determines the size of the network and how many IP addresses it can possibly contain. The smaller the number after the slash, the larger the size of the subnet mask in terms of number of possible ip addresses. A '/24' means the first 24 bits of the address are fixed, and the remaining 8 bits are within the range of the subnet. This indicates the subnet can have up to 256 addresses within it. A '/16' means only the first 16 bits of an IP address is fixed, and the last 16 binary digits can be used within the subnet. This provides for 65,536 ip addresses that are available for use within the subnet. The formula for number of available IP addresses within a subnet is 2^(32-n) where n is the number after the slash.
Advantages: CIDR allows for more efficient use of IP addresses. It enables the creation of subnets with sizes that are not restricted by the original class (A, B, C) system, allowing for more precise allocation of IP addresses based on actual need.
In simple terms, CIDR is a way of setting IP addresses and determining the size of a network which is more flexible and efficient than the older class-based system.
Many cloud platforms such as Amazon AWS, Microsoft Azure, and Google Cloud use this notation when setting up and describing virtual networks and the subnets within them, as well for use in network access control lists, including blocking a range of IP address from accessing a Web resource such as a Web site or a cloud API."
Here are some CIDR calculators to try to better understand the concept:
https://mxtoolbox.com/subnetcalculator.aspx