Network Address Translation: The Address Changes Midjourney
A packet, a small unit of network data, can leave a computer carrying one source address and arrive at a website carrying another. Somewhere along the way, a network device has rewritten the address. For the reply to get back, that device also needs to remember which computer the replacement address represents.
Network address translation, usually shortened to NAT, performs that rewriting as traffic crosses between networks. It changes Internet Protocol (IP) addresses, the addresses network equipment uses to send data toward a destination.
One form translates addresses alone. Another translates addresses and port numbers, which identify the ends of conversations handled by programs. Translating both lets multiple devices share an external address while keeping their exchanges distinguishable.
Why the Internet Is Running Out of Addresses
Watch one request change its return address
Take a fictional network using Internet Protocol version 4, or IPv4. One computer uses the private address 192.168.1.10. It opens a connection using port 50000.
The source combination can be written 192.168.1.10:50000. The colon separates the address from the port number. This is a number in the communication system, not a socket you can plug a cable into.
At the edge of the network, the translator replaces that combination with 198.51.100.7:40001. The website now sees that external combination as the source.
The translator records the relationship between the two combinations. This record is called a mapping. The website can send its reply to the external combination, without needing the computer's private address.
- Give every phone, laptop and TV a steadier connection with Wi-Fi 6.
- Stop the buffering at busy hours, with room for many devices at once.
- Replace an aging router and get stronger coverage across more of your home.
When that reply arrives, the translator looks up the mapping and rewrites the destination to 192.168.1.10:50000. It can then send the packet back toward the computer that began the exchange.
Add another computer without losing the first
Suppose a second computer, 192.168.1.20, also starts a connection from port 50000. Its local address differs, but the translator wants both computers to share 198.51.100.7 externally.
It can give the second exchange a different external port, such as 40002. A reply matching external port 40001 belongs to the first mapping; one matching 40002 belongs to the second.
The traditional NAT specification names this form Network Address Port Translation, or NAPT. Basic NAT maps addresses. NAPT also uses ports to distinguish the conversations. Sharing one address among many computers is a useful application of translation, rather than a rule every NAT arrangement follows.
This sharing reduces the number of public IPv4 addresses a network needs. Assigning the local addresses is a separate job. So is a router's decision about where to forward a packet, even when the same equipment performs all these functions.
How One Public Address Serves a Whole House
An outside caller needs an established way in
The example's reply benefits from a mapping created for an outgoing connection. A new caller trying to reach a service inside the network may have no such record to follow.
A static mapping, configured to point incoming traffic toward a particular internal service, can provide that path. By contrast, a dynamic mapping serves an exchange temporarily and may end when the session ends.
The mapping's location matters, too. If traffic takes a route through a different translator, that device still needs the information required to translate it. Without that record, the new translator won't know how to undo the address change.
These details explain a familiar puzzle: a computer can browse websites successfully while an outside computer cannot initiate a connection to it. Direct connections between peers and privately hosted services may need additional support.
- Get five gigabit ports and a fast ARM processor for the price of a basic home router.
- Practice real routing at your desk on gear that network pros also deploy.
- Tuck it beside your modem: it takes up almost no room.
Who lets the traffic through?
A firewall decides which traffic is allowed. Translation rewrites addressing information. Missing mappings and filtering can limit incoming traffic, but a permanent mapping may change what is reachable.
The Internet Engineering Task Force's network-protection guidance separates these functions. Rewriting an address doesn't encrypt a connection or make the receiving application safe. It also doesn't guarantee a speed increase: translation adds records and processing that the device has to manage.
An internet provider can introduce another layer through carrier-grade NAT, sharing public IPv4 addresses among subscribers. The carrier-grade NAT requirements describe this arrangement and its application constraints.
A home-router mapping then controls only part of the route. An incoming connection still has to get through the provider's translation layer.
Private Addressing: Why Separate Networks Can Reuse IP Numbers

Network Ports: How Numbers Sort Traffic Between Programs

What Is a DMZ? Separating Public Servers From Private Systems

QUOTE:
"Amateurs hack systems, professionals hack people."

