<?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 RFC3552 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.3552.xml">
<!ENTITY I-D.narten-iana-considerations-rfc2434bis SYSTEM "http://xml.resource.org/public/rfc/bibxml3/reference.I-D.narten-iana-considerations-rfc2434bis.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="no"?>
<!-- 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="std" docName="draft-gomez-lpwan-fragmentation-header-02"
     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="LPWAN fragmentation header">
    Optimized 6LoWPAN Fragmentation Header for LPWAN
    </title>

    <!-- add 'role="editor"' below for the editors if appropriate -->

    <!-- Another author who claims to be an editor -->

 



    <author fullname="Carles Gomez" initials="C.G" surname="Gomez">
      <organization>UPC/i2CAT</organization>

      <address>
        <postal>
          <street>C/Esteve Terradas, 7</street>

          <city>Castelldefels</city>

          <region/>

          <code>08860</code>

          <country>Spain</country>
        </postal>

        <phone/>

        <facsimile/>

        <email>carlesgo@entel.upc.edu</email>

        <uri/>
      </address>
    </author>

   <author fullname="Josep Paradells" initials="J.P" surname="Paradells">
      <organization>UPC/i2CAT</organization>

      <address>
        <postal>
          <street>C/Jordi Girona, 1-3</street>

          <city>Barcelona</city>

          <region/>

          <code>08034</code>

          <country>Spain</country>
        </postal>

        <phone/>

        <facsimile/>

        <email>josep.paradells@entel.upc.edu</email>

        <uri/>
      </address>
    </author>

    <author fullname="Jon Crowcroft" initials="J.C" surname="Crowcroft">
      <organization>University of Cambridge</organization>

      <address>
        <postal>
          <street>JJ Thomson Avenue</street>

          <city>Cambridge</city>

          <region>CB3 0FD</region>

          <code/>

          <country>United Kingdom</country>
        </postal>

        <phone/>

        <facsimile/>

        <email>jon.crowcroft@cl.cam.ac.uk</email>

        <uri/>
      </address>
    </author>

         <!-- uri and facsimile elements may also be added -->
      

    <date month="July" year="2016"/>

    <!-- 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>INT</area>

    <workgroup>Network Working Group</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. -->

    <!---->

    <abstract>
      <t> LPWAN technologies are characterized by a very limited data unit and/or payload size, often one order of magnitude below the one in IEEE 802.15.4. However, many such technologies do not support layer 2 fragmentation. The 6LoWPAN fragmentation header defined in RFC 4944 represents very high overhead for LPWAN technologies, and it even does not support transporting IPv6 datagrams that require fragmentation over layer 2 technologies of a payload size below 13 bytes. This specification defines an optimized 6LoWPAN fragmentation header for LPWAN. 
</t>
    </abstract>
  </front>

  <middle>
    <section title="Introduction ">

      <t>Low Power Wide Area Network (LPWAN) technologies are characterized, among others, by a very reduced data unit and/or payload size <xref
      target="I-D.minaburo-lpwan-gap-analysis"/>. However, many such technologies do not support layer two fragmentation, therefore the only option for these to support IPv6 (and, in particular, its MTU requirement of 1280 bytes <xref target="RFC2460"/>) is the use of a fragmentation header at the adaptation layer below IPv6, such as the 6LoWPAN fragmentation header defined in <xref
      target="RFC4944"/>. </t>




      <t>While the aforementioned 6LoWPAN fragmentation header is appropriate for IEEE 802.15.4-2003 (which has a frame payload size of 81 to 102 bytes), it is not suitable for several LPWAN technologies, many of which have a maximum payload size that is one order of magnitude below that of IEEE 802.15.4-2003. The overhead of the 6LoWPAN fragmentation header is high, considering the reduced payload size of LPWAN technologies and the limited energy availability of the devices using such technologies. Furthermore, its datagram offset field is expressed in increments of eight octets. In some LPWAN technologies, the 6LoWPAN fragmentation header plus eight octets from the original datagram exceeds the available space in the layer 2 (L2) payload. </t>


      <t>This specification defines an optimized 6LoWPAN Fragmentation Header for LPWAN (6LoFHL). Nevertheless, other L2 technologies beyond the LPWAN category may benefit from using 6LoFHL. </t>

      <t>It is expected that this specification will be used jointly with other 6Lo(WPAN) mechanisms such as <xref target="RFC6282"/> based header compression.</t>

      <t>The benefits of using 6LoFHL are the following: </t>
                  <t> --       While the 6LoWPAN fragmentation header defined in RFC 4944 has a size of 4 bytes (first fragment) or 5 bytes (subsequent fragments), 6LoFHL has a size of 3 bytes (any fragment). This reduces significantly both the L2 overhead and the adaptation layer overhead for transporting an IPv6 packet that requires fragmentation (see Annex A).</t>
                  <t> --         Because the datagram offset can be expressed in increments of a single octet, 6LoFHL enables the transport of IPv6 packets over L2 data units with a maximum payload size as small as only 4 bytes in the most extreme case.</t>

      <section title="Conventions used in this document">
        <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"/></t>
      </section>
   
    </section>






    <section title="6LoFHL rules and format">
      <t>If an entire payload (e.g., IPv6) datagram fits within a single
