I'll try my best to explain to you all about the concept of NAT Gateway. This is going to be simplest because I believe a 10-to-12-year-old can get on his/her head quickly.
- We can assume an internet gateway (IGW) is like a door between your house and the outside world. Just imagine! When you want to talk to someone or do something outside of your house, you need to go through the door.
- So, an internet gateway will be working in the same way. Thus, it helps your computer or other devices talk to things outside of your house.
A NAT (Network Address Translation) gateway is a special type of internet gateway that helps multiple devices inside your house share one internet connection.
oh, now this is a bit technical to understand. So, again elevate your imagination for the below lines.
- We can magnify our thoughts and assume that It's like a traffic police officer who helps everyone to take turns using the internet via IGW. When you ask for something from the internet, like a website or a video, the NAT gateway makes sure it gets your information to the right device in your house, even if multiple devices are asking for multiple distinct things at the same time.
- So, imagine your house has a group of five people who all want to use the internet at the same time. Without a NAT gateway, everyone would have to take turns using the internet, which can be super-slow and frustrating. Isn't it?
But with a NAT gateway, everyone can use the internet at the same time, without getting in each other's way.
I believe you might have gotten this into your head now. No worries let's see the real picture in technical terms and relate this to the above story.
Now, enjoy this technical below.
- An internet gateway is a networking device that connects to a local network, such as a home or business network, to the internet. Think of it like a doorway between the two networks as we discussed in the above story.
- When a device on the local network wants to communicate with a device on the internet (outside world), the data is sent through the internet gateway and onto the internet.
I think it's better to help you with a step-by-step breakdown of how an internet gateway works.
- When a device on the local network (Home) wants to communicate with a device on the internet (outside home), this device sends a request to the internet gateway (IGW).
- Then, the internet gateway receives the request and checks/verifies to see if it's allowed to go through IGW. If the request is allowed, the gateway forwards it onto the internet.
- The internet receives the request and sends back a response. Hurray!!
- The internet gateway again then receives the response and checks/validates to see which device on the local network sent the original request.
- The internet gateway sends the response back to the device that made the original request. Oh, we reached home!
Till now, we understood how IGW works. Going forward, we'll investigate the picture of NAT.
NAT stands for Network Address Translation.
So, below are the steps listed to understand the operation of NAT Gateway.
- When a device on the local network (home) wants to communicate with a device on the internet (outside home), it sends a request to the NAT gateway.
- The NAT gateway then receives the request and checks/verifies to see which device on the local network sent it.
- The NAT gateway in-fact assigns a unique identifier, called a port number, to the request. Umm, now what's this port number? C'mon let's understand this at the end.
- The NAT gateway sends the request to the internet with the assigned port number.
- When the response comes back from the internet, the NAT gateway uses the port number to figure out which device on the local network to send the response to.
- The NAT gateway again sends the response back to the device that made the original request.
So, in the example of five people sharing a single internet connection, each device on the local network sends its requests through the NAT gateway. The gateway assigns each request to a unique port number, so the internet knows which device the response needs to be sent to. Such that, this allows multiple devices to use the internet connection simultaneously without interfering with each other.
I think we're forgetting something to discuss here from the above chunk of valuable information. Port number!
- It's like an address for your computer or other device. Just like your home has a street address so people can find it through navigation, Similarly, your computer has a port number so the other devices on the internet can find it.
- When you send a message or request over the internet, you include your port number so the other device knows where to send the response (LOCK THE TARGET).
- Think of it like sending a letter - you write your address on the envelope, so the post office knows where to deliver it. Isn't this easy-peasy?
- We have port numbers between 1- 65,535 that's assigned to your devices by the internet gateway.
- It's like your computer's own special phone number on the internet. When you send a request, the internet gateway assigns a unique port number to it so the response can be sent back to your device.
Hope you can relate the port number story to the above explanation!
Have a wonderful day, Happy learning !!