<?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-6lo-schc-15dot4-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="SCHC compression over IEEE 802.15.4">
     Transmission of SCHC-compressed packets over IEEE 802.15.4 networks
    </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</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="Ana Minaburo" initials="A.M." surname="Minaburo">
      <organization>Acklio</organization>

      <address>
        <postal>
          <street>1137A avenue des Champs Blancs</street>

          <city>Cesson-Sevigne Cedex</city>

          <region/>

          <code>35510</code>

          <country>France</country>
        </postal>

        <phone/>

        <facsimile/>

        <email>ana@ackl.io</email>

        <uri/>
      </address>
    </author>


    <!-- uri and facsimile elements may also be added -->

    <date month="March" year="2022"/>

    <!-- 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>6lo 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> A framework called Static Context Header Compression and fragmentation (SCHC) has been designed with the primary goal of supporting IPv6 over Low Power Wide Area Network 
          (LPWAN) technologies <xref target="RFC8724"/>. One of the SCHC components is a header compression mechanism. If used properly, SCHC header compression allows a greater compression ratio than that
          achievable with traditional 6LoWPAN header compression <xref target="RFC6282"/>. For this reason, it may make sense to use SCHC header 
          compression in some 6LoWPAN environments, including IEEE 802.15.4 networks.  This document specifies how a SCHC-compressed packet can be carried over 
          IEEE 802.15.4 networks.
      </t>
    </abstract>
  </front>

  <middle>
    <section title="Introduction ">

      <t>RFC 6282 is the main specification for IPv6 over Low power Wireless Personal Area Network (6LoWPAN) IPv6 header compression <xref target="RFC6282"/>. 
         This RFC was designed assuming IEEE 802.15.4 as the layer below the 6LoWPAN adaptation layer, and it has also been reused (with proper adaptations)
         for IPv6 header compression over many other technologies relatively similar to IEEE 802.15.4 in terms of characteristics such as 
         physical layer bit rate, layer 2 maximum payload size, etc. Examples of such technologies comprise BLE, DECT-ULE, ITU G.9959, MS/TP, NFC, and PLC.
         RFC 6282 provides additional functionality, such as a mechanism for UDP header compression.  
      </t>

      <t>In the best cases, RFC 6282 allows to compress a 40-byte IPv6 header down to a 2-byte compressed header (for link-local interactions) or a 3-byte 
         compressed header (when global IPv6 addresses are used).  On the other hand, an RFC 6282 compressed UDP header has a typical size of 4 bytes. 
         Therefore, in advantageous conditions, a 48-byte uncompressed IPv6/UDP header may be compressed down to a 6-byte format (when using link-local
         addresses) or a 7-byte format (for global interactions) by using RFC 6282. 
      </t>
 
      <t>Recently, a framework called Static Context Header Compression (SCHC) has been designed with the primary goal of supporting IPv6 over Low Power Wide Area Network 
         (LPWAN) technologies <xref target="RFC8724"/>. SCHC comprises header compression and fragmentation functionality tailored to the extraordinary 
         constraints of LPWAN technologies, which are more severe than those exhibited by IEEE 802.15.4 or other relatively similar technologies.
         SCHC header compression allows a greater compression ratio than that of RFC 6282. If used properly, SCHC allows to compress an IPv6/UDP header 
         down to e.g. a single byte. In addition, SCHC can be used to 
         compress Constrained Application Protocol (CoAP) headers as well <xref target="RFC7252"/><xref target="RFC8824"/>, which further increases the achievable performance improvement of using SCHC header compression, since there is no 6LoWPAN header compression defined for CoAP.
         Therefore, it may make sense to use SCHC header compression in some 6LoWPAN environments [I-D.toutain-6lo-6lo-and-schc], including IEEE 802.15.4 networks,
         considering its greater efficiency. </t>

      <t>If SCHC header compression is added to the panoply of header compression mechanisms used in 6LoWPAN environments, then there is a need to
         signal when a packet header has been compressed by using SCHC. To this end, the present document specifies a 6LoWPAN Dispatch Type for 
         SCHC header compression <xref target="RFC4944"/>. 
      </t>
 
      <t>This document specifies how a SCHC-compressed packet can be carried over IEEE 802.15.4 networks. Note that, as per this document, and while SCHC 
         defines fragmentation mechanisms as well, 6LoWPAN/6Lo fragmentation is used when necessary to transport SCHC-compressed packets over IEEE 802.15.4
         networks <xref target="RFC4944"/><xref target="RFC8930"/><xref target="RFC8931"/>.
      </t>

      <t>TO-DO: indicate here any specific updates of RFC 8724 for use over IEEE 802.15.4.
      </t>
 

    </section>
 
      <section title="Terminology">
   
       <section title="Requirements language">
    
        <t>The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
          "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and
          "OPTIONAL" in this document are to be interpreted as described in
          BCP14 <xref target="RFC2119"/>, <xref target="RFC8174"/>, when, and only when,
          they appear in all capitals, as shown here.      
        </t>
       </section>

       <section title="Background on SCHC"> 
       <t>The reader is expected to be familiar with the terms and concepts 
                 defined in the specification of SCHC (RFC 8724).
       </t>
       </section>
      </section>


  <section title="Architecture">
    
      <section title="Network topologies">

        <t>IEEE 802.15.4 supports two main network topologies: the star topology, and the peer-to-peer (i.e., mesh) topology.
        </t>
 
        <t>SCHC has been designed for LPWAN technologies, which are typically based on a star topology where constrained devices (e.g., sensors) communicate with a less constrained, central network gateway [RFC 8376]. However, as stated in [draft-ietf-lpwan-architecture], SCHC is generic and it can also be used in networking environments beyond the ones originally considered for SCHC. 
        </t>

        <t>SCHC compression is applicable to both star topology and mesh topology IEEE 802.15.4 networks. 
        </t> 

      </section>

      <section title="Protocol stack">

        <t>The traditional 6LoWPAN-based protocol stack for constrained devices (Figure 1, left) places the 6LoWPAN adaptation layer between IPv6 
           and an underlying technology such as IEEE 802.15.4. Suitable upper layer protocols include CoAP
           <xref target="RFC7252"/> and UDP. (Note that, while CoAP has also been specified over TCP, and TCP may play a significant role in IoT 
           environments <xref target="RFC9006"/>, 6LoWPAN header compression has not been defined for TCP.)
        </t>

        <t>6LoWPAN can be envisioned as a set of two main sublayers, where the upper one provides header compression, while the lower one offers 
           fragmentation. 
        </t>

        <t>This document defines an alternative approach for packet header compression over IEEE 802.15.4, which leads to a modified protocol stack 
           (Figure 1, right).
        </t>

        <t>
        <figure title="Traditional 6LoWPAN-based protocol stack over IEEE 802.15.4 (left) and alternative protocol stack using SCHC for header compression 
                       (right). HC and Frag stand for Header Compression and Fragmentation, respectively."
                anchor="fig_stack">
        <artwork><![CDATA[    

     +------------+          +------------+      
     | CoAP, other|          | CoAP, other|      
     +------------+          +------------+  
     | UDP, other |          | UDP, other | 
     +------------+          +------------+  
     |    IPv6    |          |    IPv6    |
     +------------+          +------------+  
     | 6LoWPAN HC |          |  SCHC HC   |  <-- NEW       
     +------------+          +------------+
     |6LoWPAN Frag|          |6LoWPAN Frag|
     +------------+          +------------+
     |  802.15.4  |          |  802.15.4  | 
     +------------+          +------------+    

        ]]></artwork></figure>

        </t>

        <t>SCHC header compression may be applied to the headers of different protocols or sets of protocols. Some examples include: i) IPv6 packet headers,
           ii) joint IPv6 and UDP packet headers, iii) joint IPv6, UDP and CoAP packet headers, etc.
        </t>


      </section>

   
  </section>

  <section title="Frame Format">
  
      <t>This document defines the frame format to be used when a SCHC-compressed packet is carried over IEEE 802.15.4. Such format is carried as
         IEEE 802.15.4 frame payload. The format comprises a SCHC Dispatch Type, a SCHC Packet (i.e. a SCHC-compressed packet (RFC 8724), and 
         Padding bits, if any). <xref target="fig_frame_format"/> illustrates the described frame format.
      </t>

      <t>
        <figure title="Encapsulated, SCHC-compressed packet. Padding bits are added if needed." anchor="fig_frame_format">
        <artwork><![CDATA[
            
            <---------- IEEE 802.15.4 frame payload ---------->

                            <----- SCHC Packet ----->
            +---------------+-------------+---------+ - - - - +
            | SCHC Dispatch | SCHC Header | Payload | Padding |
            +---------------+-------------+---------+ - - - - +

        ]]></artwork></figure>
      </t>
    
    <section title="SCHC Dispatch">
     <t>Adding SCHC header compression to the panoply of header compression mechanisms used in 6LoWPAN/6Lo environments creates the
         need to signal when a packet header has been compressed by using SCHC.  To this end, the present document specifies the SCHC Dispatch. 
         The SCHC Dispatch indicates that the next field in the frame format is a SCHC-compressed header (SCHC Header in <xref target="fig_frame_format"/>, see 4.2)).  
     </t>

     <t>This document defines the SCHC Dispatch as a 6LoWPAN Dispatch Type for SCHC header compression <xref target="RFC4944"/>. With the aim to minimize 
        overhead, the present document allocates a 1-byte pattern in Page 0 <xref target="RFC8025"/> for the SCHC Dispatch Type:
     </t>

     <t>SCHC Dispatch Type bit pattern: 01000100 (Page 0)
        (Note: to be confirmed by IANA))
     </t>

    </section>      

    <section title="SCHC Header">
         
     <t>
         SCHC Header (<xref target="fig_frame_format"/>) corresponds to a packet 
         header that has been compressed by using SCHC.  As defined in <xref target="RFC8724"/>, the SCHC Header comprises a RuleID, and a compression
         residue. As per the present specification, a RuleID size between 1 and 16 bits is RECOMMENDED. 
         In order to decide the RuleID size to be used in a network, the trade-off between (compressed) header overhead and the number of Rules needs to be carefully assessed.
     </t>

    </section>

    <section title="Padding">
     <t>If SCHC header compression leads to a SCHC Packet size of a non-integer number of bytes, padding bits of value equal to zero MUST be appended
        to the SCHC Packet as appropriate to align to an octet boundary.
     </t> 
    </section>
     

  </section> 

  <section title="SCHC compression for IPv6, UDP, and CoAP headers">

        <t>SCHC header compression may be applied to the headers of different protocols or sets of protocols. Some examples include:
           i) IPv6 packet headers, ii) joint IPv6 and UDP packet headers, iii) joint IPv6, UDP and CoAP packet headers, etc.
        </t>

      <section title="SCHC compression for IPv6 and UDP headers">

      	<t>   IPv6 and UDP header fields MUST be compressed as per Section 10 of RFC 8724.
        </t>

        <t>   IPv6 addresses are split into two 64-bit-long fields; one for the prefix and one for the Interface Identifier (IID).
        </t>


        <t>   To allow for a single Rule being used for both directions, RFC 8724 identifies IPv6 addresses and UDP ports by their role (Dev or App)
              and not by their position in the header (source or destination). This optimization can be used as is in some IEEE 802.15.4 networks 
              (e.g., an IEEE 802.15.4 star topology where the peripheral devices (Devs) send/receive packets to/from a network-side entity (App)).
        </t>

        <t>   However, in some types of 6LoWPAN environments (e.g., when a sender and its destination are both peer nodes
   in a mesh topology network), additional functionality (TBD) is needed to allow use of the Dev and App roles for C/D. In this case, each SCHC C/D entity needs to know its role (Dev or App) for each endpoint it communicates with. In such cases, the terms Uplink and 
   Downlink that have been defined in RFC 8724 need to be understood in the context of each specific pair of endpoints.

        </t>
     
       <section title="Compression of IPv6 addresses">
        <t>   Compression of IPv6 source and destination prefixes MUST be performed as per Section 10.7.1 of RFC 8724.
        </t>

        <t>   Compression of IPv6 source and destination IIDs MUST be performed
   as per Section 10.7.2 of RFC 8724. One particular consideration when SCHC C/D is used in IEEE 802.15.4 networks is that, 
   in contrast with some LPWAN technologies, IEEE 802.15.4 data frame headers include both source and destination fields.  
   If the Dev or App IID are based on an L2 address, in some cases the IID can be reconstructed with information coming from the L2 header.  
   Therefore, in those cases, DevIID and AppIID CDAs can be used.
        </t>

       </section>
      </section>
 
      <section title="SCHC compression for CoAP headers">

      	<t>CoAP header fields MUST be compressed as per Sections 4 to 6 of RFC 8824.  
        </t>

        <t>For CoAP header compression/decompression, the SCHC Rules description
   uses direction information in order to reduce the number of Rules 
   needed to compress headers.
        </t>

        <t>As stated in 5.1, in some types of 6LoWPAN environments (e.g., when a sender and its destination are both peer nodes
   in a mesh topology network), each SCHC C/D entity needs to know its role (Dev or App) for each endpoint it communicates with. 
   Therefore, in such cases, direction information will be specific for each pair of endpoints.
        </t>


      </section>

      <section title="Header compression examples">

        <t> TO-DO: provide examples for IPv6-only, IPv6/UDP and IPv6/UDP/CoAP.
        </t>

      </section>

  </section>


  <section title="Fragmentation and reassembly">

      <t>After applying SCHC header compression to a packet intended for transmission, if the size of the resulting frame format (Section 4) 
         exceeds the IEEE 802.15.4 frame payload space available, such frame format MUST be fragmented, carried and reassembled by means of 6LoWPAN 
         fragmentation and reassembly <xref target="RFC4944"/><xref target="RFC8930"/><xref target="RFC8931"/>.
      </t>

  </section>   

  
  <section title="IANA Considerations">  
    <t>This document requests the allocation of the Dispatch Type Field bit pattern 01000100 (Page 0) as SCHC Dispatch Type.
    </t>
 
  </section>

    <section anchor="Security" title="Security Considerations">

      <t>This document does not define SCHC header compression functionality beyond the one defined in RFC 8724. Therefore, the security considerations 
         in section 12.1 of RFC 8724 and in section 9 of RFC 8824 apply.
      </t>
    
      <t>As a safety measure, a SCHC decompressor implementing the present specification MUST NOT reconstruct a packet larger than 1500 bytes 
         <xref target="RFC8724"/>.
      </t>

      <t>IEEE 802.15.4 networks support link-layer security mechanisms such as encryption and authentication. As in RFC 8824, the use of a  
         cryptographic integrity-protection mechanism to protect the SCHC headers is REQUIRED.
      </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>Ana Minaburo and Laurent Toutain suggested for the first time the use of SCHC in environments where
         6LoWPAN has traditionally been used. Laurent Toutain, Pascal Thubert, Dominique Barthel, and Guangpeng Li
         made comments that helped shape this document.
      </t>     

      <t>Carles Gomez has been funded in part by the Spanish Government 
         through project PID2019-106808RA-I00, and by Secretaria
         d'Universitats i Recerca del Departament d'Empresa i Coneixement de
         la Generalitat de Catalunya 2017 through grant SGR 376.
      </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.4944.xml'?>

      <?rfc include='reference.RFC.6282.xml'?>

      <?rfc include='reference.RFC.7252.xml'?>

      <?rfc include='reference.RFC.8025.xml'?>

      <?rfc include='reference.RFC.8065.xml'?>

      <?rfc include='reference.RFC.8174.xml'?>

      <?rfc include='reference.RFC.8724.xml'?>

      <?rfc include='reference.RFC.8824.xml'?>

      <?rfc include='reference.RFC.8930.xml'?>

      <?rfc include='reference.RFC.8931.xml'?>

    </references>

    <references title="Informative References">
      <!-- Here we use entities that we defined at the beginning. -->

      <?rfc include='reference.I-D.toutain-6lo-6lo-and-schc.xml'?>

      <?rfc include='reference.RFC.9006.xml'?>
   
    </references>

    <!-- -->
  </back>
</rfc>