Netmask primarily provides a method to create small subnetworks from a large range of IP addresses. Generally, netmask length is defined in up to 24-bit format for all types of IP classes. The division or creation of networks into subnetworks depends on the class of IP address in use along with their available netmasks. For example, the netmasks for the three IP classes are:
255.0.0.0 for Class A with an 8-bit netmask
255.255.0.0 for Class B with a 16-bit netmask
255.255.255.0 for Class A with a 24-bit netmask
The greater the length of netmask the more networks it can accommodate. Therefore, the number of hosts decreases from Class A to Class C, whereas the number of available networks or subnetworks increases.