Understanding Subnet Mask


Subnet mask is an important component of networking. Subnet mask is kind of the component which activates the network. Without subnet mask the IP address cannot start communicating logically. In networking subnet mask defines the network and the size of the network. If we classify a network then we also classify that depending on subnet mask.  Like

Class A:

Class B:

Class C:

Class A subnet mask is 8bit. Class B subnet mask is 16bit and class C subnet mask is 24bit.

If we don’t use subnet mask properly then it will be difficult to communicate between two hosts. What are the possible problems we may face if the subnet mask is incorrect!

  1. Source host may not be able to find the destination host.
  2. Remote hosts will not be able to find the host into a local network.
  3. The hosts within the local network may not be able to recognize the host.
  4. In case of ping we will find request time out.

Let’s discuss about how it works! It works using AND process. Suppose we assume source IP address is

So the subnet mask is

Destination IP is

Also the subnet mask is

If we convert them into binary then the IP address will be:


Subnet mask will be:


So if we use AND process the network is


Now desitination IP is, if we convert this into binary then we get:


Subnet mask is:


AND process result of this network is


So from the above result we can find that the last part of the results are same which means that the last part is the network part the rest is network part. Using this result we can find the network part and we can understand if the network is in local network or not. If the last part does not match then the traffic will go through the default gateway.

This is how the subnet mask works.

Leave A Reply

Your email address will not be published.