<?xml version="1.0" encoding="US-ASCII"?>
<!-- This template is for creating an Internet Draft using xml2rfc,
 which is available here: http://xml2rfc.ietf.org. -->
<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
<!-- One method to get references from the online citation libraries.
There has to be one entity for each item to be referenced. 
An alternate method (rfc include) is described in the references. -->
<!--<!ENTITY RFC2119 SYSTEM "http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml">
 -->
<!-- http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml-->
<!ENTITY RFC2119 SYSTEM "http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml">
<!ENTITY RFC6555 SYSTEM "http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.6555.xml">
<!ENTITY I-D.narten-iana-considerations-rfc2434bis SYSTEM "http://xml2rfc.ietf.org/public/rfc/bibxml3/reference.I-D.narten-iana-considerations-rfc2434bis.xml">
<!ENTITY I-D.wing-v6ops-happy-eyeballs-ipv6 SYSTEM "http://xml2rfc.ietf.org/public/rfc/bibxml3/reference.I-D.draft-wing-v6ops-happy-eyeballs-ipv6-01.xml">
]>
<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>
<!-- used by XSLT processors -->
<!-- For a complete list and description of processing instructions (PIs), 
 please see http://xml2rfc.ietf.org/authoring/README.html. -->
<!-- Below are generally applicable Processing Instructions (PIs) that most I-Ds might want to use.
 (Here they are set differently than their defaults in xml2rfc v1.32) -->
<?rfc strict="yes" ?>
<!-- give errors regarding ID-nits and DTD validation -->
<!-- control the table of contents (ToC) -->
<?rfc toc="yes"?>
<!-- generate a ToC -->
<?rfc tocdepth="3"?>
<!-- the number of levels of subsections in ToC. default: 3 -->
<!-- control references -->
<?rfc symrefs="yes"?>
<!-- use symbolic references tags, i.e, [RFC2119] instead of [1] -->
<?rfc sortrefs="yes" ?>
<!-- sort the reference entries alphabetically -->
<!-- control vertical white space 
 (using these PIs as follows is recommended by the RFC Editor) -->
<?rfc compact="yes" ?>
<!-- do not start each main section on a new page -->
<?rfc subcompact="yes" ?>
<!-- do not keep one blank line between list items -->
<!-- end of list of popular I-D processing instructions -->
<?xml-stylesheet type="text/xsl" href="rfc2629.xslt"?>
<rfc category="info" docName="draft-grinnemo-taps-he-00"
     ipr="trust200902">
  <!--	noModificationTrust200902 noDerivativesTrust200902 pre5378Trust200902">-->

  <!-- updates="6298"> -->

  <!-- ipr="full3978"> -->

  <!-- category values: std, bcp, info, exp, and historic
     ipr values: full3667, noModification3667, noDerivatives3667
     you can add the attributes updates="NNNN" and obsoletes="NNNN" 
     they will automatically be output with "(if approved)" -->

  <!-- ***** FRONT MATTER ***** -->

