NAT64

On this page 7

NAT64 is a stateful translation mechanism that allows hosts on an IPv6-only network to communicate with servers that are reachable only over IPv4, by representing every IPv4 address inside a dedicated IPv6 prefix and rewriting packet headers at a gateway. In Internet addressing, it is one of the main transition technologies that let operators retire IPv4 inside their networks while the wider Internet still contains many IPv4-only services.

NAT64 almost always works together with DNS64, a DNS resolver function that synthesizes IPv6 answers for names that have only IPv4 records. The pair is specified in RFC 6146 (stateful NAT64), RFC 6147 (DNS64) and RFC 6052 (the address format), and it underpins IPv6-only mobile networks serving hundreds of millions of devices.

How NAT64 translates between IPv6 and IPv4

NAT64 translates traffic by embedding a 32-bit IPv4 address in the low-order bits of an IPv6 address that belongs to a translation prefix, most often the well-known prefix 64:ff9b::/96. An IPv6-only client that wants to reach 192.0.2.10 sends its packet to 64:ff9b::c000:20a, and the network routes that prefix to the NAT64 gateway.

The gateway then performs header translation according to the SIIT algorithm (RFC 7915): it builds an IPv4 header, replaces the client’s IPv6 source with one of its own public IPv4 addresses and a port, and records the mapping in a session table. Replies from the IPv4 server match that entry and are translated back into IPv6. The process typically runs as follows:

  1. The client asks DNS64 for the address of an IPv4-only name.
  2. DNS64 finds only an A record and returns a synthesized AAAA record inside the NAT64 prefix.
  3. The client sends an IPv6 packet to that synthesized address.
  4. The gateway translates the header, allocates an IPv4 address and port, and forwards the packet.
  5. Return traffic is matched to the session and translated back to IPv6.

The table below shows how the main header fields are handled during translation.

IPv6 fieldIPv4 fieldTranslation rule
Source addressSource addressReplaced by a pool address and port
Destination addressDestination addressExtracted from the embedded 32 bits
Hop limitTime to liveCopied and decremented
Traffic classType of serviceCopied by default
Next headerProtocolMapped, with ICMPv6 converted to ICMP
Payload lengthTotal lengthRecalculated for the IPv4 header
Header field mapping in NAT64

Address formats and translation prefixes

The RFC 6052 address format defines where the IPv4 address sits inside the IPv6 address, and the position depends on the length of the chosen prefix. Operators can use the well-known prefix or a network-specific prefix taken from their own address space.

Prefix typeExampleTypical useMain constraint
Well-known prefix64:ff9b::/96Public IPv4 destinationsMust not carry private IPv4 addresses
Local-use prefix64:ff9b:1::/48Internal translation domainsNot routed on the public Internet
Network-specific prefixAn operator /96 or shorterMultiple gateways or private targetsClients must discover the prefix
Translation prefix options

Applications that build addresses themselves need to know the prefix in use. Hosts discover it through RFC 7050 prefix discovery, which queries the special name ipv4only.arpa, or through the PREF64 option in router advertisements defined in RFC 8781.

NAT64 compared with other transition mechanisms

NAT64 is one option among several that bridge IPv4 and IPv6, and each makes a different trade-off between simplicity, application compatibility and operator effort. The main difference is whether the access network itself still carries IPv4.

MechanismIPv4 inside the access networkLiteral IPv4 supportState location
NAT64 with DNS64NoneBroken without extra helpCentral gateway
464XLATNone, emulated on the deviceSupported through the CLATCentral gateway plus device
Dual stackFull native IPv4SupportedUsually CGNAT for IPv4
DS-LiteTunneled inside IPv6SupportedCentral tunnel concentrator
MAP-T or MAP-ETranslated or tunneledSupportedStateless, port sets on the edge
Common IPv4 and IPv6 coexistence approaches

In practice, 464XLAT is the most common companion: a client-side translator called CLAT turns IPv4 traffic from legacy applications into IPv6, and the provider-side NAT64 gateway, acting as the PLAT, turns it back into IPv4.

Deploying NAT64 in production networks

A production NAT64 deployment needs public IPv4 pool sizing, logging and redundancy planned in the same way as carrier-grade NAT. Each IPv4 address offers about 64,000 ports per transport protocol, and an active smartphone or laptop may hold hundreds of simultaneous sessions, so a pool of a few hundred addresses can serve a large subscriber base only when port allocation is managed carefully.

Operators also need translation logs that map IPv4 address and port back to the IPv6 subscriber for abuse handling and lawful requests. Port block allocation reduces log volume by assigning each subscriber a fixed range of ports and logging only the block assignment.

SituationRecommended choiceReason
Mobile network with modern handsetsNAT64 with 464XLATNative CLAT support in common mobile operating systems
Enterprise guest Wi-FiNAT64 with DNS64 plus PREF64Simple IPv6-only design for browsers and apps
Data center with IPv4-only dependenciesNetwork-specific prefixAllows translation to private IPv4 services
Network with many legacy devicesKeep dual stackLiteral IPv4 use would break under NAT64 alone
Deployment decisions for NAT64

Limitations and failure modes

NAT64 fails in predictable ways, and most problems come from applications that bypass DNS64 or from interactions with security features. Experienced operators test the following cases before switching a network to IPv6-only.

  • IPv4 address literals in URLs, configuration files or protocols cannot be resolved by DNS64 and fail without a CLAT.
  • DNSSEC validation on the client rejects synthesized AAAA records because they were never signed by the zone owner.
  • Protocols that embed addresses in the payload, such as some VoIP and FTP modes, need application-level gateways.
  • Path MTU differences between the two headers, a 20-byte gap, can cause fragmentation issues when ICMP is filtered.
  • Session table exhaustion under heavy load blocks new connections even though existing ones keep working.

NAT64 also inherits the general drawbacks of address sharing: inbound connections to IPv6-only clients from IPv4 are not possible without explicit mappings, and many users behind one IPv4 address can trigger rate limits or reputation blocks on remote services.

The idea in brief

The Internet speaks two address languages: the older IPv4 and the newer IPv6. Some networks now speak only the new one, yet many websites still understand only the old one.

NAT64 is a live interpreter at the border between them. Your phone writes a letter in IPv6, the interpreter rewrites the envelope in IPv4, sends it on, and translates the reply back. A helper in the phone book, called DNS64, gives your phone a translated address to write to in the first place. The key point is that the network can drop the old language internally without cutting users off from older services.

A practical scenario

A mobile operator with 4 million subscribers runs out of private IPv4 space for its dual-stack design. It moves its smartphone customers to IPv6-only connectivity with 464XLAT, placing NAT64 gateways in two data centers and announcing 64:ff9b::/96 inside its core. Each gateway pair shares a pool of 512 public IPv4 addresses and assigns subscribers blocks of 256 ports.

After migration, about 70 percent of traffic already travels natively over IPv6 to large content and cloud platforms, so only the remaining 30 percent passes through NAT64. Handsets with a built-in CLAT keep apps that use IPv4 literals working. The operator stops expanding its IPv4 address plan, simplifies its radio network configuration to a single protocol, and keeps translation logs small thanks to port block allocation.