A subnet mask splits an IP address, such as
255.255.255.0, into its host and network addresses. The bits (digits) in a subnet mask indicate the number of bits allotted to the network’s address and the number of bits available for host addresses in the network.
In the example subnet mask
255.255.255.0, the first three octets indicate that the first 24 bits of the IP address make up the network’s address and the remaining eight bits have been allotted to host addresses on the network. In this case, the network has 255 available IP addresses to assign to devices. In this example, the first 24 bits of the subnet mask blocks out or masks the network address to determine where the network address ends and where the block of host addresses begin in a network.
The prefix length or prefix is the subnet mask equivalent for IPv6 networks. The prefix represents the number of bits of the address that represent the network address. For example, the IPv6 address
1999:1ab2:bbbb:2222::::100:/64 has a prefix length of
/64, which is the first 64 bits of the IPv6 address (
A subnet mask also defines the used range of IP addresses within a network.