Skip to main content

Subnet masking explained: CIDR calculation, subnetting, and network design

By Richard Ellor
14 July 2016
6 min read
Subnet masking explained: CIDR calculation, subnetting, and network design
Interactive network toolEnterprise subnet masking & CIDR architect

Enterprise subnet mask & CIDR network architecture planner

Calculate usable host capacity, broadcast boundaries, binary masks, and DHCP lease turnover to design scalable enterprise and guest WiFi networks.

Private ranges: 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16
/16 (65k hosts)/22 (1,022 hosts)/30 (2 hosts)
1001,200 devices5,000
30 mins2 hours8 hours

Calculated subnet parameters for 192.168.1.0/22

Subnet Mask

255.255.252.0

Wildcard Mask

0.0.3.255

Network Address

192.168.0.0

Broadcast Address

192.168.3.255

Usable Host Range

192.168.0.1 - 192.168.3.254

Total Usable Hosts

1,022 host addresses

Binary Subnet Mask (32 bits)

11111111.11111111.11111100.00000000

DHCP Pool CapacityEXHAUSTION WARNING

Estimated daily turnover (~3,120 devices) exceeds available hosts (1,022) by 3.1x. Shorten DHCP lease time to 15-30 minutes or expand subnet.

WiFi Broadcast Airtime OverheadMODERATE

Balanced capacity for high-density guest WiFi. Combine with a 30-minute DHCP lease time and Proxy ARP to protect wireless airtime.

Planning enterprise WiFi subnets or multi-SSID networks?

Purple provides cloud-managed captive portals, Cloud RADIUS 802.1X authentication, and identity-driven VLAN segregation across complex multi-vendor wireless environments.

Interactive Network Tool

Subnet mask and CIDR visualizer

Calculate host ranges, visualize binary network allocations, and design optimal subnets for enterprise WiFi.

Quick presets:
Subnet mask
255.255.252.0
Wildcard: 0.0.3.255
Usable host capacity
1,022 hosts
Total IPs: 1,024 (2 reserved)
Network address
192.168.8.0/22
Broadcast: 192.168.11.255
Usable host range
192.168.8.1
to 192.168.11.254
32-bit binary bitmask breakdown (/22)
Network bits (22)Host bits (10)
Octet 1
11111111
Octet 2
11111111
Octet 3
11111100
Octet 4
00000000
Looking for enterprise network automation? Purple combines captive portal guest management, 802.1X Cloud RADIUS, and dynamic VLAN assignment for seamless subnet isolation.

Every connected device on a Local Area Network (LAN) or Wide Area Network (WAN) requires an Internet Protocol (IP) address to send and receive packets. However, assigning thousands of devices to a single unmanaged network creates severe broadcast congestion, security vulnerabilities, and routing inefficiencies. Subnet masking solves this challenge by dividing large IP networks into smaller, logically isolated sub-networks known as subnets.

Key takeaways: subnet masking

  • Binary bitmask division: A 32-bit subnet mask splits IPv4 addresses into network identifiers (binary 1s) and host identifiers (binary 0s).
  • CIDR flexibility: Classless Inter-Domain Routing (CIDR) replaced rigid Class A, B, and C address blocks with variable prefix lengths (/8 to /30).
  • Enterprise guest WiFi sizing: High-traffic venues require /22 subnets (1,022 usable hosts) with short 30-minute DHCP lease times to prevent IP pool exhaustion caused by MAC randomisation.
  • Security through isolation: Segregating guest WiFi, corporate devices, and IoT hardware onto distinct subnets with Layer 2 isolation prevents unauthorised lateral scanning.
  • Airtime efficiency: Dividing large broadcast domains restricts Address Resolution Protocol (ARP) floods, preserving wireless spectrum for active client traffic.

What is a subnet mask and how does it work?

An IPv4 address consists of 32 bits arranged into four 8-bit bytes (octets), represented in dotted-decimal format (such as 192.168.1.50). To route data packets correctly, network switches and routers must distinguish between two parts of this address:

  1. Network identifier (Network ID): Specifies the specific sub-network to which the device belongs.
  2. Host identifier (Host ID): Identifies the individual endpoint (such as a laptop, smartphone, access point, or printer) on that sub-network.

