Understanding binary addressing fundamentals
At its core, IP addressing relies on binary mathematics. Every IPv4 address is a 32-bit binary number divided into four 8-bit octets. Understanding this binary foundation is crucial for subnet design and network troubleshooting.
Decimal: 192.168.1.100
Binary: 11000000.10101000.00000001.01100100
Hex: C0.A8.01.64
Binary-to-decimal conversion
Each octet represents values from 0–255 using positional notation. Position values: 128, 64, 32, 16, 8, 4, 2, 1.
- 192 =
11000000= 128 + 64. - 168 =
10101000= 128 + 32 + 8.
CIDR notation and prefix length
Classless Inter-Domain Routing (CIDR) revolutionised IP addressing by replacing rigid class boundaries with flexible prefix lengths. The prefix indicates how many bits represent the network portion.
192.168.1.0/24
Network bits: 11000000.10101000.00000001.00000000
Subnet mask: 11111111.11111111.11111111.00000000 (255.255.255.0)
Host bits: xxxxxxxx.xxxxxxxx.xxxxxxxx.HHHHHHHH (256 addresses)
10.0.0.0/8
Network bits: 00001010.00000000.00000000.00000000
Subnet mask: 11111111.00000000.00000000.00000000 (255.0.0.0)
Host bits: xxxxxxxx.HHHHHHHH.HHHHHHHH.HHHHHHHH (16,777,216 addresses)
Calculating available addresses
Formula: 2n − 2 = usable host addresses, where n = number of host bits. We subtract 2 because the network address and broadcast address are reserved.
| Prefix | Host bits | Total addresses | Usable hosts | Subnet mask |
|---|---|---|---|---|
/30 | 2 | 4 | 2 | 255.255.255.252 |
/29 | 3 | 8 | 6 | 255.255.255.248 |
/28 | 4 | 16 | 14 | 255.255.255.240 |
/27 | 5 | 32 | 30 | 255.255.255.224 |
/26 | 6 | 64 | 62 | 255.255.255.192 |
/24 | 8 | 256 | 254 | 255.255.255.0 |
Interactive subnet calculator
Practise subnet calculations with our interactive calculator. Experiment with different IP addresses and subnet masks to see real-time calculations, binary breakdowns, and network ranges.
Try the following examples:
- Home network:
192.168.1.0/24— 254 usable hosts, standard home router setup. - Corporate VLAN:
10.0.100.0/26— 62 usable hosts, department-sized network. - Point-to-point:
10.10.10.0/30— 2 usable hosts only, router-to-router links.
Subnet design methodology
Effective subnet design requires understanding requirements, planning for growth, and optimising address space utilisation.
1. Requirements analysis
- Identify departments / VLANs.
- Count devices per segment.
- Plan for 30–50% growth.
- Consider security boundaries.
2. Address allocation
- Start with largest subnets.
- Use Variable Length Subnet Masking.
- Reserve point-to-point links (
/30). - Document everything.
Real-world example: corporate network design
Design subnets for a company with the following requirements:
- Sales: 120 devices
- Engineering: 80 devices
- Marketing: 45 devices
- IT / servers: 30 devices
- Management: 15 devices
- WAN links: 4 point-to-point connections
Given address space: 192.168.0.0/22 (1024 addresses).
Step 1: calculate required subnet sizes (with growth).
- Sales: 120 × 1.5 = 180 →
/24(254 hosts). - Engineering: 80 × 1.5 = 120 →
/25(126 hosts). - Marketing: 45 × 1.5 = 68 →
/26(62 hosts). - IT / servers: 30 × 1.5 = 45 →
/26(62 hosts). - Management: 15 × 1.5 = 23 →
/27(30 hosts). - WAN links: 4 links →
/30each (2 hosts).
Step 2: subnet allocation (largest to smallest):
192.168.0.0/24 - Sales (254 hosts)
192.168.1.0/25 - Engineering (126 hosts)
192.168.1.128/26 - Marketing (62 hosts)
192.168.1.192/26 - IT/Servers (62 hosts)
192.168.2.0/27 - Management (30 hosts)
192.168.2.32/30 - WAN Link 1 (2 hosts)
192.168.2.36/30 - WAN Link 2 (2 hosts)
192.168.2.40/30 - WAN Link 3 (2 hosts)
192.168.2.44/30 - WAN Link 4 (2 hosts)
Variable Length Subnet Masking (VLSM)
VLSM allows different subnet sizes within the same network, maximising address space efficiency. This is essential for modern network design where departments have vastly different device counts.
Traditional fixed subnetting:
192.168.1.0/26 (62 hosts)
192.168.1.64/26 (62 hosts)
192.168.1.128/26 (62 hosts)
192.168.1.192/26 (62 hosts)
Total: 248 usable addresses
Waste: significant for small departments
VLSM-optimised design:
192.168.1.0/26 (62 hosts) - Large dept
192.168.1.64/27 (30 hosts) - Medium dept
192.168.1.96/28 (14 hosts) - Small dept
192.168.1.112/30 (2 hosts) - WAN link
Total: 108 usable addresses
Waste: minimal, room for expansion
- Start large: allocate largest subnets first to avoid fragmentation.
- Power of two: subnet sizes must be powers of 2 (4, 8, 16, 32, etc.).
- No overlap: ensure subnet ranges don't overlap.
- Alignment: subnets must start on appropriate boundaries.
- Documentation: maintain detailed IP address management records.
Advanced subnetting scenarios
Route summarisation (supernetting)
Combining multiple subnets into a single route reduces routing table size and improves network efficiency.
Original subnets:
192.168.0.0/24 (192.168.0.0 - 192.168.0.255)
192.168.1.0/24 (192.168.1.0 - 192.168.1.255)
192.168.2.0/24 (192.168.2.0 - 192.168.2.255)
192.168.3.0/24 (192.168.3.0 - 192.168.3.255)
Binary analysis:
192.168.0.0 = 11000000.10101000.00000000.00000000
192.168.1.0 = 11000000.10101000.00000001.00000000
192.168.2.0 = 11000000.10101000.00000010.00000000
192.168.3.0 = 11000000.10101000.00000011.00000000
Common bits: 11000000.10101000.000000xx.xxxxxxxx
Summary route: 192.168.0.0/22 (covers all four subnets)
Hierarchical network design
Large organisations benefit from hierarchical addressing that mirrors physical or logical network topology:
Corporate HQ: 10.0.0.0/8
├── Region 1: 10.1.0.0/16
│ ├── Building A: 10.1.1.0/24
│ └── Building B: 10.1.2.0/24
├── Region 2: 10.2.0.0/16
│ ├── Building C: 10.2.1.0/24
│ └── Building D: 10.2.2.0/24
└── Data centres: 10.255.0.0/16
├── DC Primary: 10.255.1.0/24
└── DC Backup: 10.255.2.0/24
Common subnetting mistakes
Overlapping subnets. Accidentally creating subnets that share address space. Solution: use subnet calculators and maintain documentation.
Insufficient growth planning. Not allocating enough addresses for expansion. Solution: plan for 50–100% growth in addressing.
Ignoring summarisation. Creating subnets that can't be efficiently summarised. Solution: design with route aggregation in mind.
Poor documentation. Not maintaining accurate IP address management records. Solution: use IPAM tools and update regularly.
IPv6 considerations
While this guide focuses on IPv4, modern networks increasingly deploy IPv6. Key differences:
- Address space: 128-bit addresses (vs. 32-bit IPv4).
- Notation: hexadecimal with colons (
2001:db8::1). - Subnetting: typically use
/64for LANs,/48for sites. - Auto-configuration: SLAAC reduces manual configuration.
Organisations should plan dual-stack deployment strategies while maintaining IPv4 expertise for legacy systems.
Key takeaways: always design with growth and summarisation in mind; use VLSM to optimise address space utilisation; maintain detailed documentation of all subnet assignments; test connectivity and validate designs with practical tools; plan for IPv6 transition while maintaining IPv4 expertise.
Related reading: What is an IP address? · Bogon addresses · Network diagnostics