Understanding CIDR Notation in IP Addresses
The Problem It Solves
You know that devices on a network have IP addresses like 192.168.1.5, right? Each device gets its own unique address so data knows where to go.
Now, here’s the real-world problem that CIDR notation solves:
Imagine you’re setting up a home network with 10 devices. You need to tell your router: “These 10 IP addresses all belong to MY network, and everything else is outside my network.”
You could list all 10 addresses individually:
- 192.168.1.1
- 192.168.1.2
- 192.168.1.3
- … and so on
But that’s tedious. So instead, network engineers came up with a shorthand way to say “all addresses that start with 192.168.1” belong together.
What CIDR Notation Does
CIDR notation is just a shorthand way to describe a group of IP addresses.
When you see 192.168.1.0/24, here’s what it means:
- 192.168.1.0 = The starting address of the network
- /24 = “The first 24 bits of the address stay the same for everyone in this group”
Think of it like phone numbers in a city. If all numbers in your neighborhood start with the same area code and exchange (like 555-0100, 555-0101, 555-0102), you could say “everyone in the 555-01xx range is in my neighborhood.”
The /24 is doing the same thing - it’s saying “the first three numbers (192.168.1) stay the same, and only the last number changes” for devices in this network.
The 24 Bits Explained
Here’s the key insight: IP addresses aren’t stored the way we write them.
When you see 192.168.1.5, that’s just the human-friendly way to write it. But inside the computer, that same address is stored as 32 bits (32 ones and zeros).
192.168.1.5 in human notation becomes:
11000000.10101000.00000001.00000101 in computer notation
See how there are four groups of 8 bits each? That’s where those four numbers come from:
- 192 = 8 bits
- 168 = 8 bits
- 1 = 8 bits
- 5 = 8 bits
- Total = 32 bits
Now when you write /24, you’re saying “the first 24 bits stay the same for everyone in this network.”
- 24 bits = the first three numbers (192.168.1)
- The remaining 8 bits = the last number (which can change from 0 to 255)
Common Patterns
Those dots in IP addresses aren’t random - each section between the dots represents 8 bits, and the slash number tells you how many bits (and therefore how many sections) are “locked in” for that network.
- /8 = first number stays the same (huge network)
- Example: 10.0.0.0/8 includes 10.0.0.0 to 10.255.255.255
- /16 = first two numbers stay the same (big network)
- Example: 10.50.0.0/16 includes 10.50.0.0 to 10.50.255.255
- /24 = first three numbers stay the same (small network)
- Example: 192.168.1.0/24 includes 192.168.1.0 to 192.168.1.255
- /32 = all four numbers stay the same (just one specific device)
- Example: 192.168.1.5/32 is just that one address
Where You’ll See This
You’ll encounter CIDR notation everywhere in networking:
- Router settings
- Cloud configurations (AWS, Azure, Google Cloud)
- Network diagrams
- Firewall rules
- VPN configurations
Anytime someone needs to describe “this group of IP addresses,” they’ll use that slash notation.
Key Takeaway
CIDR notation is just a compact way to say “here’s a range of addresses that belong together.” The number after the slash tells you how many bits (and therefore how many of those four numbers) stay the same across the network.