<?xml version="1.0" encoding="US-ASCII"?>

<?rfc toc="yes"?>
<?rfc tocompact="yes"?>
<?rfc tocdepth="6"?>
<?rfc symrefs="yes"?>
<?rfc sortrefs="yes"?>
<?rfc autobreaks="no"?>
<?rfc subcompact="no"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
    <!ENTITY rfc3315 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.3315.xml">
    <!ENTITY rfc6887 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.6887.xml">
    <!ENTITY rfc6241 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.6241.xml">
    <!ENTITY rfc7596 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.7596.xml">
    <!ENTITY rfc7341 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.7341.xml">
    <!ENTITY rfc7598 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.7598.xml">
    <!ENTITY rfc7618 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.7618.xml">
    <!ENTITY I-D.ietf-softwire-lw4over6 SYSTEM 'http://xml.resource.org/public/rfc/bibxml3/reference.I-D.ietf-softwire-lw4over6.xml'>
    <!ENTITY I-D.ietf-softwire-map-dhcp SYSTEM 'http://xml.resource.org/public/rfc/bibxml3/reference.I-D.ietf-softwire-map-dhcp.xml'>
    <!ENTITY I-D.ietf-pcp-port-set SYSTEM 'http://xml.resource.org/public/rfc/bibxml3/reference.I-D.ietf-pcp-port-set.xml'>
    <!ENTITY I-D.fsc-softwire-dhcp4o6-saddr-opt SYSTEM 'http://xml.resource.org/public/rfc/bibxml3/reference.I-D.fsc-softwire-dhcp4o6-saddr-opt.xml'>
    <!ENTITY I-D.sun-softwire-yang SYSTEM 'http://xml.resource.org/public/rfc/bibxml3/reference.I-D.sun-softwire-yang.xml'>
    <!ENTITY I-D.perreault-softwire-lw4over6-pcp SYSTEM 'http://xml.resource.org/public/rfc/bibxml3/reference.I-D.perreault-softwire-lw4over6-pcp.xml'>
    <!ENTITY bcp38 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2827.xml">
]>

<rfc category="info" docName="draft-liu-softwire-lw4over6-dynamic-provisioning-02" ipr="trust200902">

<front>
  <title abbrev="lw4over6 dynamic provisioning">Dynamic IPv4 Provisioning for Lightweight 4over6</title>
  <author fullname="Cong Liu" initials="C." surname="Liu">
    <organization>Tsinghua University</organization>
    <address>
    <postal>
      <street>Department of Computer Science, Tsinghua University</street>
      <city>Beijing</city>
      <code>100084</code>
      <country>P.R.China</country>
    </postal>
    <phone>+86-10-6278-5822</phone>
    <email>cong-liu13@mails.tsinghua.edu.cn</email>
    </address>
  </author>
  <author fullname="Qi Sun" initials="Q." surname="Sun">
    <organization>Tsinghua University</organization>
    <address>
    <postal>
      <street>Department of Computer Science, Tsinghua University</street>
      <city>Beijing</city>
      <code>100084</code>
      <country>P.R.China</country>
    </postal>
    <phone>+86-10-6278-5822</phone>
    <email>sunqi@csnet1.cs.tsinghua.edu.cn</email>
    </address>
  </author>
  <author fullname="Jianping Wu" initials="J." surname="Wu">
    <organization>Tsinghua University</organization>
    <address>
    <postal>
      <street>Department of Computer Science, Tsinghua University</street>
      <city>Beijing</city>
      <code>100084</code>
      <country>P.R.China</country>
    </postal>
    <phone>+86-10-6278-5983</phone>
    <email>jianping@cernet.edu.cn</email>
    </address>
  </author>
  <author fullname="Ian Farrer" initials="I." surname="Farrer">
    <organization>Deutsche Telekom AG</organization>
    <address>
      <postal>
        <street>CTO-ATI,Landgrabenweg 151</street>
        <city>Bonn</city>
        <region>NRW</region>
        <code>53227</code>
        <country>Germany</country>
      </postal>
      <email>ian.farrer@telekom.de</email>
    </address>
  </author>

  <date year="2016"/>

  <workgroup>Network Working Group</workgroup>

  <abstract>
    <t>
    Lightweight 4over6 <xref target="RFC7596"/> is an
    IPv4 over IPv6 hub-and-spoke mechanism that provides overlay IPv4
    services in an IPv6-only access network. It uses a
    deterministic, DHCPv6 based method for the provisioning
    of IPv4 addresses and port sets to customer CE devices. This
    document describes how existing specifications can be used for
    the dynamic IPv4 provisioning of Lightweight 4over6, based
    on DHCPv4 over DHCPv6 <xref target="RFC7341"/>.
    </t>
  </abstract>