<front>
	<!-- The abbreviated title is used in the page header - it is only necessary if the 
	     full title is longer than 39 characters -->

	<title>Happy Eyeballs for Transport Selection</title>

	<author fullname="Karl-Johan Grinnemo" initials="K-J" surname="Grinnemo">
		<organization>Karlstad University</organization>
		<address>
			<postal>
				<street>Universitetsgatan 2</street>
				<code>651 88</code>
				<city>Karlstad</city>
				<region></region>
				<country>Sweden</country>
			</postal>
			<phone>+46 54 700 24 40</phone>
			<email>karl-johan.grinnemo@kau.se</email>
		</address>
	</author>

	<author fullname="Anna Brunstrom" initials="A." surname="Brunstrom">
		<organization>Karlstad University</organization>
		<address>
			<postal>
				<street>Universitetsgatan 2</street>
				<code>651 88</code>
				<city>Karlstad</city>
				<region></region>
				<country>Sweden</country>
			</postal>
			<phone>+46 54 700 17 95</phone>
			<email>anna.brunstrom@kau.se</email>
		</address>
	</author>

	<author fullname="Per Hurtig" initials="P." surname="Hurtig">
		<organization>Karlstad University</organization>
		<address>
			<postal>
				<street>Universitetsgatan 2</street>
				<code>651 88</code>
				<city>Karlstad</city>
				<region></region>
				<country>Sweden</country>
			</postal>
			<phone>+46 54 700 23 35</phone>
			<email>per.hurtig@kau.se</email>
		</address>
	</author>

	<author fullname="Naeem Khademi" initials="N." surname="Khademi">
		<organization>University of Oslo</organization>
		<address>
			<postal>
				<street>PO Box 1080 Blindern</street>
				<code>N-0316</code>
				<city>Oslo</city>
				<region></region>
				<country>Norway</country>
			</postal>
			<phone>+47 2285 24 93</phone>
			<email>naeemk@ifi.uio.no</email>
		</address>
	</author>


	<date year="2016" month="July"/>

	<area>Transport</area>
	<workgroup>TAPS</workgroup>
	<keyword>taps, transport services</keyword>

	<abstract>
		<t>It is widely recognized that it has become very difficult to introduce new transport protocols on the Internet.
		On reason to this is that there are no agreed-upon way for a source end host to find out whether there is support
		for a particular transport protocol along the network path from itself to a destination end host or not. This
		document describes a Happy Eyeballs framework that generalizes previously proposed Happy Eyeballs mechanisms to
		include a transport protocol, the configuration of this transport protocol, as well as a transport address, i.e.,
		to include complete transport solutions. The described Happy Eyeballs framework is not only useful in the design
		and implementation of mechanisms that are to determine the support of particular transport solutions, but also
		for the design of mechanisms that are to select the transport solution, which, according to some criteria, is the
		most appropriate one to use.</t>
	</abstract>
</front>

<middle>
	<section title="Definitions" anchor='sec-def'>
		<t>The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
		"SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
		document are to be interpreted as described in <xref target="RFC2119">RFC 2119</xref>.</t>
</section>

<section anchor="sec-intro" title="Introduction">
	<t>Concerns have been raised in the past several years that introducing new transport protocols on the Internet has become
	increasingly difficult, not least because there is no agreed-upon way for a source end host to find out if a transport
	protocol is supported all the way to a destination peer. Of course, testing a set of candidate protocols can be done serially,
	e.g., try first with the preferred choice, X, and, if the connection attempt fails after a suitable timeout, fall back to
	a default alternative, Y. However, since a connection timeout can introduce a delay of up to tens of seconds, serializing
	attempts can incur a large delay penalty when the new protocol, X, is not supported, stalling the application until the
	subsequent connection attempt succeeds. A solution to a similar problem, finding out support for IPv6, has been proposed and
	is currently being deployed, the Happy Eyeballs (HE) mechanism <xref target='RFC6555'></xref>: The HE mechanism was introduced
	as a means to facilitate IPv6 adoption. Dual-stack client applications should be encouraged to try setting up connections over
	IPv6 first, and fall back to using IPv4 if IPv6 connection attempts fail. However, serializing tests for IPv6 and IPv4
	connectivity can result in large connection latencies. HE for IPv6 minimizes the cost in delay by parallelizing attempts over
	IPv6 and IPv4. HE has also been proposed as an efficient way to find out the optimal combination of IPv4/IPv6 and TCP/SCTP
	to use to connect to a server <xref target='I-D.wing-v6ops-happy-eyeballs-ipv6'></xref>. This document suggests a further
	generalization of the transport HE mechanism proposed in Wing et al. <xref target='I-D.wing-v6ops-happy-eyeballs-ipv6'></xref>
	which addresses the selection of arbitrary transport solutions, i.e., arbitrary combinations of transport protocol, transport
	address, and pertaining configurations, and which lend itself to arbitrary transport selection criterias, not only support
	for a particular transport solution. Particularly, this document provides a HE framework from which a transport selection
	mechanism could be realized that selects, from supported transport solutions, the one that according to some criteria is the
	most appropriate one.</t>
