What is a Subnet? — Network Subnetting Explained
Definition
A subnet (subnetwork) is a logical subdivision of an IP network created by applying a subnet mask to partition the address space into smaller, manageable segments. Subnetting allows network administrators to organize devices into groups, control traffic flow between segments, improve security by isolating parts of the network, and use IP address space efficiently. Each subnet has a network address (all host bits zero), a broadcast address (all host bits one), and usable addresses in between.
How It Works
Subnetting works by designating some bits of the host portion of an IP address as the subnet identifier. A subnet mask like 255.255.255.0 (or /24 in CIDR) means the first 24 bits are fixed as the network address and the remaining 8 bits identify hosts (0–255), giving 254 usable addresses. Halving a /24 into two /25 subnets gives each half 126 usable hosts. Cloud platforms like AWS VPCs and Azure Virtual Networks rely heavily on subnetting to isolate resources across availability zones and control routing between public, private, and database tiers.
Common Use Cases
- ▸Isolating database servers in a private subnet with no direct internet access
- ▸Segmenting cloud VPC into public (internet-facing) and private (internal) subnets
- ▸Creating separate subnets for different departments or security zones
- ▸Planning IP address allocation to avoid exhaustion in large networks
- ▸Configuring routing rules so different subnets communicate through a gateway
Example
Network: 192.168.1.0/24 Split into two /25 subnets: Subnet A: 192.168.1.0/25 Range: 192.168.1.1 – 192.168.1.126 Hosts: 126 usable addresses Subnet B: 192.168.1.128/25 Range: 192.168.1.129 – 192.168.1.254 Hosts: 126 usable addresses
Related Tools
Calculate network address, broadcast, hosts, and subnet mask from IP/CIDR notation.
Calculate CIDR notation, total IPs, and subnet mask from a start and end IP address.
Validate IPv4 and IPv6 addresses with class, scope, and private/public detection.
FAQ
- What is the difference between a /24 and /16 subnet?
- A /24 subnet has 8 host bits (2^8 = 256 addresses, 254 usable). A /16 subnet has 16 host bits (2^16 = 65,536 addresses, 65,534 usable). Smaller prefix numbers mean larger subnets. AWS default VPCs use a /16 network divided into /20 subnets.
- How do I calculate how many hosts a subnet can have?
- For a /N subnet: usable hosts = 2^(32-N) - 2. The -2 subtracts the network address and broadcast address. A /24 has 2^8 - 2 = 254 usable hosts. A /28 has 2^4 - 2 = 14 usable hosts.
- What is a CIDR block?
- CIDR (Classless Inter-Domain Routing) notation like 10.0.0.0/8 defines an IP address block. The number after / is the prefix length — how many leading bits are fixed. CIDR replaced the older classful network system (Class A/B/C) and allows flexible, efficient allocation of IP address blocks.