<?xml version="1.0" encoding="utf-8"?>
<!-- name="GENERATOR" content="github.com/mmarkdown/mmark Mmark Markdown Processor - mmark.miek.nl" -->
<rfc version="3" ipr="trust200902" docName="draft-martin-ipv6-addr-selection-updates-00" category="std" xml:lang="en" xmlns:xi="http://www.w3.org/2001/XInclude" updates="6724" indexInclude="true">

<front>
<title abbrev="ipv6-addr-selection-updates">Updates to IPv6 Default Address Selection</title><seriesInfo value="draft-martin-ipv6-addr-selection-updates-00" status="standard" name="Internet-Draft"></seriesInfo>
<author initials="F." surname="Martin" fullname="Franck Martin"><organization>Peachymango.org</organization><address><postal><street></street>
</postal><email>franck@peachymango.org</email>
</address></author><author initials="X." surname="Xiao" fullname="XiPeng Xiao"><organization>Huawei Technologies Dusseldorf</organization><address><postal><street></street>
</postal><email>xipengxiao@gmail.com</email>
</address></author><author initials="B." surname="Carpenter" fullname="Brian E. Carpenter"><organization>University of Auckland</organization><address><postal><street></street>
</postal><email>brian.e.carpenter@gmail.com</email>
</address></author><date year="2026" month="September" day="12"></date>
<area>Internet</area>
<workgroup></workgroup>
<keyword>IPv6</keyword>
<keyword>RFC6724</keyword>
<keyword>address selection</keyword>
<keyword>getaddrinfo</keyword>
<keyword>DNS load balancing</keyword>

<abstract>
<t>This document updates RFC 6724 with three improvements to IPv6 destination
address selection. The updates allow recent IPv6 connection or service
failures to influence IPv6/IPv4 ordering, incorporate likely
source/destination address pairs when sorting candidates, and let ISP and
enterprise operators preserve DNS load-balancing order where Rule 9 would
otherwise override it. The updates are intended to be implementable inside
<tt>getaddrinfo()</tt> or an equivalent system mechanism, without requiring changes
to existing application-facing socket APIs.</t>
</abstract>

<note><name>About This Document</name>
<t>This note is to be removed before publishing as an RFC.</t>
<t>The latest revision of this draft can be found at
<eref target="https://github.com/franckhlmartin/ietf-draft-ipv6-addr-selection-updates/">https://github.com/franckhlmartin/ietf-draft-ipv6-addr-selection-updates/</eref>.
An HTML editor's copy is at
<eref target="https://franckhlmartin.github.io/ietf-draft-ipv6-addr-selection-updates/draft-martin-ipv6-addr-selection-updates.html">https://franckhlmartin.github.io/ietf-draft-ipv6-addr-selection-updates/draft-martin-ipv6-addr-selection-updates.html</eref>.
Status information for this document may be found at
<eref target="https://datatracker.ietf.org/doc/draft-martin-ipv6-addr-selection-updates/">https://datatracker.ietf.org/doc/draft-martin-ipv6-addr-selection-updates/</eref>.
Discussion of this document takes place on the v6ops Working Group
mailing list (<eref target="mailto:v6ops@ietf.org">mailto:v6ops@ietf.org</eref>), which is archived at
<eref target="https://mailarchive.ietf.org/arch/browse/v6ops/">https://mailarchive.ietf.org/arch/browse/v6ops/</eref>. Subscribe at
<eref target="https://www.ietf.org/mailman/listinfo/v6ops/">https://www.ietf.org/mailman/listinfo/v6ops/</eref>. Working group assignment
(v6ops versus 6man) is to be determined at adoption time.</t>
<t>Source for this draft and an issue tracker can be found at
<eref target="https://github.com/franckhlmartin/ietf-draft-ipv6-addr-selection-updates">https://github.com/franckhlmartin/ietf-draft-ipv6-addr-selection-updates</eref>.</t>
</note>

</front>

<middle>

<section anchor="introduction"><name>Introduction</name>
<t><xref target="RFC6724"></xref> defines default source and destination address selection for IPv6
and dual-stack hosts. Operational experience has identified cases where
additional information available to a host or operator can improve destination
ordering. In particular, Section 10.3.1 of <xref target="RFC6724"></xref> notes that a host with
working IPv4 connectivity but broken IPv6 connectivity can experience unwanted
timeouts because the default policy normally prefers IPv6.</t>
<t>This document specifies three updates addressing recent IPv6 connection or
service failures, source/destination address-pair considerations, and DNS-based
load balancing. The implementations described in this document are believed to
benefit operators in their IPv6 deployments and IPv4 retirement.</t>

