A netmask is a mask used to divide an IP address into subnets and specify the number of available host addresses in the subnet.

The netmask consists of a 32-bit sequence on the format

There are three commonly used network classes:

Class Netmask length # of networks Number of hosts Netmask
Class A 8 126 16777214
Class B 16 16382 65534
Class C 24 2097150 254

The last 0 and 255 in a sequence are always assigned and cannot be used as host addresses.

For example, in, 0 is the assigned network address.

In, 255 is the assigned IPv4 broadcast address.