<?xml version="1.0" encoding="US-ASCII"?>
<!-- This template is for creating an Internet Draft using xml2rfc,
     which is available here: http://xml.resource.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://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml">
<!ENTITY RFC2629 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2629.xml">
<!ENTITY RFC6763 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.6763.xml">
<!ENTITY RFC4193 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.4193.xml">
<!ENTITY RFC6749 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.6749.xml">
<!ENTITY RFC5246 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.5246.xml">
<!ENTITY RFC3484 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.3484.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://xml.resource.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="4"?>
<!-- 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="no" ?>
<!-- keep one blank line between list items -->
<!-- end of list of popular I-D processing instructions -->
<rfc category="exp" docName="draft-dessez-homenet-googleplus-interconnect-00" ipr="trust200902">
  <!-- 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 abbrev="GooglePlus Homenet Interconnect">Connecting Home Networks via the social network GooglePlus</title>

    <!-- add 'role="editor"' below for the editors if appropriate -->

    <!-- Another author who claims to be an editor -->

    <author fullname="Cedric Dessez" initials="C.D." surname="Dessez">
      <organization>Cisco Systems</organization>

      <address>
        <postal>
          <street></street>

          <!-- Reorder these if your country does things differently -->

          <city>Paris</city>

          <region></region>

          <code></code>

          <country>France</country>
        </postal>

        <!--<phone></phone> -->

        <email>cedric@dessez.fr</email>

        <!-- uri and facsimile elements may also be added -->
      </address>
    </author>

    <date month="July" year="2013" />

    <!-- If the month and year are both specified and are the current ones, xml2rfc will fill 
         in the current day for you. If only the current year is specified, xml2rfc will fill 
     in the current day and month for you. If the year is not the current one, it is 
     necessary to specify at least a month (xml2rfc assumes day="1" if not specified for the 
     purpose of calculating the expiry date).  With drafts it is normally sufficient to 
     specify just the year. -->

    <!-- Meta-data Declarations -->

    <area>General</area>

    <workgroup>Internet Engineering Task Force</workgroup>

    <!-- WG name at the upperleft corner of the doc,
         IETF is fine for individual submissions.  
     If this element is not present, the default is "Network Working Group",
         which is used by the RFC Editor as a nod to the history of the IETF. -->

    <keyword>IPv6</keyword>
    <keyword>Homenet</keyword>
    <keyword>OSPFv3</keyword>
    <keyword>DNS-SD</keyword>
    <keyword>GooglePlus</keyword>
    <keyword>Tunnel</keyword>
    <keyword>Social network</keyword>

    <!-- Keywords will be incorporated into HTML output
         files in a meta tag but they have no effect on text or nroff
         output. If you submit your draft to the RFC Editor, the
         keywords will be used for the search engine. -->

    <abstract>
      <t>This document describes an experimental implementation for connecting home
      networks via a social network. The social network is used to extend the boundary 
      of a single home network to include other home networks. In this way, access to 
      devices or services within a home can be granted among home networks based on their 
      relation to one another within the social network.
