


Subnet masks are used to design subnetworks, or subnets, that connect local networks. It determines both the number and size of subnets where the size of a subnet is the number of hosts that can be addressed.
In simplistic terms, you can create a subnet mask by taking the 32-bit value of an existing IP address, choosing how many subnets you want to create or alternatively, how many nodes you need on each subnet, and then setting all subsequent network bits to "1" and host bits to "0". The resulting 32-bit value is your subnet mask.
A subnet mask also pinpoints the endpoints of the range of IP addresses for a subnet. In any given network, two host addresses are always reserved for special purposes. The "0" address becomes the network address or network identification and the "255" address is assigned as a broadcast address. These cannot be assigned to a host.