background image
252 Chapter 5: Network Protocols
Decimal Algorithm for Deriving the Subnet Number, Difficult Subnetting
The decimal algorithm that I like best for difficult subnetting works well. However, this
algorithm is not very helpful for understanding subnetting. So, if you understand subnetting and
are willing to use the more time-consuming binary algorithm on the exam for the difficult cases,
you may want to skip this section to avoid getting confused. The algorithm is as follows:
Step 1
Write down the IP address in decimal.
Step 2
Write down the mask in decimal.
Step 3
Examine the mask. One of the four octets will have a value besides
255 or 0; otherwise, this would not be considered to be a difficult
case. The octet with the non-255, non-0 value is considered to be
the "interesting" octet. The other three are considered "boring."
Write down the number (1, 2, 3, or 4) of the interesting octet. (For
example, mask 255.255.240.0 has an interesting third octet.)
Step 4
Subtract the mask's interesting octet value from 256. Call that
value the multiplier. Write it down.
Step 5
For any boring octets to the left of the interesting octet, copy those
octets' values onto your paper, leaving space for the remaining
octets. This will be where you record your subnet number.
Step 6
For any boring octets to the right of the interesting octet, record a
value 0 in your subnet number. One of the four octets should still
be empty--the interesting octet.
Step 7
Examine the interesting octet of the original IP address. Discover
the multiple of the multiplier closest to this number, but less than
the number. Write down this interesting multiple of the multiplier
into the interesting octet of the subnet number.
For those of you in doubt, examine the examples that follow. In each case, the steps in the
algorithm are shown. The crux of the algorithm is to search for the integer multiple of the
multiplier that is close to, but less than, the value in the interesting octet of the IP address.
Address (Step 1)
172.100.201.2
1010 1100 0110 0100 1100 1001 0000 0010
Mask (Step 2)
255.255.254.0
1111 1111 1111 1111 1111 1110 0000 0000
Result (Steps 3 and 4)
172.100.200.0
1010 1100 0110 0100 1100 1000 0000 0000
Address (Step 1)
17.9.44.70
0001 0001 0000 1001 0010 1100 0100 0110
Mask (Step 2)
255.255.255.192
1111 1111 1111 1111 1111 1111 1100 0000
Result (Steps 3 and 4)
17.9.44.64
0001 0001 0000 1001 0010 1100 0100 0000
ch05.fm Page 252 Monday, March 20, 2000 5:06 PM