<?xml version="1.0" encoding="US-ASCII" ?>

<!DOCTYPE rfc SYSTEM "http://xml.resource.org/authoring/rfc2629.dtd" [
<!ENTITY rfc6555 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.6555.xml'>
<!ENTITY rfc6556 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.6556.xml'>
<!ENTITY rfc6724 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.6724.xml'>
]>

<?xml-stylesheet type="text/xsl" href="rfc2629.xslt" ?>

<?rfc toc="yes"?>
<?rfc tocompact="yes"?>
<?rfc tocdepth="3"?>
<?rfc tocindent="yes"?>
<?rfc symrefs="yes"?>
<?rfc sortrefs="yes"?>
<?rfc comments="yes"?>
<?rfc inline="yes"?>
<?rfc compact="yes"?>
<?rfc subcompact="no"?>
<rfc category="std" docName="draft-bajpai-happy-00.txt" ipr="trust200902">

  <front>
    <title abbrev="Measuring Happy Eyeballs">
      Measuring the Effectiveness of Happy Eyeballs
    </title>

    <author fullname="Vaibhav Bajpai" initials="V."
            surname="Bajpai">

      <organization>Jacobs University Bremen</organization>
      <address>
        <postal>
          <street>Campus Ring 1</street>
          <city>28759 Bremen</city>
          <country>Germany</country>
        </postal>
        <phone>+49 421 200 3112</phone>
        <email>v.bajpai@jacobs-university.de</email>
        <uri></uri>
      </address>

    </author>

    <author fullname="Juergen Schoenwaelder" initials="J."
            surname="Schoenwaelder">

      <organization>Jacobs University Bremen</organization>
      <address>
        <postal>
          <street>Campus Ring 1</street>
          <city>28759 Bremen</city>
          <country>Germany</country>
        </postal>
        <phone>+49 421 200 3587</phone>
        <email>j.schoenwaelder@jacobs-university.de</email>
        <uri></uri>
      </address>

    </author>

    <date month="July" year="2013" />
    <area>Operations and Management</area>

    <abstract>

      <t>

        The IETF has developed solutions that promote a healthy IPv4 and IPv6
        co-existence. The happy eyeballs algorithm for instance, provides
        recommendations to application developers to help prevent bad user
        experience in situations where IPv6 connectivity is broken. This
        document describes a metric used to measure the effectiveness of the
        happy eyeballs algorithm. The insights uncovered by analysing the data
        from multiple locations is discussed.

      </t>

    </abstract>

  </front>

  <middle>

    <section title="Introduction">

      <t>

        The function getaddrinfo(...) resolves a service name to a list of
        endpoints in an order that prioritizes an IPv6-upgrade path <xref
          target="RFC6724"/>. The order can dramatically reduce the
        application's responsiveness when IPv6 connectivity is broken. The
        degraded user experience can be subverted by implementing the happy
        eyeballs algorithm <xref target="RFC6555"/>. The algorithm recommends
        that a host, after resolving the service name, tries a TCP
        connect(...) to the first endpoint.  However, instead of waiting for a
        timeout, it waits for 300ms, after which it must initiate another TCP
        connect(...) to an endpoint with a different address family and start
        a competition to pick the one that completes first.

      </t>

      <t>

        This document describes a metric used to measure the effectiveness of
        the happy eyeballs algorithm. The insights uncovered by analysing the
        data from multiple locations is discussed.

      </t>

    </section>

    <section title="Related Work">

      <t>

        Fred Baker in <xref target="RFC6556"/> describes metrics and testbed
        configurations to measure how quickly an application can reliably
        establish connections from a dual-stacked environment. The metrics
        measure whether the communication establishment time is same
        regardless of the address family and the routing viability available
        to a dual-stacked host. The metrics defined in <xref
        target="RFC6556"/> is different in three ways:

        <list style="symbols">

          <t>

            DNS is accounted in connection establishment time. Our metric does
            not take this into account. Accounting DNS resolution may invite
            multiple input factors (slow resolvers) that may bias our TCP
            connection establishment time results. In addition, according to
            <xref target="RFC6555"/>, the 300ms advantage applies to the first
            address family after the getaddrinfo(...) call. From a programming
            perspective, an application calls getaddrinfo(...) and that does
            its job, regardless of which address family is used.

         </t>

          <t>

            The testbed configuration in <xref target="RFC6556"/> is more
            passive than active. An external analyser is used to passively
            observe the client's traffic using tcpdump. There is no active
            measurement test, instead the routers along the path are
            configured to control what connectivity route is taken. We on the
            other hand, have an active measurement test running on the client.
            The test is agnostic to network path configuration since it
            independently tries a TCP connection to each connectivity route.
            It also actively measures the time taken instead of relying on an
            external analyser program.

          </t>

          <t>

            The testbed setup in <xref target="RFC6556"/> is designed for a
            controlled environment. The router in the path is configured to
            disrupt all but one routes to control the prefix used in the
            connection. As such, the test is repeated N times with different
            router configurations to try all possible permutations of route
            connectivity. Our measurement test is agnostic to the network path
            and does not require path configuration changes.

          </t>

        </list>

      </t>

    </section>

    <section title="Metric">

      <t>

        We have defined a metric that uses the TCP connection establishment
        times as a parameter to measure the algorithm's effectiveness. The
        methodology also helps examine the impact of tunneling mechanisms
        employed by early adopters. The input parameter of the metric is a (IP
        address, port number) tuple and the output is the connection
        establishment time, typically measured in microseconds.

      </t>

    </section>

    <section title="Implementation">

      <t>

        We have developed happy, a simple TCP happy eyeballs probing tool that
        conforms to the definition of our metric. It uses non-blocking
        connect(...) calls to concurrently establish connections to all
        endpoints of a service and measures the elapsed time. The tool
        enforces a small delay between concurrent connect(...) calls to avoid
        bursty TCP SYN traffic. The initially performed service name
        resolution is not accounted in the connection establishment elapsed
        time.

      </t>

    </section>

    <section title="Measurement Trials">

      <t>

        We use Alexa's top 1M service names as input to prepare a top 100
        dual-stacked service names list. We run happy on our internal test-bed
        of multiple measurement agents with different flavors of connectivity
        ranging from native IPv4, native IPv6, IPv6 tunnel broker endpoints,
        Teredo and tunnelled IPv4. The list of Measurement Agents (MAs) is
        shown in <xref target="table_ex"/>.

      </t>

      <texttable anchor="table_ex" title="A List of Measurement Agents (MAs)">
          <ttcol align='center'>MA #</ttcol>
          <ttcol align='center'>IPv4 AS</ttcol>
          <ttcol align='center'>IPv6 AS</ttcol>
          <ttcol align='center'>City</ttcol>
          <ttcol align='center'>Country</ttcol>
          <ttcol align='center'>Platform</ttcol>

          <c>1</c>
          <c>AS680</c>
          <c>AS680</c>
          <c>Bremen</c>
          <c>Germany</c>
          <c>Mac OS X</c>

          <c>2</c>
          <c>AS680</c>
          <c>AS680</c>
          <c>Braunschweig</c>
          <c>Germany</c>
          <c>GNU/Linux</c>

          <c>3</c>
          <c>AS13237</c>
          <c>Teredo</c>
          <c>Berlin</c>
          <c>Germany</c>
          <c>GNU/Linux</c>

          <c>4</c>
          <c>AS31334</c>
          <c>AS6939</c>
          <c>Bremen</c>
          <c>Germany</c>
          <c>OpenWrt</c>

          <c>5</c>
          <c>AS680</c>
          <c>AS680</c>
          <c>Bremen</c>
          <c>Germany</c>
          <c>SamKnows</c>

          <c>6</c>
          <c>AS31334</c>
          <c>AS6939</c>
          <c>Bremen</c>
          <c>Germany</c>
          <c>SamKnows</c>

          <c>7</c>
          <c>AS24956</c>
          <c>AS24956</c>
          <c>Braunschweig</c>
          <c>Germany</c>
          <c>SamKnows</c>

          <c>8</c>
          <c>AS3320</c>
          <c>AS3320</c>
          <c>Bremen</c>
          <c>Germany</c>
          <c>SamKnows</c>

          <c>9</c>
          <c>AS5607</c>
          <c>AS5607</c>
          <c>London</c>
          <c>England</c>
          <c>SamKnows</c>

          <c>10</c>
          <c>AS3269</c>
          <c>AS3269</c>
          <c>Torino</c>
          <c>Italy</c>
          <c>SamKnows</c>

          <c>11</c>
          <c>AS8903</c>
          <c>AS8903</c>
          <c>Madrid</c>
          <c>Spain</c>
          <c>SamKnows</c>

          <c>12</c>
          <c>AS2614</c>
          <c>AS2614</c>
          <c>Timisoara</c>
          <c>Romania</c>
          <c>SamKnows</c>

          <c>13</c>
          <c>AS13030</c>
          <c>AS13030</c>
          <c>Olten</c>
          <c>Switzerland</c>
          <c>SamKnows</c>

          <c>14</c>
          <c>AS2856</c>
          <c>AS2856</c>
          <c>Ipswich</c>
          <c>England</c>
          <c>SamKnows</c>

      </texttable>

    </section>

    <section title="Data Analysis Insights">

      <t>

        The initial results show higher connection times and variations over
        IPv6 as shown in <xref target="fig1"/>.
      </t>

      <figure anchor="fig1"
	      title="service vs {mean_v4, mean_v6}: samsbox1 (30 days, 300ms)">
        <artwork>
  1e+06 ++-----+-----+------+-----+------+------+-----+------+-----+
       +mean (v4) ******   +     +      +      +     +      +     +
       +mean (v6) ######   :     :      :      :     :      :     :
       *      + *   *      :     :      :      :     :      : * * *
       *      : *   *      :     :      :      :     :      :** * *
       |*     : * ##*#     :     :      :      :     :      :** * *
  100000 +*.......*.#.**.......................................******
       +*     : *##*:*     :     :      :      :     :      #******
       +*     : **#*:*     :     :      :      :     :      * *****
       +*     :*****:*#    :     :      :      :     :      *  ****
       +*#    :**** : *    :     #      :      :     :      *  ** *
  10000 +*#*******.....**#*#*##**#####*##*####*#########*##*#*...*..
       + **   ***   : * ******  ********:*******************:   * :
       +  *   :*    :      :     :      :      :     :     *:   * :
       +  *   :*    :      :     :      :      :     :     *:   * :
       +      :     :      :     :      :      :     :      :     :
       +      +     +      +     +      +      +     +      +     +
  1000 ++-----+-----+------+-----+------+------+-----+------+-----+
       0      10    20     30    40     50     60    70     80    90
                                  Service Names
        </artwork>
      </figure>

      <t>

        Fig. 1. shows the average TCP connection establishment times for both
        IPv4 and IPv6. The Measurement Agent (MA) is a SamKnows probe
        connected at Jacobs University Bremen. It receives IPv4 and IPv6
        connectivity via German Research Network (DFN) [AS 680]. A PDF
        rendering of the plot is available at <xref target="mean"/>.

      </t>

      <figure anchor="fig2"
	      title="service vs {std_v4, std_v6}: samsbox1 (30 days, 300ms)">
        <artwork>
  1e+06 ++-----+-----+------+-----+------+------+-----+------+-----+
       +std (v4) ******    +     +      +      +     +      +     +
       +std (v6) ######    :     :      :      :     :      :     :
       +      +     +      :     :      :      :     :      :   # :
  100000 ++.......*...**..........................................#.*
       +      : * ##**     :     :      :      :     :      : * # *
       *  #   : * # **     :     #      :      :     :      :***# *
       #* # # : * **#*#*   * #*# # #   #:      #     :      :***##*
  10000 #*.#.*..**.**..**#..*.#**.#.#..##*...#..##......*...*.***..*
       # *#** *** * : **** * #**#### *#**   #* ###   :#* #*** # * *
       +#*#** ****  : * ****#* #**###* *#* # * # #   #** #* * # * *
       +##*#**#***  : * ****** #********#****************** *#  **:
       |#     :##*  :      :     :    * :      :     :     #*    *:
  1000 ++......#...........................................#.....*.
       +      :     :      :     :      :      :     :      :     :
       +      :     :      :     :      :      :     :      :     :
       +      +     +      +     +      +      +     +      +     +
   100 ++-----+-----+------+-----+------+------+-----+------+-----+
       0      10    20     30    40     50     60    70     80    90
                                  Service Names
        </artwork>
      </figure>

      <t>

        <xref target="fig2"/> shows the standard deviation of the TCP
        connection establishment times for both IPv4 and IPv6. The
        Measurement Agent (MA) is a SamKnows probe connected at Jacobs
        University Bremen. It receives IPv4 and IPv6 connectivity via
        German Research Network (DFN) [AS 680].  A PDF rendering of
        the plot is available at <xref target="std"/>.

      </t>

      <t>

        It appears that an application never uses
        IPv6 using Teredo except when IPv4 connectivity is broken. We noticed,
        that a 300ms advantage leaves a dual-stacked host only 1% chance to
        prefer a IPv4 route even though it may be significantly faster than
        IPv6. We also measured the margin by which happy eyeballs is
        inhibiting the fastest available route by comparing the slowness of a
        happy eyeballed winner to that of the loser.

      </t>

    </section>

    <section title="Conclusions">

      <t>

        We have performed a preliminary study on measuring the effectiveness
        of happy eyeballs. We noticed several cases where the algorithm does
        not select the best route and instead hampers the user experience. We
        are working towards running this test on a large-scale measurement 
	platform to develop a more comprehensive picture to help improve the
	algorithm.

      </t>

    </section>

  </middle>

  <back>

    <references title="Informative References">
      &rfc6555;
      &rfc6556;
      &rfc6724;
      <reference anchor="mean" target="http://cnds.eecs.jacobs-university.de/users/vbajpai/ietf87-v6ops/samsbox1-mean.pdf">
        <front>
          <title>IPv4 and IPv6 Average Connection Establishment Times</title>
          <author initials="V." surname="Bajpai" fullname="Vaibhav">
            <organization /> 
          </author>
          <date month="July" year="2013" />
        </front>
      </reference>

      <reference anchor="std" target="http://cnds.eecs.jacobs-university.de/users/vbajpai/ietf87-v6ops/samsbox1-std.pdf">
        <front>
          <title>IPv4 and IPv6 Connection Establishment Times Variations</title>
          <author initials="V." surname="Bajpai" fullname="Vaibhav">
            <organization /> 
          </author>
          <date month="July" year="2013" />
        </front>
      </reference>

    </references>

  </back>

</rfc>
