concept Networks
Happy Eyeballs IPv6/IPv4 connection races
Happy Eyeballs staggers IPv6 and IPv4 connection attempts so a slow first attempt need not block the next. Follow the time from each DNS answer to connection success to see why the later start can win.
What it means
Happy Eyeballs lets a client try another address while its first connection attempt is still pending. On a site reachable over both IPv6 and IPv4, the client need not wait for IPv6 to time out before trying IPv4. The attempts start in order, but they can overlap. The first successful connection wins, not necessarily the first address returned by DNS.
Try it
Simulation. Start with the default race, in which IPv4 wins at 330 ms. Change only IPv6 attempt duration from 500 ms to 40 ms. Look at the IPv4 start time as well as the winner: did IPv4 lose a running race, or did it never start?
Happy Eyeballs IPv6/IPv4 connection races
Explain parallelized dual-stack attempts under failed or slow address families
IPv4 is the first successful completion. The state distinguishes an unstarted, failed or canceled alternative.
Outcome
- IPv6 address ready0 ms
- IPv4 address ready20 ms
- Race ends330 ms
- Other candidatecanceled
Bars end at actual modeled completion or cancellation, not at an unobserved would-be success. DNS readiness and connection start are different events.
Evaluated inputs
- Required scenario evidence
- provided
- AAAA candidate available
- 0 ms
- A candidate available
- 20 ms
- Resolution hold after A answer
- 50 ms
- IPv6 attempt duration
- 500 ms
- IPv6 completion
- success
- Attempt spacing
- 250 ms
- IPv4 attempt duration
- 80 ms
- IPv4 completion
- success
Exactly one positive A and AAAA answer, no absent answers or adaptive sorting; IPv6 preference during resolution hold, teaching scheduler with 10 ms minimum launch spacing, early failure and explicit cancellation. Same-tick tie at launch resolves completed success before launch. Not a complete RFC8305 implementation or measured RTT.
About this model
The controls set only a local, bounded scenario. The computed branch is not a verdict about a live system. Inputs listed as not evaluated did not participate in this branch after validation.
Reset restores the original inputs. It does not change the open or closed state of help or FAQ answers.
Here is the default race on one clock, with times measured from the beginning of the example:
| Address family | DNS address ready | Connection attempt starts | Actual outcome |
|---|---|---|---|
| IPv6 (AAAA answer) | 0 ms | 0 ms | Still pending when canceled at 330 ms |
| IPv4 (A answer) | 20 ms | 250 ms | Connects at 330 ms |
Both attempts are set to succeed if allowed to finish. IPv4's 80 ms duration counts from its start, not from the A answer: 250 + 80 = 330 ms. IPv6 would need until 500 ms, but the race is already over. Its cancellation is not a connection failure.
With the 40 ms IPv6 duration, the A answer is still ready at 20 ms. This time IPv6 connects before the scheduled IPv4 start, so there is no IPv4 attempt to cancel. Its selected duration and outcome play no part in the result. Use Reset to restore the default race.
Why there are two delays
The resolution hold helps decide which address to try first. In this simulation, if the A answer arrives first, the client gives the AAAA answer up to 50 ms at the default setting. If AAAA arrives by that deadline, IPv6 starts as soon as its address is ready. Otherwise IPv4 starts when the hold ends. The client does not add 50 ms to an IPv6 attempt that can already start.
Attempt spacing answers a different question: when can the next attempt start? For example, let A arrive at 0 ms and AAAA at 100 ms. IPv4 starts at 50 ms, when the hold expires. With 250 ms spacing and IPv4 still pending, IPv6 starts at 300 ms, not at 100 ms. If IPv6 needs just 10 ms and IPv4 needs 500 ms, IPv6 wins at 310 ms despite being the later DNS answer and the later start.
An explicit failure can shorten the wait. Back in the default example, suppose IPv6 fails at 30 ms rather than remaining pending. IPv4 is already available, and the simulation's 10 ms minimum between starts has passed. IPv4 can start at 30 ms and connect at 110 ms. Nothing is canceled: IPv6 had already failed.
An exact-time boundary is also useful. With the default start times, set IPv6 completion to failure and its duration to 330 ms. IPv4 still connects at 330 ms. The two events occur at the same modeled instant: IPv6 failed simultaneously, rather than earlier or after cancellation. If IPv6 is instead set to succeed, the two successes tie; the lab does not invent a tie-breaker.
RFC 8305, Sections 3–5, distinguishes resolving names, ordering destination addresses, and attempting connections. Ordering is not a prediction of which connection will finish first. For example, RFC 6724, Section 6, takes available source addresses into account when ordering destinations. The simulation uses only its stated readiness and hold rule; it does not perform that address selection.
In practice
If you are reading a connection trace, look for three events on the same clock: when each address became available, when each attempt started, and when it connected, failed, or was canceled. A trace that identifies only the winning family cannot distinguish a failed alternative from one that was never tried. A missing event is not evidence of failure.
This is a simplified Happy Eyeballs v2 example based on RFC 8305, with exactly one positive A answer and one positive AAAA answer. It does not cover absent answers, adaptive ordering, a particular browser's scheduler, or the version 3 Internet-Draft. The durations are inputs, not measurements of network round-trip time.
Use the first successful completion to explain the choice for this connection. If you know only which DNS answer came first, the next useful observation is the connection start and outcome for each candidate—not a change to your site's IPv4 or IPv6 configuration.
Frequently asked questions
Editorial questions based on the listed sources and explicitly labeled local examples.
Is 250 ms mandatory?
No. RFC 8305 recommends 250 ms as a default connection-attempt delay, with a mandatory minimum interval of 10 ms; implementations may use other timing within the protocol constraints.
Is the winning family always fastest later?
No. The winner belongs to one stipulated candidate race. The model contains no observations of future paths.
Does racing mean DNS is ignored?
No; addresses must become available and be ordered.
What happens to the losing attempt?
A pending attempt can be canceled when another succeeds. A candidate that never started is not canceled, and an attempt that failed has a different outcome. The lab distinguishes these cases, including simultaneous failure and success.
Sources & model boundaries
Primary references used for this explanation. The interactive example is an educational model, not a live check.
- RFC 8305: Happy Eyeballs Version 2
3–5. Separate resolution and connection-attempt delays; connections can overlap. A 250 ms attempt-delay default is recommended, with mandatory 10 ms minimum spacing. Successful connection ends the race.
Checked .
- RFC 6724: Default Address Selection for IPv6
Abstract; §§2,6. Address ordering is a separate decision from racing connections. RFC6724 can order IPv4 and IPv6 destinations based on available source addresses; this lab stipulates the candidate order.
Checked .