## 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. 2N is called the increment. Record that number.

Step 3 Create a list, one entry above the other, that contains repeated copies of the decimal network number. However, leave the interesting octet blank. This will become the list of subnet numbers.

Step 4 In the first number in the list, in the interesting octet, write a decimal 0. This is the first (zero) subnet.

Step 5 For each successive entry in your list of subnets, add the increment to the previous entry's interesting octet value, and record that value in the interesting octet.

Step 6 When 256 is the value to be recorded in Step 5, you have completed the list of subnet numbers.

Two examples of the nonbinary algorithm will be shown. First, Table 5-22 shows the familiar 150.150.0.0, mask 255.255.248.0

Table 5-22 Valid Subnet Numbers, 150.150.0.0, Mask 255.255.248.0

Step 1 Interesting byte is 3

Step 2 Increment 23 = 8

150.150._.0 and so forth

Step 4 150.150.0.0

Step 5 150.150.8.0

150.150.16.0 150.150.24.0 Skipped a few for brevity 150.150.248.0 (This is the last one)

Step 6

150.150.256.0 (This one is invalid)

 Step 1 Interesting byte is 3 Step 2 Increment 22 = 4 Step 3 128.1. .0 128.1. .0 128.1. .0 128.1. .0 128.1. .0 and so forth Step 4 128.1.0.0 Step 5 128.1.4.0 128.1.8.0 128.1.12.0 Skipped a few for brevity 128.1.252.0 (This is the last one) Step 6 128.1.256.0 (This one is invalid)
0 0