IPv4 Layer 3 Architecture & Bitwise Engineering

IP Subnet Mask, Host Range & Bitwise Network Calculator

Decompose IPv4 addresses and CIDR prefixes into physical network boundaries, broadcast vectors, usable host ranges, and Cisco ACL wildcard masks via hardware-level bitwise Boolean logic.

Subnet Boundary & Host Range Engine

RFC 791 • RFC 1519 CIDR • RFC 3021 /31 • 32-Bit Linear Space
/24
Enterprise & Carrier Subnet Archetypes:
Network & Broadcast Boundaries
Layer 3 topological routing identifiers
Network ID (Wire Subnet)
192.168.1.0
Prefix: /24
Broadcast IP 192.168.1.255
Dotted Decimal Mask 255.255.255.0
Cisco Wildcard Mask 0.0.0.255
Broadcast Strategy Standard Directed
Host Capacity & Usable Range
Address allocation span and link bounds
Total Usable Hosts
254 Hosts
28 − 2 usable
First Usable IP 192.168.1.1
Last Usable IP 192.168.1.254
Total Subnet Space 256 Addresses
Host Utilization Ratio 99.22% Usable
Classification & Scoping
RFC governance, registry status & class
Address Scope / Registry
RFC 1918 Private
Non-routable on public global Internet
Historical Class Class C Equivalent
Hexadecimal Mask 0xFFFFFF00
Hexadecimal IP 0xC0A80169
32-Bit Integer IP 3,232,235,881
32-Bit Binary Octet Allocation Map
Network Bits (24)
Host Bits (8)
Boundary split: Octet 3 / Octet 4 (Bit 24 • 24 Network / 8 Host) Mask: 11111111.11111111.11111111.00000000
Hardware-Level Bitwise Boolean AND Calculation (Destination IP & Subnet Mask)
Destination IP Address 11000000 . 10101000 . 00000001 . 01101001 192.168.1.105
Subnet Mask 11111111 . 11111111 . 11111111 . 00000000 255.255.255.0
••• BITWISE BOOLEAN AND (&) FILTER •••
Resulting Network ID 11000000 . 10101000 . 00000001 . 00000000 192.168.1.0
Wildcard Mask (Inverted) 00000000 . 00000000 . 00000000 . 11111111 0.0.0.255
VLSM Subnet Halving Slices (Borrowing 1 Host Bit → Subnet /25)
Valid Subnet Boundary

Splitting this prefix into two equal child subnets by advancing the mask boundary by +1 bit:

Dynamic Mathematical Derivation Chain
Input IP: 192.168.1.105 | Prefix: /24 (255.255.255.0) | Host Bits h = 32 - 24 = 8 bits | Total IP Addresses = 2⁸ = 256 | Total Usable Hosts = 2⁸ - 2 = 254 | Network Address = 192.168.1.105 AND 255.255.255.0 = 192.168.1.0 | Broadcast Address = Network (192.168.1.0) OR Wildcard (0.0.0.255) = 192.168.1.255 | First Usable Host = 192.168.1.0 + 1 = 192.168.1.1 | Last Usable Host = 192.168.1.255 - 1 = 192.168.1.254 | Cisco Wildcard Mask = 255.255.255.255 - 255.255.255.0 = 0.0.0.255

The Engineering Foundations of IPv4 Subnetting & Bitwise Masking

An authoritative, CCIE-level technical treatise examining the 32-bit linear address space, hardware ASIC bitwise Boolean logic, the evolution from RFC 791 classful routing to RFC 1519 CIDR, point-to-point /31 link dynamics under RFC 3021, and Cisco ACL wildcard masking.

1. The Mathematics of IPv4 Addressing: Bits, Octets, and Bitwise Logic

At the physical and data-link boundary, an Internet Protocol Version 4 (IPv4) address is not a formatted text string; it is an unsigned 32-bit binary integer. The entire global IPv4 address pool occupies a linear numerical continuum spanning exactly 232 distinct permutations:

Total IPv4 Address Pool = 232 = 4,294,967,296 Addresses
Address Bounds: 000000000000000000000000000000002 (0.0.0.0) to 111111111111111111111111111111112 (255.255.255.255)

Because raw 32-bit binary strings are unwieldy for human network administrators, RFC 791 segmented the 32 bits into four 8-bit bytes termed octets. Each octet represents a base-10 numerical magnitude between 0 and 28 − 1 (0 through 255), concatenated with period delimiters to yield dotted-decimal format (for example, 192.168.1.105).