<section anchor="requirements-language"><name>Requirements Language</name>
<t>The key words &quot;<bcp14>MUST</bcp14>&quot;, &quot;<bcp14>MUST NOT</bcp14>&quot;, &quot;<bcp14>REQUIRED</bcp14>&quot;, &quot;<bcp14>SHALL</bcp14>&quot;,
&quot;<bcp14>SHALL NOT</bcp14>&quot;, &quot;<bcp14>SHOULD</bcp14>&quot;, &quot;<bcp14>SHOULD NOT</bcp14>&quot;, &quot;<bcp14>RECOMMENDED</bcp14>&quot;,
&quot;<bcp14>NOT RECOMMENDED</bcp14>&quot;, &quot;<bcp14>MAY</bcp14>&quot;, and &quot;<bcp14>OPTIONAL</bcp14>&quot; in this document are to be
interpreted as described in BCP 14 <xref target="RFC2119"></xref> <xref target="RFC8174"></xref> when, and only when,
they appear in all capitals, as shown here.</t>
</section>

<section anchor="motivation"><name>Motivation</name>
<t>Applications commonly use <tt>getaddrinfo()</tt> <xref target="POSIX"></xref> <xref target="RFC3493"></xref> to obtain an
ordered list of destination addresses. <xref target="RFC6724"></xref> defines the default
destination address selection algorithm that implementations apply when sorting
that list. The rules provide useful interoperability and policy control on the
global Internet, but three operational gaps have emerged:</t>

<ul spacing="compact">
<li><strong>Connectivity:</strong> Static precedence can continue to prefer IPv6 after an IPv6
connection or service-establishment attempt has recently failed. Happy
Eyeballs <xref target="RFC8305"></xref> reduces the impact for applications that race IPv6 and
IPv4 attempts, but other applications can repeatedly experience the same
failure or delay.</li>
<li><strong>Address pairs:</strong> Sorting destinations without considering the likely
source/destination pair can yield suboptimal or incorrect connectivity,
especially when multiple source addresses are available.</li>
<li><strong>DNS load balancing:</strong> Operators commonly spread load by returning
multiple address records and varying their order---DNS-based load
balancing as described in <xref target="RFC1794"></xref>. Rule 9 (&quot;Use longest matching
prefix&quot;) can collapse that intentionally varied order to a single
preferred destination, defeating the operator's intent. DNS and routing
communities have offered conflicting advice on whether resolver ordering
or DNS response order should prevail; this document closes that gap for
configured deployments.</li>
</ul>
</section>

<section anchor="scope"><name>Scope</name>
<t>This document is a focused update to destination address selection
(Section 6 of <xref target="RFC6724"></xref>). Source address selection (Section 5) is out
of scope except where needed to evaluate source/destination pairs for
destination ordering.</t>
</section>

<section anchor="design-principle"><name>Design Principle</name>
<t>The three enhancements are <bcp14>OPTIONAL</bcp14>, independent, and individually
configurable. Implementations <bcp14>MUST NOT</bcp14> enable any of them by default, and
enabling one enhancement <bcp14>MUST NOT</bcp14> implicitly enable another, so current
<xref target="RFC6724"></xref> behavior is preserved without deliberate administrative input.</t>
<t>The enhancements <bcp14>SHOULD</bcp14> be implementable inside <tt>getaddrinfo()</tt> or an
equivalent system resolver mechanism. This document does not require changes to
existing application-facing socket APIs or application source code. Experimental
evidence for address-pair-aware ordering appears in <xref target="GET-ADDR-PAIRS"></xref>.</t>
</section>
</section>

<section anchor="terminology"><name>Terminology</name>
<t><strong>Destination address selection:</strong> The process by which a host orders
candidate destination addresses before returning them to an application,
as defined in <xref target="RFC6724"></xref>.</t>
<t><strong>Address pair:</strong> A combination of a selected or likely source address
and a candidate destination address used to evaluate connectivity or
ordering for a given communication attempt.</t>
<t><strong>Recent-failure state:</strong> Host-local state recording a recent IPv6 connection
or service-establishment failure that can be consulted by destination address
selection.</t>
<t><strong>Network context:</strong> Information identifying the network environment in which
a connection attempt is made, such as the outgoing interface, network
attachment, VPN, or equivalent implementation-specific context.</t>
<t><strong>Service:</strong> The transport and port and, when available, higher-layer protocol
or service-binding information associated with an attempt. For example, the
service can be represented as <tt>TCP/443</tt>, <tt>HTTPS/TCP/443</tt>, or
<tt>HTTPS/h3/QUIC/443</tt>. Happy Eyeballs Version 3 <xref target="HAPPY-HEV3"></xref> similarly extends
connection establishment beyond transport-only information when such service
information is available.</t>
</section>

