Subnetting Calculations Step by Step
- Networking Fundamentals & OSI Model
- TCP/IP Model
- Network Topologies
- IP Addressing & Subnetting
- Routing Algorithms & Protocols
- Switching Concepts
- Transport Layer Protocols (TCP & UDP)
- Application Layer Protocols
- Network Security & Firewalls
- Wireless Networking & Wi-Fi
- Network Address Translation (NAT)
- DNS Deep Dive
- Congestion Control & Flow Control
- Error Detection & Correction
- Network Devices
- VPN & Tunneling
- Load Balancing & CDN Networking
- Socket Programming
- Network Troubleshooting Tools
- Physical Layer & Transmission Media
- Data Link Layer & MAC Addressing
- Ethernet Protocol
- ARP (Address Resolution Protocol)
- ICMP Protocol
- Unicast, Multicast, Broadcast and Anycast
- Proxy Servers
- Port Numbers Reference
- Network Performance Metrics
- Quality of Service (QoS)
- Software-Defined Networking (SDN)
- HTTP/2 and HTTP/3 Overview
- 5G and Mobile Networks
- IoT Networking Basics
- VoIP Networking Basics
A Practical Scenario
Suppose a network has the block 192.168.1.0/24, and it needs to be split into 4 smaller subnets. Walking through the actual math makes subnetting far less abstract.
Step 1: How Many Extra Bits Are Needed?
To create 4 subnets, enough bits must be borrowed from the host portion to represent 4 distinct values. Since 2^2 = 4, borrowing 2 bits is exactly enough.
Original: /24 (24 network bits)
Borrow 2 bits from the host portion
New prefix: /26 (24 + 2 = 26 network bits)Step 2: Find the Size of Each New Subnet
A /26 leaves 6 host bits, so each subnet contains 2^6 = 64 total addresses (62 usable, after reserving the network and broadcast addresses).
Step 3: List Out Each Subnet's Range
Subnet 1: 192.168.1.0 - 192.168.1.63 (usable: .1 to .62)
Subnet 2: 192.168.1.64 - 192.168.1.127 (usable: .65 to .126)
Subnet 3: 192.168.1.128 - 192.168.1.191 (usable: .129 to .190)
Subnet 4: 192.168.1.192 - 192.168.1.255 (usable: .193 to .254)Each block jumps by 64 addresses (the subnet size), and the first and last address in every block are reserved as that subnet's network and broadcast addresses.
The General Pattern to Remember
- Decide how many subnets are needed, and find the smallest power of 2 that covers it.
- Borrow that many bits from the host portion to get the new prefix length.
- The subnet size is
2^(remaining host bits), and ranges simply repeat in steps of that size.
Once this pattern is understood, subnetting becomes a matter of mechanical arithmetic rather than guesswork.