When an IP packet arrives at an enterprise multilayer switch or carrier edge router, the silicon forwarding engine (typically implemented within a Ternary Content-Addressable Memory — TCAM ASIC) never parses text. Instead, it performs a clock-cycle-level bitwise Boolean AND operation between the destination IP address and the configured subnet mask.

Network Address = Destination IP & Subnet Mask
Broadcast Address = Network Address | Inverted Subnet Mask (Wildcard)
Usable Host Span = (Network Address + 1) through (Broadcast Address − 1)

The Boolean AND truth table dictates that a result bit is 1 if and only if both the input address bit and the mask bit are 1. Wherever the subnet mask contains 1s, the corresponding bits of the IP address are passed through unaltered, preserving the Network Identifier. Wherever the mask contains 0s, the bits are zeroed out, isolating the wire network boundary regardless of the specific host bits present.

2. From Classful Routing to Classless Inter-Domain Routing (CIDR)

During the early ARPANET and DARPA Internet deployments of the 1980s, the global address space was partitioned into rigid, immutable architectural classes dictated by RFC 791:

  • Class A (0.0.0.0/8 to 127.0.0.0/8): Identified by a leading bit of 0. The first octet defined the network (8 bits), leaving 24 bits for hosts (224 − 2 = 16,777,214 usable hosts per domain). Only 126 Class A networks existed globally, allocated to early universities, tech giants, and defense agencies.
  • Class B (128.0.0.0/16 to 191.255.0.0/16): Identified by leading bits 10. The first two octets defined the network (16 bits), leaving 16 bits for host addressing (216 − 2 = 65,534 usable hosts).
  • Class C (192.0.0.0/24 to 223.255.255.0/24): Identified by leading bits 110. Three octets defined the network (24 bits), leaving just 8 bits for host allocation (28 − 2 = 254 usable hosts).
  • Class D (224.0.0.0/4 to 239.255.255.255/4): Identified by leading bits 1110, reserved strictly for IP multicast group dissemination without discrete host routing.
  • Class E (240.0.0.0/4 to 255.255.255.255/4): Identified by leading bits 1111, permanently reserved by the IETF for experimental and future research endeavors.
The Exhaustion Crisis & The RFC 1519 CIDR Revolution

By 1992, the classful paradigm brought the Internet to the brink of collapse. Organizations requiring 300 host IP addresses were too large for a single Class C block (254 hosts), forcing regional registries to allocate entire Class B blocks (65,534 hosts), resulting in over 99% address waste. Simultaneously, the explosion of Class C route advertisements threatened to overwhelm the routing table memory of backbone routers.

In September 1993, the Internet Engineering Task Force (IETF) ratified RFC 1519: Classless Inter-Domain Routing (CIDR), completely decoupling network masks from historical octet boundaries. Network prefix lengths could now be defined at any arbitrary bit position (/0 through /32), enabling Variable Length Subnet Masking (VLSM) and route aggregation (supernetting) across Border Gateway Protocol (BGP-4) routing engines.

3. Special Subnet Allocations: The /30 vs. /31 vs. /32 Dilemma

Nowhere is subnet engineering more nuanced than at the lower boundary of host bit allocations (/30, /31, and /32 prefixes):

  • Legacy /30 Point-to-Point WAN Links: Historically, router-to-router point-to-point links utilized a 30-bit mask (255.255.255.252). A /30 yields 232-30 = 4 total IP addresses. Under traditional RFC 791 conventions, the first address is the unassignable Network ID (all host bits 0), and the last address is the unassignable Subnet Directed Broadcast (all host bits 1). This left exactly 2 usable host addresses (for router interface A and router interface B). Crucially, this represented a 50% architectural waste (2 wasted IPs for every 2 operational IPs), squandering hundreds of millions of public IPv4 addresses across global telecommunication backbones.
  • Modern RFC 3021 /31 Router Links: To halt this waste, the IETF ratified RFC 3021: Using 31-Bit Prefixes on IPv4 Point-to-Point Links in December 2000. Under RFC 3021, point-to-point links operate with zero broadcast capability. A /31 provides exactly 2 addresses (232-31 = 2). The lowest numerical address (host bit 0) is assigned to one router interface, and the highest numerical address (host bit 1) is assigned to the opposite peer. Directed broadcast packets are forbidden on such links, recovering 50% of otherwise wasted link addressing space across enterprise backbones and cloud transit VPCs.
  • Host Routes (/32): A 32-bit mask (255.255.255.255) contains exactly zero host bits (20 = 1 address). It identifies an isolated, singular endpoint. In carrier networking, /32 prefixes are deployed for router Loopback interfaces (providing invariant IP endpoints for BGP router-IDs, OSPF router-IDs, and MPLS LDP signaling), VPN virtual tunnel adapters, and server Anycast clusters (such as public DNS resolvers 8.8.8.8 and 1.1.1.1).

