What is a subnet mask
The mask makes it possible to split an IP address into network and host parts, sets the size of the subnet, and simplifies routing. In CIDR notation, the mask is expressed as a prefix length (for example, /24 for IPv4 — 255.255.255.0).
When an organization needs additional networks, subnets are created by dividing the host portion of an IP address into smaller subnets. The purpose of the mask is to support this subnetting process.
Without a clear understanding of the mask, it is impossible to properly implement subnetting, organize routing in large DPI-based solutions, or serve a large number of subscribers using a BNG.
How the mask works
The subnet mask performs a logical AND operation between the mask and the IP address, making it possible to determine which subnet a given address belongs to. For example, the mask 255.255.255.0 (/24) provides 256 addresses, of which one is the network address, one is the broadcast address, and the rest are device addresses.
Table of common IPv4 masks:
| Mask | Prefix | Number of addresses | Addresses for hosts |
| 255.255.255.0 | /24 | 256 | 254 |
| 255.255.255.128 | /25 | 128 | 126 |
| 255.255.255.192 | /26 | 64 | 62 |
| 255.255.255.252 | /30 | 4 | 2 |
Applying the mask in networks
Masks make it possible to:
- split large ranges into independent subnets — for branches, services, and clients;
- fine-tune security policies and limit broadcast traffic;
- quickly detect problem areas in the address space during audits and planning.
In modern IPv6 networks, the mask more often appears as a prefix (for example, /64), which further simplifies administration.
Technical FAQ
What is the difference between an IP address and a subnet mask?
An IP address identifies a device on a network, while a subnet mask determines which part of that address belongs to the network and which part belongs to a specific device (host). An IP address and a mask are always used together: without a mask, a device cannot determine whether the recipient is on the same subnet or whether traffic needs to be sent through a router.
How can I find my subnet mask?
You can find your subnet mask in your network connection settings or using system commands. On Windows, the ipconfig command is used; on Linux and macOS, ip addr or ifconfig. Most home networks use the mask 255.255.255.0 (or prefix /24), but corporate and carrier networks may use other values depending on the addressing scheme.
What does the mask 255.255.255.0 mean?
The mask 255.255.255.0 corresponds to the prefix /24 and means that the first 24 bits of the IP address are used for the network identifier, while the remaining 8 bits are used for device addresses. Such a subnet contains 256 IP addresses, of which 254 are typically available for hosts. This is one of the most common addressing schemes in local networks.
How do you calculate the number of subnets?
The number of possible subnets depends on the number of bits allocated for subnetting. If n additional bits are used to divide the network, 2ⁿ subnets can be created. For example, if a /24 network is divided into /26 subnets, two additional bits are used (26 − 24 = 2), resulting in 4 subnets of 64 addresses each. This calculation helps design the address space in advance and avoid IP address conflicts when expanding the network.