What is NAT (Network Address Translation)
NAT stands for network address translation and this is a service that is used in routers. Its purpose is to convert a group of IP addresses to another group of IP addresses. The reason for having the NAT service is to help the Limited number of IP version 4 public IP addresses that we have available around the world.
When the IP version 4 address was introduced,
engineers didn't realise how big the internet would be Because even though
there were over 4 billion IP version 4 addresses available.
The engineers thought 4 billion IP addresses would
be enough, but they were wrong.
To prevent a shortage of public IP version 4 addresses, engineers
developed two terms public and private IP addresses and (NAT) network address translation to work in between.
Now there are two different types of IP
version 4 addresses there's public and there is private.
Public IP Address:
Public IP addresses are publicly registered
on the Internet. You must have a
public IP address if you want to go on the internet and there are approximately
4 billion public IP addresses available. As they are limited to 4 billion public IP addresses.
Private IP Address:
Now Private IP addresses are not publicly
registered. You cannot directly access the internet with a private IP. Private IP addresses
are only used internally
(Local Area Network) such as inside a home or business.
They are not accessible outside on the public Internet worldwide and your router is what assigns your
internal devices a private IP
address.
Let's have a
daily life example to further explain, that most homes and
businesses are not going to have just one device that needs internet access.
They are going to have multiple devices that need
access to the Internet. All devices need a public IP address if they
want to access the Internet. We need additional public IP
addresses for all our devices but that’s going to be expensive to have these
additional IP addresses. Now It would
also be a waste of public IP addresses as well as a waste of money. On the other hand, if
every device in the world had its own public IP address, we would have run
out of public IP addresses as we are already.
Routers with
NAT are introduced to fulfil this gap, router
assigns the devices inside our home or business Private IP addresses
and when our devices need to access the Internet Their private IP
address will be translated by NAT in the router to the one public IP
address that we have been given by internet
service provider.
This is what NAT does it Translates a set of IP addresses to another set
of IP addresses.
Not only does it translate private to public but
also translates public to private.
If a computer out on the internet
wants to communicate with a computer on this private network, then the public IP
address needs to be translated by NAT to the private IP address for that
computer.