rfc-6555

Happy Eyeballs: Success with Dual-Stack Hosts

D. Wing, A. Yourtchenko
date2012-04 streamIETF areaops wgv6ops statusPROPOSED STANDARD pages15 canonicalhttps://www.rfc-editor.org/rfc/rfc6555 doi10.17487/RFC6555 errataview
When a server's IPv4 path and protocol are working, but the server's IPv6 path and protocol are not working, a dual-stack client application experiences significant connection delay compared to an IPv4-only client. This is undesirable because it causes the dual- stack client to have a worse user experience. This document specifies requirements for algorithms that reduce this user-visible delay and provides an algorithm. [STANDARDS-TRACK]

obsoleted by

Extracted elements (23)

design-rationale §4.1

IPv6 is given preference over IPv4 (not just equal treatment) to reduce load on IPv4 infrastructure such as NAT devices and load-balancers, enabling ISPs and content providers to reduce IPv4 investment. Treating both address families equally based solely on connection speed would sustain IPv4 load and make IPv6 transition more expensive.

ip, v6ops, nat

design-rationale §4.4

Non-winning connections are recommended to be abandoned (rather than reused) to reduce server file descriptors and TCP control block usage, reduce stateful middlebox (NAT/firewall) state, and prevent HTTP cookie and same-origin policy breakage that occurs when connections from the same client arrive from different IP address families.

ip, v6ops, nat

design-rationale §3.1

Single shared hostnames for IPv4 and IPv6 are required (rather than separate namespaces like 'ipv6.example.com') to avoid namespace fragmentation that would reduce the ability for users to share hostnames and complicate printed material.

ip, v6ops, dns

design-rationale §4.2

The 10-minute retry interval for a failed preferred address family avoids simple doubling of connection attempts on both IPv6 and IPv4, while still allowing the algorithm to detect when the preferred path becomes functional again. It can be implemented by flushing Happy Eyeballs state every 10 minutes.

ip, v6ops

design-rationale §3

The scope of Happy Eyeballs is limited to connection-oriented transports (TCP, SCTP) because connectionless protocols (UDP) require application-level request/response semantics (as used by ICE) to determine connectivity, which is outside this document's scope.

ip, v6ops, tcp

design-rationale §5.5

Using a 150-250 ms pacing interval rather than aggressive millisecond-scale timeouts is chosen because aggressive timeouts create billable traffic on some networks, create state in middleboxes (firewalls, IDS, NATs), and consume shared IPv4 ports; the longer interval still achieves imperceptible delay for users.

ip, v6ops

interoperability-note §3

Happy Eyeballs applies only to connection-oriented transports (TCP, SCTP). For connectionless protocols such as UDP, a similar mechanism can be used only if the application has request/response semantics, as done by ICE for media path selection.

ip, v6ops, tcp, udp

interoperability-note §5.3

The interaction of Happy Eyeballs with hosts having three or more logical interfaces (e.g., due to VPN tunnels, multiple physical interfaces, or VLANs) is explicitly left for further study.

ip, v6ops, vpn

interoperability-note §5.6

Web browsers implement a same-origin policy that causes subsequent connections to the same hostname to go to the same IPv4 or IPv6 address as the previous successful connection; Happy Eyeballs must not violate this policy even though it may reduce responsiveness in failure scenarios.

ip, v6ops, http, security

normative-requirement §4.3 SHOULD

A Happy Eyeballs algorithm SHOULD re-initialize when the interface is connected to a new network, since every network has different characteristics (e.g., working or broken IPv6 or IPv4 connectivity).

ip, v6ops

normative-requirement §4.2 MUST

A stateful Happy Eyeballs implementation that falls back to a non-preferred address family MUST occasionally make connection attempts using the host's preferred address family (as it may have become functional again) and SHOULD do so every 10 minutes.

ip, v6ops

normative-requirement §4 MUST

After performing connection attempts, the client MUST cache information regarding the outcome of each connection attempt and use that information to avoid thrashing the network with subsequent attempts. Cache entries should be flushed when their age exceeds a system-defined maximum on the order of 10 minutes.

ip, v6ops

normative-requirement §4.2 SHOULD

If connections using the preferred address family are again successful after a failure period, the preferred address family SHOULD be used for subsequent connections.

ip, v6ops

normative-requirement §4.1 MUST

Implementations MUST prefer the first IP address family returned by the host's address preference policy unless implementing a stateful algorithm. If the host's policy is unknown or not attainable, implementations MUST prefer IPv6 over IPv4.

ip, v6ops

normative-requirement §5.5 RECOMMENDED

It is RECOMMENDED that connection attempts be paced 150-250 ms apart to balance human factors against network load, rather than using aggressive timeouts on the order of tens of milliseconds.

ip, v6ops

normative-requirement §4.4 RECOMMENDED

It is RECOMMENDED that the non-winning connections be abandoned, even though they could in some cases be put to reasonable use, in order to reduce load on the server and stateful middleboxes and reduce IPv4 address sharing contention.

ip, v6ops, nat

normative-requirement §5.6 MUST NOT

Web browsers MUST NOT change their same-origin policy because of Happy Eyeballs, as doing so would create an additional security exposure.

ip, v6ops, security

normative-requirement §5.4 SHOULD NOT

Web site operators with native IPv6 connectivity SHOULD NOT offer multiple AAAA records because, for clients without Happy Eyeballs and with broken IPv6 connectivity, multiple AAAA records further increase the delay before falling back to IPv4.

ip, v6ops, dns

normative-requirement §5.4 RECOMMENDED

When a DNS query returns multiple A or AAAA records, it is RECOMMENDED that a Happy Eyeballs implementation order the responses following the host's address preference policy and try the first address; if that fails, the next address SHOULD be an IPv4 address.

ip, v6ops, dns

protocol-element §6

The Happy Eyeballs algorithm initiates a connection attempt with the preferred address family (typically IPv6), and if that connection does not complete within a short period (Firefox and Chrome use 300 ms), initiates a second attempt with the first address of the other address family (IPv4). The first connection established is used and the other is discarded.

ip, v6ops

security-consideration §4.4

Abandoning non-winning connections is recommended to reduce the risk of HTTP cookie-based attacks and same-origin policy violations that can occur when a client holds simultaneous connections to the same hostname from different IP address families.

ip, v6ops, security, http

security-consideration §5.6

Web browsers MUST NOT modify their same-origin policy to accommodate Happy Eyeballs behavior, because allowing connections to different IP addresses for the same origin would create additional security vulnerabilities beyond the connectivity benefits gained.

ip, v6ops, security, http

state-machine §4.2

A stateful Happy Eyeballs implementation transitions from 'prefer IPv6' to 'prefer IPv4' when an IPv6 connection attempt fails within the timeout period. It returns to 'prefer IPv6' after 10 minutes (by flushing state) and retrying; if IPv6 succeeds again, it remains in the 'prefer IPv6' state. State is reset on network re-initialization.

ip, v6ops