Dual-Stack Networking: IPv6 Gets the Head Start in a Race
Networking
Your connection may be carrying two public addresses at once, one of each version, and nothing on screen asks which you would like to use. Something settles it on your behalf, and it is neither the website nor your provider. It is the machine in front of you, working through a procedure that three standards documents set out in detail.
Dual stack means two complete implementations
The arrangement has a name, and the name is literal.
RFC 4213, a Standards Track document published in October 2005, specifies two ways for an IPv6 device to stay compatible with the IPv4 world. The first is dual stack, and its abstract defines it in a single clause: “Dual stack implies providing complete implementations of both versions of the Internet Protocol (IPv4 and IPv6)”. Not a translation layer, not a hybrid address format. Two full protocol stacks, running side by side on the same device.
The document is direct about why anyone would carry the extra weight. “The key to a successful IPv6 transition is compatibility with the large installed base of IPv4 hosts and routers,” it says, before recording the expectation it was written under: “We expect that most nodes in the Internet will need such compatibility for a long time to come, and perhaps even indefinitely.” That was twenty-one years ago.
The address scarcity that made a second version necessary, and that pushed providers into sharing one address between many homes, is why the first stack is still in service. Where the two versions came from covers that half of the story.
The order used to be left to the resolver
Running both stacks creates a question that running one does not. A name can resolve to an address of either version, or to both, and something has to pick.
RFC 4213 is firm about the capability and quiet about the decision. The requirement is unambiguous: “DNS resolver libraries on IPv6/IPv4 nodes MUST be capable of handling both AAAA and A records.” What follows is a permission rather than an instruction. The resolver library, it says, “MAY order the results returned to the application in order to influence the version of IP packets used to communicate with that specific node”.
That permission carried more weight than it looks, because of what software did with the list. The same section observes that “most applications try the addresses in the order they are returned by the resolver”, so whoever controlled the ordering effectively controlled the version. The document then declines the job: “The actual ordering mechanisms are out of scope of this memo.”
A capability, a permission, and a pointer elsewhere. What arrived in that gap is the rest of this article.
A specified default, with an override built in
RFC 6724, Default Address Selection for Internet Protocol Version 6 (IPv6), is a Standards Track document from September 2012 that replaced an earlier one doing the same job. Its abstract states the scope plainly: “This document describes two algorithms, one for source address selection and one for destination address selection.”
Two separate questions, then. Which of your own addresses goes into the outgoing packet, and which of the remote addresses you send it to. The second settles the version.
Its sharpest sentence says why the answer had to be an algorithm rather than a setting: “In such cases, a simple policy to always prefer IPv6 or always prefer IPv4 can produce poor behavior.” A device can hold an address of a version it cannot actually reach anything with, so a flat preference will sometimes pick the useless one. Ranking replaces preference. The algorithms are “specified as a set of rules that define a partial ordering on the set of addresses that are available for use”, and those rules weigh properties of the pair rather than the version label alone.
It is a default rather than a lock. There are “policy hooks to allow administrative override”, about which the document offers its own cold assessment: they “are certainly not a panacea”. Nor are the rules meant to sit above the software using them.
One sentence in RFC 6724 reads differently now. Describing what a well-behaved application should do with a sorted list, it notes that “it might be appropriate to try multiple addresses in parallel (e.g., with some small delay in between) and use the first one to succeed.” That is the core of the next idea, five years early, inside a parenthesis.
Preferring IPv6 happens in two places
RFC 8305, a Standards Track document from December 2017, turned that parenthesis into a named procedure. It describes itself as “a technique for reducing user-visible delays on dual-stack hosts”, and it is explicit that the preference is an input rather than an output: the document “assumes that the preference policy for the host destination address favors IPv6 over IPv4”.
The procedure has four phases, and the fourth is the one to hold on to: “Establishment of one connection, which cancels all other attempts.”
Before any of that, your device asks twice. With both kinds of connectivity available, it “needs to send out both AAAA and A DNS queries”, and the sequencing is specified, “with the AAAA query made first and immediately followed by the A query”. It is told not to sit waiting for the pair: “Implementations SHOULD NOT wait for both families of answers to return before attempting connection establishment.” Where those two questions actually go is the journey a name query takes.
The first place IPv6 gains its advantage is in that waiting. If the IPv4 answer arrives first, your device pauses briefly rather than acting on it, on the reasoning that “it is common for the AAAA response to follow the A response by a few milliseconds”. The pause has a name, the Resolution Delay, and a figure: “The recommended value for the Resolution Delay is 50 milliseconds.” If nothing useful lands inside that window, the IPv4 addresses are used.
The second place is the ordering. Once answers are in, the addresses are sorted by RFC 6724’s destination rules, then deliberately shuffled again: the client is told to “modify the ordered list to interleave address families”, so that whichever version leads is followed by an address of the other. Interleaving is “performed to avoid waiting through a long list of addresses from a given address family if connectivity over that address family is impaired.”
One attempt at a time
What follows is a race with a handicap rather than a free-for-all. “In order to avoid unreasonable network load, connection attempts SHOULD NOT be made simultaneously.” One attempt goes out, the next follows after a wait, and attempts already running are left to run.
That wait is the Connection Attempt Delay. “One recommended value for a default delay is 250 milliseconds.” A following attempt “MUST NOT be started within 10 milliseconds of the previous attempt”. The first attempt to complete ends the exercise, and anything not yet tried is dropped.
The specification does not treat those figures as constants, and neither should you. They “were determined empirically by measuring the timing of connections on a very wide set of production devices”, and it says what it expects of them: “it is expected that these values will change over time.” A number in a standard is sometimes a measurement of the world at the time of writing.
The two addresses on your own connection
You can at least see the input to all of this, because the procedure above leaves nothing on your screen.
Our own dashboard reports which of the two you actually have on separate rows, so an empty one settles the question before the rest applies. On the split between the versions the page says only that “Many connections still use IPv4, but IPv6 is increasingly common on mobile and fibre networks.”
The second half of the picture is what an address gives up when somebody looks it up, and the versions do not give up the same amount. Check one of each version and the page is candid about where it struggles: “Some IP addresses do not have useful hostname or city data. Mobile networks, VPN servers, IPv6 allocations, and corporate networks can return broad or generic results.” So the version you leave by can change how specific a lookup of your address turns out to be.
What the race hides
The racing approach has a cost, and RFC 8305 puts it in a section of its own rather than leaving you to find it.
“It has been observed in practice that Happy Eyeballs can hide issues in networks,” it says, with the case spelled out: “if a misconfiguration causes IPv6 to consistently fail on a given network while IPv4 is still functional, Happy Eyeballs may impair the operator’s ability to notice the issue.” Its remedy is addressed to operators rather than to you, recommending they “deploy external means of monitoring to ensure functionality of all address families”. A broken half of a dual-stack network does not announce itself. It gets routed around instead, which is both the point of the procedure and the problem with it.
There is a smaller consequence for you, in the same document’s security section. Happy Eyeballs “may make it more likely that subsequent connections to a single hostname use different IP addresses”. Two visits to one site minutes apart can leave by different versions, from different addresses, with nothing having changed at your end.
None of this is a setting you are expected to manage, and on a working connection there is nothing to see. It is worth knowing for the reason that hidden-failure note sits in the specification at all: a dual-stack connection that is half broken does not present itself as broken. The procedure that keeps it usable is the same one that keeps it quiet.