🌐

NAT and IP Addressing

Jun 12, 2025

Overview

This lecture explains how Network Address Translation (NAT) allows multiple devices using private IPv4 addresses to share limited public IP addresses and communicate over the internet.

IPv4 Address Limitations

  • IPv4 supports about 4.29 billion addresses, which have been fully allocated.
  • With billions of internet-connected devices, there are not enough IPv4 addresses for each device.

Private vs. Public IP Addresses

  • Private IP addresses are not routable on the public internet and are defined by RFC 1918.
  • Common private IP ranges:
    • 10.0.0.0 – 10.255.255.255 (often used in large enterprises)
    • 172.16.0.0 – 172.31.255.255
    • 192.168.0.0 – 192.168.255.255 (often used at home)
  • Devices with private IP addresses use NAT to access the internet.

Basic Network Address Translation (NAT)

  • NAT translates a device's private IP address to a public IP address before sending packets to the internet.
  • Example: A device with a private IP of 10.10.20.15 is translated by the router to a public IP (e.g., 94.1.1.1) to communicate outside the local network.
  • When replies come back, the router reverses the translation to deliver data to the internal device.

Port Address Translation (PAT) / NAT Overload

  • PAT allows multiple devices to share a single public IP address by also translating port numbers.
  • Each internal connection gets a unique combination of public IP and port on the router.
  • Multiple users can access the internet simultaneously using the same public IP with different ports.

Key Terms & Definitions

  • IPv4 — Internet Protocol version 4, which supports about 4.29 billion addresses.
  • Private IP Address — IP addresses usable only within local networks, defined by RFC 1918, not routed on the public internet.
  • Public IP Address — An IP address that can be routed on the internet.
  • NAT (Network Address Translation) — A technology that converts private IP addresses to public IPs for internet communications.
  • PAT (Port Address Translation) — Also called NAT overload, allows multiple devices to share one public IP by tracking port numbers.

Action Items / Next Steps

  • Review RFC 1918 for details on private IP address ranges.
  • Understand how NAT tables store and translate private/public IP and port combinations.