TCP/IP Subnetting

 Copyright (c) Guy Bruneau, 2000-2001. 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.

 

 

Addressing Summary Example

172.16.2.160

10101100

00010000

00000010

10 100000

Host

255.255.255.192

11111111

11111111

11111111

11 000000

Mask

172.16.2.128

10101100

00010000

00000010

10 000000

Subnet

172.16.2.191

10101100

00010000

00000010

10 111111

Broadcast

172.16.2.129

10101100

00010000

00000010

10 000001

First

172.16.2.190

10101100

00010000

00000010

10 111110

Last

 

 

 

  10 bits ®

Subnet Counting Range

Host Counting Range

 

 

Maximum number of subnets available on this network

 

No. Bits

Subnet Mask

No. Subnets

No. Hosts

2

255.255.192.0

2

16,382

3

255.255.224.0

6

8190

4

255.255.240.0

14

4094

5

255.255.248.0

30

2046

6

255.255.252.0

62

1022

7

255.255.254.0

126

510

8

255.255.255.0

254

254

9

255.255.255.128

510

126

10

255.255.255.192

1022

62

11

255.255.255.224

2046

30

12

255.255.255.240

4094

14

13

255.255.255.248

8190

6

14

255.255.255.252

16,382

2

 

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 (210 - 2  = 1024 -2  =  1022)

 

Number of Subnet = 2n - 2

            n = number of subnet bits

            Number = 1 that were added

 

Number of host/subnet = 2m - 2

            m = number of host bits

            Number = 0's in the mask