Subnet Calculation Guide

Master IP subnetting, CIDR notation, and VLSM with practical examples

📊 CIDR Reference Table

Complete subnet mask reference for all CIDR notations

CIDR Subnet Mask Usable Hosts Total Networks Class
/8 255.0.0.0 16,777,214 1 Class A
/9 255.128.0.0 8,388,606 2 Class A
/10 255.192.0.0 4,194,302 4 Class A
/11 255.224.0.0 2,097,150 8 Class A
/12 255.240.0.0 1,048,574 16 Class A
/13 255.248.0.0 524,286 32 Class A
/14 255.252.0.0 262,142 64 Class A
/15 255.254.0.0 131,070 128 Class A
/16 255.255.0.0 65,534 256 Class B
/17 255.255.128.0 32,766 512 Class B
/18 255.255.192.0 16,382 1,024 Class B
/19 255.255.224.0 8,190 2,048 Class B
/20 255.255.240.0 4,094 4,096 Class B
/21 255.255.248.0 2,046 8,192 Class B
/22 255.255.252.0 1,022 16,384 Class B
/23 255.255.254.0 510 32,768 Class B
/24 255.255.255.0 254 65,536 Class C
/25 255.255.255.128 126 131,072 Class C
/26 255.255.255.192 62 262,144 Class C
/27 255.255.255.224 30 524,288 Class C
/28 255.255.255.240 14 1,048,576 Class C
/29 255.255.255.248 6 2,097,152 Class C
/30 255.255.255.252 2 4,194,304 Class C
/31 255.255.255.254 2* 8,388,608 Class C
/32 255.255.255.255 1 16,777,216 Class C

🔒 Private IP Address Ranges

RFC 1918 private address space for internal networks

CIDR Range Start Address End Address Total Hosts Network Type
10.0.0.0/8 10.0.0.0 10.255.255.255 16,777,216 Class A
172.16.0.0/12 172.16.0.0 172.31.255.255 1,048,576 Class B
192.168.0.0/16 192.168.0.0 192.168.255.255 65,536 Class C

🎯 VLSM (Variable Length Subnet Mask)

Efficient IP address allocation using variable subnet sizes

Example: Company Network Design

Allocating 192.168.1.0/24 for different departments:

Sales Department
Hosts needed: 50 Subnet: 192.168.1.0/26 Range: 192.168.1.1-62
Engineering
Hosts needed: 25 Subnet: 192.168.1.64/27 Range: 192.168.1.65-94
Management
Hosts needed: 10 Subnet: 192.168.1.96/28 Range: 192.168.1.97-110
Server Room
Hosts needed: 5 Subnet: 192.168.1.112/29 Range: 192.168.1.113-118
WAN Links
Hosts needed: 2 Subnet: 192.168.1.120/30 Range: 192.168.1.121-122

💻 Understanding Subnet Masks in Binary

How subnet masks work at the binary level

IP Address: 192.168.1.100
Binary: 11000000.10101000.00000001.01100100
Subnet /24: 255.255.255.0
Binary: 11111111.11111111.11111111.00000000
Network: 11000000.10101000.00000001.00000000
Result: 192.168.1.0 (Network Address)
Subnetting Best Practices
  • Always plan for growth: Reserve 20-30% extra IP addresses for future expansion
  • Use VLSM efficiently: Allocate larger subnets first, then smaller ones
  • Document everything: Maintain an IP address management (IPAM) spreadsheet
  • Consider summarization: Design subnets that can be easily summarized for routing
  • Reserve networks: Keep some subnet space unallocated for emergency use
  • Use private ranges: Always use RFC 1918 addresses for internal networks
  • Plan for services: Separate subnets for servers, users, management, and DMZ
  • Remember the rules: Network and broadcast addresses cannot be assigned to hosts