CIDR and Subnet Masks Explained Simply
CIDR and Subnet Masks Explained Simply
Direct Answer:
A Subnet Mask (e.g., 255.255.255.0) and CIDR Notation (e.g., /24) are two different ways of writing the exact same thing. They tell a computer how much of an IP address represents the “Network Name” (the street) and how much represents the “Host ID” (the specific house on that street).
The Problem: Splitting an IP Address
An IP address like 192.168.1.50 does not inherently tell a computer where the network boundary is. Is the network 192.168.1 and the device is 50? Or is the network just 192.168 and the device is 1.50?
To figure this out, computers rely on the Subnet Mask.
What is a Subnet Mask?
A Subnet Mask is a second set of numbers paired with an IP address. The most common subnet mask in the world is:
255.255.255.0
When a computer lines up the IP address and the mask, the 255 sections act as a lock. They say, “This part of the IP address is the Network Name. It cannot change.” The 0 section says, “This part is the Host ID. It can be assigned to devices.”
- IP Address:
192.168.1.50 - Subnet Mask:
255.255.255.0 - Result: The network is
192.168.1.x. The network has space for 254 devices (from.1to.254).
If you used a different mask, like 255.255.0.0, it locks only the first two sections (192.168), leaving the last two sections for devices, giving you space for over 65,000 devices!
What is CIDR Notation?
Writing out 255.255.255.0 repeatedly is tedious for network engineers. CIDR (Classless Inter-Domain Routing) is simply a shorthand way to write the subnet mask.
Instead of writing the full mask, CIDR counts the number of binary “1s” that make up the mask. (In binary, 255.255.255.0 is exactly 24 ones in a row).
So, instead of writing:
IP: 192.168.1.50, Mask: 255.255.255.0
An engineer will just write:
192.168.1.50/24
The /24 (pronounced “slash twenty-four”) is the CIDR notation. It instantly tells any professional that the network can hold 254 devices.
Common CIDR Sizes
/24(Mask255.255.255.0): 254 usable IPs. The standard for home routers and small offices./16(Mask255.255.0.0): 65,534 usable IPs. Used for massive corporate networks or ISP infrastructure./32(Mask255.255.255.255): Exactly 1 IP address. Used when referring to a single, specific machine.