Subnetting questions become manageable when every answer comes from the same few decisions: how many bits are fixed, how large each block is, which block contains the address, and whether the available host count fits the requirement.
Suppose a host is configured as 192.168.40.77/26. The first three octets look familiar, but they do not settle the subnet. A /26 splits the fourth octet into blocks of 64. Address 77 belongs to the 64-127 block, so the network is 192.168.40.64 and the broadcast address is 192.168.40.127.
That process works for unfamiliar addresses because it does not depend on recognizing a memorized example. Use the tables as accelerators, not substitutes for the method.
Check your work: The IPv4 Subnet Calculator shows the network, broadcast, usable range, host counts, mask, wildcard mask, address status, binary octets, and the steps behind the result.
The 32-bit subnetting model
An IPv4 address contains 32 bits arranged as four 8-bit octets. CIDR notation places a slash and prefix length after the address. The prefix length tells you how many leading bits identify the network.
For 192.168.40.77/26:
- 26 bits identify the network.
- 6 bits remain for addresses inside the subnet.
- The mask contains 26 ones followed by 6 zeros.
- The total address count is
2^6, which equals 64. - Traditional usable host count is 64 minus the network and broadcast addresses, which equals 62.
A dependable calculation follows this order:
- Identify the prefix and subnet mask.
- Find the changing octet.
- Calculate the block size.
- Locate the boundary below the entered address.
- Find the next boundary, then subtract one for the broadcast address.
- Move one address inward from each boundary for the traditional usable range.
- Confirm that the host count satisfies the requirement.
This order prevents a common mistake: finding the right host count but attaching it to the wrong network boundary.
Common IPv4 CIDR blocks
The table combines masks, address counts, and familiar uses. Large blocks are included because route tables and private ranges often use them. Treat the usable-host column as subnet math, not a recommendation to place millions of devices in one broadcast domain.
| Prefix | Subnet mask | Total addresses | Traditional usable | Useful clue |
|---|---|---|---|---|
| /0 | 0.0.0.0 | 4,294,967,296 | 4,294,967,294 | IPv4 default route, matches every destination |
| /8 | 255.0.0.0 | 16,777,216 | 16,777,214 | Historical Class A size; 10.0.0.0/8 is private |
| /12 | 255.240.0.0 | 1,048,576 | 1,048,574 | 172.16.0.0/12 private range |
| /16 | 255.255.0.0 | 65,536 | 65,534 | Historical Class B size; two octets fixed |
| /20 | 255.255.240.0 | 4,096 | 4,094 | Third-octet block size 16 |
| /21 | 255.255.248.0 | 2,048 | 2,046 | Third-octet block size 8 |
| /22 | 255.255.252.0 | 1,024 | 1,022 | Third-octet block size 4 |
| /23 | 255.255.254.0 | 512 | 510 | Spans two /24-sized ranges |
| /24 | 255.255.255.0 | 256 | 254 | Fourth-octet block size 256 |
| /25 | 255.255.255.128 | 128 | 126 | Fourth-octet boundaries 0 and 128 |
| /26 | 255.255.255.192 | 64 | 62 | Boundaries 0, 64, 128, 192 |
| /27 | 255.255.255.224 | 32 | 30 | Fourth-octet block size 32 |
| /28 | 255.255.255.240 | 16 | 14 | Fourth-octet block size 16 |
| /29 | 255.255.255.248 | 8 | 6 | Fourth-octet block size 8 |
| /30 | 255.255.255.252 | 4 | 2 | Traditional small point-to-point subnet |
| /31 | 255.255.255.254 | 2 | 2 on supported point-to-point links | RFC 3021 endpoint pair, no directed broadcast |
| /32 | 255.255.255.255 | 1 | 1 | One host address or host route |
For prefixes between rows, keep halving or doubling. Moving from /24 to /25 adds one network bit and halves the block from 256 to 128 addresses. Moving back from /25 to /24 removes one network bit and doubles the block.
Powers of two and host requirements
Host counts come from the number of host bits:
Total addresses = 2^(32 - prefix)
For ordinary subnets through /30:
Traditional usable hosts = total addresses - 2
The subtraction accounts for the network and broadcast addresses. /31 and /32 follow the special behavior covered later.
Memorize the small powers of two because they appear in both host calculations and block sizes:
| Host bits | Power | Total addresses | Traditional usable |
|---|---|---|---|
| 1 | 2¹ | 2 | Special `/31` case |
| 2 | 2² | 4 | 2 |
| 3 | 2³ | 8 | 6 |
| 4 | 2⁴ | 16 | 14 |
| 5 | 2⁵ | 32 | 30 |
| 6 | 2⁶ | 64 | 62 |
| 7 | 2⁷ | 128 | 126 |
| 8 | 2⁸ | 256 | 254 |
| 9 | 2⁹ | 512 | 510 |
| 10 | 2¹⁰ | 1,024 | 1,022 |
| 11 | 2¹¹ | 2,048 | 2,046 |
| 12 | 2¹² | 4,096 | 4,094 |
When a question asks for the smallest subnet supporting 50 hosts, find the first usable count that reaches 50. A /27 provides 30, which fails. A /26 provides 62, which fits. A /25 also fits, but it consumes twice the address space.
Watch the wording. “50 devices” may not be the same as “50 endpoint addresses” when the subnet also needs router interfaces, appliances, printers, access points, growth, or reserved addresses. Use the requirement the scenario actually gives.
Borrowed subnet bits
Borrowed bits describe how a parent block is divided. The parent prefix must be stated or implied before the phrase has useful meaning.
Suppose an organization owns 192.168.50.0/24 and divides it into /27 subnets:
- Parent prefix:
/24 - New prefix:
/27 - Borrowed bits:
27 - 24 = 3 - Number of equal subnets:
2^3 = 8 - Host bits per new subnet:
32 - 27 = 5 - Addresses per new subnet:
2^5 = 32 - Traditional usable hosts per subnet: 30
The eight boundaries are 0, 32, 64, 96, 128, 160, 192, and 224 in the fourth octet.
Important qualifier: An address does not carry its parent allocation with it. You cannot say how many bits were borrowed from `/27` alone. You need the original prefix, such as `/24`, for that comparison.
The block-size shortcut
Find the first mask octet that is not 255. That is the changing octet. Subtract its value from 256:
Block size = 256 - changing mask octet
For /26, the mask is 255.255.255.192:
256 - 192 = 64
Fourth-octet boundaries therefore occur every 64 values: 0, 64, 128, and 192.
For /20, the mask is 255.255.240.0. The third octet changes:
256 - 240 = 16
Third-octet boundaries occur at 0, 16, 32, 48, and so on through 240. Every block includes all 256 values of the fourth octet.
Use this sequence when locating an address:
- Write the mask.
- Identify the changing octet.
- Calculate the block size.
- Count boundaries until one is less than or equal to the entered octet.
- The next boundary minus one is the final value in that block.
For 172.20.77.9/20, the third octet is 77 and the block size is 16. Boundaries around 77 are 64 and 80. The network begins at 172.20.64.0, and the broadcast address is one before the next boundary: 172.20.79.255.
Private and special-use IPv4 ranges
Subnet math still works inside special ranges, but the address category changes how the result should be interpreted.
| Range | Category | Operational clue |
|---|---|---|
| 10.0.0.0/8 | Private | RFC 1918 private-use space |
| 172.16.0.0/12 | Private | Private range ends at 172.31.255.255 |
| 192.168.0.0/16 | Private | Common home and small-office private space |
| 100.64.0.0/10 | Shared address space | Commonly associated with carrier-grade NAT, not RFC 1918 |
| 127.0.0.0/8 | Loopback | Traffic remains on the local host |
| 169.254.0.0/16 | IPv4 link-local | Often called APIPA in Windows; DHCP failure is a common clue |
| 192.0.2.0/24 | Documentation | TEST-NET-1 for examples |
| 198.51.100.0/24 | Documentation | TEST-NET-2 for examples |
| 203.0.113.0/24 | Documentation | TEST-NET-3 for examples |
| 198.18.0.0/15 | Benchmarking | Reserved for network-device benchmarking tests |
| 224.0.0.0/4 | Multicast | Group delivery, not ordinary unicast host assignment |
| 240.0.0.0/4 | Reserved | Special-use rules take precedence over ordinary public addressing |
| 255.255.255.255/32 | Limited broadcast | Local-link broadcast destination, not normally routed |
A private address does not automatically provide security. Firewall policy, segmentation, authentication, exposed services, and routing determine risk. A public address is not automatically reachable either. It must be allocated, configured, routed, and allowed by policy.
Legacy class labels may still appear in exam questions. Class A historically used a /8 default, Class B a /16, and Class C a /24. Modern subnetting and routing use the stated CIDR prefix. An address such as 192.168.10.10 is not automatically /24 just because it falls in the old Class C first-octet range.
How /31 and /32 behave
/31 point-to-point links
A /31 contains two addresses. Traditional subtraction would leave zero usable hosts, but RFC 3021 defines a different model for supported point-to-point links. Both addresses can act as endpoints, and the link does not use a directed broadcast address.
For 203.0.113.10/31:
- Lower endpoint:
203.0.113.10 - Upper endpoint:
203.0.113.11 - Total endpoint addresses: 2
- Directed broadcast: none for the RFC 3021 point-to-point design
Use /31 only when the scenario and devices support point-to-point behavior. A normal Ethernet LAN with several hosts still needs an appropriate multi-access subnet.
/32 host routes
A /32 fixes all 32 address bits. The block contains exactly one address. Route tables use /32 to identify one IPv4 destination, and loopback interfaces often receive /32 addresses because the route should represent one stable endpoint rather than a connected multi-host subnet.
For 192.0.2.44/32, the network and only address are both 192.0.2.44. There is no separate broadcast address.
Worked subnetting examples
Example 1: Find the boundaries of a /26
Address: 192.168.40.77/26
/26mask:255.255.255.192- Changing octet: fourth
- Block size:
256 - 192 = 64 - Boundaries: 0, 64, 128, 192
- Address 77 falls between 64 and 127
- Network:
192.168.40.64 - Broadcast:
192.168.40.127 - Usable range:
192.168.40.65through192.168.40.126 - Usable hosts: 62
Example 2: Work in the third octet
Address: 10.50.38.200/21
/21mask:255.255.248.0- Changing octet: third
- Block size:
256 - 248 = 8 - Boundaries around 38: 32 and 40
- Network:
10.50.32.0 - Broadcast:
10.50.39.255 - Usable range:
10.50.32.1through10.50.39.254 - Total addresses: 2,048
- Traditional usable hosts: 2,046
The fourth octet spans 0 through 255 because the changing boundary occurs in the third octet.
Example 3: Decide whether two hosts are local
Hosts:
10.20.30.62/2710.20.30.65/27
A /27 uses blocks of 32. Address 62 falls in the 32-63 block. Address 65 falls in the 64-95 block. The addresses differ by only 3, yet they belong to separate subnets and require routing between them.
Example 4: Choose the smallest subnet
A segment requires 120 usable addresses.
/26provides 62, too small./25provides 126, fits./24provides 254, fits but wastes more space.
The smallest suitable answer is /25, assuming the stated 120 includes every address the design needs.
VLSM allocation example
Variable-length subnet masking lets one parent block use several prefix sizes. Allocate the largest requirement first so small early choices do not fragment the remaining space.
Suppose 192.168.60.0/24 must support:
- User LAN: 100 hosts
- Voice LAN: 50 hosts
- Server LAN: 20 hosts
- Router point-to-point link: 2 endpoints with
/31support
A clean allocation is:
| Need | Assigned block | Usable range or endpoints | Reason |
|---|---|---|---|
| User LAN | 192.168.60.0/25 | 192.168.60.1-192.168.60.126 | 126 traditional usable addresses |
| Voice LAN | 192.168.60.128/26 | 192.168.60.129-192.168.60.190 | 62 traditional usable addresses |
| Server LAN | 192.168.60.192/27 | 192.168.60.193-192.168.60.222 | 30 traditional usable addresses |
| Point-to-point | 192.168.60.224/31 | 192.168.60.224 and 192.168.60.225 | Two RFC 3021 endpoints |
The remaining addresses begin at 192.168.60.226. Future allocations must still begin on a valid boundary for their chosen prefix. For example, another /29 needs a multiple-of-8 boundary, so 192.168.60.232/29 is aligned while 192.168.60.226/29 is not.
Common subnetting mistakes
Assuming the first three octets define the subnet
That shortcut works only for a /24. A /23 crosses two third-octet values, while /25 through /30 divide the fourth octet into smaller blocks.
Using the old address class instead of the stated prefix
172.20.10.5/24 uses /24, even though 172 historically fell in the Class B range. CIDR controls the modern network boundary.
Subtracting two before finding total addresses
The exponent gives total addresses. Calculate 2^(host bits) first, then subtract two for traditional subnets. Subtracting from the exponent produces the wrong scale.
Forgetting the network and broadcast addresses
A /27 has 32 total addresses and 30 traditional usable hosts. The first and last addresses are boundaries, not ordinary endpoint choices.
Treating every /31 as unusable
RFC 3021 allows two endpoints on supported point-to-point links. Context determines whether that special design applies.
Calling every 172 address private
Only 172.16.0.0/12 is RFC 1918 private space. The range ends at 172.31.255.255.
Calling APIPA a private DHCP lease
169.254.0.0/16 is IPv4 link-local space. In a Windows troubleshooting scenario, it often indicates that normal DHCP configuration was not obtained.
Allocating small VLSM blocks first
A handful of small subnets can leave gaps that no longer fit the largest requirement. Sort needs from largest to smallest before assigning boundaries.
Rounding a boundary to a convenient-looking number
Valid boundaries follow the block size. A /27 begins on multiples of 32. 192.168.1.96/27 is aligned; 192.168.1.100/27 is an address inside that block, not its network address.
A subnetting practice routine
Use short repetitions rather than one long memorization session:
- Write the powers of two from 2 through 256.
- Rebuild the
/24through/30mask and host table from those values. - Solve five fourth-octet examples using block size.
- Solve two third-octet examples such as
/20or/21. - Choose the smallest prefix for three host requirements.
- Decide whether several address pairs share a subnet.
- Check the answers with the IPv4 Subnet Calculator.
- Explain one error in words before moving on.
A calculation error usually belongs to one of four categories: wrong mask, wrong block size, wrong boundary, or wrong host formula. Naming the category makes the next practice set more useful.
Official references
- IANA IPv4 Special-Purpose Address Space registry
- RFC 1918: Address Allocation for Private Internets
- RFC 3021: Using 31-Bit Prefixes on IPv4 Point-to-Point Links
- RFC 3927: Dynamic Configuration of IPv4 Link-Local Addresses
- RFC 4632: Classless Inter-domain Routing
- RFC 5737: IPv4 Address Blocks Reserved for Documentation
- RFC 6598: Shared Address Space Request