In computer networking, not all IP addresses are created equal. While every device participating in the global web must be uniquely identifiable, allocating a globally unique public IP to every smart bulb, phone, and laptop would have exhausted IPv4 before the turn of the millennium. The solution lies in the fundamental distinction between Public IP addresses and Private IP addresses, bridged seamlessly by Network Address Translation (NAT).

Interactive CIDR Prefix & Subnet Calculator

Select a CIDR prefix to calculate the corresponding subnet mask, total address space, and usable host count.

Core Differences: Public vs. Private

Attribute Public IP Address Private IP Address (RFC 1918)
Routability Globally routable across the public Internet Non-routable; dropped by internet core routers
Assignment Allocated by IANA / RIRs to ISPs Assigned locally by router DHCP or network admin
Uniqueness Globally unique; no duplicates worldwide Locally unique; reused across billions of LANs
Visibility Seen by web servers, remote hosts, and APIs Hidden behind gateway NAT boundary
Cost Leased from ISPs (frequently charged for statics) Completely free for unlimited internal deployments

The RFC 1918 Private Ranges

The Internet Engineering Task Force established three standardized address blocks reserved strictly for private internal networks under RFC 1918:

  • Class A Range: 10.0.0.0 – 10.255.255.255 (10.0.0.0/8). Provides 16,777,216 distinct addresses, utilized by cloud providers, datacenters, and large enterprises.
  • Class B Range: 172.16.0.0 – 172.31.255.255 (172.16.0.0/12). Provides 1,048,576 addresses across 16 contiguous /16 blocks, standard for university campuses and container orchestrators like Docker.
  • Class C Range: 192.168.0.0 – 192.168.255.255 (192.168.0.0/16). Provides 65,536 addresses, subdivided into 256 /24 subnets. Subnets like 192.168.1.0/24 and 192.168.0.0/24 power hundreds of millions of residential Wi-Fi routers worldwide.

How Network Address Translation (NAT) Operates

When your laptop at home with private IP 192.168.1.45 requests a web page from a remote server, that private address cannot travel onto the public internet. Your home router acts as a NAT gateway:

  1. Outbound Translation: Your router intercepts the packet, substitutes your private IP and local port with the router's single public IP and an assigned ephemeral source port (e.g., port 49152).
  2. State Table Tracking: The router records this mapping in an internal NAT translation table: 192.168.1.45:51234 <--> 203.0.113.19:49152 <--> Remote Server.
  3. Inbound Demultiplexing: When the remote server replies to the public IP on port 49152, the router consults its translation table, translates the destination back to 192.168.1.45:51234, and forwards the packet to your laptop.

Carrier-Grade NAT (CGNAT - RFC 6598)

As IPv4 exhaustion intensified, ISPs ran out of public IPv4 addresses even for home routers. To solve this, ISPs deployed Carrier-Grade NAT (CGNAT), placing residential routers behind an additional layer of carrier-level translation using the dedicated prefix 100.64.0.0/10.

While CGNAT conserves IP space, it creates "Double NAT," complicating self-hosted web servers, port forwarding, and peer-to-peer online gaming.

Discover your current public IP address and whether your connection is flagged as datacenter or mobile on our live diagnostic dashboard.