.0 – .63.64 – .127.128 – .191.192 – .255.10.77/24/26
Pins: the 32 bits of an address; raised = 1, sunk = 0Pink stencil: the subnet mask, a hole over each 1 bitMat: the home network; coloured tiles are the four /26 subnetsEnvelope: where host A sends the messageHost A (192.168.1.10) on 192.168.1.0/24. Each of the 32 pins is one bit of the address on show: raised = 1, sunk = 0. The pink stencil is the mask 255.255.255.0: a hole over each 1 bit, solid over each 0. All host bits 0 is the network address, all 1 the broadcast; 254 addresses are left for devices. Lowered over a destination, the stencil keeps the network bits and presses the host bits to 0 (address AND mask). Same result as host A's own network: deliver directly. Different: hand it to the router. Lending 2 host bits makes /26 (255.255.255.192): four subnets of 64 addresses, 62 usable each, and host B (192.168.1.77) is now on another one. 192.168.1.0/24 is private RFC 1918 space, the kind a home router hands out; 198.51.100.20 is an RFC 5737 documentation address. Host and router numbers are illustrative.

Bits and masks

  1. Host A's address, 192.168.1.10, is really 32 bits (binary digits, 0 or 1), in four groups of 8 called octets. Each pin is one bit: up means 1, down means 0. So 192 is 11000000.

Same network or not?

Splitting a network

The bits, step by step

;; step 1/10 · address-bits
;; at: address
;; mask /24 = 255.255.255.0
192.168.1.10
11000000.10101000.00000001.00001010
192 = 128 + 64 = 11000000

A bitwise AND keeps a bit only when both bits are 1. Laying the mask over an address does exactly that, so the network part survives and the host part becomes 0 (RFC 1122 §3.3.1). The "minus 2" rule has exceptions: a /31 has no broadcast and uses both addresses on point-to-point links (RFC 3021), and old advice to skip the first and last subnet is obsolete (RFC 1878).