Monday 21 October 2019

What is Network Address Translation & how NAT works?

What is Network Address Translation & how NAT works?

This article cover What is Network Address Translation & how NAT works, it features.

WHAT IS NAT?

NAT has many uses, but the main use of NAT is to translate or map the private IPs to public IP address. This is achieved by allowing networks to use private IPv4 addresses internally and by providing translation to a public address only when necessary. NAT has the additional benefit of providing a certain degree of privacy and additional security to a network, since it hides the internal IPv4 addresses of external networks.
Routers with NAT enabled can be configured with one or more valid public IPv4 addresses. These public addresses are known as " NAT pool". When an internal device sends out-of-network traffic, the router with NAT enabled translates the device's internal IPv4 address to a public address in the NAT set. For external devices, all incoming and outgoing network traffic appears to have a public IPv4 address from the set of addresses provided.

In general, NAT routers work at the border of an internal route network. An internal route network is one that has a single connection to its neighboring network, an entrance to the network and an exit from it. In the example in Image 3, R2 is a border router. Viewed from the ISP, R2 forms a network of internal routes.
When a device within the internal route network wishes to communicate with a device outside its network, the packet is forwarded to the border router. The border router performs the NAT process, that is, it translates the internal private address of the device to a public, external and routable address.

NAT FEATURES

There are not enough public IPv4 addresses to assign a unique address to each device connected to the Internet. Networks are usually implemented through the use of private IPv4 addresses, as defined in RFC 1918. Image 1 shows the range of addresses included in RFC 1918. It is very likely that the computer you use to view this website is assigned a private address

These private addresses are used within an organization or a site to allow devices to communicate locally. However, since these addresses do not identify individual companies or organizations, private IPv4 addresses cannot be routed over the Internet. To allow a device with a private IPv4 address to access resources and devices outside the local network, the private address must first be translated into a public address. NAT provides the translation of private addresses to public addresses. This allows a device with a private IPv4 address to access resources outside its private network, such as those found on the Internet. The combination of NAT with private IPv4 addresses proved to be a useful method to preserve public IPv4 addresses. A single public IPv4 address can be shared among hundreds or even thousands of devices, each configured with an exclusive private IPv4 address.
Without NAT, IPv4 address space depletion would have occurred long before the year 2000 . However, NAT has some limitations, which are discussed below. The solution to IPv4 address space depletion and  Network Address Translation limitations is the final transition to IPv6 .

NAT TERMINOLOGY

According to  Network Address Translation terminology, the internal network is the set of networks subject to translation. The external network refers to all other networks.
When using NAT, IPv4 addresses are designated differently, depending on whether they are on the private network or on the public network (Internet), and whether the traffic is inbound or outbound.

NAT includes four types of addresses:

  • Private Local Address
  • Global IP Address
  • External local address
  • Global external address

When determining what type of address is used, it is important to remember that NAT terminology is always applied from the perspective of the device with the translated address:

  • Private address:  the address of the device that is translated through NAT.
  • External address:  the address of the destination device.

 Network Address Translation also uses the concepts of local or global in relation to addresses:

  • Local address:  any address that appears in the internal portion of the network.
  • Global address:  any address that appears in the outer portion of the network.

HOW DOES NAT WORK?

In this example, PC1 with private address 192.168.10.10 wishes to communicate with an external web server with public address 209.165.201.1.


  • PC1 sends a packet addressed to the web server. R1 forwards the packet to R2.
  • When the packet arrives at R2, the router with NAT enabled for the network, R2 reads the source IPv4 address of the packet to determine if it meets the criteria specified for translation.
  • In this case, the source IPv4 address meets the criteria and translates from 192.168.10.10 (internal local address) to 209.165.200.226 (internal global address). R2 adds this local to global address assignment to the NAT table.
  • R2 sends the packet with the translated source address to the destination.
  • The web server responds with a packet addressed to the internal global address of PC1 (209.165.200.226).
  • The R2 receives the packet with the destination address 209.165.200.226. The R2 reviews the NAT table and finds an entry for this assignment. R2 uses this information and translates the internal global address (209.165.200.226) to the internal local address (192.168.10.10), and the packet is forwarded to PC1.


No comments:

Post a Comment