TEZZ CONNECTBlog

Blog / Internet Technology & Updates

Internet Technology & Updates

What Is Subnetting? CIDR, Subnet Masks, VLSM and IP Address Planning

Learn how IP subnetting divides networks, how CIDR prefixes and subnet masks work, how to calculate IPv4 ranges, and how VLSM supports efficient address planning.

By Suraj Vishwakarma · Published by TEZZ CONNECT · Published 27 November 2026 · Updated 30 November 2026

Network infrastructure representing IP networks and subnet design
Subnetting organises IP address space into smaller routed networks

Subnetting is one of the core skills behind designing reliable IP networks. It divides a larger address block into smaller networks, making it easier to organise devices, control traffic and plan for growth.

This guide explains CIDR prefixes, subnet masks, network and broadcast addresses, usable host ranges, VLSM, VLAN relationships, route aggregation and IPv6 prefix planning. Worked examples use private IPv4 addresses and clearly distinguish conventional subnet rules from special cases.

1. What is subnetting and why is it used?

Subnetting is the process of dividing an IP network into smaller logical networks called subnets. Instead of treating one large address block as a single network, an administrator creates smaller prefixes that can be assigned to departments, buildings, VLANs, cloud networks or point-to-point links.

Subnetting is fundamental to IP addressing and routing. It helps an organisation use address space deliberately, separate broadcast domains, summarise routes and apply security policy at network boundaries. It is not simply a way to make internet speed faster. Its value is in structure, scale, operational control and predictable routing.

For example, a company might receive the IPv4 block 192.168.40.0/24. It could use one subnet for staff computers, another for printers, another for guest Wi-Fi and another for network management. A router or Layer 3 switch routes between those subnets according to its routing table and firewall policy.

Subnetting also supports growth. A flat network that begins with a few devices can become difficult to manage as more users, access points, cameras, phones and servers are added. A well-planned IP scheme makes it easier to understand where devices belong and how traffic should flow.

2. IPv4 addresses: 32 bits in four octets

An IPv4 address is 32 bits long and is commonly written as four decimal octets separated by dots, such as 192.168.1.25. Each octet represents eight bits and can range from 0 to 255. The binary form of the example is 11000000.10101000.00000001.00011001.

IP addresses are logical Layer 3 identifiers. They are not the same as Ethernet MAC addresses, which are used for local link delivery. A host uses its IP address and subnet prefix to decide whether a destination is on the local subnet or must be reached through a router.

In an IPv4 subnet, the prefix identifies the network portion and the remaining bits identify addresses within that subnet. The boundary can fall between octets or inside an octet. That is why a subnet mask such as 255.255.255.192 may be less intuitive at first than 255.255.255.0.

3. CIDR notation: what /24, /26 and /30 mean

Classless Inter-Domain Routing (CIDR) writes a network as an IPv4 address followed by a slash and prefix length. In 192.168.1.0/24, the /24 means the first 24 bits are the network prefix and the remaining eight bits are available for addresses within the block.

The prefix length can range from /0 to /32 for IPv4. A shorter prefix contains more addresses; a longer prefix contains fewer. For example, /16 contains 65,536 addresses, /24 contains 256, /26 contains 64 and /30 contains four.

CIDR replaced the older class-based assumptions of Class A, B and C networks as the basis for modern allocation and routing. Prefix length gives a precise boundary and supports flexible network sizes. The original CIDR architecture is described in RFC 1518 and RFC 1519; later operational guidance is in RFC 4632.

4. Subnet masks and the network/host boundary

An IPv4 subnet mask is a 32-bit pattern with contiguous one bits followed by zero bits. The ones indicate the network prefix; the zeros identify the host portion. The /24 prefix corresponds to 255.255.255.0, while /26 corresponds to 255.255.255.192.

To find the network address, a host performs a bitwise AND between its IP address and subnet mask. For example, 192.168.1.70 AND 255.255.255.192 gives 192.168.1.64. That means the address belongs to the 192.168.1.64/26 subnet.

The subnet mask does not identify the router, DNS server or VLAN by itself. It only describes the prefix boundary. Other network configuration and routing information determines how the host communicates beyond its local subnet.

5. Network address, broadcast address and usable host range

In a conventional IPv4 subnet with a prefix from /1 through /30, the first address is the network address and the last is the directed broadcast address. The addresses between them are traditionally available for host interfaces. This convention produces the familiar usable-host formula 2^(32-prefix) minus 2.

For 192.168.10.0/24, there are 256 total addresses. The network address is 192.168.10.0, the broadcast address is 192.168.10.255 and the conventional host range is 192.168.10.1 through 192.168.10.254. That gives 254 host addresses.

For 192.168.10.64/26, there are 64 total addresses. The network address is .64, broadcast is .127, and conventional host range is .65 through .126. That gives 62 host addresses.

Do not apply the minus-two formula blindly to every prefix. A /31 is commonly used for point-to-point links under RFC 3021, where both addresses can be used as endpoints. A /32 identifies one host route. IPv4 special-purpose blocks and platform-specific behaviours also require care.

6. How to calculate subnet sizes quickly

