Subnetting Made Easy: A Practical Guide for IP Networks
From CIDR notation to subnet splitting—network engineering fundamentals
Master IPv4 subnetting with clear explanations of CIDR, subnet masks, network/broadcast addresses, host calculations, and why /31 and /32 subnets exist.
What You'll Learn
- •CIDR to subnet mask conversion
- •Network address calculation (bitwise AND)
- •Broadcast address calculation
- •Usable host count formula
- •/31 point-to-point subnet support
- •/32 single host route
- •Subnet splitting by CIDR prefix
- •Private IP range classification
Full Guide
Subnetting is the art of dividing a network IP range into smaller sub-networks. Every network engineer, sysadmin, and IT student must understand it. This guide makes subnetting intuitive.
Core Concepts
IP addresses are 32-bit binary numbers. A subnet mask tells us which bits represent the network (fixed) and which represent hosts (variable). The bitwise AND operation between IP and mask gives the network address.
CIDR Notation Shorthand
- /24 means 255.255.255.0—the first 24 bits are network bits. /24 gives 256 total IPs (254 usable, minus network and broadcast).
- /25 gives 128 total (126 usable). Each step down doubles the number of networks and halves hosts per network.
Key Calculations
- Network address: IP AND Subnet Mask (bitwise AND)
- Broadcast address: Network address OR (NOT Subnet Mask)
- First usable host: Network address + 1
- Last usable host: Broadcast address - 1
- Total hosts: 2^(32 - CIDR)
- Usable hosts: Total - 2
Special Cases
- /31 point-to-point links (RFC 3021): Uses exactly 2 IPs with no waste—no network or broadcast address.
- /32: A single-host route with no subnet range.
Subnet Splitting Example
You have 192.168.1.0/24 (256 IPs, 254 usable). Need 4 subnets of at least 50 hosts each? /26 (64 IPs each) gives you 4 subnets: .0/.64/.128/.192.
Private IP Ranges (Non-routable on public internet)
- 10.0.0.0/8: Class A, 16.7M hosts
- 172.16.0.0/12: Class B, 1M hosts
- 192.168.0.0/16: Class C, 65K hosts