Chapter 5

Network Address Translation (NAT)

By Nikhila Sattala
15 mins read

NAT is a technique used in networking to allow multiple devices on a local network to share a single public IP address. It is commonly used in home and office networks to conserve public IP addresses and enhance security. Here's an elaborate example to explain NAT

Imagine you have a home network with several devices, including computers, smartphones, and a smart TV. Your Internet Service Provider (ISP) has assigned you a single public IP address (let's say Without NAT, only one device could use this public IP address at a time, severely limiting your network's functionality.

Internal Private Addresses: Inside your home network, each device is assigned a private IP address. These addresses are not routable on the public internet and are typically from reserved address ranges like or For example, your computer might have the address

Outgoing Request: When a device in your network, such as your computer, wants to access a website like, it creates a request packet. This packet includes your private IP address (e.g., as the source address and the website's IP address as the destination (e.g.,

NAT Router: Your home router, which has both a private and a public IP address, intercepts the outgoing packet from your computer.

Source Address Translation: The NAT router changes the source IP address of the packet from your computer's private IP address (e.g., to its own public IP address (e.g., It also keeps a record of this translation in a NAT table.

Outgoing to the Internet: The router sends the modified packet out to the internet with the router's public IP address as the source.

Response from the Internet: When the response packet arrives from the internet (e.g., responds), it has a destination IP address of your router's public IP (

Destination Address Translation: Your router, using its NAT table, knows that the incoming packet is meant for your computer ( It translates the destination IP address back to the original private IP address ( and forwards the packet to your computer.


  • Your computer can access websites and services on the internet using the same public IP address.
  • Multiple devices in your home network can share the same public IP address simultaneously.
  • The NAT router keeps track of translations in its NAT table, allowing it to route responses to the correct internal devices.