IP Addressing, Subnetting, and Network Security Fundamentals
A foundational guide to the Internet Protocol: IPv4 versus IPv6, CIDR prefix masks, RFC 1918 private address ranges, Network Address Translation (NAT), and geolocation privacy.
Every packet of data traveling across the global internet relies on an Internet Protocol (IP) address to reach its intended destination. Whether you are configuring server firewalls, setting up cloud subnets on AWS or Google Cloud, or diagnosing visitor geo-targeting, understanding the mathematical structure of IP addressing is essential.
01 IPv4 vs. IPv6 Architecture
IPv4 (32-bit Architecture)
Expressed in 4 decimal octets separated by dots (e.g., 192.0.2.1). Yields \(2^{32}\) total theoretical addresses (\(\approx 4.29\text{ billion}\)), which are now completely exhausted globally by IANA.
IPv6 (128-bit Architecture)
Expressed in 8 groups of 4 hexadecimal digits separated by colons (e.g., 2001:0db8:85a3::8a2e:0370:7334). Yields \(2^{128}\) addresses (\(\approx 3.4 \times 10^{38}\)), providing virtually infinite unique addresses.
02 CIDR Notation & Subnet Mask Math
Classless Inter-Domain Routing (CIDR) replaced older class-based networks (Class A, B, C) with a flexible prefix slash notation denoting how many leading bits represent the network prefix:
| CIDR Prefix | Subnet Mask | Total Usable Usable Host IPs | Common Usage |
|---|---|---|---|
| /32 | 255.255.255.255 | 1 | Single host / server loopback |
| /24 | 255.255.255.0 | 254 (256 − 2) | Standard office LAN, small cloud VPC |
| /16 | 255.255.0.0 | 65,534 | Corporate intranet / enterprise cloud |
| /8 | 255.0.0.0 | 16,777,214 | Large telecom carrier / ISP allocation |
*Note: In any subnet, 2 addresses are reserved: the network identifier (all host bits 0) and the broadcast address (all host bits 1).
03 Public vs. RFC 1918 Private IP Ranges
To conserve IPv4 addresses, the Internet Engineering Task Force (IETF) reserved specific blocks for non-routable private networks (RFC 1918):
10.0.0.0to10.255.255.255(10.0.0.0/8 — Enterprise private networks)172.16.0.0to172.31.255.255(172.16.0.0/12 — Medium corporate networks)192.168.0.0to192.168.255.255(192.168.0.0/16 — Home Wi-Fi routers)
Because these addresses are never routed over public internet backbones, routers use Network Address Translation (NAT) to map thousands of local private devices to a single external public IP address.
04 What Your Public IP Exposes
Whenever your device connects to any web server, your public IP is transmitted in the IP packet header. This reveals:
Country, state/region, city, and postal code inferred from ISP routing BGP announcements.
Autonomous System Number (ASN) and organization name (e.g. Comcast, Verizon, AT&T).
Inspect Your Current IP Exposure
Check your public IPv4, IPv6, ISP hostname, and approximate geolocation coordinates.