Subnet Mask: The Number That Changes Which Addresses Are Local
A subnet mask marks which part of an address identifies the network and which part identifies an individual connection within it. It helps a computer determine which other addresses belong to its local group, called a subnet.
The examples here use Internet Protocol (IP) version 4, or IPv4. An IP address is a numerical network address.
An address such as 192.168.10.20 doesn't tell you that group's size by itself. The same address paired with one mask can treat 192.168.10.200 as local; paired with another, it can place that destination outside the local subnet.
What the mask is counting
IPv4 addresses contain 32 bits. A bit is a zero or a one, and those bits are displayed to people as four decimal numbers separated by dots.
A mask also has 32 bits. In the masks used here, a run of ones marks the leading network portion, called the prefix. The remaining zeros mark the part available for addresses within that network. Cisco's explanation of addresses and subnets describes this division.
Subnetting Starts Making Sense Right Here
The mask 255.255.255.0 contains 24 leading one bits. That's why it's also written as /24. It leaves eight bits for the remaining address portion. Each of those eight positions can be zero or one, producing 256 combinations.
With the example address 192.168.10.20/24, the first three decimal numbers identify the network. The full address range runs from 192.168.10.0 through 192.168.10.255.
One more network bit makes a smaller group
Changing the mask to 255.255.255.128 makes it /25. One more bit now belongs to the network portion, leaving seven bits and 128 address combinations. The former /24 range divides into two groups: .0 through .127, and .128 through .255.
Our example computer, ending in .20, belongs to the first group.
| Address and mask | Full local subnet range | Ordinary device addresses in that range |
|---|---|---|
| 192.168.10.20/24 | 192.168.10.0–192.168.10.255 | 192.168.10.1–192.168.10.254 |
| 192.168.10.20/25 | 192.168.10.0–192.168.10.127 | 192.168.10.1–192.168.10.126 |
In these examples, the first address identifies the network itself. The last is its broadcast address, used to address the subnet as a group. Those two addresses aren't ordinary device addresses, so the /24 offers 254 of those and the /25 offers 126.
Subtracting two isn't a universal rule for every network. A /31 point-to-point link, connecting just two ends, can use both of its addresses for those ends. These calculations also concern IPv4; IPv6 has different addressing rules.
- Give every phone, laptop and TV a steadier connection with Wi-Fi 6.
- Stop the buffering at busy hours, with room for many devices at once.
- Replace an aging router and get stronger coverage across more of your home.
Why the boundary changes the journey
For the .20 computer with a /24 mask, destination .200 falls inside the same subnet. With a /25 mask, .200 is outside it. In an ordinary local-network setup, reaching that destination now requires a router to forward traffic beyond the local group.
A configured gateway can provide that next stop. The mask defines the address boundary; it doesn't supply the route or assign addresses to other devices.
This explains why changing a mask is more than changing a number in a settings box. The computer may keep its own address while making a different decision about where another address belongs.
IP Addresses: Why Your Device Can Have More Than One

IP Forwarding: How a Packet Finds Its Next Stop

Private Addressing: Why Separate Networks Can Reuse IP Numbers

QUOTE:
"Amateurs hack systems, professionals hack people."
