“Without subnetting, your network is like a house without partitions; everyone can peek in, and traffic becomes chaotic. It’s time you learned how IPv4 subnetting works!”
Think of your computer network as a crowded city. Without proper planning, data traffic will be chaotic, broadcast storms will disrupt performance, security will be vulnerable, and IP allocation will be inefficient. This is where Subnetting IPv4 acts as a digital “city planner,” dividing large networks into small, organized subnets.
For those of you who are new to the world of networking, terms such as subnet masks, CIDR notation, or network bits may sound complicated. But calm down! This article will guide you to understand how IPv4 subnetting works in practical terms, from the basic concepts, subnet sharing steps, to real-world examples that can be applied right away.
What Is IPv4 Subnetting and Why Is It Needed?
Subnetting IPv4 is a technique of dividing one large block of IP address into several smaller tissues called subnet. Imagine dividing an office building into several floors, each department (HR, IT, Marketing) gets its own space with controlled access.
3 Main Reasons Subnetting Is Needed
1. Reduce Network Traffic (Broadcast Domain)
- Without subnetting, broadcast traffic (e.g., ARP requests) floods the entire network.
- Example: On the /24 network (254 hosts), the broadcast will be sent to all devices, even though only 10 devices may be needed.
2. Improve Security
- Isolation of subnets prevents attacks from spreading (e.g., malware in the Marketing division does not directly infect HR).
- Practical example: The subnet for guest WiFi is separated from the company’s internal network.
3. Optimize IP Address Allocation
Avoid IP wastage. Example:
- The 192.168.1.0/24 network (254 hosts) is used for only 20 devices → 234 IPs are wasted.
- With subnetting, it is possible to create /27 (30 hosts per subnet) → more efficient.
“What if your company has 5 departments but only /24 available? Can subnetting still be done?”
The Basic Components of IPv4 Subnetting: A Must-Master Foundation
a. IP Address and Subnet Mask – Two Sides of Currency That Complement Each Other
An IPv4 address is a unique 32-bit address written in 4 decimal octets (example: 192.168.1.0). However, this address is only meaningful when paired with a subnet mask, which serves as a “glass” to identify which parts are the network ID and host ID.
Example:
- Address 192.168.1.10 with subnet mask 255.255.255.0 (/24) means:
- Network ID: 192.168.1.0
- Host ID: 10
Subnet masks always consist of a series of ‘1’ bits sequentially on the left (network) and ‘0’ on the right (host). It’s like a firm dividing line between the network address and the device.
b. CIDR Notation – Efficient Short Language
CIDR (Classless Inter-Domain Routing) notation is a more efficient modern way to write subnet masks. The /24 format is much more practical than having to write 255.255.255.0.
Illustration:
- /24 = 24 bits for the network (or 255.255.255.0)
- /26 = 26 bit network (255.255.255.192)
The larger the CIDR number (e.g. /28), the smaller the subnet generated because more bits are allocated to the network portion.
c. Network Bits vs Host Bits – Power Sharing in the IP World
Network bits (network bit) are the part that defines the identity of a subnet, while host bits (host bit) define the address of devices within that subnet.
1. Network bits:
- Like an area code in a phone number
- All devices in the same subnet have identical network bits
- Example: In 192.168.1.0/24, the first 24 bits are network bits
2. Host bits:
- Such as a unique phone number within the same area
- Must be unique to each device in a subnet
- Example: In /24, 8 bits are left for the host (2⁸-2 = 254 possible hosts)
Network bits are the name of the street, and host bits are the house number on that street. Subnetting means dividing a large city into many small streets.
Important Comparison Table:
| Component | Example | Function | Bit Allocation (/24) |
| Network ID | 192.168.1.0 | Subnet identity | The first 24 bits |
| Host ID | 0.0.0.10 | Device identity | Last 8 bits |
| Subnet Mask | 255.255.255.0 | Network/host limiter | 24 bit ‘1’ |
Warning: Two addresses in each subnet are always reserved:
- Network address (all host bits 0)
- Broadcast address (all host bits 1)
How IPv4 Subnetting Works: A Step-by-Step Guide with Practical Examples
Step 1: Determine Subnet Needs
Action Plan:
- Identify the number of subnets needed
- Specify the maximum number of hosts per subnet
- Add a 20-30% buffer for future expansion
Case Examples:
The company requires:
- 4 subnets (HR, IT, Marketing, Guest WiFi)
- Each subnet hosts ±50 hosts
- Initial network: 192.168.1.0/24
Always calculate real needs + reserves. For 50 hosts, plan for ±64 hosts.
Step 2: Calculate the New Subnet Mask
Once we know the number of subnets, we need to determine how many bits of the host part should be borrowed to be part of the network. Use the formula:
Number of subnets = 2ⁿ (n = bits borrowed from host portion)
Available hosts = 2h – 2 (h = remaining host bits)
Account:
- Host requirement: 50 → 6 host bits (2⁶-2 = 62 hosts)
- Initial network /24 (8 host bits) → borrow 2 bits for subnets (2² = 4 subnets)
- New subnet mask: /26 (24+2) or 255.255.255.192
Bit Visualization:
Original: 11111111.1111111111111111111.0000000(/24)
New: 11111111.111111111.111111111.111100000 (/26)
[Network] [Sub][Host]Step 3: Define Subnet Blocks
Once a new subnet mask is defined, the main network is divided into subnet blocks.
Magic Number Formula:
Block size = 256 - last octet subnet mask
Example: 256 - 192 = 64For example, from the initial network 192.168.1.0/24, you can create a new subnet as follows:
- Subnet 1: 192.168.1.0/26 (0-63)
- Subnet 2: 192.168.1.64/26 (64-127)
- Subnet 3: 192.168.1.128/26 (128-191)
- Subnet 4: 192.168.1.192/26 (192-255)
Note: Each subnet has 62 usable hosts (64 total – network – broadcast).
Step 4: Calculate Valid IP Range
For each subnet, you must specify a valid IP address for the device (host), a network address, and a broadcast address. For example, for subnet 192.168.1.0/26:
- Network Address: 192.168.1.0
- Valid Host:
- First: 192.168.1.1
- Latest: 192.168.1.62
- Broadcast: 192.168.1.63
Quick Cheat Sheet:
| Subnet | Network Address | First Host | Last Host | Broadcast |
| 1 | 192.168.1.0 | 192.168.1.1 | 192.168.1.62 | 192.168.1.63 |
| 2 | 192.168.1.64 | 192.168.1.65 | 192.168.1.126 | 192.168.1.127 |
Step 5: Verify with Real Case Studies
Scenario:
- 3 departments (HR, IT, Marketing)
- Maximum of 30 hosts per subnet
- Network: 192.168.1.0/24
Solution:
- Count requirements: 30 hosts → 5 host bits (2⁵-2=30)
- Subnet mask: /27 (32-5) or 255.255.255.224
- Block size: 256-224=32
- Subnet Allocation:
- HR: 192.168.1.0/27 (1-30)
- IT: 192.168.1.32/27 (33-62)
- Marketing: 192.168.1.64/27 (65-94)
Use diagrams for visualization:
[ HR ] 192.168.1.0/27 Host: 1-30
[ IT ] 192.168.1.32/27 Host: 33-62
[ MKT ] 19.168.1.64/27 Host: 65-94Common Mistakes in Subnetting and Practical Solutions
1. Miscalculating Subnet Mask
- Using subnet masks that don’t meet your needs
Example: Need 60 hosts/subnet but use /27 (only 30 hosts) - Result: Network not functioning optimally, IP conflict
2. Forgot Network Allocation & Broadcast Address
- Assume all IPs in the range are usable
Example: In subnet 192.168.1.0/26, assume the range 0-63 is all usable
3. Overlapping Subnet Ranges
Overlapping subnets
Example:
- Subnet A: 192.168.1.0/26 (0-63)
- Subnet B: 192.168.1.32/27 (32-63) → Overlap occurred!
4. Leaving No Expansion Space
- Allocate a mediocre IP
Example: Need 30 hosts → Out-of-the-box /27 (30 hosts)
5. Convert CIDR to Subnet Mask
- Misinterpreting CIDR notation
Example: Calculating /25 = 255.255.255.5 (incorrect!)
“Always test subnetting with ping tests and traceroutes before deploying to production. Use a lab simulator like Cisco Packet Tracer for practice!”
Tools to Make Subnetting Easier
Performing IPv4 subnetting calculations manually is indeed beneficial for basic practice and understanding. But in professional practice, especially when dealing with complex networks, the use of tools and visual aids goes a long way in speeding up and minimizing errors.
Here are some of the best tools you can use to simplify the subnetting process:
1. Subnet Calculator
The subnetting calculator helps you determine:
- The number of subnets that can be created.
- The number of hosts available per subnet.
- Valid IP range, broadcast address, and network address.
- CIDR and subnet mask notation are automatically.
Recommended Tools:
SolarWinds Advanced Subnet Calculator
→ Free and highly accurate, suitable for system administrators.
Website: solarwinds.com
Spiceworks Subnet Calculator
→ Web-based, lightweight, and user-friendly.
Website: spiceworks.com
2. Network Simulator
If you want to test subnets interactively, use a network simulator. You can create a virtual topology, set up subnet masks, and see firsthand how devices communicate with each other.
Recommendations:
Cisco Packet Tracer
→ Cisco’s official simulator, ideal for training subnetting, routing, and network device configuration.
Suitable for students and IT professionals.
GNS3 (Graphical Network Simulator-3)
→ More advanced and flexible, used for large-scale network simulation.
3. Quick Formula & Cheat Sheet
If you prefer the manual way but want the process to be quick, use the CIDR cheat sheet. This is a quick reference table that shows the relationship between CIDR notation, subnet masks, number of hosts, and IP blocks.
Example of Cheat Sheet Format:
| CIDR | Subnet Mask | Host/Subnet |
| /24 | 255.255.255.0 | 254 |
| /26 | 255.255.255.192 | 62 |
| /27 | 255.255.255.224 | 30 |
| /30 | 255.255.255.252 | 2 |
Cheat sheets like these are especially useful during exams, network certifications (like CCNA), or when configuring quickly in the field.
Understanding how subnetting works manually is important, but using subnetting tools will:
- Save time
- Reduces the risk of errors
- Improve accuracy in network design
Use a combination of calculators, simulators, and quick references for the best results in daily networking practice.
