
Computer networks are the backbone of most organizations and homes. Subnetting is of primary importance in network design, an area that is usually simplified to the point that network administrators actually struggle (not so much because of the complexity, but certainly because of the amount of practice it requires) to organise, secure and expand an IP-based infrastructure. If you have ever wondered what a subnet is, how it works and what it is used for, this guide will explain them. A clean definition of the subnets, how they work, and what we need to make sure when applying them. Core subjects will include subnet masks, CIDR notation, and IP addressing with examples to really solidify the concepts.
What Is a Subnet?
A subnet (short for “subnetwork”) is a logically segmented piece of a larger network. By dividing a big network into smaller, manageable sub-networks, or subnets, you gain better control over traffic flow, improved security, and efficient use of IP addresses.
- Logical grouping: Devices that share common functions—say, all printers—can live in one subnet.
- Traffic isolation: Broadcast traffic stays within its subnet, reducing overall network noise.
- Administrative boundaries: Different teams or departments can have separate subnets.
In essence, subnetting allows you to partition a single physical network into multiple logical networks.
Why Use Subnets?
Subnetting is a fundamental practice for several reasons:
- Scalability: A large flat network can become unmanageable as the number of devices grows. Subnets break it into bite-sized chunks.
- Performance: Local broadcast traffic (e.g., ARP requests) remains confined. Less unnecessary chatter means faster response times.
- Security: You can implement firewall rules or access control lists (ACLs) at the subnet level to restrict traffic between departments or functions.
- Efficient IP Usage: Avoid wasted IPs by tailoring subnet sizes to the specific needs of various network segments.
- Troubleshooting: Smaller networks are easier to monitor, diagnose, and fix when something goes wrong.
Basics of IP Addressing
Every device on an IP network has a unique IP address, typically written in dotted-decimal format (for IPv4), such as 192.168.1.45. An IPv4 address is a 32-bit number, divided into four 8-bit octets. Each octet ranges from 0 to 255.
Example:
11000000.10101000.00000001.00101101
192 .168 .1 .45
- The network portion identifies the subnet.
- The host portion identifies the specific device within that subnet.
To tell devices where the network portion ends and the host portion begins, we use a subnet mask.
Subnet Masks and CIDR Notation
A subnet mask is a 32-bit number that, like an IP address, is written in dotted-decimal form. It “masks” the IP address, distinguishing the network portion from the host portion by using contiguous ones (1s) for the network and zeros (0s) for the host.
Example subnet mask:
255.255.255.0
11111111.11111111.11111111.00000000
- The first three octets (1s) indicate the network bits.
- The last octet (0s) indicates the host bits.
CIDR Notation
Classless Inter-Domain Routing (CIDR) offers a shorthand way to specify the mask: an IP address followed by a slash (/) and the number of network bits.
Example:
192.168.1.0/24
Here /24 means the first 24 bits are network bits (255.255.255.0 mask).
Common CIDR blocks and their masks:
| CIDR | Mask | Number of Hosts |
|---|---|---|
| /30 | 255.255.255.252 | 2 |
| /29 | 255.255.255.248 | 6 |
| /28 | 255.255.255.240 | 14 |
| /24 | 255.255.255.0 | 254 |
| /16 | 255.255.0.0 | 65,534 |
Calculating Subnets: A Step-by-Step Example
Let’s say your organization has the 10.0.0.0/24 network. You need to create four subnets of equal size.
- Determine required subnets: 4 subnets
- Calculate bits needed: 2 bits (2² = 4)
- Generate new prefix length: 24 (original) + 2 = 26
- Find the new mask: /26 = 255.255.255.192
- Calculate block size: 256 – 192 = 64
- List subnets:
-
- Subnet 1: 10.0.0.0/26 (hosts .1–.62, .63 broadcast)
- Subnet 2: 10.0.0.64/26 (hosts .65–.126, .127 broadcast)
- Subnet 3: 10.0.0.128/26 (hosts .129–.190, .191 broadcast)
- Subnet 4: 10.0.0.192/26 (hosts .193–.254, .255 broadcast)
Each subnet now has 62 usable IP addresses (64 minus network and broadcast).
Types of Subnets
Public vs. Private Subnets
- Public subnets: Directly reachable from the internet (e.g., web servers).
- Private subnets: Isolated from direct internet access. Typically only accessible through a firewall or NAT gateway (e.g., databases, internal apps).
VLAN-Based Subnets
Virtual LANs (VLANs) let you segment traffic on a single physical switch. Each VLAN typically maps to its own IP subnet, which helps enforce broadcast domains and simplify security policies.
Key Benefits of Subnetting
- Enhanced Security
- Restrict inter-subnet traffic with ACLs or firewall rules.
- Isolate sensitive servers (e.g., databases) in private subnets.
- Improved Performance
- Reduce broadcast traffic domain sizes.
- Minimize congestion and latency.
- Simplified Management
- Delegate subnet administration to different teams.
- Apply policies (QoS, ACLs) per subnet.
- IP Address Conservation
- Avoid wasting IP addresses by customizing subnet sizes to actual needs.
- Easier Troubleshooting
- Smaller broadcast domains mean faster pinpointing of network issues.
Best Practices for Designing Subnets
- Plan Ahead
- Estimate future growth.
- Reserve address space for expansion.
- Use Logical Grouping
- Group devices by function or department.
- Implement Private Addressing
- Follow RFC 1918: 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16 for private networks.
- Document Everything
- Maintain an IP address management (IPAM) spreadsheet or tool.
- Leverage Automation
- Use DHCP with reservations for dynamic environments.
- Employ network configuration tools (Ansible, Terraform) for reproducibility.
- Monitor and Audit
- Continuously check for IP conflicts, rogue devices, or subnet overlaps.
Tools and Resources
- Online Subnet Calculators: Quickly determine subnet ranges, broadcast addresses, and host counts (e.g., ipcalc, subnet-calculator.com).
- IPAM Software: Tools like phpIPAM or SolarWinds IPAM help manage large IP spaces.
- Network Simulators: GNS3, Cisco Packet Tracer for hands-on subnetting practice.
- Further Reading:
-
- RFC 950 (Internet Standard Subnetting Procedure)
- RFC 3021 (IPv4 Address Assignment to Point-to-Point Links)
Conclusion
Subnetting is a cornerstone of modern network design. By breaking a large network into smaller, distinct segments, you gain control over performance, security, and IP address utilization. Although subnet calculations may seem daunting at first, mastering the fundamentals of IP addresses, subnet masks, and CIDR notation empowers you to design robust, scalable networks.
Thank you for reading! If you found this guide helpful, share it with your network-savvy friends, or leave a comment below with your subnetting tips and experiences. Happy networking!
Discover more from Aree Blog
Subscribe now to keep reading and get access to the full archive.


