Choose Subnet Masks 1
This post presents questions that ask you to analyze design data about a network and then choose the one subnet mask to use for all subnets. If a company uses one subnet mask for all subnets of one classful network, before deploying the first subnet, you can predict the number of subnets and the number of hosts per subnet. You can also list the subnet IDs and the range of addresses in each subnet.
For those who care to pass Cisco certifications, you should strive to get the answer to each problem in about 15 seconds. This post gives you five problems. Get a stopwatch or clock app open and get ready to practice!
Videos: How to and More Practice
The left video discusses the design approach to subnet masks, which begins with the choice to use only one subnet mask within the entire classful network. Then, you consider the number of subnets the design requires, plus the size needed for each subnet, to determine which masks will work—and then choose among those masks.
The right video provides some practice with the process.
Practice Problems (Hidden)
You may make the following assumptions:
- By choice, the design should use a single subnet mask for all subnets within the network.
- All subnets can be used, including the zero subnet and broadcast subnet.
Each problem supplies a classful network (a class A, B, or C network). It also states the number of subnets and the number of hosts needed in the largest subnet. Your job:
- Plan the address structure with:
- The number of network bits based on the network class.
- The minimum number of subnet bits that provides enough subnets per the requirements.
- The minimum number of hosts bits that provides enough hosts/subnet per the requirements.
- Determine if no mask, exactly one mask, or many masks meets the requirements.
- If many masks meet the requirements, note the range of prefix mask values, and note which maximizes the number of subnets, and which maximizes the number of hosts/subnet.
| Problem | Class | Maximum Hosts/Subnet to Support | Maximum Subnets to Support |
| 1 | A | 287 | 187 |
| 2 | B | 87 | 147 |
| 3 | C | 9 | 9 |
| 4 | B | 1200 | 40 |
The following table supplies the powers of 2 and their decimal equivalents.
| 2^x | Decimal | 2^x | Decimal |
|---|---|---|---|
| 2^0 | 1 | 2^9 | 512 |
| 2^1 | 2 | 2^10 | 1024 |
| 2^2 | 4 | 2^11 | 2048 |
| 2^3 | 8 | 2^12 | 4096 |
| 2^4 | 16 | 2^13 | 8192 |
| 2^5 | 32 | 2^14 | 16,384 |
| 2^6 | 64 | 2^15 | 32,768 |
| 2^7 | 128 | 2^16 | 65,536 |
| 2^8 | 256 | 2^17 | 131,072 |
Answers and Explanations for Each Problem
| Class | Minimum Subnet Bits | Minimum Host Bits | Valid Mask(s) | Maximizes Subnets | Maximizes Hosts | |
| 1 | A | 8 | 9 | /16 – /23 | /23 | /16 |
| 2 | B | 8 | 7 | /24 – /25 | /25 | /23 |
| 3 | C | 4 | 4 | /28 | N/A | N/A |
| 4 | B | 6 | 11 | None | N/A | N/A |
Table 1: Mask Design Problems: Answers
| Class | Minimum Subnet Bits | Minimum Host Bits | Valid Mask(s) | |
| 1 | A | 8 | 9 | /16 – /23 |
Table 1: Mask Design Problems: Answers
This problem results in multiple of valid masks. The mask requires 8 network bits (due to a class A network). It also requires a minimum of 8 subnet and 9 host bits. As a result, 7 bits remain, with a design choice of using those as subnet or host bits.
Figure 1 shows the comparison of the edge cases for the final mask choice. The top of the figure depicts the mask based on the minimum number of subnet bits, which maximizes the number host bits and the number of hosts/subnet. The bottom part of the figure shows the other edge case, which depicts the case with the minimum number of host bits, which therefore maximizes the number of subnets.

Figure 1: Concepts Behind Problem 1
| Class | Minimum Subnet Bits | Minimum Host Bits | Valid Mask(s) | |
| 2 | B | 8 | 7 | /24 – /25 |
Table 1: Mask Design Problems: Answers
This problem results in multiple of valid masks. The mask requires 16 network bits (due to a class B network). It also requires a minimum of 8 subnet and 7 host bits. As a result, 1 bits remain, with a design choice of using that bit as a subnet or host bit.
Figure 2 shows the comparison of the edge cases for the final mask choice. The top of the figure depicts the mask based on the minimum number of subnet bits, which maximizes the number host bits and the number of hosts/subnet. The bottom part of the figure shows the other edge case, which depicts the case with the minimum number of host bits, which therefore maximizes the number of subnets.

Figure 2: Concepts Behind Problem 2
| Class | Minimum Subnet Bits | Minimum Host Bits | Valid Mask(s) | |
| 3 | C | 4 | 4 | /28 |
Table 1: Mask Design Problems: Answers
This problem results in one valid mask. The mask requires 24 network bits (due to a class C network). It also requires a minimum of 4 subnet and 4 host bits. Those fields total 32 bits, with 0 additional bits. The only design choice is to use the one mask that matches that structure (/28). The figure shows the structure of this single case.

Figure 3: Concepts Behind Problem 3
| Class | Minimum Subnet Bits | Minimum Host Bits | Valid Mask(s) | |
| 4 | B | 6 | 11 | None |
Table 1: Mask Design Problems: Answers
This problem results in no viable masks. The mask requires 16 network bits (due to a class B network). It also requires a minimum of 6 subnet and 11 host bits. Added together, those fields total 33 bits, which do not fit into the 32-bit IPv4 subnet mask. So no mask can provide enough bits in each field. The figure notes the field sizes needed per the design requirements.