L2 data unit, it is unfragmented and a fragmentation header is not needed.  If the datagram does not fit within a single L2 data unit, it SHALL be broken into fragments. The first fragment SHALL contain the first fragment header as defined in <xref
      target="fig.firstfragment"/>.</t>

      <figure anchor="fig.firstfragment"
              title="First Fragment">
        <artwork><![CDATA[
                           1                   2         
       0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3  
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |1 1 0 0 1|    datagram_size    |  datagram_tag |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

]]></artwork>
      </figure>

      <t>
   The second and subsequent fragments (up to and including the
   last) SHALL contain a fragmentation header that conforms to the
   format shown in <xref target="fig.nextfragments"/>. </t>

<figure anchor="fig.nextfragments"
              title="Subsequent Fragments">
        <artwork><![CDATA[

                           1                   2                                
       0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3  
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |1 1 0 1 0|   datagram_offset   |  datagram_tag |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

]]></artwork>
      </figure>

      <t>
   datagram_size:  This 11-bit field encodes the size of the entire IP
      packet before link-layer fragmentation (but after IP layer
      fragmentation).  For IPv6, the datagram size SHALL be
      40 octets (the size of the uncompressed IPv6 header) more than the
      value of Payload Length in the IPv6 header <xref
      target="RFC4944"/> of the
      packet.  Note that this packet may already be fragmented by hosts
      involved in the communication, i.e., this field needs to encode a
      maximum length of 1280 octets (the required by IPv6).</t>

      <t>
        datagram_tag:  The value of datagram_tag (datagram tag) SHALL be the
      same for all fragments of a payload (e.g., IPv6) datagram.
      The sender SHALL increment datagram_tag for successive, fragmented
      datagrams.  The incremented value of datagram_tag SHALL wrap from
      255 back to zero.  This field is 8 bits long, and its initial
      value is not defined.</t>

      <t>
    datagram_offset:  This field is present only in the second and
      subsequent fragments and SHALL specify the offset, in
      increments of 1 octet, of the fragment from the beginning of the
      payload datagram.  The first octet of the datagram (e.g., the
      start of the IPv6 header) has an offset of zero; the implicit
      value of datagram_offset in the first fragment is zero.  This
      field is 11 bits long. </t>

      <t>
    The recipient of link fragments SHALL use (1) the sender's L2
   source address, (2) the destination's L2 address, (3)
   datagram_size, and (4) datagram_tag to identify all the 
   fragments that belong to a given datagram. </t>

      <t>
Upon receipt of a link fragment, the recipient starts constructing
   the original unfragmented packet whose size is datagram_size.  It
   uses the datagram_offset field to determine the location of the
   individual fragments within the original unfragmented packet.  For
   example, it may place the data payload (except the encapsulation
   header) within a payload datagram reassembly buffer at the location
   specified by datagram_offset.  The size of the reassembly buffer
   SHALL be determined from datagram_size. </t>

      <t>
