What a subnet mask actually does

No formulas needed. Build one intuition first: a mask is a ruler used to split addresses.

1. An IP address is 32 bits

192.168.1.10 is just a human-readable form. The computer sees 32 zeros and ones, grouped in eights. In binary that is 11000000.10101000.00000001.00001010.

2. The mask splits street from house number

The mask 255.255.255.0 is 24 ones followed by 8 zeros. The first 24 bits identify the network (the street), the last 8 identify the host (the house). That is why it is also written /24.

Addresses on the same street share the network bits; the host bits run from all zeros to all ones. All-zeros is the network address, all-ones is the broadcast address. Neither can be assigned to a device, so a /24 has 256 addresses but only 254 usable hosts.

3. Subnetting borrows bits from the host part

Changing /24 to /26 borrows 2 host bits for the network. You get 4 smaller subnets of 64 addresses each, 62 usable. The number of pieces is always a power of two: 2, 4, 8, 16…

4. The two things people trip over

  • Forgetting powers of two — use the powers and bit weights table.
  • Forgetting the −2 — usable hosts = total − 2, except /31 and /32.

5. A suggested path

  1. Calculate an existing subnet with the IPv4 subnet calculator and read each field.
  2. In the mask converter, type “need 50 hosts” and see why it recommends /26.
  3. Scan the mask cheat sheet from /24 to /30 until it feels familiar.

Do not study wildcard masks yet. When you configure an ACL, copy from the wildcard scenarios table once and it clicks.