Share our tools:



 

Step 3: Subnet Masking

If you finished step 1 and 2, you now know that every IP address consists of 4 octets, 8 bits each and that every IP address, depending on the Class, is separated into a network part and a hosts part.

When working with big network environments like the internet or major WAN's (Wide Area Networks), the standard type of addressing can deplete the number of available IP addresses quickly. This is caused by i.e. the limitation of topologies, which is the number of host per segment. The standard addressing of a Class A network, would allow for 126 networks of 16,777,214 hosts. This makes a total of 2,113,928,964 (2 billion) hosts. For a network like the internet, neither the number of hosts or the number of networks is enough.

For this problem, subnetting can be a solution. Subnetting uses the available host bits and divides this part into a subnet part and a hosts part. So, the IP address is split up in a network, subnet and host part. This is used for administrative ease, i.e. by giving every department or geographical location it's own subnet. It also allows for mixing of different technologies such as Token Ring and EtherNet. Another advantage is the reduction of network traffic by segmenting the network.

The bits / octet for determining the subnet are located at the following positions (Bold marks the spot):

Class      Location of subnets octet
 A               W.X.Y.Z
 B               W.X.Y.Z
 C               W.X.Y.Z


Subnetting, or splitting the hosts part, is possible by defining a subnet mask. To start your way in determining the subnet mask that is most suitable for you, determine the number of required subnets. Possible number of subnets are none, 2, 6, 14, 30, 62, 126 or 254. Convert the number of required subnets to binary. For example:

30 subnets = 00011110

Now, count from right to left the numbers until you reach the last bit set to one. In this case that is five bits. To form a subnet from this number, apply the number of bits on the subnet mask, from left to right. So, that would look like this:

5 bits from left to right = 11111000 binary = 248 in decimal.

By coverting the outcome to decimal value, you have determined the subnet mask bits. for a Class B IP address, to obtain 30 subnets, the subnet mask would be 255.255.248.0

A much faster way is to consult a list that shows you the right mask for the possible subnets, shown per Class, like the following list:

Class A Table

Subnets  Binary       Mask            Hosts
0        10000000     255.128.0.0     Invalid subnet
2        11000000     255.192.0.0     4,194,302
6        11100000     255.224.0.0     2,097,150
14       11110000     255.240.0.0     1,048,574
30       11111000     255.248.0.0     524,286
62       11111100     255.252.0.0     262,142
126      11111110     255.254.0.0     131,070
254      11111111     255.255.0.0     65,534



Class B Table

Subnets  Binary       Mask              Hosts
0        10000000     255..255.128.0    Invalid subnet
2        11000000     255.255.192.0     16,382
6        11100000     255.255.224.0     8,190
14       11110000     255.255.240.0     4,094
30       11111000     255.255.248.0     2,046
62       11111100     255.255.252.0     1,022
126      11111110     255.255.254.0     510
254      11111111     255.255.255.0     254



Class C Table

Subnets  Binary       Mask                Hosts
0        10000000     255.255.255.128     Invalid subnet
2        11000000     255.255.255.192     62
6        11100000     255.255.255.224     30
14       11110000     255.255.255.240     14
30       11111000     255.255.255.248     6
62       11111100     255.255.255.252     2
126      11111110     255.255.255.254     Invalid subnet
254      11111111     255.255.255.255     Invalid subnet



The different Classes all contain one or more invalid subnet remarks. These options are invalid because when used they would give all one's or all zero's. All one's or all zero's is not possible, because when ANDed, they would leave no subnet, or no hosts. Try to AND one of the Invalid subnet options and see what happens.

It is a general rule that the network and the hosts ID can not be all zero, which would indicate the 'Local network', or cannot all be one, which would indicate the broadcast address.