Saturday, May 5, 2012

Network & Port Address Translation

Network Address Translation, or simply put, NAT is the method of modifying IP address information while it moves across a routing device.

There are a 2 main methods of implementing NAT, namely the static and dynamic methods. Static NAT, also known as one-to-one NAT, is the simplest form of providing a translation for one IP address. This form of NAT can also be utilised to interconnect two IP networks even if they have incompatible addressing.

Dynamic NAT on the other hand, is a many-to-many mapping of NAT, for example a private IP address is mapped to a public IP address drawing from a pool of registered or, public, IP addresses. Hence allowing users on the internal network (using private IPs), to be able to surf the Internet after going through the NAT router. A benefit of dynamic NAT is that it is able to aid in securing a network as it is able to mask the internal configurations of the private network and hence cannot be monitored easily by outsiders.

Port Address Translation or PAT is an extension to the NAT function as discussed above. While the main function of NAT is to allow multiple devices on a local area network to be mapped to a single public IP address, PAT's goal is to conserve IP address.

A scenario in which PAT is used would be a typical home network - a router, and two laptops (X & Z). The ISP assigns a single (public) IP address to the router, as laptop X accesses the internet, the router gives X a port number that is appended to its internal address, giving X a unique address. Hence as Z logs into the internet at the same time, another unique address is generated in the context of Z, and in effect, only 1 public IP address is used and therefore there is conservation.

1 comment:

  1. Hi, Adi here.

    This post, to me, is quite good because it is to the point. You've explained both Network Address Translation and Port Address Translation clearly. I feel that you could have added more however. You could have explained the scenarios when NAT is used instead of PAT and vice versa. A diagram would also have been helpful with explaining the last paragraph.

    You could also have added some information about what NAT and PAT require in order to function. NAT, for example needs a range of private addresses, while PAT requires port numbers.

    ReplyDelete