What is NAT (Network Address Translation)?
A technique that rewrites the IP addresses of packets passing through a router. The variant that also rewrites port numbers so many devices can share one global address is called NAPT (IP masquerading).
Japanese name: NAT
NAT (Network Address Translation) appears in 2 practice questions across 1 topic, including Computer Networking Basics.
Field: Computer Networking Basics
IPv4 address shortage and NAT
IPv4 addresses are 32 bits, only about 4.3 billion, and the spread of the internet left too few new addresses to hand out. NAPT has eased this shortage by using private addresses inside organizations and sharing a few global addresses only when going outside. Carrier-grade NAT (CGN), where the network operator adds another layer of NAPT, is also used. IPv6 has ample addresses, so NAT for saving addresses is basically unnecessary there.
Side effects of NAT
Connections started from outside have no entry in the translation table, so by default they do not reach inside devices. This happens to block incoming connections, but it is no substitute for a firewall. Hosting a server inside requires port forwarding, and applications where devices connect directly to one another, such as online games and calling apps, need techniques to get through NAT (NAT traversal).
FAQ
What is the difference between NAT and NAPT?
NAT rewrites only IP addresses, basically mapping inside and outside addresses one-to-one. NAPT also rewrites port numbers, so many devices can share one global address at once. Home routers perform NAPT.
If I have NAT, do I still need a firewall?
Yes. NAT often ends up blocking connections started from outside, but it is not a rule-based filter, and it does not protect traffic you have port-forwarded or traffic started from inside.