</front>

<middle>
    <section title="Introduction">
     <t>Lightweight 4over6 <xref target="RFC7596"/> (lw4o6) provides IPv4 access
     over an IPv6 network with a hub-and-spoke softwire
     architecture.  In Lightweight 4over6, each Lightweight B4 (lwB4)
     is assigned a full, or shared (port-restricted) IPv4 address
     to be used for IPv4 communication. Provisioning the lwB4 with
     its IPv4 address, port set and other parameters necessary for
     building the softwire is a core function of the lw4o6 control plane.</t>

     <t><xref target="RFC7596"/> describes the use of DHCPv6 for
     deterministic IPv4 provisioning.  The IPv4 address, port set ID
     (PSID) and address of the lwAFTR are carried in DHCPv6 options defined in
     <xref target="RFC7598"/>.</t>

     <t>However, the deterministic provisioning of the IPv4 parameters
      imposes restrictions on the deployment:<list style="symbols">

       <t>The IPv4 address' life time is bound to the client's IPv6 tunnel
        endpoint life time</t>
       <t>The tunnel must be initiated from a fixed and predictable /64 prefix
        in the home network topology</t>
       <t>The IPv4 address and PSID need to be embedded into the IID of the
       clients' /128 IPv6 address</t>
       <t>IPv4 address resources are permanently reserved for a client
       whether it is active or not. This results in less efficient public
       IPv4 address usage</t>

     </list>
     </t>

      <t>This document describes how lw4o6 uses DHCPv4 over DHCPv6 to achieve 
      dynamic IPv4 address provisioning. The main advantages of using a 
      dynamic provisioning model over a deterministic provisioning model are
      as follows:<list style="symbols">

       <t>No inherent restrictions on the IPv6 source address within the
       customer internal network that the client uses for sourcing its tunneled
       traffic</t>
       <t>The lifetimes of IPv6 and IPv4 addresses are decoupled, allowing for
       more flexibility in the service provider's addressing policy</t>
       <t>Inactive clients' addresses can be released/reclaimed for
       allocation to active clients, so more efficient address usage
       is possible</t>
     </list>
     </t>

      <t>Since DHCPv4 over IPv4 cannot be used natively in a pure IPv6 network, 
      DHCPv4 over DHCPv6 (DHCP 4o6) <xref target="RFC7341"/> allows DHCPv4 messages 
      to be trasported over a pure IPv6 network by encapsulating DHCPv4 messages 
      into specific DHCPv6 options and messages.</t>

      <t> Note that the dynamic provisioning decouples the IPv6 and IPv4 addresses, the
      binding info required by lwAFTR turns to be an ayschronous combiantion of
      (restricted) IPv4 address and IPv6 address.
      <xref target="I-D.fsc-softwire-dhcp4o6-saddr-opt"/> defines a DHCP 4o6 based
      mechanism for the lwB4 to inform the server of its binding between dynamically
      allocated IPv4 address and Port Set ID and the IPv6 address that it will use for
      accessing IPv4-over-IPv6 services</t>
      <!-- LH COMMENT: there should be more statement about how the saddr is 
      related to the dynamic provisioning. I added some text here to make it more clear. !-->

      <t>The architecture which is described in this document can be implemented
      with or without the sharing of IPv4 addresses between multiple clients.
      If IPv4 address sharing is required, then <xref target="RFC7618"/>
      describes the necessary extensions to the DHCPv4 server and client
      provisioning for the allocation and lease management of shared IPv4
      addresses.</t>
      <!-- LH COMMENT: in lw4o6, the shared IPv4 address is required, it seems that the
      shared IPv4 address is "must" in this document, maybe we need to remove this
      paragraph?
      IF - RFC7596 references using RFC7040 for full address with no sharing
      so I think it's fine to keep in there.!-->
    </section>

    <section title="Terminology">
      <t>Terminology defined in <xref target="RFC7341"/>
      and <xref target="RFC7596"/> is used extensively throughout this document.
      </t>

      <t>Determinstic provisioning: Lightweight B4 provisioning with DHCPv6 as described
      in section 5.1 of <xref target="RFC7596"/>. The IPv4 address, restricted port set
      and the address of lwAFTR are carried in DHCPv6 options defined in
      <xref target="RFC7598"/>.</t>

      <t>Dynamic provisioning: Lightweight B4 provisioning with DHCPv4 over DHCPv6 as
      described in this document. The IPv4 address and rescricted port set are allocated
      through DHCP 4o6 transport as defined in <xref target="RFC7341"/>. The allocation
      of lwAFTR's IPv6 address is descirbed in
      <xref target="I-D.fsc-softwire-dhcp4o6-saddr-opt"/>.</t>

    </section>

    <section title="Dynamic Provisioning Model">
     <t>As shown in Figure 1, the dynamic provisioning model consists of four functional
     elements: lwB4, lwAFTR, DHCPv6 Server and DHCP 4o6 Server. Note that these elements
     are not necessarily separate devices, one or more functional elements
     could be located on a single device. One existing example of this is the co-location
     of the DHCP 4o6 Server and lwAFTR as a single gateway device. The differences in 
     the message flow from this co-location are also described below.</t>

      <figure align="center" anchor="structure" title="Dynamic lw4o6
        Provisioning Model">
          <artwork><![CDATA[
              ________     __________
             |        |   |          |
             | DHCPv6 |   | DHCP 4o6 |
             | Server |   |  Server  |
             |________|   |__________|
                 ^       /            \
               1 |    2 /              \ 3a/b
              ___v____ /                \ ________
             |        |                  |        |
             |  lwB4  |<---------------->| lwAFTR |
             |________|    Data Plane    |________|
           ]]></artwork>
           <postamble>The numbers corresponding to each of the provisioning flows are
             described in more detail below.</postamble>
        </figure>

     <section title="Flow 1: lwB4's IPv6 Addressing and DHCPv6 Configuration">
      <t>Before attempting the DHCP 4o6 configuration process to obtain IPv4
      configuration, the lwB4 requires an IPv6 address of a suitable scope to allow
      communication with the lwAFTR (e.g. a link-local address cannot be used). This IPv6
      address can be configured using any applicable method (e.g. SLAAC, DHCPv6, etc.).
      </t>

      <t>To enable DHCPv4 over DHCPv6 transport, the lwB4 needs to perform DHCPv6 to
      retrieve the DHCP 4o6 server's IPv6 address. The option code
      OPTION_DHCP4_O_DHCP6_SERVER (88) is included in the client's ORO. The DHCPv6 server
      responds the DHCP 4o6 server's IPv6 address by carrying the addresses in DHCP 4o6
      Server Address option as defined in <xref target="RFC7341"/>.</t>
     </section> 

     <section title="Flow 2: DHCP 4o6 Function">
      <t>Once the lwB4 has acquired the IPv6 address of the DHCP 4o6 server, stateful
      configuration using DHCP 4o6 is performed to obtain an IPv4 address and (optionally)
      a port set. The lwB4 sends a DHCPv4 DISCOVER message in a DHCPv4-query Message to
      the DHCP 4o6 server(s) to activate the DHCP 4o6 transport. To obtain a shared IPv4
      address, the lwB4 also has to include Parameter Request List option with the option
      code OPTION_V4_PORTPARAMS (159) as described in <xref target="RFC7618"/>.</t>

      <t>To obtain the IPv6 address of lwAFTR and inform the DHCP4o6 server of the lwB4's
      IPv6 tunnle source address, the message flow described in section 5 of 
      <xref target="I-D.fsc-softwire-dhcp4o6-saddr-opt"/> is followed by the lwB4.</t>

      <t>Once successfully completed, the client has been provisioned with the IPv6
      address of the lwAFTR, an IPv4 address and (optionally) a range of source ports.
      The server has the /128 IPv6 address that the client will use its tunnel source
      associated with the IPv4 lease.</t>
     </section>

     <section title="Flow 3: lwAFTR Binding Table Maintainence">
      <t>As stated in <xref target="RFC7596"/>, the lwAFTR MUST synchronize the binding
      information with the port-restricted address provisioning process. In the dynamic
      provisioning model described in this document, once the lwB4's provisioning process
      is completed and the DHCP 4o6 server holds the client's /128 IPv6 tunnel endpoint
      address, this binding information can be syncronized with the lwAFTR. The method for
      this synchronization is dependent on whether the DHCP 4o6 and lwAFTR functions
      are co-located on the same physical host.</t>

      <section title="Flow 3a: Binding Table Maintenance for Co-located lwAFTR/DHCP 4o6
      Functions">
       <t>Here, the lwAFTR maintains its binding table as per section 6.1 of 
        <xref target="RFC7596"/> and is synchronized with DHCP 4o6
         process. The following DHCP 4o6 messages trigger binding table modification:
        <list style="hanging">
          <t hangText="DHCPACK:">Generated by the DHCP 4o6 server, triggers lwAFTR
           to add a new entry or modify an existing entry.</t>
          <t hangText="DHCPRELEASE:">Generated by lwB4, triggers lwAFTR to delete
           an existing entry.</t>
         </list>
       </t>

       <t>When the DHCP 4o6 server generates a DHCPACK message, information about the 
       new lease including the client's IPv6 tunnel endpoint address and IPv4 address/PSID
       tuple is sent to the lwAFTR process. The lwAFTR performs a check that this
       new binding does not match an existing binding (both the v6 and v4 information 
       must be checked independently to ensure no conflicts). If no conflicts are found
       the lwAFTR creates a new binding table entry for the client.</t>
       
       <t>If there an existing entry is found, the lwAFTR updates the IPv6
         address and lifetime fields of the entry.</t>
         
       <t>When the DHCP 4o6 server receives a DHCPRELEASE
         message, the lwAFTR looks up the binding table using the lwB4's IPv6
         address, IPv4 address and PSID as index. The lwAFTR deletes the entry
         either by removing it from the binding table or by marking the lifetime
         field with an invalid value (e.g. 0).</t>
          <!-- IF - There's an edge failure case missing here. What if the v6 address
          matches one entry for the v6 address and another entry for the v4 prefix?
          For the second option here of marking with an invalid lifetime, won't this
          lead to binding tables growing over time? The lifetime field for a binding
          table entry is not a defined field in any of the specs, so this is an implementation
          specific feature. Suggest it's deleted.!-->
      </section>

      <section title="Flow 3b: Binding Table Maintenance for Distributed lwAFTR/DHCP 4o6
      Functions">
        <t>With this architecture, NETCONF
        <xref target="RFC6241"/> is used for syncronising client DHCP 4o6 provisioning 
        and the lwAFTR binding table. A YANG model for lw4o6 is defined in
        <xref target="I-D.sun-softwire-yang"/>. In this deployment model, the DHCP 4o6
        server and lwAFTR also implements a NETCONF server. When an IPv4 leasing event 
        occurs (DHCPACK/DHCPRELEASE messages, or an active lease expiring), the DHCP 4o6
        server informs the operator's centralised configuration database of the change.
        </t>

         <t>The operator's configuration database will then use NETCONF to update the 
         lwAFTR of the relevant change by adding or removing the binding table entry 
         which matches he DHCP 4o6 server's IPv4 address lease.</t>
      </section>

     </section>
	</section>

    <section title="Security Considerations">
      <t>Security considerations in <xref target="RFC7596"/> and <xref target="RFC7341"/>
      are also relevant here.
      </t>
      <t>The DHCP message triggered binding table maintenance may be used by an
        attacker to send fake DHCP messages to lwAFTR. The operator network should
        deploy <xref target="RFC2827"/> to prevent this kind of attack.</t>
      <section title="Data Retention Requirements">
        <t>In some countries, regulations require a service providers to retain
          the necessary information to link IP allocatoin information to a specific
          customer at a specific point in time.</t>
          <t>With a deterministic provisioning model, any individual client will
          always receive a pre-determined set of IPv4 provisioning requirements.
          In this scenario, the logging requirement may be met by retaining
          information on how the DHCPv6 server has been pre-provisioned,
          with timestamp information on when changes to the pre-provisioning
          have come into effect.</t>

          <t>The dynamic provisioning model that is described in this document
            brings an additional logging requirement to the service provider:
            The retention logs holding allocated IPv4 address and ports, the
            associated IPv6 tunnel endpoint and timestamps marking the start and
            end of the lease. This is a higher logging overheard than
            deterministic provisioning, but is in line with the amount of logging
            that service providers currently have.</t>
      </section>
    </section>

    <section title="IANA Considerations">
    <t>This document does not include an IANA request.</t>
    </section>

</middle>

<back>

    <references title="Normative References">
      &rfc7596;
      &rfc7341;
      &rfc7618;
      &I-D.fsc-softwire-dhcp4o6-saddr-opt;
      &bcp38;
    </references>
    <references title="Informative References">
      &rfc3315;
      &rfc6887;
      &rfc7598;
      &rfc6241;
      &I-D.sun-softwire-yang;
      <!--&I-D.ietf-pcp-port-set;-->
      <!--&I-D.perreault-softwire-lw4over6-pcp;-->
    </references>
</back>
</rfc>