</section>

<section anchor="sec-problem" title="Problem Statement">
	<t>There is, as mentioned in <xref target="sec-intro" />, no agreed-upon way for a source end host to find out if a
	transport protocol is supported along a network path between itself and a destination end host. As a consequence, it has
	become increasingly difficult to introduce new transport protocols. This is further aggravated by the fact that several
	applications, including many web applications, run over TCP although there are other transport solutions that better meet
	the requirements of these applications. Another, related problem, addressed by our proposed HE framework is how to select
	the transport solution that is, according to some critera, the most appropriate one for a given application. In fact,
	our HE framework provides guidelines on how to design and implement a HE transport selection mechanism that combines these
	two problems by selecting, from among supported transport solutions, the one that best meets a given criteria.
</t>

</section>

<section anchor="sec-he-framework" title="The Happy Eyeballs Framework">
	<t>
	<figure align="center" anchor="fig-he-example" title="Illustration of Happy Eyeballing between three TCP transport solutions.">
	         <artwork align="center">
		             <![CDATA[
client                    server
  |     TS1: SYN            |
  +------------------------>|
  |     TS2: SYN            |
  +------------------------>|
  |     TS3: SYN            |
  +------------------------>|
  |                         |
  |                         |
  |     TS1: SYN+ACK        |
  |<------------------------|
  |     TS2: SYN+ACK        |
  |   <---------------------+
  |     TS3: SYN+ACK        |
  |        <----------------+
  |                         |
  |                         |
  ]]>
		</artwork>
	</figure>
	</t>
	<t>The HE framework takes as input a list of candidate transport solutions, L, sorted in decreasing priority order. The exact
	scale used for the priority is beyond the scope of the framework, however, since the difference between priorities should
	be meaningful, it must at least be an interval scale.

	The HE framework consists of the following two steps (cf. <xref target="fig-he-example" />):
	
		<list style="numbers">
			<t>Spawn in priority order connection attempts for each candidate transport solution in L. The difference
                        in priority between two consecutive candidates, C1 and C2, is translated according to some criteria to
                        a delay, D. D then governs the delay between the spawn of C1 and C2. The way connection attempts are
			spawned is not within the scope of the HE framework, and could, for example, be realized through threads
			or asynchronous I/O.</t>
			
			<t>Wait for the first connection, W, to be established. W becomes the winning transport solution. The action
                        taken with the remaining, non-winning, transport solutions is beyond the scope of the HE framework.</t>
		</list>
	</t>
</section>

<section anchor="sec-design-impl-consid" title="Design and Implementation Considerations">
	<t>This section discusses implementation issues that should be considered when a HE mechanism is designed and implemented on
	the basis of the HE framework proposed in this document.</t>

	<section anchor="sec-caching" title="Caching">
		<t>As pointed out in RFC 6555 <xref target='RFC6555'></xref>, a HE algorithm should not waste networking resources by
		routinely making simultaneous connection attempts. To this end, the HE algorithm should cache the outcome of previous
		connection attempts. Cached connection attempts should be valid for a configurable time after which they should become
		invalid and have to be repeated. The impact and efficiency of the HE algorithm has been evaluated in a publication
		by us <xref target='Papastergiou16'></xref>. The paper suggests that caching significantly reduces the CPU load
		imposed by a HE mechanism.</t>
	</section>

	<section anchor="sec-non-win" title="Non-Winning Transport Solutions">
		<t>As mentioned in Section <xref target="sec-he-framework" />, the management of the non-winning transport solutions
		is not within the scope of the HE framework. Still, it is recommended that all non-winning transport solutions are
		abandoned. Moreover, if caching is used, we recommend that the outcome of the connection attempt of the non-winning
		transport solution is cached.</t>
	</section>
</section>