The number of IPv4 addresses in a prefix is 2^(32 minus prefix length). The number of host bits is 32 minus the prefix length. A /27 has five host bits and therefore 32 addresses; a /28 has four host bits and 16 addresses; a /29 has three host bits and eight addresses.

When the prefix boundary falls inside an octet, calculate the block size in the affected octet. For a /26, the mask is 255.255.255.192. The block size is 256 minus 192, or 64. Subnet boundaries in the last octet are therefore 0, 64, 128 and 192.

For a /27, the mask is 255.255.255.224 and the block size is 32. The boundaries are 0, 32, 64, 96, 128, 160, 192 and 224. To identify the subnet for an address, find the greatest boundary that does not exceed its value in that octet.

For example, 192.168.5.118/27 falls in the 192.168.5.96/27 subnet. Its network address is .96, broadcast address is .127 and conventional host range is .97 through .126.

7. Subnetting a /24 into smaller networks

Imagine a small office has 192.168.20.0/24 and wants four equal subnets. Borrowing two host bits changes the prefix from /24 to /26. The original 256-address block becomes four 64-address subnets:

  • 192.168.20.0/26 — conventional hosts .1 to .62; broadcast .63.
  • 192.168.20.64/26 — conventional hosts .65 to .126; broadcast .127.
  • 192.168.20.128/26 — conventional hosts .129 to .190; broadcast .191.
  • 192.168.20.192/26 — conventional hosts .193 to .254; broadcast .255.

Each subnet has 64 total addresses and 62 conventional usable host addresses. The four subnets exactly cover the original /24 without overlap or gaps.

Subnets must be correctly aligned to their block size. A /26 cannot begin at an arbitrary last-octet value such as .20 or .90. Its valid boundaries in that octet are multiples of 64.

8. VLSM: different subnet sizes for different needs

Variable Length Subnet Masking (VLSM) allows an address block to be divided into subnets of different sizes. This avoids assigning the same large subnet to every segment when departments or links have very different requirements.

Suppose a site has 192.168.50.0/24 and needs a subnet for 100 devices, another for 50, one for 20 and a point-to-point link. A possible allocation is /25 for the first group (126 conventional hosts), /26 for the second (62), /27 for the third (30), and /30 for a traditional two-endpoint link (2 conventional host addresses).

Allocate the largest subnet first, then the next largest, keeping each network aligned to its prefix boundary. For example: 192.168.50.0/25, 192.168.50.128/26, 192.168.50.192/27 and 192.168.50.224/30. The remaining addresses can be reserved for future needs, provided the plan is documented.

VLSM improves address efficiency, but it increases planning responsibility. Administrators must track every allocation and avoid overlapping ranges. A central IP address management (IPAM) system or carefully maintained registry becomes increasingly useful as the network grows.

9. Subnetting, VLANs and routing: how they fit together

A subnet is a Layer 3 IP network. A VLAN is a Layer 2 broadcast domain commonly implemented using IEEE 802.1Q tagging on managed Ethernet switches. Networks often map one IPv4 subnet to one VLAN, but the concepts are not identical: a VLAN separates Layer 2 traffic, while the subnet defines IP addressing and routing boundaries.

Devices in the same IPv4 subnet can generally communicate directly at Layer 2 when they share the same broadcast domain and security policy permits it. Devices in different subnets need a router or Layer 3 switch to forward packets between them. The host sends remote-destination traffic to its default gateway.

Separating guest Wi-Fi, staff computers, printers and management interfaces into different VLANs and subnets can support security policy. However, segmentation is not automatic protection. Firewall rules, access-control lists, authentication and switch configuration determine which traffic is actually permitted.

10. Route aggregation and summarisation

CIDR supports route aggregation, also called summarisation or supernetting. Instead of advertising many adjacent smaller prefixes individually, a router may advertise a larger aggregate route if the networks are contiguous, correctly aligned and covered by that summary.

For example, four adjacent /24 networks beginning at 10.20.0.0 can be represented by 10.20.0.0/22, provided the address range and routing design match. The aggregate covers 10.20.0.0 through 10.20.3.255. It reduces routing table entries and can simplify network design.

Summarisation must be accurate. An overly broad aggregate can attract traffic for addresses that are not actually reachable, potentially causing black holes. Routing protocols and network design should include appropriate more-specific routes or discard routes where required.

11. Private IPv4 ranges and public address planning

Many internal networks use the private IPv4 ranges defined in RFC 1918: 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16. These addresses are not globally routed on the public internet. Organisations commonly use them behind network address translation, although private addressing and NAT are separate concepts.

Choose internal ranges with future connectivity in mind. Two companies that both use 192.168.1.0/24 may face address overlap when connecting VPNs or merging networks. A deliberate IP plan can reduce conflicts across branches, cloud VPCs, partner links and remote-access VPNs.

Public IPv4 allocations are managed through regional internet registries and provider arrangements. Organisations should not assume that an address is available for public use simply because it appears unused on a private LAN. Use assigned public ranges only where authorised.

12. IPv6 prefixes and subnetting

