Home/Blog/CCNA & IPv4
12 min readReviewed

IPv4 and subnetting: calculate networks with CIDR

Work out network addresses, broadcasts, host ranges and prefix lengths, then plan subnets around actual requirements.

What you will take away

Knowledge you can put to work.

  • Calculate network, broadcast and host ranges from CIDR
  • Use block sizes and binary boundaries to plan subnets
  • Allocate VLSM without overlap and with justified reserve

A CIDR prefix identifies network bits; the remaining bits define the address block. Calculate its valid boundary, broadcast and usable range, then allocate VLSM networks from largest to smallest and verify the result.

IPv4 addresses and masks

IPv4 addresses contain 32 bits, displayed as four eight-bit decimal octets. For example, 192.168.10.1 is 11000000.10101000.00001010.00000001 in binary. A subnet mask contains network ones followed by host zeroes; CIDR records the number of network bits.

In an ordinary IPv4 LAN, /8 (255.0.0.0) has 16,777,214 usable host addresses; /16 (255.255.0.0) has 65,534; /24 (255.255.255.0) has 254; /30 (255.255.255.252) has two. These counts reserve the network and broadcast addresses.

  • RFC 1918: 10.0.0.0–10.255.255.255 (/8), used in many company networks.
  • RFC 1918: 172.16.0.0–172.31.255.255 (/12), also encountered in container and cloud networks.
  • RFC 1918: 192.168.0.0–192.168.255.255 (/16), common in homes and small offices. These private blocks are not globally routed.

The prefix separates network and host bits

For 192.0.2.130/26, 26 bits identify the network and six remain for hosts. The relevant mask octet is 192, or 11000000 in binary, giving a block size of 64. Boundaries are 0, 64, 128 and 192. The address lies in 192.0.2.128/26, with broadcast 192.0.2.191 and ordinary host range .129–.190.

Two to the power of the host-bit count gives the number of addresses. Standard LAN planning excludes network and broadcast from host assignments. Special cases such as /31 point-to-point links require deliberate protocol and platform support. The 'magic number' method uses the final set mask bit to identify the block size.

VLSM starts with the largest requirement

Variable Length Subnet Masking divides an address space into differently sized prefixes. Sort requirements by size and allocate the largest blocks at valid boundaries first, then smaller ones. A table of purpose, prefix, network, host range, broadcast and reserve helps prevent overlap.

Account for growth, summarisation and operational boundaries. Blanket /24 allocations can waste space while undersized networks force early migrations. Infrastructure, management and transit networks also need room.

Calculate and then verify

Frequent mistakes include an invalid block boundary or confusing address count with usable host count. Show the relevant octet in binary, then use a second calculation method or IP calculator as a check rather than a substitute for understanding.

In operation, address, mask and gateway must agree. Hosts with apparently similar addresses but different masks can disagree on whether the other is local, creating asymmetric and hard-to-diagnose failures.

Practical checklist

  1. 01

    Convert the prefix into host bits and block size.

  2. 02

    Find the valid network boundary at or below the address.

  3. 03

    Calculate broadcast and usable host range.

  4. 04

    Allocate the largest VLSM requirements first without overlap.

  5. 05

    Document the result in a table and verify it independently.

Frequently asked questions

How many hosts fit in a /27?

Five host bits give 32 addresses, of which 30 are usable host addresses in an ordinary LAN.

Why is 255.255.255.192 a /26?

The first three octets contain 24 set bits. The final octet, 192 or binary 11000000, adds two more network bits.

From reading to action

How Bissolux can help

Turn the checks in this guide into a practical plan. Tell us about your systems and requirements so we can agree the work, responsibilities and scope.

Infrastructure diagram connecting workstations, network, servers and separate backupAdvertisement · Bissolux
Illustrative service preview
Bissolux · our offerA system that fits

IT infrastructure

Plan network, server and cloud capacity, access and ongoing responsibilities around your actual workloads.

Illustrative planning workspace with system documentationAdvertisement · Bissolux
Illustrative working environment
Bissolux · our offerClarity for your IT

IT planning and architecture

Review dependencies, requirements and operating costs before choosing the next implementation step.