<section anchor="updates-to-rfc6724"><name>Updates to RFC6724</name>
<t>This section specifies updates to destination address selection in
<xref target="RFC6724"></xref>.</t>

<section anchor="connectivity-informed"><name>Connectivity-Informed Destination Selection</name>
<t>Connectivity-informed destination address selection is enabled by updating
Rule 6 of <xref target="RFC6724"></xref> from &quot;Prefer higher precedence&quot; to &quot;Prefer higher
precedence unless recently failed&quot;.</t>
<t>The updated rule is:</t>
<blockquote><t><strong>Rule 6: Prefer higher precedence unless recently failed.</strong></t>
<t>When exactly one of DA and DB is an IPv6 destination and the other is an
IPv4 destination, if applicable recent-failure state exists for the IPv6
destination, prefer the IPv4 destination.</t>
<t>Otherwise, if Precedence(DA) &gt; Precedence(DB), then prefer DA. Similarly, if
Precedence(DA) &lt; Precedence(DB), then prefer DB.</t>
</blockquote><t>When this enhancement is enabled, the component that determines that an IPv6
connection or service-establishment attempt has failed creates or refreshes a
recent-failure record. The logical record contains the following fields:</t>
<table>
<thead>
<tr>
<th>Field</th>
<th>Example</th>
</tr>
</thead>

<tbody>
<tr>
<td>Network context</td>
<td>Corp-WiFi-A</td>
</tr>

<tr>
<td>IPv6 destination</td>
<td>2001:db8:1234:5678::42</td>
</tr>

<tr>
<td>IPv6 source</td>
<td>2001:db8:1111::123</td>
</tr>

<tr>
<td>Service</td>
<td>TCP/443</td>
</tr>

<tr>
<td>Failure type</td>
<td>timeout</td>
</tr>

<tr>
<td>Timestamp</td>
<td>2026-09-07T14:32:18+02:00</td>
</tr>
</tbody>
</table><t>The first four fields identify the scope to which the observation applies. An
entry is applicable when its network context, IPv6 destination, IPv6 source,
and service match the current candidate as far as those fields are known. The
<tt>IPv6 source</tt> and <tt>Service</tt> fields <bcp14>SHOULD</bcp14> be recorded when available. The
Service field can contain only transport-level information or can include
higher-layer protocol or service-binding information when available.</t>
<t>A failed attempt to establish a usable instance of the identified service,
such as a timeout, unreachable indication, connection refusal, or an
applicable higher-layer establishment failure, creates or refreshes
recent-failure state. Local API or resource errors unrelated to the attempted
IPv6 communication do not. No active probing or measurement of RTT, packet
loss, throughput, or other performance statistics is required.</t>
<t>Recent-failure state <bcp14>SHOULD</bcp14> expire 10 minutes after the most recent
applicable failure. This interval follows the stateful Happy Eyeballs guidance
in Section 4.2 of <xref target="RFC6555"></xref>, which recommends retrying a failed preferred
address family every 10 minutes and notes that this can be implemented by
flushing state every 10 minutes. Implementations <bcp14>MAY</bcp14> make the interval
configurable. A subsequent successful establishment of the same service over
the same applicable IPv6 context <bcp14>SHOULD</bcp14> clear the state, and a relevant
network-context change <bcp14>SHOULD</bcp14> make the state inapplicable.</t>
<t>In the absence of applicable recent-failure state, Rule 6 behaves as specified
in <xref target="RFC6724"></xref>, so IPv6 retains its normal default preference. This enhancement
changes destination ordering only; it does not remove IPv6 addresses from the
candidate list. Happy Eyeballs and other connection-racing mechanisms can
therefore continue to attempt both address families.</t>
<t>Implementations <bcp14>MAY</bcp14> expose recent-failure information to network-management
systems for aggregation and operational diagnosis, as discussed in
<xref target="operational-diagnostics"></xref>.</t>
</section>