A subnet mask is a 32-bit companion filter that tells the router where the network identifier ends and the host identifier begins. In binary, a subnet mask uses contiguous 1s for network bits and contiguous 0s for host bits.

When a device attempts to transmit a packet, its operating system performs a bitwise AND operation between the destination IP address and its local subnet mask. If the resulting network address matches the local network ID, the packet is delivered directly across the local switch. If the network IDs differ, the packet is forwarded to the default gateway router for inter-VLAN or WAN routing.

Classful networking vs CIDR (Classless Inter-Domain Routing)

When IPv4 was introduced in 1981 under RFC 791, addresses were divided into rigid, fixed-length classes:

  • Class A (1.0.0.0 to 126.0.0.0): Subnet mask 255.0.0.0 (/8 prefix). Reserved for massive multinational organisations, providing 16,777,214 hosts per network.
  • Class B (128.0.0.0 to 191.255.0.0): Subnet mask 255.255.0.0 (/16 prefix). Provided 65,534 hosts per network.
  • Class C (192.0.0.0 to 223.255.255.0): Subnet mask 255.255.255.0 (/24 prefix). Provided only 254 usable hosts per network.

Classful allocation proved highly inefficient. An enterprise requiring 500 IP addresses was forced to request a Class B network, wasting more than 65,000 unassigned addresses. In 1993, the Internet Engineering Task Force (IETF) introduced CIDR (RFC 1519), allowing network administrators to create variable-length subnets using slash notation (such as 10.0.0.0/22).

Complete IPv4 CIDR and subnet mask reference table

The following cheat sheet details the subnet mask, wildcard mask, and usable host capacity for standard enterprise IPv4 subnet allocations:

CIDR prefix Subnet mask Wildcard mask Usable hosts Primary enterprise use case
/16 255.255.0.0 0.0.255.255 65,534 Enterprise core backbone / WAN aggregation block
/20 255.255.240.0 0.0.15.255 4,094 Large stadium, airport terminal, or university guest pool
/21 255.255.248.0 0.0.7.255 2,046 Regional shopping centre or large hotel resort
/22 255.255.252.0 0.0.3.255 1,022 Standard enterprise guest WiFi (recommended default)
/23 255.255.254.0 0.0.1.255 510 Mid-sized restaurant, bar, or corporate branch office
/24 255.255.255.0 0.0.0.255 254 Staff 802.1X corporate VLAN or single office floor
/26 255.255.255.192 0.0.0.63 62 Building management systems (BMS) / IoT sensors
/28 255.255.255.240 0.0.0.15 14 Private resident apartment / iPSK personal area network
/30 255.255.255.252 0.0.0.3 2 Point-to-point router uplink interfaces

Worked example: calculating a /22 subnet for guest WiFi

To understand how subnet masks operate in binary arithmetic, consider an enterprise network team provisioning a guest WiFi scope using the network block 10.100.0.0/22:

  1. Convert prefix to binary mask: A /22 prefix means the first 22 bits are set to 1 and the remaining 10 bits are set to 0:
    11111111.11111111.11111100.00000000
  2. Convert binary octets to decimal:
    Octet 1: 11111111 = 255
    Octet 2: 11111111 = 255
    Octet 3: 11111100 = 252 (128 + 64 + 32 + 16 + 8 + 4)
    Octet 4: 00000000 = 0
    Resulting subnet mask: 255.255.252.0
  3. Calculate total and usable hosts:
    Total IP addresses = 2(32 - 22) = 210 = 1,024
    Usable host addresses = 1,024 - 2 = 1,022 (subtracting the Network ID 10.100.0.0 and Broadcast Address 10.100.3.255).
  4. Define usable IP range: 10.100.0.1 through 10.100.3.254.

Enterprise WiFi subnet design: preventing DHCP pool starvation

Network engineers designing wired corporate LANs typically assign standard /24 subnets (254 addresses) to each department, assuming devices remain connected for weeks. Applying this same logic to public and guest WiFi networks causes severe operational outages.

Public venues experience high visitor turnover. Furthermore, modern smartphones (iOS 14+, Android 10+, and Windows 11) employ private MAC address randomisation, generating new virtual hardware addresses when reconnecting or roaming across networks. A shopping centre or hotel with 400 concurrent visitors can easily consume over 1,500 DHCP leases across a 12-hour period.

