WhatIP
CIDR and Subnetting Explained: The Ultimate Beginner’s Guide
Understanding how network traffic flows can feel overwhelming when you first start learning networking or web development. Terms like IP Addresses, Subnets, and CIDR notation often sound like complex mathematical formulas.
In this guide, we will break down what Subnets and CIDR are, why they exist, and how they work using simple, everyday analogies.
What is an IP Address?
Before diving into subnetting, let’s briefly refresh what an IP address is.
An IPv4 address is a unique 32-bit numerical identifier assigned to every device connected to a network. It looks something like this:
192.168.1.1
An IP address consists of two main parts:
-
Network Portion: Identifies the specific network the device belongs to (like a street name).
-
Host Portion: Identifies the specific device on that network (like a house number).
1. What is Subnetting?
Subnetting is the practice of dividing a large physical network into two or more smaller, logical sub-networks (known as subnets).
(Image Suggestion: A diagram showing one large network splitting into two isolated subnets—e.g., Office A and Office B)
The Apartment Building Analogy
Imagine a massive 4-story building without any internal doors, flat numbers, or section divisions. If a delivery driver enters to deliver a package, they would have to search the entire building floor-by-floor.
Now imagine dividing that building into structured flats (Flat 101, Flat 201). Delivery becomes faster, management becomes easier, and security is improved.
Why do we use Subnets?
-
Network Efficiency: Reduces unnecessary network traffic (broadcast noise).
-
Enhanced Security: Keeps sensitive departments (like Finance) on a separate subnet from general devices or guest Wi-Fi.
-
Organized Management: Makes identifying and troubleshooting network devices simpler.
2. What is CIDR? (Classless Inter-Domain Routing)
In the early days of the internet, IP addresses were assigned in rigid categories called Classful Networks (Class A, Class B, and Class C).
This system was inefficient. For example, if a company needed 500 IP addresses, they were forced to take a Class B block, which provided 65,536 addresses—wasting over 65,000 IPs in the process.
To fix this massive waste of IP addresses, CIDR (Classless Inter-Domain Routing) was introduced. CIDR allows network administrators to allocate IP blocks of flexible sizes tailored to exact requirements.
(Image Suggestion: A graphic breaking down 192.168.1.0/24 into 24 Network Bits and 8 Host Bits)
3. Demystifying Slash Notation (/24, /16, /32)
When configuring routers, firewalls, or web servers, you frequently see IP addresses formatted with a slash at the end, such as 192.168.1.0/24.
The number following the slash (/24) is the CIDR Prefix. Out of the total 32 bits in an IPv4 address, it tells you how many bits are allocated to the Network Portion.
-
Total Bits in IPv4: 32
-
Network Bits (
/24): 24 -
Remaining Host Bits: $32 – 24 = 8\text{ bits}$
To calculate the number of total host IP addresses available:
Since 2 addresses in every subnet are reserved (one for the Network Address and one for the Broadcast Address), the usable IPs formula is:
4. CIDR Cheat Sheet
Here is a quick reference table comparing common CIDR prefixes, their subnet masks, and available IP addresses:
| CIDR Notation | Subnet Mask | Total IPs | Usable IPs | Common Usage |
| /32 | 255.255.255.255 | 1 | 1 | Single specific host/device |
| /30 | 255.255.255.252 | 4 | 2 | Point-to-Point router links |
| /28 | 255.255.255.240 | 16 | 14 | Small office/department |
| /24 | 255.255.255.0 | 256 | 254 | Standard Local Area Network (LAN) |
| /16 | 255.255.0.0 | 65,536 | 65,534 | Large enterprise or Cloud VPC |
| /8 | 255.0.0.0 | 16,777,216 | 16,777,214 | ISP level / Massive infrastructure |
Key Takeaway: The larger the CIDR prefix number (e.g.,
/30), the smaller the available IP pool. The smaller the CIDR prefix number (e.g.,/16), the larger the available network pool!
5. Practical Example: Splitting a /24 Network
Suppose you have an IP range of 192.168.1.0/24 (254 usable IPs) and you want to divide it equally between two departments: Development and Sales.
(Image Suggestion: A diagram illustrating 192.168.1.0/24 splitting into two /25 ranges)
By borrowing 1 bit from the host portion, your prefix becomes /25:
-
Subnet A (Development):
192.168.1.0/25-
Usable IP Range:
192.168.1.1to192.168.1.126(126 usable devices)
-
-
Subnet B (Sales):
192.168.1.128/25-
Usable IP Range:
192.168.1.129to192.168.1.254(126 usable devices)
-
Both departments now operate on isolated subnets, keeping network management clean and secure.
Why this appears in IP tools
ASN, WHOIS/RDAP and routing data often describe IP ranges rather than individual addresses. Understanding CIDR makes those results much easier to read.
You can use WHOIS Lookup or ASN Lookup to inspect network ownership data.
Conclusion
Subnetting and CIDR are core fundamentals of modern networking, cloud environments, and server administration. By replacing rigid address classes with flexible CIDR notation, IP allocation has become far more efficient and scalable.