If a fragment recipient disassociates from its L2 network, the recipient   
   MUST discard all link fragments of all partially
   reassembled payload datagrams, and fragment senders MUST discard all
   not yet transmitted link fragments of all partially transmitted
   payload (e.g., IPv6) datagrams.  Similarly, when a node first
   receives a fragment with a given datagram_tag, it starts a reassembly
   timer.  When this time expires, if the entire packet has not been
   reassembled, the existing fragments MUST be discarded and the
   reassembly state MUST be flushed.  The reassembly timeout MUST be set
   to a maximum of TBD seconds). </t>

      <t>Implementers need to be aware that in some LPWAN technologies, the MTU in use may vary over time. </t>

    </section>

    <section title="Changes from RFC 4944 fragmentation header and rationale">
      <t>The main changes introduced in this specification to the fragmentation header format defined in RFC 4944 are listed below, together with their rationale:
      </t>

      <t>-- The datagram size field is only included in the first fragment. Rationale: In the RFC 4944 fragmentation header, the datagram size was included in all fragments to ease the task of reassembly at the receiver, since in an IEEE 802.15.4 mesh network,  the fragment that arrives earliest to a destination is not necessarily the first fragment transmitted by the source. However, in LPWAN, such reordering effects are not expected. LPWAN technologies typically define star topology networks, peripheral to peripheral communications are not expected, and the central device is not expected to perform priority queuing operations. Nevertheless, the fragmentation format defined in this document supports limited reordering. </t>

      <t>-- The datagram tag size is reduced from 2 bytes to 1 byte. Rationale: Given the low bit rate, as well as the low message rate of LPWAN technologies, ambiguities due to datagram tag wrapping events are not expected to occur despite the reduced tag space.  </t>

      <t>-- The datagram offset size is increased from 8 bits to 11 bits. Rationale: This allows to express the datagram offset in single-octet increments.</t>
    </section>


   
    <section anchor="IANA" title="IANA Considerations">
      <t>This document allocates the following sixteen RFC 4944 Dispatch type values:</t>

      <t>	11001 000</t>

      <t>through</t>

      <t>	11001 111</t>

      <t>	and</t>

      <t>	11010 000</t>

      <t>through</t>

      <t>	11010 111</t>
    </section>

    <section anchor="Security" title="Security Considerations">
      <t>6LoWPAN fragmentation attacks have been analyzed in the literature. Countermeasures to these have been proposed as well <xref
      target="HHWH"/>.</t>

      <t>A node can perform a buffer reservation attack 
   by sending a first fragment to a target. Then, the receiver will reserve 
   buffer space for the whole packet on the basis of the datagram size 
   announced in that first fragment. Other incoming fragmented packets will be 
   dropped while the reassembly buffer is occupied during the reassembly 
   timeout. Once that timeout expires, the attacker can repeat the same 
   procedure, and iterate, thus creating a denial of service attack. The (low) 
   cost to mount this attack is linear with the number of buffers at the 
   target node. However, the cost for an attacker can be increased if 
   individual fragments of multiple packets can be stored in the reassembly 
   buffer. To further increase the attack cost, the reassembly buffer 
   can be split into fragment-sized buffer slots. Once a packet is complete, 
   it is processed normally. If buffer overload occurs, a receiver can discard 
   packets based on the sender behavior, which may help identify which 
   fragments have been sent by an attacker.</t>

       <t>In another type of attack, the malicious node is required to have 
   overhearing capabilities. If an attacker can overhear a fragment, it can 
   send a spoofed duplicate (e.g. with random payload) to the destination. A 
   receiver cannot distinguish legitimate from spoofed fragments. Therefore, 
   the original IPv6 packet will be considered corrupt and will be dropped. To 
   protect resource-constrained nodes from this attack, it has been proposed 
   to establish a binding among the fragments to be transmitted by a node, by 
   applying content-chaining to the different fragments, based on 
   cryptographic hash functionality. The aim of this technique is to allow a 
   receiver to identify illegitimate fragments.</t>

       <t>Further attacks may involve sending overlapped fragments (i.e. comprising 
   some overlapping parts of the original datagram) or announcing a datagram 
   size in the first fragment that does not reflect the actual amount of data 
   carried by the fragments. Implementers should make sure that correct 
   operation is not affected by such events.</t>

    </section>

    <!-- This PI places the pagebreak correctly (before the section title) in the text output. -->

    <!-- Possibly a 'Contributors' section ... -->

    
    <section anchor="ACKs" title="Acknowledgments">
      <t>In section 2, the authors have reused extensive parts of text available in section 5.3 of RFC 4944, and would like to thank the authors of RFC 4944.</t>

      <t>The authors would like to thank Carsten Bormann, Tom Phinney, Ana Minaburo and Laurent Toutain for valuable comments that helped improve the document.</t>

      <t>Carles Gomez has been funded in part by the Spanish Government (Ministerio de Educacion, Cultura y Deporte) through the Jose Castillejo grant CAS15/00336. His contribution to this work has been carried out  during his stay as a visiting scholar at the Computer Laboratory of the University of Cambridge.</t>
    
    </section>

    <section title="Annex A. Quantitative comparison of RFC 4944 fragmentation header with 6LoFHL">
      
 <figure anchor="L2overhead"
              title="L2 overhead (in terms of L2 data units) required to transport an IPv6 datagram">
        <artwork><![CDATA[
                   +-------------------------------------------------------+      
                   |                IPv6 datagram size (bytes)             |
                   +-------------+-------------+-------------+-------------+
                   |     11      |    40       |     100     |     1280    |
+------------------+-------------+-------------+-------------+-------------+
|L2 payload (bytes)| 4944 |6LoFHL| 4944 |6LoFHL| 4944 |6LoFHL| 4944 |6LoFHL|  
+------------------+-------------+-------------+-------------+-------------+
|       10         | ---- |   2  | ---- |   6  | ---- |  15  | ---- |  183 |    
+------------------+-------------+------+------+------+------+-------------+
|       15         |   1  |   1  |   5  |   4  |  13  |  9   |  160 |  107 |
+------------------+-------------+------+------+------+------+-------------+
|       20         |   1  |   1  |   4  |   3  |  12  |  6   |  159 |  76  |
+------------------+-------------+------+------+------+------+-------------+
|       25         |   1  |   1  |   3  |   2  |   7  |  5   |   80 |  59  |
+------------------+-------------+------+------+------+------+-------------+
|       30         |   1  |   1  |   2  |   2  |   5  |  4   |   54 |  48  |
+------------------+-------------+------+------+------+------+-------------+ 
]]></artwork>
      </figure>

 <figure anchor="AdaptOverhead"
              title="Adaptation layer fragmentation overhead (in bytes) required to transport an IPv6 datagram">
        <artwork><![CDATA[
                   +-------------------------------------------------------+      
                   |                IPv6 datagram size (bytes)             |
                   +-------------+-------------+-------------+-------------+
                   |     11      |     40      |     100     |     1280    |
+------------------+-------------+-------------+-------------+-------------+
|L2 payload (bytes)| 4944 |6LoFHL| 4944 |6LoFHL| 4944 |6LoFHL| 4944 |6LoFHL| 
+------------------+-------------+-------------+-------------+-------------+
|       10         | ---- |   6  | ---- |  18  | ---- |  45  | ---- |  768 |    
+------------------+-------------+------+------+------+------+-------------+
|       15         |   0  |   0  |  24  |  12  |  64  |  27  |  799 |  321 |
+------------------+-------------+------+------+------+------+-------------+
|       20         |   0  |   0  |  19  |   9  |  59  |  18  |  794 |  228 |
+------------------+-------------+------+------+------+------+-------------+
|       25         |   0  |   0  |  14  |   6  |  34  |  15  |  399 |  177 |
+------------------+-------------+------+------+------+------+-------------+
|       30         |   0  |   0  |   9  |   6  |  24  |  12  |  269 |  144 |
+------------------+-------------+------+------+------+------+-------------+ 
]]></artwork>
      </figure>


      <t>Note 1: with the RFC 4944 fragmentation header it is not possible to transport IPv6 datagrams of the considered sizes over a 10-byte payload L2 technology.</t>

      <t>Note 2: 11 bytes is the size of an IPv6 datagram with a 3-byte RFC 6282 compressed header (the shortest possible IPv6 header that uses global addresses), a 4-byte RFC 6282 UDP compressed header, and a CoAP message without header options and without payload.</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">
      
      <?rfc include='reference.RFC.2119.xml'?>

      <?rfc include='reference.RFC.2460.xml'?>

      <?rfc include='reference.RFC.4944.xml'?>

      <?rfc include='reference.RFC.6282.xml'?>
      
    </references>

    <references title="Informative References">
      <!-- Here we use entities that we defined at the beginning. -->
      <?rfc include='reference.I-D.minaburo-lpwan-gap-analysis'?>

      <reference anchor="HHWH">
        <front>
          <title>6LoWPAN fragmentation attacks and mitigation mechanisms</title>

          <author fullname="Rene" initials="R." surname=" Hummen et al">
          </author>

          <date year="2013"/>
        </front>
      </reference>
      
    </references>

    <!-- -->
  </back>
</rfc>
