Designing Subnets

As established in the previous section, subnet bits cannot be all zeros or all ones in classful environments.
Likewise, an IP host address cannot have all its host bits set to zero— this setting is reserved for the
address router's use to represent the network or subnet itself. And the host bits cannot be set to all ones, as
this setting is the broadcast address. These restrictions apply to the host bits with no exceptions and are
starting points for designing subnets. Beyond these starting points, network designers need to choose the
most appropriate subnetting scheme in terms of matching the address space to the particulars of an
internetwork.
When designing subnets and their masks, the number of available subnets under a major network address
and the number of available hosts on each subnet are both calculated with the same formula: 2 n – 2,
where n is the number of bits in the subnet or host space and 2 is subtracted to account for the unavailable
all-zeros and all-ones addresses. For example, given a class A address of 10.0.0.0, a subnet mask of
10.0.0.0/16 (255.255.0.0) means that the 8-bit subnet space will yield 28 – 2 = 254 available subnets and
216 – 2 = 65,534 host addresses available on each of those subnets. On the other hand, a mask of
10.0.0.0/24 (255.255.255.0) means that a 16-bit subnet space is yielding 65,534 subnets and an 8-bit host
space is yielding 254 host addresses for each subnet.
The following steps are used to subnet an IP address:
NOTE
A stepwise method for designing subnets
1. Determine how many subnets are required and how many hosts per subnet are required.
2. Use the 2 n – 2 formula to determine the number of subnet bits and the number of host bits that will
satisfy the requirements established in step 1. If multiple subnet masks can satisfy the
requirements, choose the one that will best scale to future needs. For example, if the internetwork
is most likely to grow by adding subnets, choose more subnet bits; if the internetwork is most
likely to grow by adding hosts to existing subnets, choose more host bits. Avoid choosing a
scheme in which either all subnets or all host addresses within the subnets will be used up
immediately, leaving no room for future growth.
3. Working in binary, determine all available bit combinations in the subnet space; in each instance,
set all the host bits to zero. Convert the resulting subnet addresses to dotted decimal. These are the
subnet addresses.
4. For each subnet address, again working in binary, write all possible bit combinations for the host
space without changing the subnet bits. Convert the results to dotted decimal; these are the host
addresses available for each subnet.
NOTE
When configuring subnets, always work in binary instead of dotted decimal.
The importance of doing the last two steps in binary cannot be overemphasized. The single greatest
source of mistakes when working with subnets is trying to work with them in dotted deci mal without
under standing what is happening at the binary level. Again, dotted decimal is for convenience in reading
and writing IP addresses. Routers and hosts see the addresses as 32-bit binary strings; to successfully
work with IP addresses, they must be seen the way the routers and hosts see them.
The last paragraph may seem a bit overzealous in light of the examples given so far; the patterns of subnet
and host addresses have been quite apparent without having to see the addresses and masks in binary. The
next section uses the four design steps to derive a subnet design in which the dotted-decimal
representations are not so obvious. 37