4. Cisco Wildcard Masks & Access Control List (ACL) Logic

In Cisco IOS, IOS-XE, Junos, and standard network access control list (ACL) syntax, firewall filtering and routing protocol link enablement (such as OSPF and EIGRP network statements) frequently rely on Wildcard Masks (also known as inverse masks) rather than standard subnet masks.

A wildcard mask inverts the Boolean operational meaning of the bits:

  • A bit value of 0 indicates: "Match the corresponding bit of the incoming IP address exactly."
  • A bit value of 1 indicates: "Ignore the corresponding bit (do-not-care / wildcard match)."
Wildcard Mask = 255.255.255.255 − Subnet Mask
Example for /26 (255.255.255.192):
255.255.255.255 − 255.255.255.192 = 0.0.0.63

Because wildcard masks operate on pure bitwise Boolean evaluation, advanced network engineers can craft discontiguous wildcard masks that have no equivalent in contiguous subnet masks. For example, applying an access list with wildcard 0.0.0.254 against an IP block allows an engineer to filter or permit all odd-numbered host IP addresses (since the lowest-order bit is 0, requiring an exact match of the odd parity bit) while ignoring all higher-order bits.

5. Address Scoping: Private, Public, and Special-Purpose Registries

Not all valid 32-bit addresses are publicly routable across the global Internet. The Internet Assigned Numbers Authority (IANA) and the IETF have cordoned off specific address blocks for specialized engineering purposes:

  • RFC 1918 Private Address Space: Reserved strictly for internal enterprise LANs, data center pods, and home networks. Routers on the public Internet drop these packets by default:
    • 10.0.0.0/8 (10.0.0.0 to 10.255.255.255 • 16,777,216 addresses)
    • 172.16.0.0/12 (172.16.0.0 to 172.31.255.255 • 1,048,576 addresses)
    • 192.168.0.0/16 (192.168.0.0 to 192.168.255.255 • 65,536 addresses)
  • RFC 3927 IPv4 Link-Local (APIPA): The 169.254.0.0/16 block is designated for automatic dynamic address assignment on isolated network segments when DHCP servers are unreachable. Link-local packets cannot traverse a router boundary.
  • RFC 6598 Carrier-Grade NAT (CGNAT): The 100.64.0.0/10 block (100.64.0.0 to 100.127.255.255) is reserved for telecommunication service providers to perform upstream Large-Scale NAT (LSN) without conflicting with customer internal RFC 1918 networks.
  • RFC 5737 Documentation & Examples: Three distinct /24 blocks (TEST-NET-1: 192.0.2.0/24, TEST-NET-2: 198.51.100.0/24, and TEST-NET-3: 203.0.113.0/24) are reserved exclusively for technical manuals and architectural diagrams to prevent accidental production traffic leakage.
  • Loopback Host Block: The entire 127.0.0.0/8 block is assigned to internal host loopback communication (with 127.0.0.1 being the universal localhost socket target).

Comprehensive IPv4 Subnet Mask & CIDR Prefix Reference Table (/0 to /32)

A complete architectural index cataloging all 33 IPv4 subnet prefix lengths, dotted-decimal subnet masks, Cisco wildcard masks, total address capacity, usable host counts, and standard deployment applications.

