Skip to main content

Module nat64

Module nat64 

Source
Expand description

NAT64 for the Happy Eyeballs engine on an IPv6-only network (RFC 8305 section 7, RFC 8445 section 5.1.1.2): the prefix the network’s NAT64 uses is discovered with RFC 7050 (the AAAA records of IPV4ONLY_ARPA, which a DNS64 resolver synthesizes from its well-known IPv4 addresses), and IPv4 addresses are written into IPv6 ones with that prefix as RFC 6052 section 2.2 has it.

Structs§

Nat64Prefix
A NAT64 prefix (RFC 6052 section 2.2): its first len bits are the network’s.

Constants§

IPV4ONLY_ARPA
RFC 7050 section 2: the well-known name whose AAAA records a DNS64 resolver synthesizes.
PREFIX_LENGTHS
RFC 6052 section 2.2: the prefix lengths an IPv4-embedded IPv6 address may have.
WELL_KNOWN_IPV4
RFC 7050 section 2.2: the well-known IPv4 addresses of IPV4ONLY_ARPA.

Functions§

discover_prefixes
RFC 7050 section 3: the NAT64 prefixes the AAAA answers for IPV4ONLY_ARPA show. Each IPv6 address is searched for one of the WELL_KNOWN_IPV4 addresses at each prefix length (longest first); an address that holds none is not a synthesized one and is ignored. Duplicates are dropped; the order of the answers is kept.
synthesize_all
RFC 8305 section 7.1: the IPv6 addresses synthesized for the IPv4 ones among addresses with each of prefixes, with their ports. “The synthesized addresses are then inserted into the list of addresses as if they were results from DNS queries”.