IPv4 vs. IPv6 Subnetting Guide: CIDR Masks, /64 Prefixes & RFC 5952 Compression
A practical reference for networking students and engineers comparing 32-bit IPv4 CIDR subnetting with 128-bit IPv6 prefix allocation and canonical address formatting.
Practice subnet calculations interactively in your browser
Verify binary masks, host ranges, and RFC 5952 IPv6 compression instantaneously.
1. Core Architectural Differences Between IPv4 and IPv6
Internet Protocol version 4 (IPv4) uses 32-bit addresses written in dotted-decimal notation (such as 192.168.10.0/24), providing $2^{32}$ (4,294,967,296) total addresses. Because public IPv4 space is exhausted, networks rely heavily on Network Address Translation (NAT) and Variable Length Subnet Masking (VLSM) to conserve every usable host IP.
Internet Protocol version 6 (IPv6) expands address length to 128 bits written as eight 16-bit hexadecimal groups separated by colons (such as 2001:db8:85a3::8a2e:370:7334). Instead of conserving individual host addresses, IPv6 subnetting focuses on clean hierarchical routing across nibble boundaries (4-bit hex digits).
| Feature | IPv4 (RFC 4632) | IPv6 (RFC 5952) |
|---|---|---|
| Address Bit Length | 32 bits (4 octets) | 128 bits (8 hextets) |
| Standard LAN Subnet | /24 (254 usable hosts) | /64 (264 interface IDs) |
| Broadcast Traffic | Yes (last address in subnet) | None (replaced by Multicast ff00::/8) |
| Auto-Configuration | DHCPv4 | SLAAC (requires /64) or DHCPv6 |
2. How IPv4 CIDR & Usable Host Math Works
In IPv4, a CIDR prefix like /26 locks the first 26 bits as the network ID and leaves $32 - 26 = 6$ host bits. That produces $2^6 = 64$ total IP addresses per block (block size = 64). Subtracting the network address (all host bits 0) and the broadcast address (all host bits 1) leaves 62 usable host addresses. Use our Visual IPv4 Subnet Calculator to inspect the exact binary bitmask and wildcard mask for any prefix from /1 to /32.
3. IPv6 Prefix Allocation (/48, /56, /64) & RFC 5952 Rules
In IPv6, Regional Internet Registries assign /32 blocks to ISPs, enterprises receive /48 site prefixes (providing 65,536 individual /64 LAN subnets), and residential broadband routers receive /56 prefixes (256 LAN subnets). Because Stateless Address Autoconfiguration (SLAAC) relies on a 64-bit Interface Identifier, standard local networks are always sized to /64.
Under RFC 5952, canonical IPv6 text formatting requires lowercase hexadecimal digits, suppression of leading zeros inside each 16-bit group (0db8 becomes db8), and using :: only once for the longest run of two or more consecutive all-zero groups. Test any compressed or expanded address in our IPv6 Subnet Calculator.