A subnet mask is a 32-bit value that distinguishes the network ID from the host ID for different sub-networks on the same logical network. Like IP addresses, subnet masks consist of four octets in dotted decimal notation. You can use subnet masks to route and filter the transmission of IP packets among your sub-networks. The value “255” is assigned to octets that belong to the network ID, and the value “0” is assigned to octets that belong to the host ID.
For the example above, if you want all the devices on the sub-networks to receive each other’s IP packets, set the subnet mask to 255.255.0.0. If you want the devices on a single sub-network only to receive IP packets from other devices on its own sub-network, set the subnet mask to 255.255.255.0 for the devices on that sub-network.
Subnet Mask Routing and Filtering
0.0.0.0IP packets are transmitted to all devices.
IP packets are only transmitted to devices that are IP that’s first octet
255.0.0.0matches the sender’s IP address’s first octet.
| IP packets are only transmitted to devices that are IP that’s first two |
255.255.0.0 | octets match the sender’s IP address’s first two octets. |
| IP packets are only transmitted to devices that are IP that’s first three |
255.255.255.0 | octets match the sender’s IP address’s first three octets. |