Featured image of post A Deep Dive into NAT64 and 6to4 Transition Mechanisms

A Deep Dive into NAT64 and 6to4 Transition Mechanisms

A technical exploration of NAT64 and 6to4, two mechanisms for transitioning from IPv4 to IPv6.

Introduction to IPv6 Transition Mechanisms

The transition from IPv4 to IPv6 is a long and complex process. There are a number of different mechanisms that can be used to help with the transition. This article will provide a technical deep dive into two of the most popular IPv6 transition mechanisms: NAT64 and 6to4.

NAT64

NAT64 is a mechanism for translating between IPv6 and IPv4. It is a stateful NAT mechanism that allows IPv6-only clients to communicate with IPv4-only servers.

How NAT64 Works

NAT64 works by using a NAT64 translator. The NAT64 translator is a device that is located at the boundary between an IPv6 network and an IPv4 network.

When an IPv6-only client wants to communicate with an IPv4-only server, it sends a DNS query for the server’s name. The DNS server returns an IPv6 address for the server. This IPv6 address is a synthetic address that is created by the NAT64 translator.

The IPv6-only client then sends a packet to the synthetic IPv6 address. The NAT64 translator receives the packet and translates it into an IPv4 packet. The NAT64 translator then forwards the IPv4 packet to the IPv4-only server.

When the IPv4-only server responds, it sends a packet to the NAT64 translator. The NAT64 translator receives the packet and translates it into an IPv6 packet. The NAT64 translator then forwards the IPv6 packet to the IPv6-only client.

DNS64

DNS64 is a mechanism for synthesizing IPv6 addresses from IPv4 addresses. It is used in conjunction with NAT64 to allow IPv6-only clients to communicate with IPv4-only servers.

When an IPv6-only client sends a DNS query for an AAAA record, the DNS64 server will first check to see if there is an AAAA record for the name. If there is an AAAA record, the DNS64 server will return the AAAA record to the client. If there is not an AAAA record, the DNS64 server will then check to see if there is an A record for the name. If there is an A record, the DNS64 server will synthesize an AAAA record from the A record and return it to the client.

6to4

6to4 is a mechanism for tunneling IPv6 traffic over an IPv4 network. It is a stateless mechanism that allows IPv6 hosts to communicate with each other over an IPv4 network.

How 6to4 Works

6to4 works by using a special prefix: 2002::/16. Any IPv6 packet that has a destination address in this prefix will be encapsulated in an IPv4 packet and forwarded to a 6to4 relay router.

The 6to4 relay router will then decapsulate the IPv6 packet and forward it to its destination.

6to4 Relay Routers

A 6to4 relay router is a router that is connected to both an IPv4 network and an IPv6 network. It is responsible for encapsulating and decapsulating 6to4 traffic.

There are a number of public 6to4 relay routers available on the internet.

NAT64 vs. 6to4

Feature NAT64 6to4
Type Stateful NAT Stateless Tunneling
Use Case IPv6-only clients to IPv4-only servers IPv6 hosts to IPv6 hosts over an IPv4 network
DNS64 Required Not required
Relay Router Not required Required

Conclusion

NAT64 and 6to4 are two of the most popular IPv6 transition mechanisms. They are both used to help with the transition from IPv4 to IPv6. NAT64 is a good choice for allowing IPv6-only clients to communicate with IPv4-only servers. 6to4 is a good choice for allowing IPv6 hosts to communicate with each other over an IPv4 network. The best transition mechanism for you will depend on your specific needs.

Built with Hugo
Theme Stack designed by Jimmy