background image
IP Addressing and Subnetting 263
As Table 5-20 shows, the same 256 subnet numbers are derived with the binary algorithm as
with the decimal algorithm. The second example shows one not-so-obvious (at least in decimal)
case with difficult subnetting (Table 5-21).
So, with 5 subnet bits, there should be 2
5
or 32 subnets, including the zero and broadcast
subnets. Examining the third octet of the decimal subnet numbers, with a little imagination, the
32 subnet numbers are 150.150.x.0, where x is an integer multiple of 8. The zero subnet is
150.150.0.0, and 150.150.248.0 is the broadcast subnet.
Decimal Algorithm for Deriving the Valid Subnets with Basic and Difficult
Subnetting
CCNAs will need to derive the valid subnets of a network on a regular basis, so a decimal
algorithm to derive the valid subnets--even when difficult subnetting is used--proves
invaluable. With some practice, you can use the following algorithm without pen and paper or
a calculator. This algorithm works only if the subnet field is less than 8 bits. If the subnet field
is larger, you can use a similar algorithm (which is not shown) once you understand this specific
algorithm. The algorithm is as follows:
Step 1
Based on the network number and mask, all subnet bits are in 1
byte. (Having all subnet bits in 1 byte is an assumption used for
this algorithm.) This is the "interesting" byte. Write down which
byte is the interesting byte. The other 3 octets/bytes are considered
"boring."
Step 2
Find the number of host bits in the interesting octet, and call that
number N. 2
N
is called the increment. Record that number.
Table 5-21
Valid Subnet Numbers, 150.150.0.0, Mask 255.255.248.0
Step 2 (only one line shown)
1001 0110 1001 0110
Step 3 (only one line shown)
1001 0110 1001 0110 000 0000 0000
Step 4
1001 0110 1001 0110 0000 0000 0000 0000
150.150.0.0
Step 5
1001 0110 1001 0110 0000 1000 0000 0000
150.150.8.0
Step 6
1001 0110 1001 0110 0001 0000 0000 0000
150.150.16.0
Step 6
1001 0110 1001 0110 0001 1000 0000 0000
150.150.24.0
Step 6
1001 0110 1001 0110 0010 0000 0000 0000
150.150.32.0
Step 6
1001 0110 1001 0110 0010 1000 0000 0000
150.150.40.0
Skipped a few for brevity
Step 6
1001 0110 1001 0110 1111 1111 0000 0000
150.150.248.0
ch05.fm Page 263 Monday, March 20, 2000 5:06 PM