If the guest VLAN is restricted to a /24 subnet (254 hosts) with a default 24-hour DHCP lease, the address pool will exhaust within two hours. Subsequent guests will experience connection failures, API timeouts, and captive portal loading errors.

Three rules for guest WiFi subnet architecture

  • Deploy /22 or /21 subnets: Provision at least 1,022 (/22) or 2,046 (/21) usable IP addresses for high-density guest SSIDs to absorb peak daily turnover.
  • Enforce short DHCP lease times: Set guest DHCP lease durations between 30 and 60 minutes. When a visitor leaves the venue, their allocated IP address returns to the available pool quickly.
  • Enable Layer 2 client isolation and proxy ARP: While a /22 subnet creates a larger broadcast domain, enterprise wireless controllers eliminate broadcast overhead by enabling wireless client isolation. Access points drop client-to-client broadcast traffic and answer ARP requests directly from controller cache tables, protecting wireless airtime.

Automating network segmentation and access control with Purple

Modern enterprise environments require granular security boundaries between guest visitors, corporate staff, and automated IoT building systems:

  • Guest WiFi captive management: Purple Guest WiFi integrates directly with enterprise hardware (Cisco Meraki, Aruba, Ruckus, Juniper Mist) to deliver branded onboarding, social logins, and automated bandwidth rate-limiting on guest subnets.
  • Passwordless 802.1X staff access: Purple integrates with Microsoft Entra ID, Okta, and Google Workspace to provision certificate-based WPA3-Enterprise profiles, dynamically assigning staff devices to private corporate VLANs.
  • Multi-tenant residential isolation: In Build-to-Rent (BTR) and student accommodation, Purple uses Identity Pre-Shared Keys (iPSK) to assign each resident an isolated /28 personal subnet, ensuring personal IoT devices (printers, smart TVs) remain invisible to neighbouring units.

For more details on securing wireless boundaries, explore our complete Enterprise WiFi Security Guide or test your configurations using our free Subnet Calculator tool.

Frequently asked questions

What is a subnet mask and how does it determine network and host portions?

A subnet mask is a 32-bit number used in IPv4 networking to separate the IP address into a network identifier and a host identifier. By performing a bitwise AND operation between an IP address and its subnet mask, routers and switches determine whether a destination packet is located within the local subnet or must be routed through a default gateway.

What is the difference between CIDR notation and traditional classful subnetting?

Classful networking originally categorized IP addresses into rigid Class A (/8), Class B (/16), and Class C (/24) blocks, leading to massive address waste. Classless Inter-Domain Routing (CIDR) replaced this by allowing variable-length subnet masking (VLSM), enabling network engineers to allocate exact prefix lengths (such as /22 or /28) tailored to specific venue requirements.

Why is a /22 subnet recommended for high-density public guest WiFi networks?

A /22 subnet provides 1,022 usable host addresses, offering sufficient capacity for high visitor turnover in public venues like stadiums, shopping centers, and hotels. When paired with short 15 to 30 minute DHCP lease times, a /22 prevents address exhaustion while keeping broadcast domains small enough to avoid degrading wireless airtime.

How do large subnet broadcast domains degrade enterprise WiFi performance?

In wireless networks, broadcast and multicast frames (such as ARP requests and mDNS discovery) are transmitted at low base data rates across all connected access points. Oversized flat subnets (like /20 or /16) generate heavy broadcast traffic that floods wireless channels, consuming airtime and creating latency for client devices.

How does Layer 2 client isolation protect subnets in public WiFi environments?

Layer 2 client isolation prevents wireless devices on the same subnet or VLAN from communicating directly with each other. This stops malicious scanning, ARP spoofing, and man-in-the-middle attacks, ensuring guest devices can only reach the default gateway and authorized internet destinations.

How does Purple integrate with enterprise subnetting and VLAN architectures?

Purple integrates with access points and wireless controllers across any subnet topology. Using 802.1X Cloud RADIUS and captive portal redirection, Purple enforces dynamic VLAN steering, bandwidth rate limiting, and walled garden access control based on user authentication credentials.

Ready to get started?

Book a demo with one of our experts to see how Purple can help you achieve your business goals.

Speak to an expert