<section anchor="address-pairs"><name>Source/Destination Pair Consideration</name>
<t>When sorting destination addresses, implementations <bcp14>SHOULD</bcp14> consider the
likely source address that would be used for each candidate destination,
not only the destination in isolation. Ordering <bcp14>SHOULD</bcp14> prefer
source/destination pairs that are more likely to succeed or perform well.
This update aligns with the implementation architecture described in
<xref target="RFC6724"></xref>, where <tt>getaddrinfo()</tt> may obtain source-address information when
sorting destinations. <xref target="GET-ADDR-PAIRS"></xref> demonstrates a prototype approach.</t>
<blockquote><t>TODO: Normative text for pair evaluation and interaction with existing
Rules 2, 5, and 9.</t>
</blockquote></section>

<section anchor="dns-load-balancing"><name>Preserving DNS Load-Balancing Order</name>
<t>Operators who use DNS-based load balancing <xref target="RFC1794"></xref>---for example,
multiple A or AAAA records whose order is rotated by the authoritative
server---expect clients to try addresses in the order returned by DNS.
Rule 9 reorders those candidates by longest matching prefix, which can
concentrate traffic on one backend and undermine the operator's
load-spreading intent. DNS operators and routing-oriented guidance have
historically given conflicting advice on this point; this section
standardizes operator-controlled behavior.</t>
<t>Implementations <bcp14>MUST</bcp14> support administrative configuration of one or more
IPv4 and IPv6 prefix ranges for which Rule 9 does not apply. This update
does not itself change ordering across address families: Rules 1--8 continue
to apply before Rule 9. If the enhancement in <xref target="connectivity-informed"></xref> is
enabled, Rule 6 is applied as updated there; otherwise Rule 6 remains as
specified in <xref target="RFC6724"></xref>. When Rule 9 would otherwise reorder candidates of
the same address family, and a candidate destination address falls within a
configured range, the implementation <bcp14>MUST</bcp14> preserve the order received from
the name-resolution step (for example, the order of A or AAAA records in the
DNS response) among those same-family candidates, rather than reordering them
by longest matching prefix. This section does not introduce a new within-family
sort order; it only prevents Rule 9 from overriding DNS response
order for configured destinations. Configuration mechanisms <bcp14>MAY</bcp14> include a
policy table, <tt>/etc/gai.conf</tt>, or an equivalent system resolver setting; no
application changes are required.</t>
</section>
</section>

<section anchor="implementation-and-deployment-considerations"><name>Implementation and Deployment Considerations</name>
<t>Implementations that apply these updates inside <tt>getaddrinfo()</tt> <xref target="POSIX"></xref>
<xref target="RFC3493"></xref> or an equivalent system mechanism preserve compatibility with
existing applications that use the returned address ordering. For connectivity-informed
selection, the implementation needs a mechanism to retain recent connection or
service-establishment failures for later use by destination selection; no new
application-facing API is required.</t>
<t>Operators <bcp14>MAY</bcp14> use existing policy mechanisms such as <tt>/etc/gai.conf</tt> on
glibc-based systems to influence precedence; however, such files alone do not
fully disable Rule 9 today. The connectivity-informed enhancement does not
require dynamic modification of the RFC 6724 policy table; the existing policy
table continues to express address preference, while recent-failure state
qualifies the Rule 6 preference when applicable.</t>
<t>Backward compatibility on the global Internet <bcp14>MUST</bcp14> be preserved: with no
operator configuration, implementations <bcp14>MUST</bcp14> behave as <xref target="RFC6724"></xref>.</t>
<t>This document is related to, but distinct from, the Enhanced Dual Stack
(EDS) framework <xref target="EDS"></xref>. EDS describes a broader host-side deployment
model; this document normatively updates destination address selection
rules.</t>

<section anchor="operational-diagnostics"><name>Operational Diagnostics</name>
<t>Implementations <bcp14>MAY</bcp14> emit recent-failure records defined in <xref target="connectivity-informed"></xref> to a system logging or telemetry facility (for example, syslog <xref target="RFC5424"></xref>) as an aid to operational diagnosis. Such records <bcp14>SHOULD</bcp14> preserve the per-event fields defined in <xref target="connectivity-informed"></xref>. Logging is independent of the recent-failure state used by Rule 6; expiration or clearing of that state does not require deletion of corresponding log messages.</t>
<t>Retention, forwarding, filtering, and aggregation of these messages are matters of local policy and are outside the scope of this document. Operators <bcp14>MAY</bcp14> use existing log-management or network-management systems to collect and analyze them across hosts and time.</t>
</section>
</section>