CIDR Prefix Subnet Mask Cisco Wildcard Total Addresses Usable Hosts Class Equivalent & Operational Use Case
/32 255.255.255.255 0.0.0.0 1 1 (Host Only) Loopback Interface, VPN Virtual Endpoint, BGP Anycast Node
/31 255.255.255.254 0.0.0.1 2 2 (RFC 3021) High-Efficiency Point-to-Point Router Links (Zero Broadcast Waste)
/30 255.255.255.252 0.0.0.3 4 2 Legacy Point-to-Point WAN Circuits (50% Address Overhead)
/29 255.255.255.248 0.0.0.7 8 6 Small Carrier Public IP Block (Router, Firewall HA Pairs)
/28 255.255.255.240 0.0.0.15 16 14 Enterprise Firewall DMZ, Small Production Web Cluster
/27 255.255.255.224 0.0.0.31 32 30 Departmental Subnet, Isolated VLAN, Industrial IoT Segment
/26 255.255.255.192 0.0.0.63 64 62 Mid-Sized Branch Office, Dedicated Wireless AP Pool
/25 255.255.255.128 0.0.0.127 128 126 Half-Class C Allocation, Split Enterprise Voice / Data VLAN
/24 255.255.255.0 0.0.0.255 256 254 Standard Class C / Typical Office LAN / Minimum Internet BGP Route
/23 255.255.254.0 0.0.1.255 512 510 Supernetted Office Building, Multi-Floor Wi-Fi Guest Pool
/22 255.255.252.0 0.0.3.255 1,024 1,022 Large Campus Wi-Fi Pool, University Dormitory Network
/21 255.255.248.0 0.0.7.255 2,048 2,046 Regional Enterprise Node, Enterprise Kubernetes Cluster Subnet
/20 255.255.240.0 0.0.15.255 4,096 4,094 Data Center Server Pod, Large Cloud VPC Availability Zone
/19 255.255.224.0 0.0.31.255 8,192 8,190 Metro Carrier Distribution, Municipal Broadband Node
/18 255.255.192.0 0.0.63.255 16,384 16,382 Regional ISP Allocation, Cloud Super-VPC Infrastructure
/17 255.255.128.0 0.0.127.255 32,768 32,766 Half-Class B Supernet, Tier-2 Telecommunications Backbone
/16 255.255.0.0 0.0.255.255 65,536 65,534 Standard Class B / Corporate Global VPC / Major Service Provider
/15 255.254.0.0 0.1.255.255 131,072 131,070 Multi-Region Corporate WAN Aggregation Block
/14 255.252.0.0 0.3.255.255 262,144 262,142 National Cellular Carrier 4G/5G PGW User Plane Pool
/13 255.248.0.0 0.7.255.255 524,288 524,286 Continental Enterprise Supernetting Allocation
/12 255.240.0.0 0.15.255.255 1,048,576 1,048,574 Entire RFC 1918 Class B Private Pool (172.16.0.0/12)
/11 255.224.0.0 0.31.255.255 2,097,152 2,097,150 Multinational Telco Mobile Subscriber IP Pool
/10 255.192.0.0 0.63.255.255 4,194,304 4,194,302 Carrier-Grade NAT (RFC 6598: 100.64.0.0/10 Shared CGNAT)
/9 255.128.0.0 0.127.255.255 8,388,608 8,388,606 Half Class A Supernet Allocation / Tier-1 Core Aggregate
/8 255.0.0.0 0.255.255.255 16,777,216 16,777,214 Historical Class A / RFC 1918 10.0.0.0/8 / Loopback 127.0.0.0/8
/7 254.0.0.0 1.255.255.255 33,554,432 33,554,430 Continental RIR Regional Registry Allocation Block
/6 252.0.0.0 3.255.255.255 67,108,864 67,108,862 Major Global Internet Backbone Super-Aggregation
/5 248.0.0.0 7.255.255.255 134,217,728 134,217,726 Large-Scale Registry Master Transit Reservation
/4 240.0.0.0 15.255.255.255 268,435,456 268,435,454 Multicast Pool (224.0.0.0/4) / Experimental Pool (240.0.0.0/4)
/3 224.0.0.0 31.255.255.255 536,870,912 536,870,910 One-Eighth of Total Global IPv4 Space
/2 192.0.0.0 63.255.255.255 1,073,741,824 1,073,741,822 One-Quarter of Total Global IPv4 Space
/1 128.0.0.0 127.255.255.255 2,147,483,648 2,147,483,646 One-Half of Total Global IPv4 Space (0.0.0.0/1 or 128.0.0.0/1)
/0 0.0.0.0 255.255.255.255 4,294,967,296 All IPv4 Space Default Route (0.0.0.0/0 • Gateway of Last Resort)