From f875cac1fcb444d1c7665197d1550831fc8c5227 Mon Sep 17 00:00:00 2001 From: Guus der Kinderen Date: Sat, 21 Sep 2024 20:10:50 +0200 Subject: [PATCH] new ProtoXEP: Happy Eyeballs When a server's IPv4 path and protocol are working, but the server's IPv6 path and protocol are not working, a dual-stack application that initiates a connect experiences significant connection delay compared to an IPv4-only application. This is undesirable because it causes the dual-stack initiating entity to have a worse user experience. This XEP defines how IETF's 'Happy Eyeballs' algorithm requirements that reduce this user-visible delay are applied to XMPP. --- inbox/xep-happy-eyeballs.xml | 100 +++++++++++++++++++++++++++++++++++ xep.ent | 2 + 2 files changed, 102 insertions(+) create mode 100644 inbox/xep-happy-eyeballs.xml diff --git a/inbox/xep-happy-eyeballs.xml b/inbox/xep-happy-eyeballs.xml new file mode 100644 index 00000000..47a6551a --- /dev/null +++ b/inbox/xep-happy-eyeballs.xml @@ -0,0 +1,100 @@ + + +%ents; +]> + + +
+ Happy Eyeballs + When a server's IPv4 path and protocol are working, but the server's IPv6 path and protocol are not working, a dual-stack application that initiates a connect experiences significant connection delay compared to an IPv4-only application. This is undesirable because it causes the dual-stack initiating entity to have a worse user experience. This XEP defines how IETF's 'Happy Eyeballs' algorithm requirements that reduce this user-visible delay are applied to XMPP. + &LEGALNOTICE; + xxxx + ProtoXEP + Standards Track + Standards + Council + + RFC 6120 + RFC 2782 + RFC 6724 + RFC 8305 + + + + NOT_YET_ASSIGNED + + Guus + der Kinderen + guus.der.kinderen@gmail.com + guus.der.kinderen@igniterealtime.org + + + 1.0.0 + 2024-09-19 + gk +

First draft.

+
+
+ +

In context of establishing TCP connections between XMPP entities, &rfc6120; 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 &rfc2782;, 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 &rfc8305;. 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 &rfc2782;, &rfc6724; and &rfc8305;.

+
+
Dual Stacked (hosts) (from RFC 2782)
Hosts that support both the IPv4 and IPv6 address families.
+
Target host (from RFC 2782)
A host (typically represented by a domain name) that is announced in the Target attribute of an SRV resource record. Used to identify service that provide an (XMPP) service.
+
Priority group
Target hosts in an SRV response that share the same 'priority' value
+
Resolution Delay
The time to wait for an AAAA response after receiving an A response (from RFC 8305) and to wait for a response to the request made against the first (by SRV 'weight' ordering) target after receiving a response for a later target.
+
+
+ +

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 &rfc8305; 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 &rfc6120;, 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 &rfc6120;, Section 3.2.2, then the 'Happy Eyeballs' algorithm defined in this XEP is essentially the same as the algorithm that is specified in &rfc8305;.

+ +

The initiating entity preforms an SRV lookup, sorts and orders the resulting list of target hosts, as defined in the 'Usage rules' section of &rfc2782;. 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 &rfc2782;). 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 &rfc8305;. 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 &rfc8305;, 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 &rfc8305;, this is done to give preference to IPv6. In addition to the specification in &rfc8305;, 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.

+
+ +

&rfc8305;, 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 &rfc6724;, Section 6.

+

An additional Destination Selection rule that prefers an addresses by their SRV-defined Weight attribute SHOULD be added before rule 9 of &rfc6724; (but after the two rules added by &rfc8305;).

+
+ +

Connection attempts are made as described in &rfc8305;, 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 &rfc6120;, Section 3.2.2. If it does, it SHOULD implement this in accordance with the 'Happy Eyeballs' algorithm as defined in &rfc8305;.

+
+
+ +

This XEP, similar to &rfc8305;, 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 &rfc2782;, &rfc6724; and &rfc8305;

+
+ +

This document does not define Privacy Considerations in addition to those defined in &rfc2782;, &rfc6724; and &rfc8305;

+
+ +

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.

+
+
diff --git a/xep.ent b/xep.ent index 0ff94484..21507096 100644 --- a/xep.ent +++ b/xep.ent @@ -672,6 +672,7 @@ THE SOFTWARE. RFC 6648 RFC 6648: Deprecating the X- Prefix and Similar Constructs in Application Protocols <http://tools.ietf.org/html/rfc6648>." > RFC 6698 RFC 6698: The DNS-Based Authentication of Named Entities (DANE) Transport Layer Security (TLS) Protocol: TLSA <http://tools.ietf.org/html/rfc6698>." > RFC 6716 RFC 6716: Definition of the Opus Audio Codec <http://tools.ietf.org/html/rfc6716>." > +RFC 6724 RFC 6724: Default Address Selection for Internet Protocol Version 6 (IPv6) <http://tools.ietf.org/html/rfc6724>." > RFC 6762 RFC 6762: Multicast DNS <http://tools.ietf.org/html/rfc6762>." > RFC 6763 RFC 6763: DNS-Based Service Discovery <http://tools.ietf.org/html/rfc6763>." > RFC 6797 RFC 6797: HTTP Strict Transport Security (HSTS) <http://tools.ietf.org/html/rfc6797>." > @@ -709,6 +710,7 @@ THE SOFTWARE. RFC 9000 RFC 9000: QUIC: A UDP-Based Multiplexed and Secure Transport <http://tools.ietf.org/html/rfc9000>." > RFC 7677 RFC 7677: SCRAM-SHA-256 and SCRAM-SHA-256-PLUS Simple Authentication and Security Layer (SASL) Mechanisms <http://tools.ietf.org/html/rfc7677>." > RFC 5705 RFC 5705: Keying Material Exporters for Transport Layer Security (TLS) <http://tools.ietf.org/html/rfc5705>." > +RFC 8305 RFC 8305: Happy Eyeballs Version 2: Better Connectivity Using Concurrency <http://tools.ietf.org/html/rfc8305>." > RFC 8949 RFC 8949: Concise Binary Object Representation (CBOR) <http://tools.ietf.org/html/rfc8949>." > RFC 9266 RFC 9266: Channel Bindings for TLS 1.3 <http://tools.ietf.org/html/rfc9266>." > RFC 9460 RFC 9460: Service Binding and Parameter Specification via the DNS (SVCB and HTTPS Resource Records) <http://tools.ietf.org/html/rfc9460>." >