<section anchor="security-considerations"><name>Security Considerations</name>
<t>Recent-failure state influences address ordering and could temporarily cause
IPv4 to be preferred over IPv6. Implementations <bcp14>SHOULD</bcp14> derive this state from
connection or service-establishment outcomes observed locally by the host or a
trusted host networking component, and <bcp14>SHOULD</bcp14> resist poisoning of ordering
decisions from unauthenticated off-path input. The bounded lifetime specified
in <xref target="connectivity-informed"></xref> prevents a transient failure from suppressing the
normal IPv6 preference indefinitely.</t>
<t>Recent-failure records and aggregated diagnostics can reveal destinations,
source addresses, services, network attachments, and traffic patterns. Access
to such information <bcp14>SHOULD</bcp14> be restricted to authorized entities, and exported
information <bcp14>SHOULD</bcp14> be minimized according to operational need and protected
according to local security and privacy policy.</t>
</section>

<section anchor="iana-considerations"><name>IANA Considerations</name>
<t>This document has no IANA actions.</t>
</section>

<section anchor="acknowledgements"><name>Acknowledgements</name>
<t>Discussion on the v6ops mailing list, including threads around Enhanced
Dual Stack, helped shape the scope.</t>
</section>

</middle>

<back>
<references><name>Normative References</name>
<xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml"/>
<xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.6724.xml"/>
<xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8174.xml"/>
</references>
<references><name>Informative References</name>
<reference anchor="EDS" target="https://datatracker.ietf.org/doc/html/draft-xiao-v6ops-eds-01">
  <front>
    <title>Enhanced Dual Stack: Automatic IPv6/IPv4 Selection Based on Performance</title>
    <author fullname="XiPeng Xiao" initials="X." surname="Xiao">
      <organization>Huawei Technologies Dusseldorf</organization>
    </author>
    <date year="2026" month="July" day="4"></date>
  </front>
</reference>
<reference anchor="GET-ADDR-PAIRS" target="https://github.com/becarpenter/getapr">
  <front>
    <title>Get Address Pairs for Socket Programming in Python</title>
    <author fullname="Brian E. Carpenter" initials="B." surname="Carpenter">
      <organization>University of Auckland</organization>
    </author>
  </front>
</reference>
<reference anchor="HAPPY-HEV3" target="https://datatracker.ietf.org/doc/draft-ietf-happy-happyeyeballs-v3/">
  <front>
    <title>Happy Eyeballs Version 3: Better Connectivity Using Concurrency</title>
    <author fullname="Tommy Pauly" initials="T." surname="Pauly"></author>
    <author fullname="David Schinazi" initials="D." surname="Schinazi"></author>
    <author fullname="Nidhi Jaju" initials="N." surname="Jaju"></author>
    <author fullname="Kenichi Ishibashi" initials="K." surname="Ishibashi"></author>
    <date year="2026" month="July" day="2"></date>
  </front>
  <seriesInfo name="Internet-Draft" value="draft-ietf-happy-happyeyeballs-v3-04"></seriesInfo>
</reference>
<reference anchor="POSIX" target="https://pubs.opengroup.org/onlinepubs/9799919799/functions/getaddrinfo.html">
  <front>
    <title>IEEE/Open Group Standard for Information Technology -- Portable Operating System Interface (POSIX(TM)) Base Specifications, Issue 8</title>
    <author>
      <organization>IEEE and The Open Group</organization>
    </author>
    <date year="2024"></date>
  </front>
  <seriesInfo name="IEEE Std" value="1003.1-2024"></seriesInfo>
</reference>
<reference anchor="RFC1794" target="https://www.rfc-editor.org/info/rfc1794">
  <front>
    <title>DNS Support for Load Balancing</title>
    <author fullname="T. Brisco" initials="T." surname="Brisco"></author>
    <date year="1995" month="April"></date>
  </front>
</reference>
<xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.3493.xml"/>
<xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.5424.xml"/>
<reference anchor="RFC6555" target="https://www.rfc-editor.org/info/rfc6555">
  <front>
    <title>Happy Eyeballs: Success with Dual-Stack Hosts</title>
    <author fullname="D. Wing" initials="D." surname="Wing"></author>
    <author fullname="A. Yourtchenko" initials="A." surname="Yourtchenko"></author>
    <date year="2012" month="April"></date>
  </front>
</reference>
<reference anchor="RFC8305" target="https://www.rfc-editor.org/info/rfc8305">
  <front>
    <title>Happy Eyeballs Version 2: Better Connectivity Using Concurrency</title>
    <author fullname="D. Schinazi" initials="D." surname="Schinazi"></author>
    <author fullname="T. Pauly" initials="T." surname="Pauly"></author>
    <date year="2017" month="December"></date>
  </front>
</reference>
</references>

</back>

</rfc>
