In context of establishing TCP connections between XMPP entities, RFC 6120 [1] defines the resolution of Fully Qualified Domain Names of the receiving entity (server) by an initiating entity (client or server). The described Preferred Process uses SRV lookup, based on RFC 2782 [2], and a Fallback Process using A or AAAA record resolution.
The Preferred Process definition explicitly states that resolved addresses are tried in a particular sequence, progressing to the next address only after a preceding connection attempt has failed. As specific addresses or entire address families (IPv4 vs IPv6) may perform suboptimal on a network, or may be blocked, or broken completely, this can lead to user-visible delay.
Requirements for algorithms that reduce such delay are specified in RFC 8305 [3]. This XEP defines how this 'Happy Eyeballs' technique can be applied to XMPP, thus reducing the aforementioned user-visible delays.
This document mostly uses terminology borrowed from RFC 2782 [2], RFC 6724 [4] and RFC 8305 [3].
The primary goal of 'Happy Eyeballs' is to reduce user-visible delays when connections are established, notably on dual-stacked hosts.
The 'Happy Eyeballs' algorithm as defined in RFC 8305 [3] does not take into account the SRV lookup that is defined to be XMPP's Preferred Process for the resolution of Fully Qualified Domain Names. SRV defines attributes that are used for target host priority and server selection.
By deploying multiple SRV Resource Records (RR) that contain 'weight' and 'priority' attributes that are unequal to that of other RRs, the administrator explicitly defines that certain servers are more preferable than others. As this is a deliberate act, such information SHOULD NOT be discarded. This XEP describes how these attributes are best applied in a 'Happy Eyeballs' algorithm.
The 'Happy Eyeballs' algorithm described in this section applies primarily to the Preferred Process of resolution of fully qualified domain names as described in RFC 6120 [1], section 3.2.1, as it largely focuses on the incorporation of address characteristics discovered through SRV lookups.
When an initiation entity makes use of the Fallback Process defined in RFC 6120 [1], Section 3.2.2, then the 'Happy Eyeballs' algorithm defined in this XEP is essentially the same as the algorithm that is specified in RFC 8305 [3].
The initiating entity preforms an SRV lookup, sorts and orders the resulting list of target hosts, as defined in the 'Usage rules' section of RFC 2782 [2]. This results in a complete, ordered list of target hosts.
To maintain strict ordering as defined by the 'priority' attribute of SRV, the remainder of the algorithm is applied iteratively for each group of target hosts that shares the same SRV 'priority' value ('priority groups'), in priority order (lowest first, as specified in RFC 2782 [2]). Only after all connection attempts (as described in section 4.4) for all target hosts in the first priority group are exhausted, target hosts for the subsequent priority group are processed. This is repeated for all priority groups.
The initiating entity sends out both AAAA and A DNS queries, largely following the process as defined in section 3 'Hostname Resolution Query Handling' of RFC 8305 [3]. The process defined therein, which is based on resolution of one hostname, is adjusted as follows to accommodate the lookup of more than one hostname (each of the target hosts returned by the SRV lookup):
An AAAA and A query is sent out for each host in the priority group, starting with an AAAA query for the first host, immediately followed by an A query for the first host. This is immediately followed by an AAAA query, and then an A query, for the second host. This is repeated for all hosts in the priority group.
In line with section 3 of RFC 8305 [3], a connection attempt is immediately started if a positive AAAA response for the first host is received first, and the 'Resolution Delay' is applied when the A response for that host is received first due to reordering. As stated in RFC 8305 [3], this is done to give preference to IPv6. In addition to the specification in RFC 8305 [3], the 'Resolution Delay' is also applied when responses for hosts other than the first target are received prior to receiving responses for the first target. This helps maintain the preference order that is derived from SRV's 'weight' attribute.
RFC 8305 [3], Section 4 describes how resolved addresses are sorted before attempts are mode to connect to them, which is a slightly modified version fo the Destination Address Selection as defined in RFC 6724 [4], Section 6.
An additional Destination Selection rule that prefers an addresses by their SRV-defined Weight attribute SHOULD be added before rule 9 of RFC 6724 [4] (but after the two rules added by RFC 8305 [3]).
Connection attempts are made as described in RFC 8305 [3], Section 5. If no successful connection has been established after the entire sorted list of addresses has been processed, the initiating client can restart the algorithm with Hostname Resolution of the next priority group.
When all priority groups are exhausted and no connection has been successfully established, the initiating entity MAY attempt to establish connections using Fallback Process defined in RFC 6120 [1], Section 3.2.2. If it does, it SHOULD implement this in accordance with the 'Happy Eyeballs' algorithm as defined in RFC 8305 [3].
This XEP, similar to RFC 8305 [3], assumes that the preference policy for the host destination address favors IPv6 over IPv4, as it has many desirable properties designed to be improvements over IPv4. If so desired, the recommendations in this document can easily be adapted to change to reflect a different preference policy.
This document does not require any Accessibility Considerations.
This document does not define Security Considerations in addition to those defined in RFC 2782 [2], RFC 6724 [4] and RFC 8305 [3]
This document does not define Privacy Considerations in addition to those defined in RFC 2782 [2], RFC 6724 [4] and RFC 8305 [3]
This document does not require any IANA actions.
This document does not require any XMPP Registrar actions.
Work on this specification was funded through the NGI0 Core Fund, a fund established by NLnet with financial support from the European Commission's Next Generation Internet programme, under the aegis of DG Communications Networks, Content and Technology. The author's gratitude goes out to all those involved in realizing this valuable opportunities.
This document in other formats: XML PDF
This XMPP Extension Protocol is copyright © 1999 – 2024 by the XMPP Standards Foundation (XSF).
Permission is hereby granted, free of charge, to any person obtaining a copy of this specification (the "Specification"), to make use of the Specification without restriction, including without limitation the rights to implement the Specification in a software program, deploy the Specification in a network service, and copy, modify, merge, publish, translate, distribute, sublicense, or sell copies of the Specification, and to permit persons to whom the Specification is furnished to do so, subject to the condition that the foregoing copyright notice and this permission notice shall be included in all copies or substantial portions of the Specification. Unless separate permission is granted, modified works that are redistributed shall not contain misleading information regarding the authors, title, number, or publisher of the Specification, and shall not claim endorsement of the modified works by the authors, any organization or project to which the authors belong, or the XMPP Standards Foundation.
## NOTE WELL: This Specification is provided on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. ##
In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall the XMPP Standards Foundation or any author of this Specification be liable for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising from, out of, or in connection with the Specification or the implementation, deployment, or other use of the Specification (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if the XMPP Standards Foundation or such author has been advised of the possibility of such damages.
This XMPP Extension Protocol has been contributed in full conformance with the XSF's Intellectual Property Rights Policy (a copy of which can be found at <https://xmpp.org/about/xsf/ipr-policy> or obtained by writing to XMPP Standards Foundation, P.O. Box 787, Parker, CO 80134 USA).
The HTML representation (you are looking at) is maintained by the XSF. It is based on the YAML CSS Framework, which is licensed under the terms of the CC-BY-SA 2.0 license.
The Extensible Messaging and Presence Protocol (XMPP) is defined in the XMPP Core (RFC 6120) and XMPP IM (RFC 6121) specifications contributed by the XMPP Standards Foundation to the Internet Standards Process, which is managed by the Internet Engineering Task Force in accordance with RFC 2026. Any protocol defined in this document has been developed outside the Internet Standards Process and is to be understood as an extension to XMPP rather than as an evolution, development, or modification of XMPP itself.
The primary venue for discussion of XMPP Extension Protocols is the <standards@xmpp.org> discussion list.
Discussion on other xmpp.org discussion lists might also be appropriate; see <https://xmpp.org/community/> for a complete list.
Given that this XMPP Extension Protocol normatively references IETF technologies, discussion on the <xsf-ietf@xmpp.org> list might also be appropriate.
Errata can be sent to <editor@xmpp.org>.
The following requirements keywords as used in this document are to be interpreted as described in RFC 2119: "MUST", "SHALL", "REQUIRED"; "MUST NOT", "SHALL NOT"; "SHOULD", "RECOMMENDED"; "SHOULD NOT", "NOT RECOMMENDED"; "MAY", "OPTIONAL".
1. RFC 6120: Extensible Messaging and Presence Protocol (XMPP): Core <http://tools.ietf.org/html/rfc6120>.
2. RFC 2782: A DNS RR for specifying the location of services (DNS SRV) <http://tools.ietf.org/html/rfc2782>.
3. RFC 8305: Happy Eyeballs Version 2: Better Connectivity Using Concurrency <http://tools.ietf.org/html/rfc8305>.
4. RFC 6724: Default Address Selection for Internet Protocol Version 6 (IPv6) <http://tools.ietf.org/html/rfc6724>.
Note: Older versions of this specification might be available at https://xmpp.org/extensions/attic/
First draft.
@report{der kinderen2024xepxxxx, title = {Happy Eyeballs}, author = {der Kinderen, Guus}, type = {XEP}, number = {xxxx}, version = {1.0.0}, institution = {XMPP Standards Foundation}, url = {https://xmpp.org/extensions/xep-xxxx.html}, date = {2024-09-19/2024-09-19}, }
END