What is NAT and why is it needed in modern networks?
Network Address Translation (NAT) technology is designed to convert IP addresses within one private network into IP addresses of another network, usually the public internet. Historically, NAT was created to solve the IPv4 address shortage problem, allowing thousands of devices in an office or home to access the internet through a single public address provided by the ISP.
NAT operation is based on swapping the source and destination addresses and ports in network packet headers. A router with NAT support maintains a special translation table that records which local device corresponds to a specific outgoing port in the outside world. When a response packet arrives, the router checks the table and redirects the traffic to the correct client inside the local network.
In addition to address conservation, NAT performs a security function by hiding the internal architecture of a home or corporate network from external observers. Devices from the internet cannot directly access a computer behind a router unless port forwarding is explicitly configured. This creates a basic level of isolation for all gadgets connected to the local network.