Netmask

A Netmask consists of a 32-bit mask that is used to divide an IP address into subnets and specify the network's available hosts. With this netmask, two bits are always automatically assigned.[1] This term is also used to define the class and range of the Internet Protocol addresses. It provides the available number range of IP addresses from class A to class C, and it also specifies a mask to divide these networks into sub-networks or also known as subnets. Most of the time, netmask and subnet are used alternatively.[2] The fact is that subnets are created after the application of netmask. This subnet mask is used primarily for network configurations, while netmask typically refers to the classes of IP addresses. Both of them are used to define a range of IP addresses that can be used by an ISP or other organization.[3]

Furthermore, the netmask, together with the IP address defines the network that the computer belongs to, that is which other IP addresses the computer can touch directly in the same LAN.[4]

Functionality

A netmask is a combination of 0's, and 1's that function to screen out the portion of the IP address containing the network code, This ensures that the only visible part would be the host address.[5] The first part containing the 1's will turn the network ID part of the IP address into '0's. The binary '0's that follow will allow the host ID to remain. A frequently used netmask is 255.255.255.0. (This 255 is the decimal equivalent of a binary string to eight ones.) Netmask typically provides a method to create a small subnetwork from an extensive range of IP addresses. Generally, the netmask length is defined in up to 24-bit format for all types of IP classes. According to the class of IP address that will be used along with their available netmasks, a division of the networks is done as follows:

  • 255.0.0.0 - Class A (8-bit netmask)
  • 255.255.0.0 - Class B (16-bit netmask)
  • 255.255.255.0 - Class A (24-bit netmask)

With this, it can be implied that the higher the length of the netmask then the more networks it can accommodate. Thus, the number of hosts decreases from Class A to Class C, whereas the number of available systems or subnetworks increases.[3:1]

  • For Class A, the netmask defines a range of IP addresses in which the very first three digits section is the same, but on the other parts may each contain any number that is between 0 and 255.
  • For Class B, the addresses have the same first two sections; however, there can be variations to set of numbers that are in the second set of 2 sections.
  • For Class C, the addresses have the same first three sections, and only the last section can have different numbers. Thus, a class C IP address range may contain up to 256 addresses.

Moreover, typically, a netmask is just a 32-bit value that is commonly used to divide sections of IP addresses. While a Class C netmask is frequently written "255.255.255.0," it can also be defined as 11111111.11111111.11111111.00000000. This binary representation reveals the 32 bits that make up the netmask. It can also be seen the way the netmask masks the IP addresses it contains. The section which has all the '1's are predefined, and it cannot be changed, on the other hand, the part with all the '0's can be any number between 0 and 255.

Netmask Reading

The one on the left-hand side of a netmask (eg, 196 . 345 . 0 . 1) specifies the host address while the right-hand side defines (e.g.,/ 35) how many digits of the host addresses are significant when considered as the binary numbers.[6] Non-significant bits in the binary form are regarded as a wild card. In some instances, in the netmask 196.345.0.1/ 35, the host address is the 196.345.0.1 and this can be written in the form of a binary as 110000.10101000.11111111.00000001. To match the netmask, the address should have match precisely the 32 digits. It only means that this pattern will match one address. The netmask 196.345.0.1/ 35 means that the last binary digit is insignificant, so will match the two addresses:

110000.10101000.11111111.00000000. Hence, similarly, 196.345.0.1/33 means that the previous two numbers are irrelevant and will match the four different addresses.

The internet is composed of different and many networks that are run by several organizations. With this, each of the 'organization's networks are composed of many smaller systems or called the subnets. With the help of each subnet, it allows its connected devices to be able to communicate with each other, and routers will be used to communicate between the subnets. The size depends on the connectivity requirements and the type of network technology that will be employed. Therefore, the netmask is considered as shorthand for referring to ranges of consecutive IP addresses in the Internet Protocol.


  1. https://www.computerhope.com/jargon/n/netmask.htm ↩︎

  2. https://www.techopedia.com/definition/5376/netmask ↩︎

  3. https://techterms.com/definition/netmask ↩︎ ↩︎

  4. https://faqintosh.com/risorse/en/guides/net/tcp/basic/ ↩︎

  5. https://searchmicroservices.techtarget.com/definition/netmask ↩︎

  6. https://www.hacksplaining.com/glossary/netmasks ↩︎