What Are the Other Subnet Numbers

The final general type of IP addresing and subnetting question covered in this chapter asks you to list all the subnets of a particular network. You could use a long process, which requires you to count in binary and convert many numbers from binary to decimal. However, because most people would either learn the shortcut or use a subnet calculator in their normal jobs, I decided to just show you the shortcut method for this particular type of question.

First, the question needs a better definition—or, at least, a more complete one. The question might be better stated like this:

If the same subnet mask is used for all subnets of this Class A, B, or C network, what are the valid subnets?

IP design conventions do not require the engineer to use the same mask for every subnet. Unless specifically stated, the question "What are all the subnets?" probably assumes that the same mask is used for all subnets, unless the question specifically states that different masks can be used on different subnets.

The following easy decimal process lists all the valid subnets, given the network number, and the only mask used on that network. This three-step process assumes that the size of the subnet part of the address is, at most, 8 bits in length. The same general process can be expanded to work when the size of the subnet part of the address is more than 8 bits, but that expanded process is not described here.

The three-step process uses a chart that I call the subnet list chart. I made up the name just for this book, simply as another tool to use. Table 12-31 presents a generic version of the subnet list chart.

 Octet 1 2 3 4 Network number Mask Subnet zero First subnet Next subnet Last subnet Broadcast subnet

You list the known network number and subnet mask as the first step in the process. If the question gives you an IP address and mask instead of the network number and mask, just write down the network number of which that IP address is a member. (Remember, this three-step process assumes that the subnet part of the addresses is 8 bits or less.)

For the second of the three steps, copy the network number into the row labeled "Subnet Zero." Subnet zero, or the zero subnet, is numerically the first subnet, and it is one of the two reserved subnet numbers in a network. (You can use the zero subnet on a Cisco router if you configure the global configuration command ip zero-subnet.) Interestingly, a network's zero subnet has the exact same numeric value as the network itself—which is one of the reasons that it should not be used. For the purposes of answering questions on the exam about the number of valid subnets in a network, consider the zero subnet unusable unless the question tells you that using it is ok. In real life, do not use the zero subnet if you do not have to.

The third step in the process will be covered after Tables 12-32 and 12-33, which list two familiar examples, with the first two steps completed.

 Octet 1 2 3 4 Network number 130 4 0 0 Mask 255 255 255 0 Subnet zero 130 4 0 0
 Octet 1 2 3 4 Network number 130 4 0 0 Mask 255 255 252 0 Subnet zero 130 4 0 0

The last step in this process, Step 3, is repeated many times. This last step uses the magic number, which is 256 minus the mask octet value in the interesting octet. With this process of finding all the subnet numbers, the interesting octet is the octet that contains all of the subnet part of the addresses. (Remember, the process assumes 8 or fewer subnet bits!) In both Tables 11-32 and 11-33, the interesting octet is the third octet.

The third and final step in the process to find all the subnet numbers goes like this: Starting with the last row that's completed in the table, do the following:

a. Because this process assumes 1 byte or less in the subnet part of the addresses, on the next row of the table, copy down the three octets that are not part of the subnet field. Call the octet that is not copied down the "subnet octet" or "interesting octet."

b. Add the magic number to the previous subnet octet, and write that down as the value of the subnet octet.

c. Repeat the last two tasks until the next number that you would write down in the subnet octet is 256. (Don't write that one down—it's not valid.)

The idea behind the process of finding all the subnets becomes apparent by reviewing the same two examples used earlier. First, Table 12-34 lists the example with the easy mask. Note that the magic number is 256 - 255 = 1 in this case, and that the third octet is the interesting subnet octet.

 Octet 1 2 3 4 Network number 130 4 0 0 Mask 255 255 255 0 Subnet zero 130 4 0 0 First subnet 130 4 1 0 Next subnet 130 4 2 0 Next subnet 130 4 3 0 Next subnet 130 4 4 0 (Skipping a bunch) 130 4 X 0 Last subnet 130 4 254 0 Broadcast subnet 130 4 255 0

The logic behind how the process works might be better understood by looking at the first few entries and then the last few entries. The zero subnet is found easily because it's the same number as the network number. The magic number is 256 - 255 = 1, in this case. Essentially, you increment the third octet (in this case) by the magic number for each successive subnet number.

In the middle of the table, one row is labeled "Skipping a Bunch." Instead of making the book even bigger, I left out several entries but included enough that you could see that the subnet number's third octet just gets bigger by 1, in this case, for each successive subnet number.

Looking at the end of the table, the last entry lists 255 in the third octet. 256 decimal is never a valid value in any IP address, and the directions said to not write down a subnet with 256 in it, so the last number in the table is 130.4.255.0. The last subnet is the broadcast subnet, which is the other reserved subnet number. The subnet before the broadcast subnet is the highest, or last, valid subnet number.

With a simple subnet mask, the process of answering this type of question is very simple. In fact, many people might even refer to these subnets using just the third octet. If all subnets of a particular organization were in network 130.4.0.0, with mask 255.255.255.0, you might say simply "subnet five" when referring to subnet 130.4.5.0.

The process works the same with difficult subnet masks, even though the answers are not as intuitive. Table 12-35 lists the answers for the second example, using a mask of 255.255.252.0 The third octet is again the interesting subnet octet, but this time the magic number is 256 - 252 = 4.

 Octet 1 2 3 4 Network number 130 4 0 0 Mask 255 255 252 0 Subnet zero 130 4 0 0 First subnet 130 4 4 0 Next valid subnet 130 4 8 0 Skip a lot 130 4 X 0 Last subnet 130 4 248 0 Broadcast subnet 130 4 252 0

The first subnet number numerically, the zero subnet, starts the list. By adding the magic number in the interesting octet, you find the rest of the subnet numbers. Like the previous example, to save space in the book, many subnet numbers were skipped.

Most of us would not guess that 130.4.252.0 was the broadcast subnet for this latest example. However, adding the magic number 4 to 252 would give you 256 as the next subnet number, which is not valid—so, 130.4.252.0 is indeed the broadcast subnet.

The three-step process to find all the subnet numbers of a network is shown here:

1. Write down the network number and subnet mask in the first two rows of the subnet list chart.

2. Write down the network number in the third row. This is the zero subnet, which is one of the two reserved subnets.

3. Do the following two tasks, stopping when the next number that you would write down in the interesting column is 256. (Don't write that one down—it's not valid.)

a. Copy all three noninteresting octets from the previous line.

b. Add the magic number to the previous interesting octet, and write that down as the value of the interesting octet.

0 0