CIDR (Classless Inter-Domain Routing) notation is a method used to represent IP address ranges and subnet masks in a more flexible and concise way than traditional subnetting. CIDR notation is widely used in networking and allows for the efficient allocation of IP addresses and subnets. It consists of an IP address followed by a forward slash (/) and a number, which represents the subnet mask length in bits.
Here’s how CIDR notation works:
- IP Address: CIDR notation starts with a standard IP address, such as 192.168.1.0.
- Forward Slash (/): This character separates the IP address from the subnet mask length.
- Subnet Mask Length: The number after the forward slash indicates how many bits in the subnet mask are fixed. It’s also referred to as the “prefix length.” For example, /24 means the first 24 bits of the IP address are used for the network portion (subnet), and the remaining bits are used for host addresses.
Here are some examples of CIDR notation:
192.168.1.0/24
: This represents a Class C network with a subnet mask of 255.255.255.0. It allows for 256 host addresses within the subnet (2^8 – 2, minus the network and broadcast addresses).10.0.0.0/16
: This represents a Class A network with a subnet mask of 255.255.0.0. It allows for 65,534 host addresses within the subnet.172.16.0.0/20
: This represents a Class B network with a subnet mask of 255.255.240.0. It allows for 4,094 host addresses within the subnet.
CIDR notation simplifies network addressing and makes it easier to represent various-sized subnets within a larger IP address range. It’s commonly used in routing tables, access control lists, and when specifying IP address ranges for network configurations.