

TCP/IP Subnetting
Copyright (c) Guy Bruneau, 20002001. All rights reserved.
This is an example on how to easily calculate IP addressing and subnetting. We will use the following information:
· Host address is 172.16.2.160
· Subnet mask is 255.255.255.192
Determine the following:
· The subnet mask this host is on.
· The number of bits and host bits this network contains.
· The range of host addresses available on this particular subnet.
· The broadcast address on this subnet.
· The maximum number of subnets available on this network.
Step 1: Convert the host IP address and subnet mask to its binary equivalent and add the two to together to find the Subnet. (1 + 0 = 0, 0 + 0 = 0, 0 + 1 = 0 and 1 + 1 = 1)
Step 2: Now it is time to determine which bits in the address contain the network and subnet mask for this class address would end (dotted line). This example shows a Class B address. The default mask is 255.255.0.0.
Draw a straight line (tick) where the 1's in the mask actually ends. The network and subnet information ends where the 1's in the mask end.
To determine the total number of network and subnet bits, count the number of bits before the tick line. This example contains 26 bits.
To determine the number of subnet bits, count the number of bits between the dotted and tick line. This example contains 10 bits taken from the Class B address to make available more subnets.
To determine the number of host bits, count the number of bits between the tick line and the end of the host address. This example shows 6 hosts bits.
Step 3: This step is used to determine the bit ranges used for subnets and for hosts. The subnet counting range is located between the dotted line and the tick line (increments these bits to make subnet numbers). The host counting range is located between the tick line and the end of the host address.
Step 4: This step is used to determine the range of host addresses and the broadcast address available on this subnet.
The first step consists of copying down all network and subnet bits (all the bits before the tick line).
The second step consists of setting the Least Significant Bit (LSB) in the host counting range to find the first host address on this subnet.
The third step consists of setting all bits in the host counting range except for the LSB to find the last host address on this subnet.
The last step consists of setting all bits in the host counting range to find the broadcast address on this subnet.
The range of host addresses available on this subnet is all the hosts between the first and last host. In this example, the range of host addresses on this subnet is 172.16.2.129 through 172.16.2.190 (inclusive). The broadcast address is 172.16.2.191.

Maximum number of subnets available on this network

To determine the maximum number of subnets available in the above example is determine by how many bits are in the subnet counting range (this example has 10 bits). Use the following formulas to quickly calculate the maximum number of subnets available on a network (2^{10}  2 = 1024 2 = 1022)
Number of Subnet = 2^{n}  2
n = number of subnet bits
Number = 1 that were added
Number of host/subnet = 2^{m}  2
m = number of host bits
Number = 0's in the mask