What is Subnet mask?
A 32-bit value that shows how many upper bits of an IP address represent the network (the network part). Written like 255.255.255.0, which means the same as /24 in CIDR notation.
Japanese name: サブネットマスク
Subnet mask appears in 7 practice questions across 1 topic, including Computer Networking Basics.
Field: Computer Networking Basics
Calculating how many hosts fit
With h host bits there are 2^h addresses, but the network address (host part all 0s) and the broadcast address (host part all 1s) cannot be assigned to devices, so 2^h − 2 are usable. For example, 255.255.255.192 (/26) has 6 host bits, giving 64 − 2 = 62, and 255.255.254.0 (/23) has 9 host bits, giving 512 − 2 = 510.
FAQ
How many hosts can a 255.255.255.0 subnet mask hold?
The host part is 8 bits, so 2^8 − 2 = 254. The network address (ending in 0) and the broadcast address (ending in 255) cannot be assigned to devices.
How do you find the network address from a subnet mask?
AND the IP address and the subnet mask bit by bit. For 192.168.10.77 with 255.255.255.224, the fourth octet becomes 77 AND 224 = 64, so the network address is 192.168.10.64.