Network Address Translation (NAT) (original) (raw)

Last Updated : 28 Apr, 2026

Network Address Translation (NAT) allows multiple devices in a private network to access the internet using a single public IP address. It helps conserve IPv4 addresses and hides internal systems for added security.

7

Network Address Translation

**Note: IPv4 provides only 2³² (about 4.3 billion) addresses, which is insufficient considering the massive number of devices connected to the Internet. NAT prevents IP exhaustion by enabling thousands of private devices to share a limited number of public IP addresses.

Working

NAT ways to function is listed as below:

  1. A device sends a request, reaches the NAT enabled router.
  2. Router replaces the private IP with its public IP and assigns a unique port.
  3. NAT stores this mapping in the NAT table.
  4. When the server responds, NAT uses the stored entry to send the packet to the correct internal device.

working_of_nat

Reason This Works

Examples

**Note: When the response arrives from the external server, NAT uses the stored entry to identify the correct internal device. It then replaces the public IP and port with the original private IP and forwards the packet back to the device.

Port Number Masking in NAT

Port number masking is required when multiple internal devices use the 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.

NAT

NAT Inside & Outside Address

Types of NAT

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

Static-NAT

Types of NAT

1. Static NAT

Static NAT creates a 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 known as NAT Overload, allows multiple private IPs to share a single public IP using different port numbers.

NAT Techniques

Advantages

Disadvantages