Home > Resources > Determining All Subnets of a Network—Binary

Determining All Subnets of a Network—Binary

Another common question, typically simply a portion of a more challenging question on the CCIE written exam, relates to finding all subnets of a network. The base underlying question might be as follows:

Given a particular class A, B, or C network, and a mask/prefix length used on all subnets of that network, what are the actual subnet numbers? The answers can be found using binary or using a simple decimal algorithm. This section first shows how to answer the question using binary, using the following steps. Note that the steps include details that are not really necessary for the math part of the problem; these steps are mainly helpful for practicing the process.

Step 1 Write down the binary version of the classful network number; that value is actually the zero subnet as well.

Step 2 Draw two vertical lines through the number, one separating the network and subnet parts of the number, the other separating the subnet and host part.

Step 3 Calculate the number of subnets, including the zero and broadcast subnet, based on 2y, where y is the number of subnet bits.

Step 4 Write down y-1 copies of the binary network number below the first one, but leave the subnet field blank.

Step 5 Using the subnet field as a binary counter, write down values, top to bottom, in which the next value is 1 greater than the previous.

Step 6 Convert the binary numbers, 8 bits at a time, back to decimal.

This process takes advantage of a couple of facts about the binary form of IP subnet numbers:

■ All subnets of a classful network have the same value in the network portion of the subnet number.

■ All subnets of any classful network have binary 0s in the host portion of the subnet number. Step 4 in the process simply makes you write down the network and host parts of each subnet number, because those values are easily predicted. To find the different subnet numbers, you then just need to discover all possible different combinations of binary digits in the subnet field, because that is the only part of the subnet numbers that differs from subnet to subnet.

For example, consider the same class B network 172.31.0.0, with Static Length Subnet Masking (SLSM) assumed, and a mask of 255.255.224.0. Note that this example uses 3 subnet bits, so there will be 23 subnets. Table 4-7 lists the example.

Table 4-7 Binary Method to Find All Subnets—Steps 1 Through 4
 
At this point, you have the zero subnet recorded at the top, and you are ready to use the subnet field (the missing bits in the table) as a counter to find all possible values. Table 4-8 completes the process.

Table 4-8 Binary Method to Find All Subnets—Step 5

The final step to determine all subnets is simply to convert the values back to decimal. Take care to always convert 8 bits at a time. In this case, you end up with the following subnets: 172.31.0.0, 172.31.32.0, 172.31.64.0, 172.31.96.0, 172.31.128.0, 172.31.160.0, 172.31.192.0, and 172.31.224.0.

0 Responses

Comment

Contact Us

86-136-2222-6316
CALL ME NOW

© 2011 CathaySchool, an ANDA Technology Group company, All Rights ReservedPrivacy Policy | Refund Policy | Disclaimer | Sitemap | Resources Tags