Skip to content

Computer networking learning guide

IP Subnetting Visual Guide and Calculator

Learn IPv4 CIDR, subnet masks, network and broadcast addresses, and usable host ranges through a visual subnetting experiment and worked example.

Open the IP subnetting lab

Inspect every address bit, prefix boundary, block, and usable host range.

Start with the model

Concept overview

IPv4 subnetting divides a 32-bit address into a network prefix and a host portion. CIDR notation such as /26 states how many leading bits belong to the prefix. A subnet mask expresses the same boundary in dotted decimal. Once the boundary is known, bitwise comparison identifies the network address, broadcast address, address range, and whether two hosts share a subnet.

The visual lab is designed to make the bit boundary visible instead of turning subnetting into a memorisation trick. Change the prefix one bit at a time and watch the block size halve. Then enter addresses near a boundary to see why similar-looking dotted-decimal values may belong to different networks. The guide uses conventional IPv4 subnet examples; operational networks can reserve additional addresses and point-to-point links have special standards-defined cases.

Concept 1

Prefix length

A /n prefix fixes the first n bits. Increasing the prefix length creates more, smaller subnets; decreasing it creates fewer, larger address blocks.

Concept 2

Block boundaries

A subnet begins where its host bits are all zero. The next subnet begins one block size later, so boundaries follow powers of two rather than decimal intuition.

Concept 3

Routing aggregation

CIDR also lets routers advertise one prefix covering contiguous networks. Aggregation reduces routing-table entries when addresses and prefix boundaries align.

Guided investigation

What changes when /24 becomes /27?

  1. 1Enter 192.168.10.77/24 and record the network, broadcast, and conventional usable-host count.
  2. 2Change only the prefix to /25, /26, and /27; record the block size each time.
  3. 3For /27, locate the two surrounding multiples of 32 in the final octet.
  4. 4Test 192.168.10.94 and 192.168.10.96 and explain why they fall on different sides of a boundary.

Evidence to record

Build a table with prefix, mask, block size, network, broadcast, first host, last host, and conventional usable-host count. Show one final-octet value in binary.

Equations and variables

addresses per block = 2^(32 - prefix)

Counts all IPv4 addresses in a CIDR block.

  • 32: total IPv4 address bits
  • prefix: number of network bits

network = IP bitwise-AND subnet mask

Clears the host bits to identify the network address.

  • IP: 32-bit IPv4 address
  • subnet mask: prefix bits set to 1 and host bits set to 0

Worked example

Apply the model

Find the conventional network, broadcast, and usable range for 192.168.1.70/26.

  1. Step 1: A /26 leaves 6 host bits, so the block size is 2^6 = 64 addresses.
  2. Step 2: Final-octet blocks start at 0, 64, 128, and 192. Address 70 lies in the 64-127 block.

Answer: Network: 192.168.1.64; broadcast: 192.168.1.127; conventional usable range: 192.168.1.65 through 192.168.1.126, giving 62 host addresses.

Misconceptions to test

Common claim

A subnet mask tells you the number of devices already connected.

Correction: The mask defines the address boundary and possible block size. It does not measure how many devices are currently using addresses.

Common claim

Every subnet always loses exactly two usable addresses.

Correction: That is the conventional rule for many broadcast subnets, but standards define exceptions, including /31 point-to-point links and /32 host routes.

Teacher-ready worksheet

IPv4 subnetting practice sheet

  1. 1.Convert one dotted-decimal mask to binary.
  2. 2.Mark the network and host bits for three prefixes.
  3. 3.Calculate network, broadcast, and range for two addresses.
  4. 4.Explain the /31 exception in one sentence.
  5. 5.Design four equal subnets from one /24 and justify the new prefix.

Print or save this page as PDF to use the investigation and worksheet offline.

Knowledge check

Check your understanding

Solve four subnet, DNS, transport, and HTTP questions with immediate verified feedback.

Take the networks knowledge check

Continue learning