</t>
    </abstract>
  </front>

  <middle>
    <section title="Introduction">
      <t>The goal of this experiment is to 
      allow an average home user to extend the boundaries of their home network to other 
      home networks the user trusts. Other home networks may be owned by a single user, or 
      "friends" of the user as defined by a social network. This document describes an 
      overall architecture and specific mechanisms chosen for a working implementation 
      based on the social network Google Plus.
      </t>
      <t>In each home, one router is responsible for interacting with the social network. 
      The home network is represented within the social network as a "Page" which the user owns. 
      The router is given credentials to interact with its representative Page, while the 
      user defines the relationship of the Pages to one another. When a bidirectional 
      relationship between two home network Pages is detected, the
      information necessary to setup a tunnel is shared by posting it to
      the social network. An encrypted tunnel is then setup between the homes, 
      and a link established.
      </t>
      <t>IP reachability among linked homes is achieved by insertion and propagation of 
      routes into a routing protocol running within the home network.  Services are then advertised among 
      homes as defined in <xref target="I-D.cheshire-mdnsext-hybrid"/>
      and <xref target="I-D.stenberg-homenet-dnssdext-hybrid-proxy-ospf"/>. Finally, by 
      connecting to a UI hosted by the specific router, the user can
      define policies for the services permitted to be shared 
      within a given circle defined by the social network.
      </t>
      <t>The mechanisms described in the following sections assume a homenet 
      environment as described in <xref target="I-D.ietf-homenet-arch"/> with
      with a routing protocol such as that defined in (<xref target="I-D.acee-ospf-ospfv3-autoconfig"/>)
      as well as the mechanism of prefix assignment defined in
      <xref target="I-D.arkko-homenet-prefix-assignment"/> .
      </t>

      <section title="Requirements Language">
        <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 title="Terminology and abreviations">
        <t>In this section we define terminology and abbreviations used throughout the text.
        </t>
        <t><list style="symbols">
          <t>Homenet: a home network as defined in <xref target="I-D.ietf-homenet-arch"/></t>
          <t>Gplus: Google Plus. Google's social network.</t>
          <t>Gplus router: the router that is responsible for the connection to 
          Google Plus, on which the mechanisms described in this document are
          hosted.</t>
          <t>Circle: represents a group of people for which you can define 
          confidentiality and visibility policies in Google Plus.</t>
          <t>Gplus ID: the unique internal identifier of an entity in Google Plus. It
          apparently consists in a decimal number on the order of 10^21 for 
          users and pages accounts, and a 64-bit hexadecimal number for circles.</t>
          <t>DNS-SD: DNS-Based Service Discovery <xref target="RFC6763"/>.</t>
          <t>ULA: IPv6 Unique Local Addresses <xref target="RFC4193"/>.</t>
          <t>CA: Certificate Authority (as defined in TLS <xref target="RFC5246"/>).</t>
          <t>CRT: Certificate as defined in TLS <xref target="RFC5246"/></t>
          <t>CSR: Certificate Signing Request or Certificate Request (as defined in 
          TLS <xref target="RFC5246"/>).</t>
          <t>CPE: Customer Premises Equipment.</t>
        </list></t>
      </section>
    </section>


    <section anchor="gplus" title="Defining the set of connected homes">
      <t>The central idea of this experiment is for the homenet to be represented 
      within the social network in a way that is intuitive to the user. For this to 
      happen, the homenet must be represented in a way such that:
      <list style="symbols">
        <t>the homenet is clearly linked to its owner</t>
        <t>the user can manage the relationships of the homenet with other homenets linked 
        to other users</t>
        <t>the network devices in the homenet can retrieve its social topology and setup 
        communication with its related homenets</t>
      </list>
      If social networks were widely used for connecting homenets today, there may be some 
      specific entity that a user could define that would clearly be identified as a home network.
      This would be available for setting up connections to, based on the users policy and relationship to 
      other users with homenets as part of their profile. As that is not the case today among 
      popular social networks such as Facebook and Google Plus, we looked into what might be the closest fit
      and decided to use Google Plus pages. Intended mainly for brands
      and businesses, they are not very different from user accounts on a
      social point of view (they organize their contacts and what they see by
      the system of circles). A user may have several pages, and a page may have 
      several administrators, each of them being able to easily
      log in as the page while connected to their regular Gplus account.
      </t>
      <t>In this implementation, the home router connects to Gplus to retrieve 
      the topology and communicate with other routers using the Google Pages API. 
      This API uses OAuth 2.0 (<xref target="RFC6749"/>) to allow the user to delegate the 
      management of pages to their Gplus router.
      </t>
      <t>In Gplus, the relationships between people and pages are ruled by
      the system of circles. One can circle whoever they want in one or more
      of their circles, without it needing to be accepted by the latter.
      But in our case, we consider a tunnel must be created only if the
      relationship is bidirectional, that is only if they have both circled each
      other in at least one circle. Notice that whereas one cannot know what
      are the circles of someone else, they know who has circled them, which
      is enough to know whether a relationship is bidirectional.
      The <xref target="service_discovery"/> will
      explain in details how the visibility policies of DNS-SD services are directly
      linked to circles.
      </t>
      <t>As stated earlier, the router needs to send messages through Gplus in order to
      exchange the information necessary to establish and configure the tunnel.
      This information can be divided into three categories: routing information, 
      cryptographic keys and DNS-SD settings. The first two will be detailed in
      <xref target="network_arch"/> and the third one in <xref target="service_discovery"/>.
      The routing information and the DNS-SD settings, which we will call Network
      Setttings, are gathered in a post
      that is regularly updated and visible to everyone in the page's circles.
      The posts conveying cryptographic will be described in <xref target="network_arch"/>.
      </t>
    </section>
    
    <section anchor="global_arch" title="Overall architecture">
      
      <t><xref target="arch_schema"/> represents the global functional architecture
      of the implementation and shows the interactions between its different parts.
      </t>
      <t>The interaction with Gplus is handled by a module called GplusHandler.
      It performs regular polling to update the social topoly in the database,
      and provides the TunnelsManager with functions which can send and retrieve
      messages or force an update of the database.
      </t>
      <t>The TunnelsManager is responsible for launching and maintaining the tunnels. It also
      takes care of routing and network settings issues.
      </t>
      <t>A user interface enables the user to modify the service policies stored in the database.
      Thus, they can be accessed by the FirewallManager
      and the customized DNS server that filters DNS-SD requests accordingly.
      </t>
      <figure align="center" anchor="arch_schema">
        <artwork align="center"><![CDATA[
                       +-------+
                       | Gplus |
                       +-------+
                           |
                           |
                   +--------------+   +----------------+
                   | GplusHandler |---| TunnelsManager |
                   +--------------+   +----------------+
                           |         /
                           |        /
+------------------+       |       /
| UI to define     |   +----------+    +-----------------+
| service policies |---| Database |----| FirewallManager |
+------------------+   +----------+    +-----------------+
                           |          /
                           |         /
                    +---------------+
                    |  DNS Server:  |
                    | DNS-SD filter |
                    +---------------+
            ]]></artwork>
        <postamble>Overall functional architecture.</postamble>
      </figure>
    </section>
    
    <section anchor="network_arch" title="Network architecture">
      <section anchor="tunnels" title="Managing the tunnels">
        <t>The tunnelling technology chosen for this experiment is 
        OpenVPN with the cryptography library OpenSSL. 
        </t>
        <t>In OpenVPN, one end has to be a
        server listening to the connections of clients, which in this case are
        the Gplus routers of the connected homenets. A server might have several clients
        connected to the same network interface. Notice it can be configured
        such as the clients connected to the same server cannot send packets to each
        other.
        Though there might be better ways to proceed, for this experiment the choice of being server or
        client is made by comparing the Gplus IDs of the connected pages.
        </t>
        <t>To set a tunnel with proper authentication of the other end, an architecture
        of OpenSSL certificates must be built. A Certificate Authority (CA) is built and owned by the
        server which must sign certificates to the clients. The certificates contain
        the Common Names of they owners, which define the identity of the tunnel endpoints.
        For this experiment, the Common Name of a router is its Gplus ID.
        Since each Gplus router may potentially host at the same time a server and multiple
        clients, it creates a CA and a Certificate Request (CSR). Then it publishes in Gplus a post
        (here called Security Settings) containing
        the certificate (CRT) of its CA and its CSR and makes it visible
        by all its circles. Therefore, when a new relationship appears in the social
        network, the server retrieves the client's CSR, signs it with the key of
        its CA and sends it back with a restricted visibility to the client. As for the
        client, it retrieves the CRT of the server's CA and its signed CRT.
        Notice there is no cryptography key sent on the social network, which
        is otherwise a secure channel to exchange the CAs and CSRs.
        </t>
        <t>Concerning contact addresses, the Gplus router must have a globally
        reachable IP address whether IPv4 (for example being the CPE) or preferably
        IPv6. This/these addresse(s) are advertised in the Network Settings post
        which is published at boot time and regularly updated, and visible by
        all the circles of the homenet.
        </t>
      </section>
      
      <section anchor="routing" title="Configuring the network">
        <t>In order to enable reachability of the devices of a connected homenet via the
        tunnel between them, routes must be configured.
        For reasons explained in <xref target="security"/>, instead of injecting routes
        to the globally routable prefixes of the connected homenets, the described
        design makes the Gplus routers generate and asign ULA prefixes and only
        those are advertised.
        </t>
        <t>In order to reduce the odds of collision, the ULA prefix is generated by
        the Gplus router following the following schema:
        </t>
        <?rfc needLines="5" ?>
        <figure align="center">
          <artwork align="center"><![CDATA[
|  8 bits      |  40 bits              |
+--------------+-----------------------+
|  FD00::/8    |   Global ID           |
+--------------+-----------------------+]]>
        </artwork>
        </figure>
        <?rfc needLines="6" ?>
        <t><list style="hanging" hangIndent="14">
          <t hangText="   Global ID =">f( hash( timestamp + GplusID ) )</t>
          <t hangText="With:"></t>
          <t hangText="   f">A function that take only the 40 last bits of its argument</t>
          <t hangText="   hash">A hashing function (SHA1 for this experiment)</t>
          <t hangText="   timestamp">A string containing the current UNIX timestamp</t>
          <t hangText="   GplusID">The homenet's Gplus ID</t>
          <t hangText="   +">The string concatenation operation</t>
          
        </list></t>
        <t><vspace blankLines="1"/>Once generated, the prefix is delegated to the homenet and /64 are assigned
        as specified in <xref target="I-D.arkko-homenet-prefix-assignment"/>.
        </t>
        <t>On the other ends of tunnels, the ULA prefix for this homenet is retrieved
        from the Network Settings post in Gplus and advertised through the connected
        homenets by injecting AS-External-LSAs in OSPFv3.
        </t>
        <t>In case there are other ULA prefixes assigned in the homenet, they should
        also be advertised and routed to the connected homenets.
        Otherwise the Default Address Selection mechanism for IPv6 specified in <xref target="RFC3484"/>
        will lead to an unpredictable behaviour as the source addressed chosen by a host to communicate
        over the tunnel might not be in the prefix advertised on Gplus and then would not
        be routed at the other end. But having other ULA prefixes is non-desirable since
        it increases the odds of prefix collision. In our implementation, we assume there
        is no other ULA prefix assigned in the homenet.
        </t>
        <t>Though we strive to avoid collisions while generating the ULA prefixes, the current design assumes there is no
        collision and does not treat such a case. Collisions might appear in two situations:
        either a Gplus router chooses the same prefix as one of its connected routers, or a Gplus
        router has two connected routers that have the same prefix. 
        The best solution for this is left for further study.
        </t>
      </section>
    </section>

    <section anchor="service_discovery" 
             title="Sharing services within your set of connected homes">
      <t>Connecting homenets would be pointless without any service 
      discovery mechanism. The aim is to allow a host to query services
      in connected homenets, and to let only the authorized services appear
      in the responses.
      </t>
      <t>Inside a single home, automatic service discovery is enabled by
      the hybrid DNS-SD proxy mechanism specified in <xref target="I-D.stenberg-homenet-dnssdext-hybrid-proxy-ospf"/>.
      The following design assumes this running on all routers
      of the homenet and mostly relies on it to enable service discovery
      over multiple homes.
      </t>
      <t>Connected homenets must have distinct domain names. Each
      homenet must either have a domain name that is owned by their administrator
      or generate a local one. In case of automatic generation we again
      have a problem of collisions
      and use Gplus IDs to make them the most unlikely possible. In order 
      to make to it a minimum human-friendly too, the formatted display name
      of the associated Gplus page is put at the beginning, concatenated
      with an hyphen, the 10 last digits of the Gplus ID and the TLD.
      A generic TLD for homes might be defined in the future, though for
      this experiment we use ".test.".
      </t>
      <t>To advertise this domain name across the homenet, the Gplus router
      advertises a Domain Name TLV.
      </t>
      <t>To make hosts browse other homenets zones, a DNS Delegated Zone TLV
      must be advertise for each one of them. The S bit must be set to 0
      because those zones are not full DNS-SD domains, and the B bit set to 1
      so that they are recommended for browsing at b._dns-sd._udp.(domain).
      For each one, the domain name and authoritative DNS server address (a ULA address
      of the Gplus router) are retrieved from the Network Settings post published
      in Gplus.
      </t>
      <t>Thus, the Gplus router's DNS server receives from other homes all DNS-SD queries for
      its home's domain name. Responses are filtered based on the source
      ULA address and the services authorized to the corresponding home.
      Notice also that A records and AAAA records that do not point to ULA
      addresses are dropped.
      A service is authorized if and only if a policy of one
      of the circles in which this home is allows it. For this experiment,
      a policy is defined as an authorized DNS-SD type of service (e.g. _http._tcp)
      associated to a circle, but finer granularity might be 
      implemented (which adds complexity because of hosts changing DNS zones or name).
      </t>
    </section>

    <section anchor="security"
             title="Security Considerations">
      <t>The necessity to setup tunnels between homes is the first security consideration.
      Performing filtered DNS-SD service discovery and direct communication between homes
      might be possible thanks to end-to-end reachability enabled by IPv6. However DNS requests and most common
      services' connections are not encrypted, which makes the enforcement of a secure channel
      between homes absolutely compulsory.
      
      The goal of the experiment is to allow homes to reach one another more easily than reaching the 
      whole of the internet. Doing so, the boundaries of the homenet are redrawn to include mutliple homes,
      which brings up security issues. DNS requests and most common services' connections are not
      encrypted, which motivates the enforcement of a secure channel between homes. Besides, tunnels also
      provide identity of the incoming packets.
      </t>
      <t>Injecting global prefixes in other homes might be a way to advertise larger prefixes 
      than those actually owned (e.g. advertising a /48 while only having a /56).
      Of course we could limit the size of advertised prefixes but this is not enough.
      One could imagine a PKI verification system but this would assume support from ISPs
      which is not currently offered. Using ULA prefixes mitigates this issue though
      it adds some others (already described in <xref target="routing"/>).
      </t>
      <t>Still, defining firewall rules is probably the toughest security concern.
      First, to prevent spoofing, only packets with source and destination addresses
      in the expected ULA prefixes are allowed.
      Even though the firewall of OpenVPN servers is not able to know for sure which connected client has sent
      a packet as an IP address might be spoofed, potential harm is very limited
      because it will not receive any packet back.<vspace/>
      Second, relying on unability to discover unauthorized services via DNS-SD is not
      sufficient, hence the need to accept only traffic corresponding to authorized
      services. This is a non-trivial general issue since a service cannot be reduced to a contact
      port and IP address tuple. This issue is left for further study.
      </t>
    </section>

    <section anchor="exp_results" title="Experimental results">
      <t>TBD
      </t>
    </section>
    
    <section anchor="iana"
             title="IANA Considerations">
      <t>This document contains no request to IANA.
      </t>
    </section>
    
    <section anchor="acknowledgements" title="Acknowledgements">
      <t>The author would like to thank Mark Townsley, Alain Fiocco,
      Ole Troan and Markus Stenberg for valuable mentoring of the project,
      as well as Pierre-Alain Dupont, Nicolas Iooss, Maico Le Pape
      and Guillaume Mulocher for high contribution in the design and 
      implementation of the prototype.
      </t>
    </section>

    <!-- Possibly a 'Contributors' 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">
      <!--?rfc include="http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml"?-->
      <?rfc include="reference.I-D.draft-ietf-homenet-arch-08.xml" ?>
      <?rfc include="reference.I-D.draft-acee-ospf-ospfv3-autoconfig-03.xml" ?>
      <?rfc include="reference.I-D.draft-arkko-homenet-prefix-assignment-04.xml" ?>
      <?rfc include="reference.I-D.draft-stenberg-homenet-dnssdext-hybrid-proxy-ospf-00.xml" ?>
      <?rfc include="reference.I-D.draft-cheshire-mdnsext-hybrid-00.xml" ?>
      
      &RFC2119;
      &RFC4193;
      &RFC6763;
      &RFC6749;
      &RFC5246;

    </references>

    <references title="Informative References">
      <!-- Here we use entities that we defined at the beginning. -->
      
      &RFC3484;

      
    <!-- Change Log

v00 2006-03-15  EBD   Initial version

v01 2006-04-03  EBD   Moved PI location back to position 1 -
                      v3.1 of XMLmind is better with them at this location.
v02 2007-03-07  AH    removed extraneous nested_list attribute,
                      other minor corrections
v03 2007-03-09  EBD   Added comments on null IANA sections and fixed heading capitalization.
                      Modified comments around figure to reflect non-implementation of
                      figure indent control.  Put in reference using anchor="DOMINATION".
                      Fixed up the date specification comments to reflect current truth.
v04 2007-03-09 AH     Major changes: shortened discussion of PIs,
                      added discussion of rfc include.
v05 2007-03-10 EBD    Added preamble to C program example to tell about ABNF and alternative 
                      images. Removed meta-characters from comments (causes problems).  -->
      &RFC2629;
    </references>
  </back>
</rfc>
