What is a Subnet Mask??? (you NEED to know it!!)
Based on NetworkChuck's video on YouTube. If you like this content, support the original creators by watching, liking and subscribing to their content.
A subnet mask’s binary pattern determines which IP bits are network bits (fixed) and which are host bits (variable).
Briefing
A subnet mask isn’t just a label on an IP address—it encodes, in binary, which parts of an address identify the network and which parts identify individual hosts. Converting the subnet mask into binary reveals the “network bits” (the 1s) and the “host bits” (the 0s), and that split directly determines how many usable IP addresses a network can support—information that matters for everything from basic connectivity to planning larger subnets.
The episode starts by tackling a common rule of thumb: when a subnet mask contains 255 in an octet, the corresponding 8 bits are “frozen” as 1s. The deeper reason is arithmetic in binary. For the subnet mask octet value 255, every bit position is set to 1 because 255 equals 128+64+32+16+8+4+2+1. That means the entire octet becomes all ones in binary. By contrast, an octet value of 0 becomes all zeros, since there’s nothing to subtract from zero—so every bit in that octet is off.
Once the subnet mask is expressed as a string of ones and zeros, the meaning becomes concrete. The 1s indicate the portion of the IP address that belongs to the network; those bits don’t change within that subnet. The 0s indicate the host portion; those bits can vary to create different IP addresses inside the same network. In the example used, the first three octets are all ones and the last octet is all zeros. That structure means the network is defined by the first 24 bits, while the final 8 bits are available for hosts.
Counting host bits then yields the number of possible addresses. The episode uses the formula 2^(number of host zeros) to compute total addresses, then subtracts 2 to account for reserved values: the subnet ID (the first address) and the broadcast address (the last address). With 8 host bits, the calculation is 2^8 = 256 total addresses, minus 2 usable addresses, resulting in 254 usable IPs.
When more capacity is needed, the subnet mask changes by “borrowing” a bit from the network side and giving it to the host side—effectively turning one of the network bits into a host bit. The example shifts from 8 host zeros to 9 host zeros, increasing capacity to 2^9 = 512 total addresses, minus 2, for 510 usable IPs. This also changes the decimal subnet mask value: the mask no longer reads 255.255.255.0, but becomes 255.255.254.0 after adjusting the third octet.
Finally, the episode emphasizes a structural property: subnet masks use contiguous blocks of ones followed by contiguous blocks of zeros. That pattern—no “1s after 0s”—is what makes the network/host boundary unambiguous. The takeaway is practical: subnetting is fundamentally the act of reshaping the subnet mask’s ones-and-zeros pattern to match the number of hosts required, and binary is the key to seeing exactly how that reshaping changes address counts.
Cornell Notes
A subnet mask encodes, in binary, which bits in an IP address identify the network and which bits identify hosts. In an octet, 255 becomes eight 1s because 255 = 128+64+32+16+8+4+2+1, while 0 becomes eight 0s. The 1s mark network bits (fixed within the subnet), and the 0s mark host bits (vary to create addresses). The total number of addresses is 2^(number of host bits), and usable addresses subtract 2 for the subnet ID and broadcast address. Increasing host capacity means converting some network bits into host bits, which changes the subnet mask’s decimal form (e.g., 255.255.255.0 to 255.255.254.0).
Why does an octet value of 255 in a subnet mask correspond to “all ones” in binary?
How do the 1s and 0s in a subnet mask translate into network bits versus host bits?
What formula determines how many usable IP addresses a subnet provides?
How does subnetting increase the number of hosts in a network?
Why does changing the subnet mask also change its decimal value (not just the binary meaning)?
What does “contiguous” mean for subnet masks, and why does it matter?
Review Questions
- Given a subnet mask with 6 host bits, what are the total and usable IP address counts?
- Explain how converting a subnet mask octet to binary helps determine which IP bits are fixed and which can vary.
- If a subnet needs 510 usable IP addresses, what host-bit count is required, and what does that imply about the subnet mask’s structure?
Key Points
- 1
A subnet mask’s binary pattern determines which IP bits are network bits (fixed) and which are host bits (variable).
- 2
An octet value of 255 maps to eight 1s in binary because 255 equals 128+64+32+16+8+4+2+1.
- 3
An octet value of 0 maps to eight 0s in binary because there are no bit values to set.
- 4
Total addresses in a subnet equal 2^(number of host bits); usable addresses equal that total minus 2 for subnet ID and broadcast.
- 5
Increasing host capacity means borrowing bits from the network portion and converting them into host bits, which changes the subnet mask’s decimal form.
- 6
Subnet masks use contiguous blocks: a run of 1s followed by a run of 0s, with no 1s appearing after 0s.