Network Address Translation is a very deep and sophisticated topic, but we are here only to give you an idea about these technologies, so you’ll be aware of what it is and how it works. We will just cover the tip of an iceberg in this post, just to familiarize you with this topic.
We all know each device needs a unique IP to connect to the internet. If you have no idea about IP addresses refer this post. So imagine if each device got a unique IP address, even the 4,294,967,296 IP v4 addresses will get over quickly. Every person will have 1 IP for his laptop, one for his mobile or tablet. Each device will use a unique address and IP v4 addresses will exhaust. To solve this problem, we use Network Address Translation i.e. NAT.
In NAT, we don’t actually allocate the real IP address to users. Instead we give them a local IP for their devices, which is associated with the real IP address the user is using on web. If you want to verify this, run ‘ipconfig’ in cmd or ‘ifconfig’ in terminal and note down the IPv4 address. Now go to What Is My IP and check your IP address on web. They will never match, because the day they will, there will be no free IP address.Without NAT, a family of 4 will have at least 8 IP addresses. But using NAT, we can allocate only 1 IP address to all the 4 members or 8 devices. But how is this possible?
Well if we take an example of router, you’ll understand this quickly. Whenever any device connects to the router, it will allocate the device a local IP, generally in the range of 192.168.x.x (x being any value in 0 to 255). But if you go to What Is My IP using any device, you’ll get the same IP address across all of them. It is the job of router to keep track of which device wants which web page and deliver it to them accordingly. You can refer How Router Works? to know about this process in detail.
Well for those who don’t have a router, the process is exactly the same, the only difference being the Address Translation is carried out by the switch in ISP’s office instead of a router at your home. This is why, if you’ve a static IP address, you never enter your real IP address in your settings. This Network Address Translation has made the internet possible and far less complicated than it actually is. There are various Apps, for checking IP addresses, which will show you local IP and Public IP on the same screen. Try it and you’ll understand this better.