Have you ever wondered why the IPV4 address is still in active use today? Even with the multiplicity of devices connected to the internet, the very limited IPV4 address is yet to be exhausted.
IPV4 is said to have an address pool of 4,294,967,296 IP addresses. With 18 million for private networks and 270 million for multicast and other reserved addresses, this makes address availability very insufficient.
The rise of IoT, and the drive to have every electronic device inter-networked, has also made it very difficult to keep up with IPV4 shortages. IPV6 promises to solve this problem with an address pool sufficient enough to give an IP address to every square meter on the earth’s surface. But the implementation of IPV6 has been slow and has left us dependent on IPV4.
Now, another question arises. What is the magic that our hardworking ISPs use to ensure there are enough public IP addresses for the large number of smart devices that need internet connectivity?
PAT and NAT are your magic technology.
Network Address Translation (NAT) is a technique used by Internet Service Providers (ISPs) to map an IP address to another. This is done by changing the network address information in the header of the packet en-route to its destination. Let’s go through an explanation with the aid of a diagram.
In the above diagram, a host with a private IP address 10.0.0.1
wants to communicate over the internet with a server with the IP address 200.100. 10.1
, possibly to access some documents.
This would not be possible because private IP addresses cannot be used on the internet. But the ISPs now come in, using the NAT technique to map the private IP 10.0.0.1
to the public IP 150.150.0.1
, enabling it to communicate with the server on the internet. This is possible because NAT masquerades private IP addresses with public ones.
This is achieved by using a routing table that holds a
A situation can arise whereby the IP addresses available to the service provider (using the NAT router) are grossly insufficient to accommodate the number of
Port Address Translation (PAT) is a way of overloading NAT with port numbers so that with a few public IPs, the hosts on a private network can reach other hosts on the
PAT allows NAT to support more hosts. With PAT, the
For example, if an HTTP request is coming from two different hosts, the addresses of these hosts can be managed like this: the private IP of each host can be attached to the same public IP, and the port address of the communicating application can be attached as well.
With this setup, a very unique identifier is created for each host on that network, and the server doesn’t really care if it has multiple connections to the same host or a single connection to different host’s IP addresses. There are about 65,000 port numbers available for use by this PAT technique.
In summary, NAT and PAT do the following: