IPv4 Addressing Techniques and Usage
Focuses on practical IPv4 addressing concepts including allocation, subnet interpretation, and address application in network design.
Learning Goals
- Apply subnetting concepts to divide an IPv4 network into smaller logical networks
- Calculate valid host ranges, network addresses, and broadcast addresses for given IPv4 subnets
- Assess address allocation efficiency for different network requirements
- Select appropriate IPv4 addressing plans for small and medium-sized network topologies
- Diagnose common IPv4 addressing errors that prevent end-to-end communication
Once the fundamentals of IPv4 addressing are understood, the next step is to apply these concepts to real-world network design. Subnetting is the core technique that transforms a single, flat address space into a structured hierarchy of smaller networks, each tailored to specific organizational needs. This lesson focuses on the practical mechanics of subnetting — calculating network addresses, broadcast addresses, and valid host ranges — as well as assessing allocation efficiency, designing addressing plans, and diagnosing the configuration errors that most commonly break end-to-end connectivity.
Subnetting Explained: Networking Basics
The Mechanics of Subnetting
Subnetting works by borrowing bits from the host portion of an IPv4 address and reassigning them to the network portion. Each borrowed bit doubles the number of available subnets while halving the number of hosts per subnet. The fundamental formulas are 2:
Where is the number of bits borrowed for subnetting and is the number of remaining host bits. The subtraction of 2 accounts for the reserved network address (all host bits = 0) and broadcast address (all host bits = 1), neither of which can be assigned to a device .
The Subnet Increment (Block Size)
The block size is the key to quickly identifying subnet boundaries without converting every address to binary:
For example, with a mask of 255.255.255.192 (i.e., /26), the interesting octet is 192:
This means subnets start at multiples of 64 in the last octet: .0, .64, .128, .192.
Footnotes
-
Calculate Hosts in a Subnet, Networks in a Subnet & Range of IPs - CertificationKits - Step-by-step walkthrough of borrowing bits, calculating subnet counts, host ranges, and broadcast addresses. ↩
-
How to Calculate a Subnet Mask Using the Hosts Formula - TechTarget - Explains the subnet mask calculation formulas for hosts and subnets with practical examples. ↩ ↩2
Calculating Network Address, Broadcast Address, and Valid Host Range
- 1Step 1
Given: IP address 172.16.45.130/21. The prefix length /21 means the subnet mask is: 11111111.11111111.11111000.00000000 = 255.255.248.0 The 'interesting octet' is the third octet (248).
- 2Step 2
Block size = . Subnets in the third octet start at: 0, 8, 16, 24, 32, 40, 48, 56, 64... Since the host address is 172.16.45.130, and 45 falls between 40 and 48, the host belongs to the subnet starting at 40.
- 3Step 3
The network address is the first address in the block: 172.16.40.0
- 4Step 4
The broadcast address is the last address before the next subnet boundary: Next subnet starts at 172.16.48.0, so the broadcast is: 172.16.47.255
- 5Step 5
First usable host = Network Address + 1 = 172.16.40.1 Last usable host = Broadcast Address − 1 = 172.16.47.254 Total usable hosts = hosts.
The Quick Subnet Boundary Shortcut
To instantly find which subnet a host belongs to: divide the value of the interesting octet by the block size, drop the remainder, and multiply back. For 172.16.45.130/21: block size = 8. . So the network address starts at 172.16.40.0.
Address Allocation Efficiency: FLSM vs. VLSM
A critical challenge in network design is assigning address space without excessive waste. Two approaches exist 2:
Fixed-Length Subnet Masking (FLSM) applies the same subnet mask to every subnet in the network. This is simple to manage but inherently wasteful: if a network has departments needing 100, 50, 20, and 2 hosts respectively, FLSM would allocate a /25 (126 usable hosts) to every subnet — wasting over 60% of addresses in the smallest subnets.
Variable-Length Subnet Masking (VLSM) solves this by allowing each subnet to have a different prefix length. The VLSM process always starts by allocating the largest subnet first from the available address block, then carving the next-largest from the remaining space, and so on.
| Subnet Need | FLSM (/25 each) | VLSM (right-sized) |
|---|---|---|
| Engineering: 100 hosts | /25 → 126 usable (waste: 26) | /25 → 126 usable (waste: 26) |
| Sales: 50 hosts | /25 → 126 usable (waste: 76) | /26 → 62 usable (waste: 12) |
| Management: 20 hosts | /25 → 126 usable (waste: 106) | /27 → 30 usable (waste: 10) |
| WAN Link: 2 hosts | /25 → 126 usable (waste: 124) | /30 → 2 usable (waste: 0) |
| Total waste | 332 addresses | 48 addresses |
VLSM reduces wasted addresses by approximately 85% compared to FLSM in this scenario .
Footnotes
-
VLSM: A Complete Guide to Variable Length Subnet Masking - Netmaker - Comprehensive guide explaining VLSM mechanics, comparison with FLSM, and real-world allocation examples. ↩ ↩2
-
Efficient IPv4 Address Allocation Using VLSM and CIDR - ResearchGate - Research study demonstrating VLSM-based subnetting reduces unused addresses by approximately 30% compared to fixed-length subnetting. ↩
FLSM vs. VLSM Address Waste Comparison
Wasted IP addresses per subnet when allocating for departments of varying sizes
Given: 192.168.10.0/24 — Design subnets for 4 departments.
Step 1: Sort by size (largest first)
- Engineering: 100 hosts → needs /25 (128 IPs)
- Sales: 50 hosts → needs /26 (64 IPs)
- Management: 20 hosts → needs /27 (32 IPs)
- WAN Link: 2 hosts → needs /30 (4 IPs)
Step 2: Allocate sequentially
| Subnet | CIDR | Network | Usable Range | Broadcast |
|---|---|---|---|---|
| Engineering | /25 | 192.168.10.0 | .1 – .126 | .127 |
| Sales | /26 | 192.168.10.128 | .129 – .190 | .191 |
| Management | /27 | 192.168.10.192 | .193 – .222 | .223 |
| WAN Link | /30 | 192.168.10.224 | .225 – .226 | .227 |
Remaining: 192.168.10.228 – 192.168.10.255 (available for future use)
Selecting IPv4 Addressing Plans for Network Topologies
When designing an addressing plan for a small or medium-sized network, several practical principles guide the decision:
- Start with Requirements Gathering: Determine the number of subnets needed and the maximum host count per subnet. Include separate subnets for servers, user VLANs, management networks, and point-to-point WAN links.
- Choose the Right Private Block: Select an RFC 1918 range that provides sufficient room for growth. A
/16block (e.g.,172.16.0.0/16) gives 65,534 addresses — enough for most medium enterprises. - Apply VLSM for Efficiency: Use VLSM to right-size each subnet. Assign the largest subnets first and work downward.
- Reserve Address Space for Growth: Allocate no more than 50–60% of a block initially. Reserve the remaining space for future expansion to avoid costly re-addressing.
- Assign Consistent Host Addresses: Use a convention for key infrastructure: for example,
.1for the default gateway,.2–.10for servers,.11–.20for printers, and DHCP pools starting from.100upward. - Document Everything: Maintain an IP Address Management (IPAM) spreadsheet or tool that maps every subnet, its purpose, VLAN association, gateway address, and DHCP range .
Footnotes
-
TCP/IP Addressing and Subnetting - Microsoft Learn - Microsoft's official guide on IP addressing, subnet mask configuration, and troubleshooting common TCP/IP issues. ↩
IPv4 Address Planning Workflow
Requirements Analysis
Phase 1Inventory all network segments, device counts, VLAN requirements, and future growth projections."
Block Selection
Phase 2Choose an appropriate RFC 1918 private block (10.x, 172.16.x, or 192.168.x) based on total address needs."
VLSM Subnet Allocation
Phase 3Apply VLSM to carve right-sized subnets from the chosen block, starting with the largest subnet requirement."
Address Assignment Conventions
Phase 4Define consistent IP assignment rules — gateways, servers, DHCP pools — and reserve address space for expansion."
Documentation and Validation
Phase 5Record all allocations in an IPAM system. Validate with ping tests, verify routing, and confirm DHCP scopes."
Diagnosing Common IPv4 Addressing Errors
Misconfigured IPv4 settings are among the most frequent causes of connectivity failures. The following errors represent the vast majority of addressing issues encountered in practice 2:
1. Incorrect Subnet Mask
If two hosts on the same physical network are configured with different subnet masks, one host may believe the other is on a remote network and attempt to send traffic to the default gateway instead of communicating directly. For example:
- Host A:
192.168.1.50/24→ Network =192.168.1.0 - Host B:
192.168.1.100/16→ Network =192.168.0.0
Host B sees Host A as a local neighbor. But Host A sees Host B as local too. However, if the masks were reversed (Host A with /16, Host B with /24), Host A would see Host B's network as 192.168.0.0 and attempt local delivery, while Host B sees Host A's network as 192.168.1.0 and also attempts local delivery — the mismatch can cause intermittent or asymmetric failures that are extremely difficult to debug.
2. Duplicate IP Address
When two devices are assigned the same IPv4 address, an IP conflict occurs. Both devices will experience intermittent connectivity as ARP tables flip between the two MAC addresses. Most modern operating systems detect and warn about this condition.
3. Wrong Default Gateway
If a host's default gateway address does not match the router's interface IP on that subnet, the host can communicate locally but cannot reach any remote network. This is the classic "I can ping my neighbor but not the internet" symptom.
4. Host Assigned a Network or Broadcast Address
Accidentally assigning the network address (e.g., 192.168.1.0/24) or broadcast address (e.g., 192.168.1.255/24) to a device renders it unable to communicate, since these addresses are reserved for protocol-level use.
Footnotes
-
TCP/IP Addressing and Subnetting - Microsoft Learn - Microsoft's official guide on IP addressing, subnet mask configuration, and troubleshooting common TCP/IP issues. ↩
-
How to Fix an Incorrect Subnet Mask Configuration - OneUptime - Practical diagnosis and correction of subnet mask misconfiguration on Linux and Windows systems. ↩
The Subnet Mask Mismatch Trap
A subnet mask mismatch between two hosts on the same LAN is one of the hardest errors to diagnose because it may cause only intermittent or one-directional failures. Always verify that every device on the same VLAN is configured with the identical subnet mask. Use ipconfig (Windows) or ip addr show (Linux) to audit.
Troubleshooting and Design FAQs
Knowledge Check
A network administrator needs to create 14 subnets from the 10.1.0.0/16 network. What is the minimum number of bits that must be borrowed from the host portion?