How to Count Subnets
Conserve IP (Internet Protocol) addresses and optimize communication on a TCP/IP (Transmission Control Protocol/Internet Protocol) version 4 networks by dividing IP address ranges into smaller network groups or "subnets" which will decrease network broadcast traffic and minimize the number of unused IP addresses. Know how to count the number of subnets that a subnet mask affords so subnets created have enough IP addresses to support a few more than all the hosts planned in each subnet. Use binary to decimal conversion and IP network classes to gain an understanding of how to count subnets.
Instructions
-
-
1
Write the following binary subnet mask number on a blank piece of paper and write the equivalent decimal number below the binary number:
11111111.11111111.11111111.00000000
255 255 255 0
Note that IP addresses and subnet masks are binary numbers (base 2) that can be represented by decimal numbers (base 10) by adding the values assigned to the position of each "1" in a section or "octet" when reading from right to left. Zeros in the binary representation of IP addresses always have a value of "0." Consider the first section or "octet" of eight digits on the left of an IP address as the network number (the IP address for a single network) for "Class A" IP addresses which always have a first "octet" value ranging in value from "1" to "126." Regard the first two "octets" from the left as the network number for "Class B" IP addresses which always have a first "octet" value ranging from "128" to "191." Consider the first three "octets" from the left as "Class C" IP addresses (as displayed above) which always have a first "octet" value ranging from "192" to "223."
-
2
Replace the left most "0" in the right most "octet" of the binary "Class C" subnet mask with a "1" and change the "0" below the last "octet" to "128" as displayed below:
11111111.11111111.11111111.10000000
255 255 255 128
Note the value of the position where you replaced the "0" with a "1" is "128" and also that changing the "0" to a "1" adds that binary value and position to the subnet mask and network address and removes that binary value and position from the host portion of the address. Note that the host portion of an IP address is represented by the binary digits at the end of the IP address that are not included in the subnet mask nor network number.
-
-
3
Replace the next "0" to the right with a "1." Note the value of position where you just replaced a "0" with a "1" is "64." Add "64" to "128" and place the sum (which is 192) below the fourth octet. Note the emerging pattern where the value of each binary position is half of the value of the previous position counting from the left and twice the value of the previous position counting from the right.
-
4
Write the following table of "Class C" subnet mask numbers and values on a piece of paper:
Binary Last Octet---Subnet Mask-------Subnets
00000000-----------255.255.255.0------------1
10000000-----------255.255.255.128---------2
11000000-----------255.255.255.192---------4
11100000-----------255.255.255.224---------8
11110000-----------255.255.255.240---------16
11111000-----------255.255.255.248---------32
11111100-----------255.255.255.252---------64
11111110-----------255.255.255.254--------128
11111111-----------255.255.255.255--------256
Note that value of the last octet when counting binary from the right to left is the value reflected in the decimal subnet mask and also note that the number of subnets is equal to value derived when counting binary from left to right.
-
5
Count subnets by first identifying the IP address as Class A, B, or C. Determine the binary "1" digits in the subnet mask that are to the right of IP Class standard subnet mask. Add the positional values (counted from right to left) of each additional subnet mask binary digit to determine the number of subnets available in a given subnet mask.
-
1
References
- Photo Credit Ablestock.com/AbleStock.com/Getty Images