Understanding Subnetting and Network Division
Subnetting is the process of dividing an IP address space into smaller, logical network segments. The 32-bit IPv4 address consists of two parts: a network portion and a host portion. Routers examine the network bits to forward traffic between subnets, while the host bits identify individual devices within that subnet.
Without subnetting, a single organization would need either one massive network (inefficient) or multiple entirely separate networks (wasteful of address space). Subnetting lets you create multiple logical networks from a single block of addresses, improving security, reducing broadcast domain size, and enabling better resource management.
The boundary between network and host portions is defined by the subnet mask—a 32-bit value where consecutive 1 bits mark the network portion and 0 bits mark the host portion. For example, the mask 255.255.255.0 uses 24 bits for the network and 8 bits for hosts, expressed as a /24 in CIDR notation.
Subnet Masks and CIDR Notation
In the early days of IPv4, only three predefined classes existed: Class A (255.0.0.0), Class B (255.255.0.0), and Class C (255.255.255.0). This rigid system created an all-or-nothing problem—a company needing 300 addresses had to lease an entire Class B subnet with 65,534 usable hosts, wasting thousands of addresses.
Classless Inter-Domain Routing (CIDR) eliminated this restriction. With CIDR, any number of bits can define the network portion, enabling fine-grained allocation. A /25 subnet offers 128 total addresses (126 usable), while a /22 provides 1,024 total addresses (1,022 usable)—much more flexible than the three-class model.
The CIDR notation /24 means "the first 24 bits are the network." Converting between formats:
- Subnet mask
255.255.255.128equals/25 - Subnet mask
255.255.252.0equals/22 - Subnet mask
255.255.255.0equals/24
Calculating Network Properties from IP and Subnet Mask
Once you have an IP address and subnet mask, five key properties can be derived:
Network Address = IP AND Subnet Mask
Broadcast Address = Network Address OR (NOT Subnet Mask)
First Usable Host = Network Address + 1
Last Usable Host = Broadcast Address − 1
Total Addresses = 2(32 − CIDR)
Usable Hosts = Total Addresses − 2
IP— The IPv4 address being analyzed, expressed in dotted decimal notation (e.g., 192.168.1.50)Subnet Mask— The 32-bit mask defining the network boundary, expressed as dotted decimal (e.g., 255.255.255.0) or CIDR (e.g., /24)Network Address— The first IP in the subnet; identifies the entire network segmentBroadcast Address— The last IP in the subnet; used for sending packets to all hosts in the subnetCIDR— Classless Inter-Domain Routing notation: the count of network bits (e.g., /24 means 24 network bits, 8 host bits)
Public vs. Private IP Addresses
IPv4 addresses fall into two categories. Public addresses are globally unique and routable across the Internet; ISPs assign them to edge devices. Private addresses are reserved for internal networks and never routed on the public Internet.
The three private address ranges defined by RFC 1918 are:
10.0.0.0/8— 10.0.0.0 to 10.255.255.255 (16.7 million addresses)172.16.0.0/12— 172.16.0.0 to 172.31.255.255 (1 million addresses)192.168.0.0/16— 192.168.0.0 to 192.168.255.255 (65,536 addresses)
Any IP outside these ranges (and excluding special ranges like 127.0.0.0/8 and 169.254.0.0/16) is public. Most home networks use 192.168.x.x; corporate networks often use 10.x.x.x for scalability.
Common Subnetting Pitfalls and Best Practices
Avoid these frequent mistakes when working with subnets and network planning.
- Forgetting the Network and Broadcast Addresses — The first and last addresses in every subnet are reserved: the network address identifies the subnet itself, and the broadcast address sends traffic to all hosts at once. Neither can be assigned to individual devices, reducing usable host count by two in every subnet. A /30 subnet has only 4 total addresses but just 2 usable hosts.
- Confusing Subnet Mask Notation — Decimal notation (255.255.255.0) and CIDR notation (/24) describe the same thing, but it's easy to misread. Always double-check: /24 means the first 24 bits are the network, leaving 8 bits for hosts. Write both forms when planning to avoid miscommunication with colleagues.
- Miscalculating Supernets and Route Summarization — When combining multiple subnets into a single route prefix, the CIDR value decreases. Summarizing 192.168.0.0/24 and 192.168.1.0/24 yields 192.168.0.0/23, not /25. This matters for router configuration and BGP announcements—an error can cause traffic blackholes.
- Ignoring Address Space Exhaustion in Growth Planning — Allocating a /28 subnet (14 usable hosts) to a department seems reasonable until the business expands. Redesigning subnets mid-deployment is painful and error-prone. Always reserve extra CIDR blocks for future growth, or use NAT to extend limited space temporarily.