Types of Network Address Translation

While still very useful, the old definition of NAT types is outdated. The new definition accurately reflects the kind of NAT present in the network and what we can expect from the translator.

Glossary:

The old but common definition

You can still read this definition in the NAT page on Wikipedia. In short, we have these different types of NAT:

As you can imagine, Symmetric NAT is the worst possible situation for NAT bypass techniques (like UDP hole punching). Sometimes an ISP uses a specific implementation of NAT on purpose. E.g., symmetric NAT uses more device resources, but it won’t allow any traversal mechanism (hence things like BitTorrent or other p2p clients will suffer) and may use fewer public IPs.

The current definition

The current definition from RFCs (mostly RFC 4787) splits the behavior into parts: mapping, filter, port number, and hairpin.

Mapping

The mapping indicates which kind of mapping will occur:

Filtering

The filtering behavior controls who can use the mapped external-host and external-port to reach the internal address host:port:

Port number

A NAT device can decide to operate in different ways when assigning mapped external-ports:

Hairpin

Lastly, hairpin is the property of some routers to allow communications between hosts in the same LAN using the public/external address of the router itself. This is very useful when two hosts are trying to establish a link in the same network, and they are not aware that they can reach each other directly.

Other attributes

Note that some NAT devices have been found to change the behavior dynamically, based on resource consumption or other factors. If you’re interested in this, a chapter named “Deterministic Properties” in the RFC 4787 explains the findings.

Also, the RFC 4787 defines other minor attributes: Port parity is the capability of preserving the parity of UDP ports (even ports will be mapped to even ports, etc.), Port Contiguity when the NAT device assigns ports sequentially in some cases (like in RTCP=RTP+1), Mapping Refresh is the way the NAT device handle the mapping expiration and keepalives, handling of Application Layer Gateways, and blocking/allowing ICMP Destination Unreachable packets.

Migrate/translate between the previous and the current definition

The old and the new definitions are incompatible because the new one explains the situation with more details and possibilities. However, we can still map between them if we remember that the mapping will be somehow “fuzzy”.

Old mapping name Mapping Filtering
Full cone Endpoint-Independent Endpoint-Independent
(Address)-restricted cone Endpoint-Independent Address-Dependent
Port-restricted cone Endpoint-Independent Address and Port-Dependent
Symmetric Address- and Port-Dependent Address-Dependent / Address and Port-Dependent

Port preservation, hairpin, and other attributes were not present in the previous definitions. Also, any type of NAT may use any port reservation mechanism (unrelated), so adding these to the table makes little sense.