| 184 | |
| 185 | == NAT64 == |
| 186 | |
| 187 | In its doc, Apple suggests/requires that applications are capable of [https://developer.apple.com/library/content/documentation/NetworkingInternetWeb/Conceptual/NetworkingOverview/UnderstandingandPreparingfortheIPv6Transition/UnderstandingandPreparingfortheIPv6Transition.html supporting IPv6 DNS64/NAT64 Networks]. A common misconception in the SIP world is that by using NAT64, IPv4 and IPv6 interoperability can be automatically achieved (i.e. SIP registration, calls, and media flow will work seamlessly and smoothly between any two endpoints regardless of their address families (IPv4/IPv6)). As the doc says: {{{This (DNS64/NAT64) is an IPv6-only network that continues to provide access to IPv4 content through translation}}}, so a client behind a NAT64 network can reach an IPv4 endpoint, but not necessarily the other way around. |
| 188 | |
| 189 | In more detail, an IPv6-only SIP client behind a NAT64 can communicate with IPv6 (or dual stack) server or clients just fine, but will experience problems with IPv4-only server or clients, because there are IPv6 address literals in the SIP/SDP fields (Via, Contact, SDP), which the IPv4 instance cannot understand. |
| 190 | |
| 191 | According to [http://tools.ietf.org/html/6157 RFC 6157, IPv6 Transition in the Session Initiation Protocol (SIP)]: |
| 192 | * Section 3.1: {{{In order to support both IPv4-only and IPv6-only user agents, it is RECOMMENDED that domains deploy dual-stack outbound proxy servers or, alternatively, deploy both IPv4-only and IPv6-only outbound proxies.}}} |
| 193 | * Section 4: {{{An IPv6 node SHOULD also be able to send and receive media using IPv4 addresses, but if it cannot, it SHOULD support Session Traversal Utilities for NAT (STUN) relay usage [8].}}} |
| 194 | * Section 4.2: {{{When following the ICE procedures, in addition to local addresses, user agents may need to obtain addresses from relays; for example, an IPv6 user agent would obtain an IPv4 address from a relay. }}} |
| 195 | * Section 4.2:{{{ Implementations are encouraged to use ICE; however, the normative strength of the text above is left at a SHOULD since in some managed networks (such as a closed enterprise network) it is possible for the administrator to have control over the IP version utilized in all nodes and thus deploy an IPv6-only network, for example. The use of ICE can be avoided for signaling messages that stay within such managed networks. }}} (our note:⇒ which means when network is not standardized to one IP version, the use of ICE is a "must"). |
| 196 | |
| 197 | Therefore, to support IPv6-IPv4 interoperability in NAT64 environment: |
| 198 | 1. Application needs to replace all IPv6 occurrences with IPv4. |
| 199 | |
| 200 | In order to do this, we need to be able to synthesize IPv4 from IPv6 address. Apple uses the API getaddrindo() for this purpose, however this is only specific to Apple and as such, can only be considered as a workaround for now since other platforms may not support it. |
| 201 | 2. Our RECOMMENDATION is that when the client is put with an IPv6-only connectivity, the SIP server must also support IPv6 connectivity. |
| 202 | |
| 203 | However, if the user is unable to install IPv6 server (maybe because it’s not his/her server), then user needs to enable ICE and use “dual stack” TURN (which is supported since PJSIP 2.6). |