IPv4, IPv6, and Subnetting: The Definitive Guide

Every host connected to a TCP/IP network must possess a unique IP address to route traffic accurately. Understanding subnet division is essential for designing resilient cloud VPCs, configuring routing tables, and securing network perimeters.

IPv4 vs. IPv6 Anatomy

  • IPv4 (32-bit): Composed of 4 octets separated by dots (e.g., 192.168.10.1). Theoretical pool is $2^{32} approx 4.29$ billion addresses, which has been exhausted globally.
  • IPv6 (128-bit): Composed of 8 groups of four hexadecimal digits separated by colons (e.g., 2001:0db8:85a3:0000:0000:8a2e:0370:7334). Provides $2^{128}$ unique addresses—ample for trillions of devices.

---

Subnetting & CIDR Explained

Subnetting divides a large contiguous network block into smaller, isolated logical subnetworks. This minimizes broadcast domain congestion and allows precise firewall rules between departments or microservices.

Deciphering CIDR (Classless Inter-Domain Routing)

In CIDR notation like 10.0.0.0/24:
  • The /24 indicates that the first 24 bits represent the Network Prefix.
  • The remaining 8 bits represent assignable Host Addresses.
  • Total Hosts: $2^8 = 256$ total addresses.
  • Usable Hosts: $256 - 2 = 254$ hosts (since the first address is the Network ID and the last address is the Directed Broadcast address).

Standard Subnet Calculation Reference

| CIDR | Subnet Mask | Usable Hosts | Common Use Case | |---|---|---|---| | /30 | 255.255.255.252 | 2 | Point-to-Point Router Links | | /28 | 255.255.255.240 | 14 | Small DMZ / Server Subnets | | /24 | 255.255.255.0 | 254 | Standard Enterprise Office / VPC Subnet | | /16 | 255.255.0.0 | 65,534 | Cloud Region VPC Master Block |
Subnetting is the architectural bedrock of cloud computing (AWS VPC, GCP VPC, Azure Virtual Networks) and on-premises data center planning.