One IPv4 address bit by bit, its decimal values typed in place, with up to three barriers splitting it into subnets, and under it its network address, the address itself and its broadcast address, drawn the same way.
An address and a prefix length divide 32 bits in two: the network bits, left of the prefix, and the host bits right of it.
Splitting a network moves that line to the right.
- The workspace, at the top, holds one address: type its decimal values, flip its bits, and move its barriers.
- Under it, Original Network shows the network address, the address itself and the broadcast address inside the last barrier.
- First Split and Second Split show the subnets the second and third barriers make.
- The
Subnet Trainer drills an address's type, plus its class.
The workspace
The workspace stays at the top: the address in four octets, and the barriers between its bits.
- An octet:
- Its decimal value on top, a field to type a number from 0 to 255 into.
- Its 8 bits under it, each flipped by a click; the decimal value follows.
- No class D or E address: a first octet of 224 or more turns the field red, and a bit that would make one does not flip.
- A barrier:
- A dark line between two bits.
- Barrier 1 is the prefix.
- A click on an empty gap adds a second and a third, which split the network.
- A click on an added barrier removes it.
- The colour of a bit:
- The region between two barriers it falls in, bolder to the right: grey, blue, orange, deep orange.
- Moving a barrier:
- Every barrier drags, between its neighbours.
- Selecting an address:
- A click on any address selects it; a line inside it then gives its type, network, broadcast and usable hosts inside its last barrier.
- mask at the end of that line shows the mask inside it, as a second address: 1s up to the last barrier, 0s after it.
- Its bits sit under the address's bits: where the mask has a 1 the network bit is the address's bit, where it has a 0 the network bit is 0.
- A click again unselects it.
- Original Network:
- The network address, all host bits 0.
- The address itself, titled by its type: host, network or broadcast.
- The broadcast address, all host bits 1.
- First Split, shown with a second barrier:
- One network address per subnet barrier 2 makes: 2^k of them, for the k bits between barriers 1 and 2.
- A click on an empty gap right of barrier 2 adds a third barrier, in one of them at a time.
- Second Split, shown with that third barrier:
- The subnets it makes of that one subnet, by the same rule.
The method
Every answer is the same few moves on the bits.
- The type of an address:
- The host bits, right of the prefix, decide it.
- All zeros: the network address.
- All ones: the broadcast address.
- Any mix: a host.
- A split into N equal subnets:
- N is a power of two, 2^s.
- The prefix grows by s bits: s = 1 for 2 subnets, 2 for 4, 3 for 8, 4 for 16.
- Subnet K, counted from 1, has K − 1 in binary in those s bits, and zeros after them.
- The mask:
- A 1 for every bit left of the prefix and a 0 for every bit right of it, read as four octets.
- /29 is 255.255.255.248: the last octet is
11111000.
- The usable hosts:
- h host bits make 2^h addresses.
- The network and broadcast addresses are not usable: 2^h − 2 remain.
- The first is the network address + 1, the last the broadcast address − 1.
A worked example
The page opens with 175.38.229.194/26.
- The address:
- The last octet, 194, is
11000010; barrier 1 at /26 leaves 6 host bits: 000010. - A mix: a host.
- Network
175.38.229.192, broadcast 175.38.229.255, hosts .193 to .254: 2^6 − 2 = 62.
- Split into 4, take the 3rd:
- 4 = 2^2: click the gap at /28, which adds barrier 2 there.
- First Split shows the four subnets.
- 3 − 1 = 2 is
10: Subnet 3 has 10 in the two bits between the barriers and 0 after them, 175.38.229.224.
- Split that into 2, take the 2nd:
- 2 = 2^1: in Subnet 3, click the gap at /29, which adds barrier 3 there.
- Second Split shows its two subnets; 2 − 1 = 1 is
1: Subnet 3.2 is 175.38.229.232. - Selecting it gives broadcast
.239 and 6 usable hosts, .233 to .238; its mask is 255.255.255.248. - The last octet with its barriers:
11 | 10 | 1 | 000.