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

How NAT and NAPT work

Basic NAT rewrites addresses one-to-one between inside private addresses and outside global addresses. NAPT, widely used in homes and offices, rewrites the source port number as well as the IP address and records the mapping between "inside address and port" and "outside port" in a translation table. Returning packets have their destinations rewritten back using the table and are delivered to the right device. This lets many devices use one global address at the same time.

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).

Try it: questions about NAT (Network Address Translation)

Home broadband routers perform NAPT (IP masquerading), a form of NAT (Network Address Translation). What does NAPT make possible?

  1. ASeveral devices in the home can share one global IP address simultaneously to communicate with the internet, distinguished by port number
  2. BTraffic between home devices and the internet is encrypted so it cannot be eavesdropped on the way
  3. CEach device in the home is automatically assigned its own separate global IP address
Show answer and explanation

Answer: A. Several devices in the home can share one global IP address simultaneously to communicate with the internet, distinguished by port number

NAT (Network Address Translation) rewrites the source or destination IP addresses of packets passing through a router. NAPT rewrites port numbers as well as IP addresses and records the mapping between "inside address and port" and "outside port" in a translation table. This lets several devices using private addresses share the router's single global address at the same time. Returning packets are delivered to the right device by looking up the table. It only rewrites addresses and does not encrypt anything. Also, connections started from outside have no entry in the table, so they do not reach inside devices by default; hosting a server inside requires settings such as port forwarding.

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.

NAT (Network Address Translation) in the explanations

Questions that mention NAT (Network Address Translation) (2)

  1. Home broadband routers perform NAPT (IP masquerading), a form of NAT (Network Address Translation). What does NAPT make possible?
  2. Which of the following IPv4 addresses falls within a private address range?

Books on Computer Networking Basics Ad

As an Amazon Associate I earn from qualifying purchases.

Semiconductor, Electronics and Computing Calculators

Related terms

ARP CIDR CSMA/CA Default gateway DHCP DNS (Domain Name System) MAC address OSI reference model Port number Subnet mask

Back to the glossary