Subnetting
Subnetting is the practice of dividing a network into smaller subnetworks (subnets). It's a fundamental skill for network administrators.
Why Subnet?
Subnetting provides several benefits:
- Efficient IP usage - Allocate only what you need
- Security - Isolate sensitive systems
- Performance - Reduce broadcast traffic
- Organization - Logical network structure
Binary Basics
To subnet effectively, you need to understand binary. Each IP octet is 8 bits, with values from 0-255.
Binary Converter
Subnet Mask Deep Dive
The subnet mask determines which part of an IP is the network and which is for hosts.
Subnet Mask Visualizer
Interactive Subnet Calculator
Try different IP addresses and CIDR prefixes to see how subnets work:
Subnet Calculator
Visualizing Subnet Division
See how a network gets divided into smaller subnets:
Subnet Division Visualizer
- Borrowed bits: 26 - 24 = 2
- Number of subnets: 2^2 = 4
- Block size: 256 - 192 = 64
- Hosts per subnet: 2^6 - 2 = 62
CIDR Reference
Use this table to quickly look up subnet information:
CIDR Quick Reference
| CIDR | Subnet Mask | Block Size | Usable Hosts | Typical Use |
|---|---|---|---|---|
| /32 | 255.255.255.255 | 1 | 1 | Single host |
| /31 | 255.255.255.254 | 2 | 2 | Point-to-point |
| /30 | 255.255.255.252 | 4 | 2 | Point-to-point |
| /29 | 255.255.255.248 | 8 | 6 | Small subnet |
| /28 | 255.255.255.240 | 16 | 14 | Small subnet |
| /27 | 255.255.255.224 | 32 | 30 | Small office |
| /26 | 255.255.255.192 | 64 | 62 | Small office |
| /25 | 255.255.255.128 | 128 | 126 | Medium office |
| /24 | 255.255.255.0 | 256 | 254 | Large office / Class C |
| /23 | 255.255.254.0 | 512 | 510 | Large network |
| /22 | 255.255.252.0 | 1,024 | 1,022 | Large network |
| /21 | 255.255.248.0 | 2,048 | 2,046 | Campus |
| /20 | 255.255.240.0 | 4,096 | 4,094 | Campus |
| /16 | 255.255.0.0 | 65,536 | 65,534 | Class B |
VLSM (Variable Length Subnet Masks)
VLSM allows using different subnet sizes within the same network for efficient address allocation.
Example: You have 192.168.1.0/24 and need:
- 1 subnet for 100 hosts
- 1 subnet for 50 hosts
- 1 subnet for 25 hosts
- 2 subnets for point-to-point links (2 hosts each)
Solution (allocate largest first):
- 100 hosts needs /25 (126 hosts) = 192.168.1.0/25
- 50 hosts needs /26 (62 hosts) = 192.168.1.128/26
- 25 hosts needs /27 (30 hosts) = 192.168.1.192/27
- 2 hosts needs /30 (2 hosts) = 192.168.1.224/30
- 2 hosts needs /30 (2 hosts) = 192.168.1.228/30
Pro tip: Always allocate the largest subnets first to avoid fragmentation!
Practice Tasks
Binary Conversion: Use the Binary Converter above in Practice mode. Convert at least 5 numbers correctly.
Subnet Calculation: Using the Subnet Calculator, find the network address, broadcast address, and usable host range for 172.16.50.100/22.
Subnet Design: You have 10.0.0.0/24 and need 8 equal subnets. What CIDR would you use? How many hosts per subnet?
VLSM Design: You have 172.16.0.0/16. Design subnets for: a department with 500 hosts, a department with 200 hosts, and 4 point-to-point links.
Summary
- Subnetting divides networks into smaller segments
- Understanding binary is essential for subnet calculations
- The subnet mask separates network and host portions
- Block size = 256 - subnet mask last octet
- VLSM allows efficient use of address space with variable subnet sizes
Next up: Routing Protocols - how routers learn and share network paths.