Network Address Translation (NAT)

Share this article

Why we Need Network Address Translation

The Internet is growing larger than anyone ever imagined and the rate of growth has been such that the Internet is effectively increasing exponentially in size each year. For a system to communicate with other systems and Web Servers on the Internet, it must have an Internet protocol (IP) address. Back in the day when IPv6 was not in the picture IPv4 addresses were used. Still, IPv4 is being used by more than 60% of the internet community. It is a unique 32-bit number that identifies the location of your computer on a network.

IPv4 uses 32-bit addresses which means we can have 4,294,967,296 unique addresses (2^32). However, the actual number of available addresses is smaller, IPv4 reserves special address blocks for private networks (~18 million addresses), multicast addresses (~270 million addresses), and testing or other special uses.

With the increase in home networks, business networks, and cyber-physical systems’ networks, the number of available IP addresses is simply not enough. The solution to address this problem is IPv6 but migrating the entire infrastructure can’t be possible in a very short span of time. Therefore, IP Network address translation developed (NAT) as a hack to solve the problem of a shortage of Internet IPv4 addresses.


The need for NAT arises when multiple devices need to access the Internet but only one IPv4 Internet address is assigned by the Internet Service Provider (ISP).

Introduction

Network Address Translation (NAT) refers to a process that involves translation between the internal private IPv4 addresses and the assigned public IPv4 address.

Through a NAT system, all the devices on the private network are able to share the same public IPv4 address. These private addresses are translated into a public IP address when the requests are outgoing i.e. from the network devices to the internet. Similarly, the NAT changes the public IP address to the private IP address when the reverse process happens when incoming data, usually as a response to specific requests, are sent towards a local network.

NAT is developed by Cisco, it can be installed on a firewall, router, or computer that sits between a private network and the public network.

The above picture is an example showing how NAT looks like. A private network is an isolated network where the machine or router doesn’t have any public IP address here we have assigned IP address from subnet 192.168.0.1/16. The computer in dark blue who has assigned private as well as public IP is doing network address translation. This means all the traffic to/from the public is coming/going through the dark blue computer.

Types


NAT can be classified typically into 4 types that can be used to address different kinds of situations and scenarios:

Overloading or Port Address Translation (PAT)

Port Address Translation is one of the most common NAT systems in use. In this, many local (private) IP addresses can be translated to a single registered (public) IP address. Different source port numbers are used to distinguish the traffic. A maximum of 65,536 internal connections can be translated into a single public IP. Therefore, this is most frequently used as it is cost-effective as thousands of users can be connected to the Internet by using only one real global (public) IP address.

Dynamic NAT

Maps a private IP address to a public IP address from a group of public IP addresses at NAT router. For eg., If we have 3 public IP address in a group then at a time, only 3 private IP address gets translated into public address. This mapping usually happens like First Come First Serve. If all the public IP addresses in the group are being used and a request for translation is received then the packets will be dropped.

Static NAT

A static NAT provides a permanent mapping of a single public IP address to a single private IP address created by the private network router. Which means if we have 10 public IP address it can only server 10 private IP address. It is useful when servers needs to be accessed from the outside and can be seen in servers such as Email Servers and Web Servers.

Advantages and disadvantage of NAT

While NAT is useful in a lot of scenarios, it still has its advantages and disadvantages at times. Following are some pros and cons:

Advantages of NAT

  • It conserves the global public IP address space.
  • Networks can use private address space internally while still having access to the Internet.
  • It provides privacy by hiding the IP addressing, internal network topology and the device with network traffic.
  • Get rid of the internal address changes if you change the service provider.

Disadvantage of NAT

  • It is a processor and memory resource consuming technology, since It needs to translate IPv4 addresses for all incoming and outgoing IPv4 datagrams and to keep the translation details in memory.
  • may cause delay in IPv4 communication.
  • Cause loss of end-device to end-device IP traceability
  • Some technologies and network applications which require end-to-end connectivity may not function as expected.

Leave a Comment

Your email address will not be published. Required fields are marked *