Network NAT

Introduction to Network Address Translation (NAT)

Network Address Translation (NAT) is a networking process that allows multiple devices in a private network to access the internet using a single public IP address. It actively helps conserve IPv4 addresses and hides internal systems to provide an added layer of security.

Because IPv4 provides only about 4.3 billion addresses, the internet simply does not have enough capacity for the massive number of smart devices in the world today. NAT entirely prevents IP exhaustion by enabling thousands of private devices to share a highly limited number of public IP addresses.

Key Features


How NAT Works

When you browse a website from your home network, your private IP doesn't actually go out onto the internet. Instead, your NAT-enabled router acts as a translator and middleman.

Private Network PC: 192.168.1.10 PC: 192.168.1.11 NAT Router Public IP: 203.0.113.5 The Internet Public Server

The Step-by-Step Process

  1. A device sends a data request that reaches the NAT-enabled router.
  2. The router replaces the private IP with its own public IP and assigns a unique port.
  3. NAT carefully stores this mapping in the NAT Table.
  4. When the external server responds, NAT uses the stored entry to identify the correct internal device.
  5. It replaces the public IP and port with the original private IP and forwards the packet back to the device.

Reason This Works

Practical Examples


Port Number Masking in NAT

Port number masking is required when multiple internal devices use the exact same port number to communicate with the same external destination.


NAT Inside and Outside Addresses

In NAT terminology, "inside" and "outside" describe the location of devices relative to the local network and define which addresses are subject to translation.

INSIDE (Local Network) OUTSIDE (External Internet) NAT

Types of NAT

There are three main types of NAT based on address mapping methods:

1. Static NAT 1 Private IP to 1 Public IP 2. Dynamic NAT Private IP Pool to Public IP Pool 3. PAT (Overload) Many Private IPs to 1 Public IP

1. Static NAT

Static NAT creates a strict one-to-one mapping between a private IP address and a public IP address.

2. Dynamic NAT

Dynamic NAT maps private IP addresses to public IP addresses from a predefined pool.

3. Port Address Translation (PAT)

PAT, also heavily known as NAT Overload, allows multiple private IPs to share a single public IP using different port numbers.


NAT Techniques


Advantages and Disadvantages

Advantages Disadvantages
Conserves public IPv4 addresses heavily Breaks strict end-to-end connectivity
Allows multiple devices to share a single public IP Can cause issues with VoIP, gaming, and peer-to-peer apps
Hides internal IP addresses from external networks Adds processing overhead on the router
Improves privacy by masking the internal network structure Makes direct peer-to-peer communication more complex

Knowledge Check

?

Which type of NAT (often called NAT Overload) allows thousands of private IP addresses to share a single public IP by utilizing unique port numbers?