NAT

The router maintains a NAT forwarding table which is empty in the beginning. When a client connected to the router wants to send out a packet, the router would receive it and modify the client’s private IP to its own global IP in the packet header. It also changes the source port and notes down this mapping info from <Client IP, Old Port> to <Router Ip, New Port> in the NAT forwarding table. And then it sends out the modified packet.

The server across the Internet serves the client’s request, and exchanges the <Src Ip, port> to <Dst Ip, Port> and sends out the packet. After a set of routing hops, the packet reaches the router. The router then uses the already stored mapping in NAT forwarding table to map the packet back to the private IP client.

You may also like...

Leave a Reply

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