IPv6 uses 128-bit addresses and prefix notation, such as 2001:db8:1234:1::/64. The prefix length identifies the network portion. Unlike IPv4, IPv6 LAN design commonly assigns a /64 to an ordinary subnet, supporting the standard interface identifier model and Stateless Address Autoconfiguration.

IPv6 subnet planning often works by allocating a larger site prefix and assigning /64 subnets to individual LANs or VLANs. For example, a site with a /48 can number 65,536 distinct /64 subnets. The exact allocation should follow the organisation's provider allocation and routing architecture. A /64 is a common LAN subnet size, not a rule that every IPv6 link or special-purpose network must use /64. Point-to-point links, loopbacks and infrastructure prefixes can have different requirements; follow the relevant standards and platform guidance for those cases.

IPv6 does not use broadcast in the IPv4 sense. It uses multicast and Neighbor Discovery for local-link functions. IPv6 subnet planning should therefore not copy every IPv4 host-count rule or assume that a /64 is wasteful merely because the number of addresses is enormous.

The current IPv6 addressing architecture is described in RFC 4291, with recommendations for IPv6 site addressing in RFC 6177.

13. Common subnetting mistakes

  • Overlapping subnets: assigning the same address space to two routed segments creates ambiguity and connectivity problems.
  • Incorrect block boundaries: choosing a network address that is not aligned to its prefix causes invalid or unexpected allocations.
  • Forgetting reserved addresses: gateways, network services and infrastructure need addresses planned outside dynamic client allocations or reserved deliberately.
  • Using an unsuitable mask: a host configured with the wrong prefix may incorrectly treat a remote destination as local or vice versa.
  • Ignoring future growth: a subnet sized exactly for today's device count may be exhausted quickly.
  • Confusing VLANs and subnets: Layer 2 separation and Layer 3 addressing must both be configured consistently.
  • Assuming private ranges never overlap: mergers, VPNs and cloud connectivity can expose duplicate RFC 1918 space.

Maintain a source of truth for address allocations. Document the prefix, purpose, VLAN, gateway, DHCP scope, reserved ranges, routing policy and owner for each subnet. Update it when networks are added or retired.

14. A practical subnetting workflow

  1. List the network segments and estimate the current and expected number of endpoints in each.
  2. Choose an address block that does not conflict with connected sites, cloud networks or VPN partners.
  3. Allocate the largest subnets first, using VLSM where requirements differ.
  4. Align every subnet to its prefix boundary and check for overlaps.
  5. Reserve gateway and infrastructure addresses and define DHCP pools separately.
  6. Map subnets to VLANs and Layer 3 interfaces where appropriate.
  7. Configure routing and firewall rules, then test local and inter-subnet communication.
  8. Record the design in IPAM or a maintained network register and review it as the environment grows.

Before deployment, verify calculations with a trusted subnet calculator or IPAM tool, then independently check network address, prefix, broadcast behaviour and usable range. A calculator helps reduce arithmetic errors, but it cannot decide whether the chosen address plan is operationally sensible.

15. Frequently asked questions about subnetting

What is subnetting?

Subnetting divides an IP network into smaller logical networks called subnets. It helps organise address space, limit broadcast domains in IPv4 LANs, apply security boundaries and plan routing.

What does CIDR mean?

Classless Inter-Domain Routing (CIDR) represents an IP network using an address and prefix length, such as 192.168.10.0/24. The prefix length states how many leading bits identify the network portion.

What is a subnet mask?

An IPv4 subnet mask is a 32-bit value whose leading one bits identify the network prefix and whose remaining zero bits identify the host portion. For example, 255.255.255.0 corresponds to /24.

How many usable hosts are in a /24 subnet?

A conventional IPv4 /24 has 256 total addresses. In a traditional subnet, the all-zero host address identifies the network and the all-one host address is the directed broadcast, leaving 254 ordinary host addresses. Special-purpose prefixes and point-to-point designs have exceptions.

What is the difference between /24 and /26?

A /24 has 256 IPv4 addresses and a /26 has 64. Splitting one /24 into four aligned /26 subnets creates four smaller networks, each with 62 conventional usable host addresses.

What is VLSM?

Variable Length Subnet Masking (VLSM) allows different subnet sizes within an address block. It lets a network planner allocate larger subnets where more addresses are needed and smaller ones where fewer are needed.

What is the difference between subnetting and supernetting?

Subnetting divides a larger network prefix into smaller prefixes. Supernetting aggregates adjacent networks into a larger route summary when their prefixes and alignment permit it.

Does subnetting make internet faster?

Subnetting does not increase the capacity of an internet connection. It can improve network organisation, routing and security design, but speed depends on link capacity, congestion, device performance and the end-to-end path.

Can devices on different subnets communicate?

Yes, but they normally need a Layer 3 router or Layer 3 switch to route traffic between the subnets. Firewall rules and routing policies may allow or block that communication.

How do I find my subnet mask?

On Windows, use ipconfig; on Linux, use ip address; and on macOS, inspect network settings or use ifconfig. Look for the IPv4 address and prefix or subnet mask assigned to the active interface.

16. Standards and further reading