<section anchor="sec-example" title="Example Happy Eyeballs Mechanism">
	<t>Consider the scenario of a dual-stack IPv4/IPv6 client trying to setup a connection to a dual-stack IPv4/IPv6 server. Assume
	the client and server support both TCP and SCTP. A list of candidate transport solutions is put together that contains TCP and
	SCTP over IPv6 (with equal priority) followed by TCP and SCTP over IPv4 (with equal priority), but the latter have a lower priority 
	than their IPv6 counterparts. The HE mechanism is invoked; traverses the candidate list, and spawns a separate thread for each
	candidate transport solution. In our example, two threads are created for TCP and SCTP over IPv4, and two threads for TCP and SCTP
	over IPv6. Since the IPv4 transport solutions have a lower priority than the IPv4 ones, the creation of the threads for the IPv4
	transport solutions are delayed with respect to the IPv6 transport solution threads. The length of the delay depends on the size of
	the difference in priority. Within each thread, a connection attempt is made, and if the connection attempt is successful, the thread
	returns a connection handle. Otherwise, it signals a failure by returning an invalid connection handle. In both cases the outcome
	(connection attempt success or failure) is cached. Assume that in our example all connection attempts succeed and therefore will be
	cached as successful connection attempts. Since the IPv6 connection attempts were started earlier than IPv4 counterparts, one of
	these attempts will be selected as the winning transport solution.</t>
</section>

<section anchor="IANA" title="IANA Considerations">
<t>XX RFC ED - PLEASE REMOVE THIS SECTION XXX</t>

<t>This memo includes no request to IANA.</t>
</section>

<section anchor="Security" title="Security Considerations">
<t>Security will be considered in future versions of this document.</t>
</section>

<section anchor="Acknowledgments" title="Acknowledgements">
	<t>This work has received funding from the European Union's Horizon 2020 research and innovation programme under grant agreement
	No. 644334 (NEAT). The views expressed are solely those of the author(s).</t>
</section>

</middle>

  <!--  *****BACK MATTER ***** -->

  <back>
    <!-- References split into informative and normative -->

    <!-- There are 2 ways to insert reference entries from the citation libraries:
         1. define an ENTITY at the top, and use "ampersand character"RFC2629; here (as shown)
         2. simply use a PI "less than character"?rfc include="reference.RFC.2119.xml"?> here
         (for I-Ds: include="reference.I-D.narten-iana-considerations-rfc2434bis.xml")

         Both are cited textually in the same manner: by using xref elements.
         If you use the PI option, xml2rfc will, by default, try to find included files in the same
         directory as the including file. You can also define the XML_LIBRARY environment variable
         with a value containing a set of directories to search.  These can be either in the local
         filing system or remote ones accessed by http (http://domain/dir/... ).-->

<references title="Normative References">
	&RFC2119;
	&RFC6555;
</references>

<references title="Informative References">
	&I-D.wing-v6ops-happy-eyeballs-ipv6;
	<reference anchor="Papastergiou16">
		<front>
			<title>On the Cost of Using Happy Eyeballs for Transport Protocol Selection</title>
			<author initials="G." surname="Papastergiou"
                        	fullname="Georgios Papastergiou">
				<organization>
					Simula Research Laboratory
				</organization>
			</author>
			<author initials="K-J" surname="Grinnemo"
                        	fullname="Karl-Johan Grinnemo">
				<organization>
					Karlstad University	
				</organization>
			</author>
			<author initials="A." surname="Brunstrom"
                        	fullname="Anna Brunstrom">
				<organization>
					Karlstad University	
				</organization>
			</author>
			<author initials="D." surname="Ros"
                        	fullname="David Ros">
				<organization>
					Simula Research Laboratory
				</organization>
			</author>
			<author initials="M." surname="Tuexen"
                        	fullname="Michael Tuexen">
				<organization>
					Fachhochschole Muenster	
				</organization>
			</author>
			<author initials="N." surname="Khademi"
                        	fullname="Naeem Khademi">
				<organization>
					Simula Research Laboratory
				</organization>
			</author>
			<author initials="P." surname="Hurtig"
                        	fullname="Per Hurtig">
				<organization>
					Karlstad University	
				</organization>
			</author>
			<date month="July" year="2016" />
		</front>
	</reference>
</references>

</back>

</rfc>
