Skip to the workspace
Pebellslearn by building
Subnetting  ›  Lesson

Subnet Masks

Subnet Masks 16 minA subnet mask's 1 bits mark the network part of an address and its 0 bits mark the host part, giving two to the power of the host bits minus two usable hosts.

network engineer / Subnet Masks

Explore each scene at your own pace.

01 · The rule

The rule

Subnet Masks

Kite Studio has outgrown one flat network: guests on the Wi-Fi can see the file server, and the printer is drowning in broadcasts. The fix is to split 192.168.10.0 into smaller subnets. Every subnet plan rests on one small tool, the subnet mask, which tells a device which part of an address names the network and which part names the host.

The rule

Mask ones mark the network; mask zeros count the hosts.

A subnet mask is 32 bits, like an IPv4 address: a run of 1s followed by a run of 0s. Where the mask has 1s, the address bits are the network part; where it has 0s, they are the host part.

Address  192.168.10.57   11000000.10101000.00001010.00111001
Mask     255.255.255.0   11111111.11111111.11111111.00000000
Network  192.168.10.0    (keep the bits where the mask is 1)

With hh host bits there are 2h2^h addresses in the subnet, and two are reserved:

  • network address — all host bits 0 (192.168.10.0), the name of the subnet;
  • broadcast address — all host bits 1 (192.168.10.255), "everyone on this subnet".

So usable hosts = 2h−22^h - 2. Kite Studio's 255.255.255.0 has 8 host bits: 256 addresses, 254 usable, .1 to .254.

A mask octet can only be one of nine values, because the 1s must be continuous from the left:

1-bits in the octet 0 1 2 3 4 5 6 7 8
Octet value 0 128 192 224 240 248 252 254 255
Scene 1 of 5
Hover to wake the cannons. Drag to move, or use arrow keys when focused. Press Enter to fire a shot.