<?xml version="1.0" encoding="UTF-8"?>
  <?xml-stylesheet type="text/xsl" href="rfc2629.xslt" ?>
  <!-- generated by https://github.com/cabo/kramdown-rfc2629 version 1.3.24 -->

<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
]>

<?rfc symrefs="yes"?>
<?rfc sortrefs="yes"?>
<?rfc strict="yes"?>
<?rfc compact="yes"?>
<?rfc toc="yes"?> "rfc2629-xhtml.ent">

<rfc xmlns:xi="http://www.w3.org/2001/XInclude" ipr="trust200902" docName="draft-ietf-lpwan-schc-over-lorawan-14" category="std"> number="9011" obsoletes="" updates="" submissionType="IETF" category="std" consensus="true" xml:lang="en" symRefs="true" sortRefs="true" tocInclude="true" version="3">

  <front>
    <title abbrev="SCHC-over-LoRaWAN">Static abbrev="SCHC over LoRaWAN">Static Context Header Compression and Fragmentation (SCHC) over LoRaWAN</title>
    <seriesInfo name="RFC" value="9011"/>
    <author initials="O." surname="Gimenez" fullname="Olivier Gimenez" role="editor">
      <organization>Semtech</organization>
      <address>
        <postal>
          <street>14 Chemin des Clos</street>
          <city>Meylan</city>
          <country>France</country>
        </postal>
        <email>ogimenez@semtech.com</email>
      </address>
    </author>
    <author initials="I." surname="Petrov" fullname="Ivaylo Petrov" role="editor">
      <organization>Acklio</organization>
      <address>
        <postal>
          <street>1137A Avenue des Champs Blancs</street>
          <city>35510 Cesson-Sevigne
	      <city>Cesson-Sévigné Cedex</city>
          <code>35510</code>
          <country>France</country>
        </postal>
        <email>ivaylo@ackl.io</email>
      </address>
    </author>
    <date year="2021" month="February" day="01"/> month="April"/>
    <workgroup>lpwan Working Group</workgroup>

<keyword>header compression</keyword>
<keyword>compression</keyword>
<keyword>fragmentation</keyword>
<keyword>static context</keyword>
<keyword>rule-based</keyword>
<keyword>LPWAN</keyword>
<keyword>LPWANs</keyword>
<keyword>low power</keyword>
<keyword>low-power</keyword>
<keyword>LoRa</keyword>
<keyword>LoRaWAN</keyword>
<keyword>IoT</keyword>
<keyword>Internet of Things</keyword>
<keyword>adaptation layer</keyword>
<keyword>UDP</keyword>
<keyword>IPv6</keyword>
<keyword>sensor network</keyword>
<keyword>wireless sensor network</keyword>
<keyword>802.15.4</keyword>
<keyword>constrained network</keyword>
<keyword>constrained node</keyword>
<keyword>constrained-node network</keyword>
<keyword>SCHC</keyword>

    <abstract>
      <t>The Static Context Header Compression and fragmentation (SCHC) specification (RFC 8724) describes
      generic header compression and fragmentation techniques for Low Power Low-Power
      Wide Area
Networks Network (LPWAN) technologies. SCHC is a generic mechanism
      designed for great flexibility so that it can be adapted for any of the
      LPWAN technologies.</t>

      <t>This document specifies a profile of RFC8724 RFC 8724 to use SCHC in LoRaWAN® networks,
      LoRaWAN networks and provides elements such as efficient
      parameterization and modes of operation.</t>
    </abstract>
  </front>
  <middle>
    <section anchor="Introduction" title="Introduction">

<t>SCHC numbered="true" toc="default">
      <name>Introduction</name>
      <t>The SCHC specification <xref target="RFC8724"></xref> target="RFC8724" format="default"/> describes
generic header compression and fragmentation techniques that can be used on all
Low Power
Low-Power Wide Area Networks Network (LPWAN) technologies defined in
<xref target="RFC8376"/>. target="RFC8376" format="default"/>. Even though those technologies share a great
number of common features like star-oriented topologies, network architecture,
devices with communications that are mostly quite predictable communications, etc; predictable, etc., they do have some
slight differences with respect to payload sizes, reactiveness, etc.</t>
      <t>SCHC provides a generic framework that enables those devices to communicate on
IP networks. However, for efficient performance, some parameters
and modes of operation need to be set appropriately for each of the LPWAN
technologies.</t>
      <t>This document describes the parameters and modes of operation when
      SCHC is used over LoRaWAN networks. The LoRaWAN protocol is specified by
      the LoRa Alliance® Alliance in <xref target="lora-alliance-spec"/></t> target="LORAWAN-SPEC" format="default"/>.</t>
    </section>
    <section anchor="terminology" title="Terminology"> numbered="true" toc="default">
      <name>Terminology</name>

      <t>The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”,
“SHOULD NOT”, “RECOMMENDED”, “NOT RECOMMENDED”, “MAY”, "<bcp14>MUST</bcp14>", "<bcp14>MUST NOT</bcp14>",
      "<bcp14>REQUIRED</bcp14>", "<bcp14>SHALL</bcp14>", "<bcp14>SHALL
      NOT</bcp14>", "<bcp14>SHOULD</bcp14>", "<bcp14>SHOULD NOT</bcp14>",
      "<bcp14>RECOMMENDED</bcp14>", "<bcp14>NOT RECOMMENDED</bcp14>",
      "<bcp14>MAY</bcp14>", and “OPTIONAL” "<bcp14>OPTIONAL</bcp14>" in this document are
      to be interpreted as described in BCP 14 BCP&nbsp;14 <xref target="RFC2119"/> target="RFC2119"
      format="default"/> <xref target="RFC8174"/> target="RFC8174" format="default"/> when, and
      only when, they appear in all capitals, as shown here.</t>

      <t>This section defines the terminology and acronyms abbreviations used in this document. For
all other definitions, please look up the SCHC specification
<xref target="RFC8724"></xref>.</t>

<t><list style="symbols">
  <t>DevEUI: Device target="RFC8724" format="default"/>.</t>

<aside><t>
Note: The SCHC acronym is pronounced like "sheek" in English (or "chic" in French).
Therefore, this document writes "a SCHC Packet" instead of "an SCHC Packet".
</t></aside>

<dl>

<dt>AppKey:
</dt>
<dd>Application Key. An AES-128 root key specific to each device.
</dd>

<dt>AppSKey:
</dt>
<dd>Application Session Key. An AES-128 key derived from the AppKey for
each new session. It is used to encrypt the payload field of a LoRaWAN
applicative frame.
</dd>

<dt>DevAddr:
</dt>
<dd><t>A 32-bit non-unique identifier assigned to a device either:</t>
  <dl>
    <dt>Statically:
    </dt>
    <dd>by the device manufacturer in "Activation-by-Personalization"
    mode, or
    </dd>
    <dt>Dynamically:
    </dt>
    <dd>after a LoRaWAN "Join Procedure" by the Network Gateway in "Over-the-Air-Activation" mode.
    </dd>
  </dl>
</dd>

<dt>DevEUI:
</dt>
<dd>Device Extended Unique Identifier, an IEEE EUI-64 identifier used to
identify the device during the procedure while joining the network (Join
Procedure). It is assigned by the manufacturer or the device owner and
provisioned on the Network Gateway.</t>
  <t>DevAddr: a 32-bit non-unique identifier assigned to a device either:  <list style="symbols">
      <t>Statically: by the device manufacturer in <spanx style="emph">Activation by Personalization</spanx>
mode.</t>
      <t>Dynamically: after a Join Procedure by the Network Gateway in <spanx style="emph">Over The
Air Activation</spanx> mode.</t>
    </list></t>
  <t>Downlink: Gateway.
</dd>

<dt>Downlink:
</dt>
<dd>A LoRaWAN term for a frame transmitted by the network and received by the device.</t>
  <t>EUI: Extended device.
</dd>

<dt>EUI:
</dt>
<dd>Extended Unique Identifier</t>
  <t>LoRaWAN: Identifier
</dd>

<dt>FRMPayload:
</dt>
<dd>Application data in a LoRaWAN frame
</dd>

<dt>IID:
</dt>
<dd>Interface Identifier
</dd>

<dt>LoRaWAN:
</dt>
<dd>LoRaWAN is a wireless technology based on Industrial, Scientific, and
Medical (ISM) radio bands that is used for long-range, low-power,
low-data-rate applications developed by the LoRa Alliance, a membership
consortium: <eref target="https://www.lora-alliance.org">https://www.lora-alliance.org</eref>.</t>
  <t>FRMPayload: Application data in a LoRaWAN frame.</t>
  <t>MSB: Most
brackets="angle" target="https://www.lora-alliance.org"/>.
</dd>

<dt>MSB:
</dt>
<dd>Most Significant Byte</t>
  <t>OUI: Organisation Byte
</dd>

<dt>NGW:
</dt>
<dd>Network Gateway
</dd>

<dt>OUI:
</dt>
<dd>Organizationally Unique Identifier. IEEE assigned IEEE-assigned prefix for EUI.</t>
  <t>RCS: Reassembly EUI.
</dd>

<dt>RCS:
</dt>
<dd>Reassembly Check Sequence. Used to verify the integrity of the fragmentation-reassembly process.</t>
  <t>RX: Device’s process.
</dd>

<dt>RGW:
</dt>
<dd>Radio Gateway
</dd>

<dt>RX:
</dt>
<dd>A device's reception window.</t>
  <t>RX1/RX2: LoRaWAN window.
</dd>

<dt>RX1/RX2:
</dt>
<dd>LoRaWAN class A devices open two RX windows following an uplink, called RX1 "RX1" and RX2.</t>
  <t>SCHC "RX2".
</dd>

<dt>SCHC C/D:
</dt>
<dd>SCHC Compression/Decompression
</dd>

<dt>SCHC F/R:
</dt>
<dd>SCHC Fragmentation/Reassembly
</dd>

<dt>SCHC gateway: The
</dt>
<dd>The LoRaWAN Application Server that manages translation between an IPv6
network and the Network Gateway (LoRaWAN Network
Server).</t>
  <t>Tile: Piece Server).
</dd>

<dt>Tile:
</dt>
<dd>A piece of a fragmented packet as described in <xref target="RFC8724"></xref> section 8.2.2.1</t>
  <t>Uplink: LoRaWAN target="RFC8724"
sectionFormat="of" section="8.2.2.1" format="default"/>.
</dd>

<dt>Uplink:
</dt>
<dd>LoRaWAN term for a frame transmitted by the device and received by the network.</t>
</list></t> network.
</dd>

</dl>

</section>
    <section anchor="static-context-header-compression-overview" title="Static Context Header Compression Overview"> numbered="true" toc="default">
      <name>SCHC Overview</name>
      <t>This section contains a short overview of SCHC. For a detailed
      description, refer to the full specification <xref target="RFC8724"></xref>.</t> target="RFC8724"
      format="default"/>.</t>
      <t>It defines:</t>

<t><list style="numbers">
  <t>Compression

      <ol spacing="normal" type="1"><li>Compression mechanisms to avoid
      transporting information known by both sender and receiver over the
      air. Known information is part of the
“context”. "context". This component is
      called SCHC Compressor/Decompressor the "SCHC Compression/Decompression" (SCHC C/D).</t>
  <t>Fragmentation C/D).</li>
        <li>Fragmentation mechanisms to allow SCHC Packet transportation on a
        small, and potentially variable, MTU. This component is called SCHC Fragmentation/Reassembly the "SCHC
        Fragmentation/Reassembly" (SCHC F/R).</t>
</list></t> F/R).</li>
      </ol>
      <t>Context exchange or pre-provisioning is out of scope of this document.</t>
      <figure title="Architecture" anchor="Fig-archi"><artwork><![CDATA[ anchor="Fig-archi">
        <name>Architecture</name>

        <artwork name="" type="" align="left" alt=""><![CDATA[
    Device                                                App
+----------------+                                +----+ +----+ +----+
| App1 App2 App3 |                                |App1| |App2| |App3|
|                |                                |    | |    | |    |
|       UDP      |                                |UDP | |UDP | |UDP |
|      IPv6      |                                |IPv6| |IPv6| |IPv6|
|                |                                |    | |    | |    |
|SCHC C/D and F/R|                                |    | |    | |    |
+--------+-------+                                +----+ +----+ +----+
         |  +---+     +----+    +----+    +----+     .      .      .
         +~ |RGW| === |NGW | == |SCHC| == |SCHC|...... Internet ....
            +---+     +----+    |F/R |    |C/D |
                                +----+    +----+
|<- - - - LoRaWAN - - ->|
]]></artwork></figure>
]]></artwork>
      </figure>
      <t><xref target="Fig-archi"/> target="Fig-archi" format="default"/> represents the
      architecture for compression/decompression, compression/decompression; it is based on the terminology from <xref target="RFC8376"/> terminology.
      target="RFC8376" format="default"/>. The device is sending applications
      application flows using IPv6 or IPv6/UDP protocols. These flows might
      be compressed by a Static
Context Header Compression Compressor/Decompressor (SCHC C/D) SCHC C/D to reduce headers
size header size, and fragmented
      by the SCHC Fragmentation/Reassembly (SCHC F/R). F/R.  The resulting
      information is sent on a layer two Layer 2 (L2) frame to an LPWAN Radio Gateway
      (RGW) that forwards the frame to a Network Gateway (NGW). The NGW sends
      the data to a SCHC F/R for reassembly, if required, then to a SCHC C/D for
      decompression. The SCHC C/D shares the same rules with the device. The
      SCHC C/D and SCHC F/R can be located on the Network Gateway (NGW) NGW or in
      another place as long as a communication is established between the NGW
      and the SCHC F/R, then SCHC F/R and SCHC C/D. The SCHC C/D and SCHC F/R in the
      device and the SCHC gateway MUST <bcp14>MUST</bcp14> share the same set of
      rules. After decompression, the packet can be sent on the Internet to
      one or several LPWAN Application Servers (App).</t>
      <t>The SCHC C/D and SCHC F/R process is bidirectional, so the same principles
      can be applied to the other direction.</t>
      <t>In a LoRaWAN network, the RGW is called a Gateway, "Gateway", the NGW is Network Server, a
      "Network Server", and the SCHC C/D and SCHC F/R are an one or more
      "Application Servers".

 Application Server. It servers can be provided by the Network Gateway NGW or any third party third-party
      software. <xref target="Fig-archi"/> target="Fig-archi" format="default"/> can be mapped in
      LoRaWAN terminology to:</t>

      <figure title="SCHC anchor="Fig-archi-lorawan">
        <name>SCHC Architecture mapped Mapped to LoRaWAN" anchor="Fig-archi-lorawan"><artwork><![CDATA[ LoRaWAN</name>
        <artwork name="" type="" align="left" alt=""><![CDATA[
   End Device                                              App
+--------------+                                   +----+ +----+ +----+
|App1 App2 App3|                                   |App1| |App2| |App3|
|              |                                   |    | |    | |    |
|      UDP     |                                   |UDP | |UDP | |UDP |
|     IPv6     |                                   |IPv6| |IPv6| |IPv6|
|              |                                   |    | |    | |    |
|SCHC C/D & F/R|                                   |    | |    | |    |
+-------+------+                                   +----+ +----+ +----+
        |  +-------+    +-------+    +-----------+    .      .      .
        +~ |Gateway| === == |Network| == |Application|..... Internet ....
           +-------+    |server |    |server     |
                        +-------+    | F/R - C/D |
                                     +-----------+
|<- - - - - LoRaWAN - - - ->|
]]></artwork></figure>
]]></artwork>
      </figure>
    </section>
    <section anchor="lorawan-architecture" title="LoRaWAN Architecture"> numbered="true" toc="default">
      <name>LoRaWAN Architecture</name>
      <t>An overview of the LoRaWAN <xref target="lora-alliance-spec"/> protocol and architecture <xref target="LORAWAN-SPEC"
      format="default"/> is described in <xref target="RFC8376"/>.
      target="RFC8376" format="default"/>. The mapping between the LPWAN
      architecture entities as described in <xref target="RFC8724"></xref> target="RFC8724"
      format="default"/> and the ones in <xref target="lora-alliance-spec"/> target="LORAWAN-SPEC"
      format="default"/> is as follows:</t>

<t>o Devices
<ul>
<li>Devices are LoRaWAN End Devices (e.g. (e.g., sensors, actuators, etc.).  There
can be a very high density of devices per radio gateway (LoRaWAN
gateway). This entity maps to the LoRaWAN end-device.</t>

<t>o The Radio Gateway (RGW), which end device.
</li>

<li>The RGW is the endpoint of the constrained
link. This entity maps to the LoRaWAN Gateway.</t>

<t>o The Network Gateway (NGW) Gateway.
</li>

<li>The NGW is the interconnection node between the Radio
Gateway and the SCHC gateway (LoRaWAN Application server). Server). This entity maps to
the LoRaWAN Network Server.</t>

<t>o Server.
</li>

<li>The SCHC C/D and SCHC F/R are handled by LoRaWAN Application Server; ie the LoRaWAN
   application server will do the SCHC C/D and F/R.</t>

<t>o The Application Server.
</li>

<li>The LPWAN-AAA Server is the LoRaWAN Join Server. Its role is to manage and
deliver security keys in a secure way, way so that the devices root key is never exposed.</t>
exposed.
</li>
</ul>

      <figure title="LPWAN Architecture" anchor="Fig-LPWANarchi"><artwork><![CDATA[ anchor="Fig-LPWANarchi">
        <name>LPWAN Architecture</name>
        <artwork name="" type="" align="left" alt=""><![CDATA[
                                         (LPWAN-AAA Server)
    ()   ()   ()       |                      +------+
     ()  () () ()     / \       +---------+   | Join |
    () () () () ()   /   \======|    ^    |===|Server|  +-----------+
     () ()  ()      |           | <--|--> |   +------+  |Application|
    () ()  ()  ()  / \==========|    v    |=============|  Server   |
     ()  ()  ()   /   \         +---------+             +-----------+
    End-devices
    End devices  Gateways     Network Server          (SCHC C/D and F/R)
     (devices)    (RGW)            (NGW)
]]></artwork></figure>

<t><spanx style="emph">Note</spanx>:
]]></artwork>
      </figure>
     <aside> <t>Note: <xref target="Fig-LPWANarchi"/> target="Fig-LPWANarchi" format="default"/> terms
      are from LoRaWAN, with <xref target="RFC8376"/> target="RFC8376" format="default"/>
      terminology in brackets.</t>

<t>SCHC Compressor/Decompressor (SCHC C/D) brackets.</t></aside>
      <t>The SCHC C/D and SCHC Fragmentation/Reassembly (SCHC F/R) F/R are performed on the LoRaWAN end-device end
      device and the Application Server (called the SCHC gateway). While the
      point-to-point link between the device and the Application Server
      constitutes a single IP hop, the ultimate end-point endpoint of the IP
      communication may be an Internet node beyond the Application Server.  In
      other words, the LoRaWAN Application Server (SCHC gateway) acts as the
first hop
      first-hop IP router for the device. The Application Server and Network
      Server may be co-located, which effectively turns the
      Network/Application Server into the first hop first-hop IP router.</t>
      <section anchor="device-classes-a-b-c-and-interactions" title="Device classes numbered="true" toc="default">
        <name>Device Classes (A, B, C) and interactions"> Interactions</name>

        <t>The LoRaWAN MAC Medium Access Control (MAC) layer supports 3 three
        classes of devices named A, B B, and C.  All devices implement the Class
        A, and some devices may implement Class B or Class C. Class B and Class C
        are mutually exclusive.</t>

<t><list style="symbols">
  <t>Class

<dl>

<dt>Class A: The Class
</dt>
<dd>Class A is the simplest class of devices. The device is allowed to
transmit at any time, randomly selecting a communication channel.  The Network
Gateway may reply with a downlink in one of the 2 two receive windows immediately
following the uplinks. Therefore, the Network Gateway cannot initiate a
downlink,
downlink; it has to wait for the next uplink from the device to get a downlink
opportunity. The Class A is the lowest power consumption class.</t>
  <t>Class class.
</dd>

<dt>Class B: Class
</dt>
<dd><t>Class B devices implement all the functionalities of Class A
devices, devices but
also schedule periodic listen windows. Therefore, as opposed to the Class A
devices, Class B devices can receive downlinks that are initiated by the
Network Gateway and not following an uplink. There is a trade-off between the
periodicity of those scheduled Class B listen windows and the power
consumption of the device: if the periodicity is high downlinks </t>

  <dl>

<dt>High periodicity:</dt>
<dd>Downlinks from the NGW will be sent faster, faster but the device wakes up more often: it
often and power consumption is increased.</dd>

<dt>Low periodicity:</dt>
<dd>Downlinks from the NGW will have higher latency but lower power consumption.</t>
  <t>Class consumption.</dd>
  </dl>

</dd>

<dt>Class C: Class
</dt>
<dd>Class C devices implement all the functionalities of Class A
devices, devices but
keep their receiver open whenever they are not transmitting.  Class C devices
can receive downlinks at any time at the expense of a higher power
consumption. Battery-powered devices can only operate in Class C for a limited
amount of time (for example example, for a firmware upgrade over-the-air).  Most of the
Class C devices are grid powered (for example example, Smart Plugs).</t>
</list></t> Plugs).
</dd>

</dl>

      </section>
      <section anchor="device-addressing" title="Device addressing"> numbered="true" toc="default">
        <name>Device Addressing</name>
        <t>LoRaWAN end-devices end devices use a 32-bit network address (devAddr) (DevAddr) to
        communicate with the Network Gateway over-the-air, over the air; this address might
        not be unique in a LoRaWAN network. Devices using the same devAddr DevAddr are
        distinguished by the Network Gateway based on the cryptographic
        signature appended to every LoRaWAN frame.</t>
        <t>To communicate with the SCHC gateway, the Network Gateway MUST
        <bcp14>MUST</bcp14> identify the devices by a unique 64-bit device
        identifier called the DevEUI.</t> "DevEUI".</t>
        <t>The DevEUI is assigned to the device during the manufacturing
        process by the
device’s device's manufacturer. It is built like an Ethernet MAC
        address by concatenating the manufacturer’s manufacturer's IEEE OUI field with a
        vendor unique number.
e.g.:  For example, a 24-bit OUI is concatenated with a 40-bit
        serial number.  The Network Gateway translates the devAddr DevAddr into a
        DevEUI in the uplink direction and reciprocally on the downlink
        direction.</t>
        <figure title="LoRaWAN addresses" anchor="Fig-LoRaWANaddresses"><artwork><![CDATA[ anchor="Fig-LoRaWANaddresses">
          <name>LoRaWAN Addresses</name>
          <artwork name="" type="" align="left" alt=""><![CDATA[
+--------+         +---------+        +---------+          +----------+
| Device | <=====> | Network | <====> | SCHC    | <======> | Internet |
|        | devAddr DevAddr | Gateway | DevEUI | Gateway | IPv6/UDP |          |
+--------+         +---------+        +---------+          +----------+

]]></artwork></figure>
]]></artwork>
        </figure>
      </section>
      <section anchor="general-frame-types" title="General numbered="true" toc="default">
        <name>General Frame Types"> Types</name>
        <t>LoRaWAN implements the possibility to send confirmed or unconfirmed frames:</t>

<t><list style="symbols">
  <t>Confirmed

<dl>

<dt>Confirmed frame:
The
</dt>
<dd>The sender asks the receiver to acknowledge the frame.</t>
  <t>Unconfirmed frame.
</dd>

<dt>Unconfirmed frame:
The
</dt>
<dd>The sender does not ask the receiver to acknowledge the frame.</t>
</list></t> frame.
</dd>

</dl>

        <t>As SCHC defines its own acknowledgment mechanisms, SCHC does not require
the use of LoRaWAN Confirmed frames (MType=0b100 (FType = 0b100 as per
<xref target="lora-alliance-spec"/>)</t> target="LORAWAN-SPEC" format="default"/>).</t>
      </section>
      <section anchor="lorawan-mac-frames" title="LoRaWAN numbered="true" toc="default">
        <name>LoRaWAN MAC Frames"> Frames</name>
        <t>In addition to regular data frames, LoRaWAN implements JoinRequest and JoinAccept
frame types, which are used by a device to join a network:</t>

<t><list style="symbols">
  <t>JoinRequest:
This
<dl>

<dt>JoinRequest:
</dt>
<dd>This frame is used by a device to join a network. It contains the device’s device's
unique identifier DevEUI and a random nonce that will be used for session key
derivation.</t>
  <t>JoinAccept:
To on-board
derivation.
</dd>

<dt>JoinAccept:
</dt>
<dd>To onboard a device, the Network Gateway responds to the JoinRequest
issued by a device with a JoinAccept frame. That frame is encrypted with the device’s
device's AppKey and contains (amongst (among other fields) the network’s network's major
settings and a random nonce used to derive the session
keys.</t>
  <t>Data: keys.
</dd>

<dt>Data:
</dt>
<dd>This refers to MAC and application data. Application data are is protected with AES-128
encryption. MAC related MAC-related data are is AES-128 encrypted with another key.</t>
</list></t> key.
</dd>

</dl>

      </section>
      <section anchor="lorawan-fport" title="LoRaWAN FPort"> numbered="true" toc="default">
        <name>LoRaWAN FPort</name>
        <t>The LoRaWAN MAC layer features a frame port field in all frames. This field
(FPort) is 8 bits long and the values from 1 to 223 can be used. It allows
LoRaWAN networks and applications to identify data.</t>
      </section>
      <section anchor="lorawan-empty-frame" title="LoRaWAN empty frame"> numbered="true" toc="default">
        <name>LoRaWAN Empty Frame</name>
        <t>A LoRaWAN empty frame is a LoRaWAN frame without FPort (cf (cf. <xref target="lorawan-schc-payload"/>)
        target="lorawan-schc-payload" format="default"/>) and FRMPayload.</t>
      </section>

      <section anchor="unicast-and-multicast-technology" title="Unicast numbered="true" toc="default">
        <name>Unicast and multicast technology"> Multicast Technology</name>
        <t>LoRaWAN technology supports unicast downlinks, downlinks but also multicast: multicast; a
        multicast packet sent over a LoRaWAN radio link can be received by several
        devices.  It is useful to address many devices with the same content, content:
        either a large binary file (firmware upgrade), upgrade) or the same command (e.g: (e.g.,
        lighting control).  As IPv6 is also a multicast technology technology, this
        feature can be used to address a group of devices.</t>

<t><spanx style="emph">Note 1</spanx>:

<aside>
        <t>Note 1: IPv6 multicast addresses must be defined as per
        <xref target="RFC4291"></xref>. target="RFC4291" format="default"/>.  The LoRaWAN multicast group
        definition in a Network Gateway and the relation between those groups
        and IPv6 groupID are out of scope of this document.</t>

<t><spanx style="emph">Note 2</spanx>:
</aside>
<aside> <t>Note 2: The LoRa Alliance defined <xref target="lora-alliance-remote-multicast-set"/>
        target="LORAWAN-REMOTE-MULTICAST-SET" format="default"/> as the RECOMMENDED
        <bcp14>RECOMMENDED</bcp14> way to setup set up multicast groups on devices
        and create a synchronized reception window.</t>
</aside>

      </section>
    </section>
    <section anchor="schc-over-lorawan" title="SCHC-over-LoRaWAN"> numbered="true" toc="default">
      <name>SCHC over LoRaWAN</name>
      <section anchor="lorawan-schc-payload" title="LoRaWAN numbered="true" toc="default">
        <name>LoRaWAN FPort and RuleID"> RuleID</name>
        <t>The FPort field is part of the SCHC Message, as shown in
<xref target="Fig-lorawan-schc-payload"/>. target="Fig-lorawan-schc-payload" format="default"/>. The SCHC C/D and the SCHC F/R SHALL <bcp14>SHALL</bcp14> concatenate
the FPort field with the LoRaWAN payload to recompose the SCHC Message.</t>
        <figure title="SCHC anchor="Fig-lorawan-schc-payload">
          <name>SCHC Message in LoRaWAN" anchor="Fig-lorawan-schc-payload"><artwork><![CDATA[ LoRaWAN</name>
          <artwork name="" type="" align="left" alt=""><![CDATA[
| FPort | LoRaWAN payload  |
+ ------------------------ +
|       SCHC Message       |

]]></artwork></figure>

<t>Note:
]]></artwork>
        </figure>
        <aside><t>Note: The SCHC Message is any datagram sent by the SCHC C/D or F/R layers.</t> layers.</t></aside>
        <t>A fragmented datagram with application payload transferred from device to
Network Gateway, Gateway is called an uplink fragmented datagram. "uplink-fragmented datagram". It uses an FPort for data uplink
and its associated SCHC control downlinks, named FPortUp "FPortUp" in this document. The
other way, a fragmented datagram with application payload transferred from
Network Gateway to device, device is called downlink fragmented datagram. a "downlink-fragmented datagram". It uses another
FPort for data downlink and its associated SCHC control uplinks, named FPortDown "FPortDown"
in this document.</t>

        <t>All RuleID RuleIDs can use arbitrary values inside the FPort range allowed
        by the LoRaWAN specification <xref target="LORAWAN-SPEC"/> and MUST
        <bcp14>MUST</bcp14> be shared by the device and SCHC gateway prior to
        the communication with the selected rule.  The uplink and downlink
        fragmentation FPorts MUST <bcp14>MUST</bcp14> be different.</t>
      </section>
      <section anchor="rule-id-management" title="Rule ID management">

<t>RuleID MUST numbered="true" toc="default">
        <name>RuleID Management</name>
        <t>The RuleID <bcp14>MUST</bcp14> be 8 bits, bits and encoded in the LoRaWAN
        FPort as described in <xref target="lorawan-schc-payload"/>. target="lorawan-schc-payload"
        format="default"/>.

	LoRaWAN supports up to 223 application FPorts in
        the range [1;223] [1..223] as defined in section Section 4.3.2 of <xref target="lora-alliance-spec"/>,
        target="LORAWAN-SPEC" format="default"/>; it implies that the RuleID MSB SHOULD
        <bcp14>SHOULD</bcp14> be inside this range. An application can send non SCHC
        non-SCHC traffic by using FPort values different from the ones used
        for SCHC.</t>
        <t>In order to improve interoperability, RECOMMENDED <bcp14>RECOMMENDED</bcp14> fragmentation RuleID values are:</t>

<t><list style="symbols">
  <t>RuleID
        <ul spacing="normal">
          <li>RuleID = 20 (8-bit) for uplink fragmentation, named FPortUp.</t>
  <t>RuleID FPortUp.</li>
          <li>RuleID = 21 (8-bit) for downlink fragmentation, named FPortDown.</t>
  <t>RuleID FPortDown.</li>
          <li>RuleID = 22 (8-bit) for which SCHC compression was not possible (i.e., no matching
compression Rule was found), as described in <xref target="RFC8724"/> section 6.</t>
</list></t>

<t>FPortUp target="RFC8724" sectionFormat="of" section="6" format="default"/>.</li>
        </ul>

        <t>The FPortUp value MUST <bcp14>MUST</bcp14> be different from FPortDown. the FPortDown value.  The
        remaining RuleIDs are available for compression. RuleIDs are shared
        between uplink and downlink sessions.  A RuleID not in the set(s) of
        FPortUp or FPortDown means that the fragmentation is not used, used; thus,
        on reception, the SCHC Message
MUST <bcp14>MUST</bcp14> be sent to the SCHC
        C/D layer.</t>
        <t>The only uplink frames using the FPortDown port are the
        fragmentation SCHC control messages of a downlink fragmented downlink-fragmented datagram
        (for example, SCHC ACKs).  Similarly, the only downlink frames using
        the FPortUp port are the fragmentation SCHC control messages of an uplink fragmented
        uplink-fragmented datagram.</t>
        <t>An application can have multiple fragmented datagrams between a device and one
or several SCHC gateways.  A set of FPort values is REQUIRED <bcp14>REQUIRED</bcp14> for each SCHC gateway
instance the device is required to communicate with.  The application can use
additional uplinks or downlink fragmented downlink-fragmented parameters but SHALL <bcp14>SHALL</bcp14> implement at
least the parameters defined in this document.</t>
        <t>The mechanism for context distribution across devices and gateways is
outside the scope of this document.</t>
      </section>

      <section anchor="IID" title="Interface numbered="true" toc="default">
        <name>Interface IDentifier (IID) computation"> Computation</name>
        <t>In order to mitigate the risks described in <xref target="RFC8064"></xref> target="RFC8064" format="default"/> and <xref target="RFC8065"></xref>,
implementation MUST target="RFC8065" format="default"/>,
implementations <bcp14>MUST</bcp14> implement the following algorithm and SHOULD <bcp14>SHOULD</bcp14> use it.</t>

<t><list style="numbers">
  <t>key
        <ol spacing="normal" type="1"><li>key = LoRaWAN AppSKey</t>
  <t>cmac AppSKey</li>
          <li>cmac = aes128_cmac(key, DevEUI)</t>
  <t>IID DevEUI)</li>
          <li>IID = cmac[0..7]</t>
</list></t>

<t>aes128_cmac cmac[0..7]</li>
        </ol>
        <t>The aes128_cmac algorithm is described in <xref target="RFC4493"></xref>. target="RFC4493"
        format="default"/>. It has been chosen as it is already used by
        devices for the LoRaWAN protocol.</t>

        <t>As AppSKey is renewed each time a device joins or rejoins a LoRaWAN
        network, the IID will change over time; this
        mitigates privacy, privacy concerns, for example, location tracking and or correlation
        over time risks. time. Join periodicity is defined at the application level.</t>

<t>Address scan

        <t>Address-scan risk is mitigated thanks to AES-128, which provides enough the entropy
bits of added to
        the IID by the IID.</t> inclusion of AppSKey.</t>
        <t>Using this algorithm will also ensure that there is no correlation
        between the hardware identifier (IEEE-64 DevEUI) (DevEUI) and the IID, so an
        attacker cannot use the manufacturer OUI to target devices.</t>
        <t>Example with:</t>

<t><list style="symbols">
  <t>DevEUI: 0x1122334455667788</t>
  <t>appSKey: 0x00AABBCCDDEEFF00AABBCCDDEEFFAABB</t>
</list></t>
        <ul spacing="normal">
          <li>DevEUI: 0x1122334455667788</li>
          <li>AppSKey: 0x00AABBCCDDEEFF00AABBCCDDEEFFAABB</li>
        </ul>
        <figure title="Example anchor="Fig-iid-computation-example">
          <name>Example of IID computation." anchor="Fig-iid-computation-example"><artwork><![CDATA[ Computation</name>
          <sourcecode><![CDATA[
1. key: 0x00AABBCCDDEEFF00AABBCCDDEEFFAABB
2. cmac: 0xBA59F4B196C6C3432D9383C145AD412A 0x4E822D9775B2649928F82066AF804FEC
3. IID: 0xBA59F4B196C6C343
]]></artwork></figure> 0x4E822D9775B26499
]]></sourcecode>

        </figure>

        <t>There is a small probability of IID collision in a LoRaWAN
        network. If this occurs, the IID can be changed by rekeying the device
        at the L2 level (ie: trigger (i.e., triggering a LoRaWAN join).  The way the device is
        rekeyed is out of scope of this document and left to the
        implementation.</t>

<t>Note: Implementation
        <aside><t>Note: Implementations also using another IID source MUST
        <bcp14>MUST</bcp14> ensure that the same IID is shared between the
        device and the SCHC gateway in the compression and decompression of
        the IPv6 address of the device.</t> device.</t></aside>
      </section>
      <section anchor="padding" title="Padding"> numbered="true" toc="default">
        <name>Padding</name>
        <t>All padding bits MUST <bcp14>MUST</bcp14> be 0.</t>
      </section>
      <section anchor="Decomp" title="Decompression">

<t>SCHC numbered="true" toc="default">
        <name>Decompression</name>
        <t>The SCHC C/D MUST <bcp14>MUST</bcp14> concatenate FPort and LoRaWAN payload
        to retrieve the SCHC Packet as per <xref target="lorawan-schc-payload"/>.</t> target="lorawan-schc-payload"
        format="default"/>.</t>
        <t>RuleIDs matching FPortUp and FPortDown are reserved for SCHC Fragmentation.</t> fragmentation.</t>
      </section>
      <section anchor="Frag" title="Fragmentation"> numbered="true" toc="default">
        <name>Fragmentation</name>
        <t>The L2 Word Size used by LoRaWAN is 1 byte (8 bits).  The SCHC
        fragmentation over LoRaWAN uses the ACK-on-Error mode for uplink
        fragmentation and Ack-Always ACK-Always mode for downlink fragmentation. A
        LoRaWAN device cannot support simultaneous interleaved fragmented
        datagrams in the same direction (uplink or downlink).</t>
        <t>The fragmentation parameters are different for uplink uplink- and downlink
fragmented
        downlink-fragmented datagrams and are successively described in the
        next sections.</t>
        <section anchor="DTag" title="DTag"> numbered="true" toc="default">
          <name>DTag</name>

          <t><xref target="RFC8724"></xref> section 8.2.4 target="RFC8724" sectionFormat="of" section="8.2.4"
          format="default"/> describes the possibility to interleave several
          fragmented SCHC datagrams for the same RuleID. This is not used in SCHC over
LoRaWAN
          the SCHC-over-LoRaWAN profile. A device cannot interleave several
          fragmented SCHC datagrams on the same FPort.  This field is not used used,
          and its size is 0.</t>
<aside> <t>Note: The device can still have several parallel fragmented
datagrams with more than one SCHC gateway thanks to distinct sets of FPorts, cf
cf. <xref target="rule-id-management"/>.</t> target="rule-id-management" format="default"/>.</t></aside>
        </section>
        <section anchor="uplink-fragmentation-from-device-to-schc-gateway" title="Uplink fragmentation: numbered="true" toc="default">

          <name>Uplink Fragmentation: From device Device to SCHC gateway"> Gateway</name>
          <t>In this case, the device is the fragment transmitter, transmitter and the SCHC
          gateway is the fragment receiver. A single fragmentation rule is
          defined.  The SCHC F/R MUST <bcp14>MUST</bcp14> concatenate FPort and LoRaWAN
          payload to retrieve the SCHC Packet, as per <xref target="lorawan-schc-payload"/>.</t>

<t><list style="symbols">
  <t>SCHC
          target="lorawan-schc-payload" format="default"/>.</t>

<dl>

<dt>SCHC fragmentation reliability mode: <spanx style="verb">ACK-on-Error</spanx>.</t>
  <t>SCHC
</dt>
<dd><tt>ACK-on-Error</tt>.
</dd>

<dt>SCHC header size is two size:
</dt>
<dd>2 bytes (the FPort byte + 1 additional byte).</t>
  <t>RuleID: 8 byte).
</dd>

<dt>RuleID:
</dt>
<dd>8 bits stored in the LoRaWAN FPort. cf FPort (cf. <xref target="rule-id-management"/></t>
  <t>DTag: Size T=0 bit, target="rule-id-management"
format="default"/>).
</dd>

<dt>DTag:
</dt>
<dd>Size T = 0 bits, not used. cf used (cf. <xref target="DTag"/></t>
  <t>Window target="DTag" format="default"/>).
</dd>

<dt>Window index: 4
</dt>
<dd>4 windows are used, encoded on M = 2 bits</t>
  <t>FCN: The bits.
</dd>

<dt>FCN:
</dt>
<dd>The FCN field is encoded on N = 6 bits, so WINDOW_SIZE = 63 tiles
are allowed in a window.</t>
  <t>Last window.
</dd>

<dt>Last tile: it
</dt>
<dd><t>It can be carried in a Regular SCHC Fragment, alone in an All-1 SCHC
Fragment
Fragment, or with any of these two methods. Implementation Implementations must ensure that:
  <list style="symbols">
      <t>The that:</t>
  <ul>

    <li>The sender MUST <bcp14>MUST</bcp14> ascertain that the receiver will not
    receive the last tile through both a Regular SCHC Fragment and an All-1
    SCHC Fragment during the same session.</t>
      <t>If session.
    </li>
    <li>If the last tile is in an All-1 SCHC message: Message, the current L2 MTU MUST
    <bcp14>MUST</bcp14> be big enough to fit the All-1 header and the last tile.</t>
    </list></t>
  <t>Penultimate tile MUST
    tile.
    </li>

  </ul>
</dd>

<dt>Penultimate tile:
</dt>
    <dd><bcp14>MUST</bcp14> be equal to the regular size.</t>
  <t>RCS: Use size.
    </dd>

<dt>RCS:
</dt>
    <dd>Use the recommended calculation algorithm in <xref target="RFC8724"></xref> (§8.2.3. target="RFC8724"
    sectionFormat="of" section="8.2.3"/>, Integrity Checking).</t>
  <t>Tile: size Checking.
    </dd>

<dt>Tile:
</dt>
    <dd>Size is 10 bytes.</t>
  <t>Retransmission bytes.
    </dd>

<dt>Retransmission timer: Set
</dt>
    <dd>Set by the implementation depending on the application
    requirements. The default RECOMMENDED <bcp14>RECOMMENDED</bcp14> duration of this
    timer is 12 hours; this value is mainly driven by application requirements
    and MAY <bcp14>MAY</bcp14> be changed by the application.</t>
  <t>Inactivity application.
    </dd>

<dt>Inactivity timer: The
</dt>
    <dd>The SCHC gateway implements an “inactivity timer”. "inactivity timer". The default RECOMMENDED
    <bcp14>RECOMMENDED</bcp14> duration of this timer is 12 hours; this value
    is mainly driven by application requirements and MAY <bcp14>MAY</bcp14> be
    changed by the application.</t>
  <t>MAX_ACK_REQUESTS: application.
    </dd>

<dt>MAX_ACK_REQUESTS:
</dt>
    <dd> 8.  With this set of parameters, the SCHC fragment header Fragment Header is 16 bits,
    including FPort; payload overhead will be 8 bits as FPort is already a
    part of LoRaWAN payload. MTU is: <spanx style="emph">4 4 windows * 63 tiles * 10 bytes per
    tile = 2520 bytes</spanx></t>
</list></t> bytes.
    </dd>

</dl>

          <t>In addition to the per-rule context parameters specified in <xref target="RFC8724"></xref>, target="RFC8724" format="default"/>,
for uplink rules, an additional context parameter is added: whether or
not to ack after each window.<vspace /> window.
For battery powered devices, it is RECOMMENDED <bcp14>RECOMMENDED</bcp14> to use the ACK mechanism at the
end of each window instead of waiting until the end of all windows:</t>

<t><list style="symbols">
  <t>The
          <ul spacing="normal">
            <li>The SCHC receiver SHOULD <bcp14>SHOULD</bcp14> send a SCHC ACK after every window even if there is no
missing tile.</t>
  <t>The tile.</li>
            <li>The SCHC sender SHOULD <bcp14>SHOULD</bcp14> wait for the SCHC ACK
            from the SCHC receiver before sending tiles from the next
            window. If the SCHC ACK is not received, it SHOULD <bcp14>SHOULD</bcp14>
            send a SCHC ACK REQ up to MAX_ACK_REQUESTS times, as described previously.</t>
</list></t>
            previously.</li>
          </ul>
          <t>This will avoid useless uplinks if the device has lost network coverage.</t>
          <t>For non-battery powered devices, the SCHC receiver MAY
          <bcp14>MAY</bcp14> also choose to send a SCHC ACK only at the end
          of all windows. This will reduce downlink load on the LoRaWAN
network,
          network by reducing the number of downlinks.</t>
          <t>SCHC implementations MUST <bcp14>MUST</bcp14> be compatible with both behaviors, and this selection is
part of the rule context.</t>
          <section anchor="regular-fragments" title="Regular fragments">

<figure title="All numbered="true" toc="default">
            <name>Regular Fragments</name>
            <t><xref target="Fig-fragmentation-header-long-all0" format="default"/>
            is an example of a regular fragment for all fragments except
            the last one.  SCHC header size Header Size is 16 bits, Bits, including the
            LoRaWAN FPort." anchor="Fig-fragmentation-header-long-all0"><artwork><![CDATA[ FPort.
            </t>
            <figure anchor="Fig-fragmentation-header-long-all0">
              <name>All Fragments Except the Last One.</name>
              <artwork name="" type="" align="left" alt=""><![CDATA[
| FPort  |  LoRaWAN payload          |
+ ------ + ------------------------- +
| RuleID |   W    | FCN    | Payload |
+ ------ + ------ + ------ + ------- +
| 8 bits | 2 bits | 6 bits |         |

]]></artwork></figure>
]]></artwork>
            </figure>
          </section>
          <section anchor="last-fragment-all-1" title="Last fragment (All-1)">

<figure title="All-1 SCHC Message: numbered="true" toc="default">
            <name>Last Fragment (All-1)</name>
            <t>Following figures are examples of All-1 messages. <xref target="Fig-fragmentation-header-all1-no-tile" format="default"/>
            is without the last fragment without tile, <xref target="Fig-fragmentation-header-all1-last-tile" format="default"/>
            is with the last tile." anchor="Fig-fragmentation-header-all1-no-tile"><artwork><![CDATA[ tile.
            </t>
            <figure anchor="Fig-fragmentation-header-all1-no-tile">
              <name>All-1 SCHC Message without Last Tile</name>
              <artwork name="" type="" align="left" alt=""><![CDATA[
| FPort  | LoRaWAN payload              |
+ ------ + ---------------------------- +
| RuleID |   W    | FCN=All-1 |  RCS    |
+ ------ + ------ + --------- + ------- +
| 8 bits | 2 bits | 6 bits    | 32 bits |

]]></artwork></figure>
]]></artwork>
            </figure>
            <figure title="All-1 anchor="Fig-fragmentation-header-all1-last-tile">
              <name>All-1 SCHC Message: the last fragment Message with last tile." anchor="Fig-fragmentation-header-all1-last-tile"><artwork><![CDATA[ Last Tile</name>
              <artwork name="" type="" align="left" alt=""><![CDATA[
| FPort  | LoRaWAN payload                                            |
+ ------ + ---------------------------------------------------------- +
| RuleID |   W    | FCN=All-1 |  RCS    |  Last tile   | Opt. padding |
+ ------ + ------ + --------- + ------- + ------------ + ------------ +
| 8 bits | 2 bits |  6 bits   | 32 bits | 1 to 80 bits | 0 to 7 bits  |

]]></artwork></figure>
]]></artwork>
            </figure>
          </section>
          <section anchor="schc-ack" title="SCHC ACK"> numbered="true" toc="default">

            <name>SCHC ACK</name>
            <figure title="SCHC anchor="Fig-frag-header-long-schc-ack-rcs-ok">
              <name>SCHC ACK format, correct Format - Correct RCS check." anchor="Fig-frag-header-long-schc-ack-rcs-ok"><artwork><![CDATA[ Check</name>
              <artwork name="" type="" align="left" alt=""><![CDATA[
| FPort  | LoRaWAN payload           |
+ ------ + --------------------------+
| RuleID |   W   | C = 1 |  padding  |
|        |       |       | (b'00000) |
+ ------ + ----- + ----- + --------- +
| 8 bits | 2 bit | 1 bit |  5 bits   |

]]></artwork></figure>
]]></artwork>
            </figure>
            <figure title="SCHC anchor="Fig-frag-header-long-schc-ack-rcs-fail">
              <name>SCHC ACK format, failed Format - Incorrect RCS check." anchor="Fig-frag-header-long-schc-ack-rcs-fail"><artwork><![CDATA[ Check</name>
              <artwork name="" type="" align="left" alt=""><![CDATA[
| FPort  | LoRaWAN payload                                      |
+ ------ + --------------------------------- + ---------------- +
| RuleID |   W   | C = 0 | Compressed bitmap | Optional padding |
|        |       |       |      (C = 0)      |    (b'0...0)     |
+ ------ + ----- + ----- + ----------------- + ---------------- +
| 8 bits | 2 bit | 1 bit |    5 to 63 bits   |  0, 6 6, or 7 bits |

]]></artwork></figure>

<t>Note:
]]></artwork>
            </figure>
<aside><t>Note: Because of the bitmap compression mechanism and L2 byte alignment, only
the following discrete values are possible for the compressed bitmap size: 5, 13, 21, 29, 37, 45, 53, 61, 62 62, and 63.
Bitmaps of 63 bits will require 6 bits of padding.</t> padding.</t></aside>
          </section>
          <section anchor="receiver-abort" title="Receiver-Abort"> numbered="true" toc="default">
            <name>Receiver-Abort</name>
            <figure title="Receiver-Abort format." anchor="Fig-fragmentation-receiver-abort"><artwork><![CDATA[ anchor="Fig-fragmentation-receiver-abort">
              <name>Receiver-Abort Format</name>
              <artwork name="" type="" align="left" alt=""><![CDATA[
| FPort  | LoRaWAN payload                              |
+ ------ + -------------------------------------------- +
| RuleID | W = b'11 | C = 1 | b'11111 | 0xFF (all 1's)  |
+ ------ + -------- + ------+-------- + ----------------+
| 8 bits |  2 bits  | 1 bit | 5 bits  | 8 bits          |
              next L2 Word boundary ->| <-- L2 Word --> |

]]></artwork></figure>
]]></artwork>
            </figure>
          </section>
          <section anchor="schc-acknowledge-request" title="SCHC acknowledge request"> numbered="true" toc="default">
            <name>SCHC Acknowledge Request</name>
            <figure title="SCHC anchor="Fig-fragmentation-schc-ack-req">
              <name>SCHC ACK REQ format." anchor="Fig-fragmentation-schc-ack-req"><artwork><![CDATA[ Format</name>
              <artwork name="" type="" align="left" alt=""><![CDATA[
| FPort  | LoRaWAN payload          |
+------- +------------------------- +
| RuleID | W      | FCN = b'000000  |
+ ------ + ------ + --------------- +
| 8 bits | 2 bits | 6 bits          |

]]></artwork></figure>
]]></artwork>
            </figure>
          </section>
        </section>
        <section anchor="downlink-fragmentation-from-schc-gateway-to-device" title="Downlink fragmentation: numbered="true" toc="default">
          <name>Downlink Fragmentation: From SCHC gateway Gateway to device"> Device</name>
          <t>In this case, the device is the fragmentation receiver, receiver and the
          SCHC gateway is the fragmentation transmitter. The following fields are
          common to all devices. The SCHC F/R MUST <bcp14>MUST</bcp14> concatenate
          FPort and LoRaWAN payload to retrieve the SCHC Packet as described
          in <xref target="lorawan-schc-payload"/>.</t>

<t><list style="symbols">
  <t>SCHC target="lorawan-schc-payload" format="default"/>.</t>

<dl>

<dt>SCHC fragmentation reliability mode:
  <list style="symbols">
      <t>Unicast
</dt>
<dd>
<ul empty="true">
  <li>
<dl>

<dt >Unicast downlinks: ACK-Always.</t>
      <t>Multicast
</dt>
<dd>ACK-Always.
</dd>
<dt>Multicast downlinks: No-ACK,
</dt>

<dd>No-ACK; reliability has to be ensured by the upper layer. This feature is OPTIONAL and may not be implemented by
<bcp14>OPTIONAL</bcp14> for the SCHC gateway.</t>
    </list></t>
  <t>RuleID: 8 gateway and <bcp14>REQUIRED</bcp14> for the device.
</dd>

</dl>
  </li>
</ul>

</dd>

<dt>RuleID:
</dt>
<dd>8 bits stored in the LoRaWAN FPort. cf FPort (cf. <xref target="rule-id-management"/></t>
  <t>DTag: Size T=0
target="rule-id-management" format="default"/>).
</dd>

<dt>DTag:
</dt>
<dd>Size T = 0 bit, not used. cf used (cf. <xref target="DTag"/></t>
  <t>FCN: The target="DTag" format="default"/>).
</dd>

<dt>FCN:
</dt>
<dd>The FCN field is encoded on N=1 N = 1 bit, so WINDOW_SIZE = 1 tile.</t>
  <t>RCS: Use tile.
</dd>

<dt>RCS:
</dt>
<dd>Use the recommended calculation algorithm in <xref target="RFC8724"></xref> (§8.2.3. target="RFC8724" sectionFormat="of"
format="default" section="8.2.3"/>, Integrity Checking).</t>
  <t>Inactivity Checking.
</dd>

<dt>Inactivity timer: The
</dt>
<dd>The default RECOMMENDED <bcp14>RECOMMENDED</bcp14> duration of this timer is 12 hours;
this value is mainly driven by application requirements and MAY <bcp14>MAY</bcp14>
be changed by the application.</t>
</list></t> application.
</dd>

</dl>

          <t>The following parameters apply to ACK-Always (Unicast) only:</t>

<t><list style="symbols">
  <t>Retransmission

<dl>

<dt>Retransmission timer:  See
</dt>
<dd>See <xref target="downlink-retransmission-timer"/>.</t>
  <t>MAX_ACK_REQUESTS: 8.</t>
  <t>Window target="downlink-retransmission-timer" format="default"/>.
</dd>

<dt>MAX_ACK_REQUESTS:
</dt>
<dd>8.
</dd>

<dt>Window index (unicast only): encoded
</dt>
<dd>encoded on M=1 M = 1 bit, as per <xref target="RFC8724"></xref>.</t>
</list></t> target="RFC8724" format="default"/>.
</dd>

</dl>

          <t>As only 1 one tile is used, its size can change for each downlink, downlink and
          will be the currently available MTU.</t>
          <t>Class A devices can only receive during an RX slot, following the
          transmission of an uplink.  Therefore  Therefore, the SCHC gateway cannot
          initiate communication (e.g., start a new SCHC session). In order to
          create a downlink opportunity opportunity, it is RECOMMENDED <bcp14>RECOMMENDED</bcp14> for
          Class A devices to send an uplink every 24 hours when no SCHC
          session is
started, started; this is application specific and can be
          disabled. The RECOMMENDED <bcp14>RECOMMENDED</bcp14> uplink is a LoRaWAN empty
          frame as defined in <xref target="lorawan-empty-frame"/>. target="lorawan-empty-frame"
          format="default"/>.  As this uplink is sent only to open an RX window, any
          LoRaWAN uplink frame from the device
MAY <bcp14>MAY</bcp14> reset this
          counter.</t>

<t><spanx style="emph">Note</spanx>:

<aside><t>Note: The Fpending FPending bit included in the LoRaWAN protocol SHOULD NOT <bcp14>SHOULD
NOT</bcp14> be used for the SCHC-over-LoRaWAN protocol. It might be set by the
Network Gateway for other purposes but not SCHC needs.</t> needs.</t></aside>
          <section anchor="regular-fragments-1" title="Regular fragments">

<figure title="All numbered="true" toc="default">
            <name>Regular Fragments</name>
            <t><xref target="Fig-fragmentation-downlink-header-all0" format="default"/>
            is an example of a regular fragment for all fragments but except
            the last one.  SCHC Header size Size is 10 bits, Bits, including the
            LoRaWAN FPort." anchor="Fig-fragmentation-downlink-header-all0"><artwork><![CDATA[ FPort.
            </t>
            <figure anchor="Fig-fragmentation-downlink-header-all0">
              <name>All Fragments but the Last One.</name>
              <artwork name="" type="" align="left" alt=""><![CDATA[
| FPort  | LoRaWAN payload                      |
+ ------ + ------------------------------------ +
| RuleID | W     | FCN = b'0 | Payload          |
+ ------ + ----- + --------- + ---------------- +
| 8 bits | 1 bit | 1 bit     | X bytes + 6 bits |

]]></artwork></figure>
]]></artwork>
            </figure>
          </section>
          <section anchor="last-fragment-all-1-1" title="Last fragment (All-1)"> numbered="true" toc="default">
            <name>Last Fragment (All-1)</name>
            <figure title="All-1 anchor="Fig-fragmentation-downlink-header-all1">
              <name>All-1 SCHC Message: the last fragment." anchor="Fig-fragmentation-downlink-header-all1"><artwork><![CDATA[ The Last Fragment</name>
              <artwork name="" type="" align="left" alt=""><![CDATA[
| FPort  | LoRaWAN payload                                         |
+ ------ + --------------------------- + ------------------------- +
| RuleID | W     | FCN = b'1 |   RCS   |   Payload   | Opt padding |
+ ------ + ----- + --------- + ------- + ----------- + ----------- +
| 8 bits | 1 bit | 1 bit     | 32 bits | 6 to X bits | 0 to 7 bits |

]]></artwork></figure>
]]></artwork>
            </figure>
          </section>
          <section anchor="schc-ack-1" title="SCHC ACK"> numbered="true" toc="default">
            <name>SCHC ACK</name>
            <figure title="SCHC anchor="Fig-frag-downlink-header-schc-ack-rcs-ok">
              <name>SCHC ACK format, Format - Correct RCS is correct." anchor="Fig-frag-downlink-header-schc-ack-rcs-ok"><artwork><![CDATA[ Check</name>
              <artwork name="" type="" align="left" alt=""><![CDATA[
| FPort  | LoRaWAN payload                    |
+ ------ + ---------------------------------- +
| RuleID | W     | C = b'1 | Padding b'000000 |
+ ------ + ----- + ------- + ---------------- +
| 8 bits | 1 bit | 1 bit   | 6 bits           |

]]></artwork></figure>
]]></artwork>
            </figure>
            <figure title="SCHC anchor="Fig-frag-downlink-header-schc-ack-rcs-fail">
              <name>SCHC ACK format, Format - Incorrect RCS is incorrect." anchor="Fig-frag-downlink-header-schc-ack-rcs-fail"><artwork><![CDATA[ Check</name>
              <artwork name="" type="" align="left" alt=""><![CDATA[
| FPort  | LoRaWAN payload                                   |
+ ------ + ------------------------------------------------- +
| RuleID | W     | C = b'0 | Bitmap = b'1 | Padding b'000000 |
+ ------ + ----- + ------- + ------------ + ---------------- +
| 8 bits | 1 bit | 1 bit   |    1 bit     |      5 bits      |

]]></artwork></figure>
]]></artwork>
            </figure>
          </section>
          <section anchor="receiver-abort-1" title="Receiver-Abort">

<figure title="Receiver-Abort packet (following numbered="true" toc="default">
            <name>Receiver-Abort</name>
             <t><xref target="Fig-fragmentation-downlink-header-abort" format="default"/>
            is an example of a Receiver-Abort packet, following an All-1
            SCHC Fragment with incorrect RCS)." anchor="Fig-fragmentation-downlink-header-abort"><artwork><![CDATA[ RCS.
             </t>
            <figure anchor="Fig-fragmentation-downlink-header-abort">
              <name>Receiver-Abort Packet</name>
              <artwork name="" type="" align="left" alt=""><![CDATA[
| FPort  | LoRaWAN payload                                |
+ ------ + ---------------------------------------------- +
| RuleID | W = b'1 | C = b'1 | b'111111 | 0xFF (all 1's)  |
+ ------ + ------- + ------- + -------- + --------------- +
| 8 bits | 1 bit   | 1 bits  | 6 bits   | 8 bits          |
                next L2 Word boundary ->| <-- L2 Word --> |

]]></artwork></figure>
]]></artwork>
            </figure>
          </section>
          <section anchor="downlink-retransmission-timer" title="Downlink retransmission timer"> numbered="true" toc="default">
            <name>Downlink Retransmission Timer</name>

            <t>Class A and A, Class B or B, and Class C devices do not manage
            retransmissions and timers the same way.</t>

            <section anchor="class-a-devices" title="Class numbered="true" toc="default">
              <name>Class A devices"> Devices</name>
              <t>Class A devices can only receive in an RX slot following the
              transmission of an uplink.</t>
              <t>The SCHC gateway implements an inactivity timer with a RECOMMENDED
              <bcp14>RECOMMENDED</bcp14> duration of 36 hours.  For devices
              with very low transmission rates (example (for example, 1 packet a day in
              normal operation), that duration may be extended: extended; it is
              application specific.</t>
              <t>RETRANSMISSION_TIMER is application specific and its RECOMMENDED
              <bcp14>RECOMMENDED</bcp14> value is
              INACTIVITY_TIMER/(MAX_ACK_REQUESTS + 1).</t>

<t><spanx style="strong">SCHC
              <t><strong>SCHC All-0 (FCN=0)</spanx></t> (FCN = 0)</strong></t>
              <t>All fragments but the last have an FCN=0 FCN = 0 (because the window size
              is 1).  Following an All-0 SCHC Fragment, the device MUST
              <bcp14>MUST</bcp14> transmit the SCHC ACK message. It MUST
              <bcp14>MUST</bcp14> transmit up to MAX_ACK_REQUESTS SCHC ACK
              messages before aborting.  In order to progress the fragmented
              datagram, the SCHC layer should immediately queue for
              transmission those SCHC ACK messages if no SCHC downlink have has been
              received during the RX1 and RX2 window. windows.  The LoRaWAN layer will respect
              the applicable local spectrum regulation.</t>

<t><spanx style="emph">Note</spanx>:

<aside>              <t>Note: The ACK bitmap is 1 bit long and is always 1.</t>

<t><spanx style="strong">SCHC 1.</t></aside>
              <t><strong>SCHC All-1 (FCN=1)</spanx></t> (FCN = 1)</strong></t>

              <t>SCHC All-1 is the last fragment of a datagram, and the
              corresponding SCHC ACK message might be lost; therefore therefore, the SCHC
              gateway MUST <bcp14>MUST</bcp14> request a retransmission of this ACK
              when the retransmission timer expires.  To open a downlink
opportunity
              opportunity, the device MUST <bcp14>MUST</bcp14> transmit an uplink
              every interval of RETRANSMISSION_TIMER/(MAX_ACK_REQUESTS *
              SCHC_ACK_REQ_DN_OPPORTUNITY).  The format of this uplink is
              application specific.  It is RECOMMENDED <bcp14>RECOMMENDED</bcp14> for a
              device to send an empty frame (see <xref target="lorawan-empty-frame"/>)
              target="lorawan-empty-frame" format="default"/>), but it is
              application specific and will be used by the NGW to transmit a
              potential SCHC ACK REQ.<vspace /> REQ.  SCHC_ACK_REQ_DN_OPPORTUNITY is
              application specific and its recommended value is 2. It MUST
              <bcp14>MUST</bcp14> be greater than 1. This allows to open the opening of a
              downlink opportunity to any downlink with higher priority than
              the SCHC ACK REQ message.</t>

<t><spanx style="emph">Note</spanx>:
<aside>        <t>Note: The device MUST <bcp14>MUST</bcp14> keep this SCHC
              ACK message in memory until it receives a downlink SCHC
              Fragmentation Message (with FPort == FPortDown) that is not a
              SCHC ACK REQ: it REQ; this indicates that the SCHC gateway has received
              the SCHC ACK message.</t> message.</t></aside>
            </section>
          </section>
          <section anchor="class-b-or-class-c-devices" title="Class numbered="true" toc="default">
            <name>Class B or Class C devices"> Devices</name>
            <t>Class B devices can receive in scheduled RX slots or in RX
            slots following the transmission of an uplink. Class C devices are
            almost in constant reception.</t>

<t>RECOMMENDED
            <t><bcp14>RECOMMENDED</bcp14> retransmission timer value:</t>

<t><list style="symbols">
  <t>Class values are:</t>

<dl>

<dt>Class B: 3
</dt>
<dd>3 times the ping slot periodicity.</t>
  <t>Class periodicity.
</dd>

<dt>Class C: 30 seconds.</t>
</list></t>
</dt>
<dd>30 seconds.
</dd>

</dl>

            <t>The RECOMMENDED <bcp14>RECOMMENDED</bcp14> inactivity timer value is 12
            hours for both Class B and Class C devices.</t>
          </section>
        </section>
      </section>
      <section anchor="schc-fragment-format" title="SCHC numbered="true" toc="default">
        <name>SCHC Fragment Format"> Format</name>
        <section anchor="all-0-schc-fragment" title="All-0 numbered="true" toc="default">
          <name>All-0 SCHC fragment">

<t><spanx style="strong">Uplink fragmentation (Ack-On-Error)</spanx>:</t> Fragment</name>
          <t><strong>Uplink Fragmentation (Ack-on-Error)</strong>:</t>
          <t>All-0 is distinguishable from a SCHC ACK REQ REQ, as <xref target="RFC8724"></xref>
          target="RFC8724" format="default"/> states <spanx style="emph">This "This condition is also
          met if the SCHC Fragment Header is a multiple of L2 Words</spanx>; this Words", the
          following condition being met: SCHC header is 2 bytes.</t>

<t><spanx style="strong">Downlink
          <t><strong>Downlink fragmentation (Ack-always)</spanx>:</t> (ACK-Always)</strong>:</t>
          <t>As per <xref target="RFC8724"></xref> the target="RFC8724" format="default"/>, SCHC All-1 MUST
          <bcp14>MUST</bcp14> contain the last tile, implementation must and implementations
          <bcp14>MUST</bcp14> ensure that SCHC All-0 message Payload will be
          at least the size of an L2 Word.</t>
        </section>
        <section anchor="all-1-schc-fragment" title="All-1 numbered="true" toc="default">
          <name>All-1 SCHC fragment"> Fragment</name>
          <t>All-1 is distinguishable from a SCHC Sender-Abort Sender-Abort, as <xref target="RFC8724"></xref>
          target="RFC8724" format="default"/> states <spanx style="emph">This "This condition is met
          if the RCS is present and is at least the size of an L2 Word</spanx>;
this Word",
          the following condition being met: RCS is 4 bytes.</t>
        </section>
        <section anchor="delay-after-each-lorawan-frame-to-respect-local-regulation" title="Delay numbered="true" toc="default">
          <name>Delay after each Each LoRaWAN frame Frame to respect local regulation"> Respect Local Regulation</name>
          <t>This profile does not define a delay to be added after each
          LoRaWAN frame, frame; local regulation compliance is expected to be
          enforced by the LoRaWAN stack.</t>
        </section>

      </section>
    </section>
    <section anchor="security-considerations" title="Security Considerations"> numbered="true" toc="default">
      <name>Security Considerations</name>
      <t>This document is only providing parameters that are expected to be best
suited for LoRaWAN networks for <xref target="RFC8724"></xref>. target="RFC8724" format="default"/>. IID
security is discussed in <xref target="IID"/>. target="IID" format="default"/>. As such, this document does not contribute to
any new security issues beyond those already identified in
<xref target="RFC8724"></xref>.
Moreover, SCHC data (LoRaWAN payload) are protected at the LoRaWAN level by an AES-128
encryption with a session key shared by the device and the SCHC gateway. These session keys are renewed at each
LoRaWAN session (ie: each join or rejoin to the LoRaWAN network)</t>

</section>
<section anchor="iana-considerations" title="IANA Considerations">

<t>This document has no IANA actions.</t>

</section>
<section numbered="false" anchor="acknowledgements" title="Acknowledgements">

<t>Thanks to all those listed in the Contributors section for the excellent text,
insightful discussions, reviews and suggestions, and also to (in
alphabetical order) Dominique Barthel, Arunprabhu Kandasamy, Rodrigo Muñoz,
Alexander Pelov, Pascal Thubert, Laurent Toutain for useful design
considerations, reviews and comments.</t>

</section>
<section numbered="false" anchor="contributors" title="Contributors">

<t>Contributors ordered by family name.</t>

<t>Vincent Audebert<vspace />
EDF R&amp;D<vspace />
Email: vincent.audebert@edf.fr</t>

<t>Julien Catalano<vspace />
Kerlink<vspace />
Email: j.catalano@kerlink.fr</t>

<t>Michael Coracin<vspace />
Semtech<vspace />
Email: mcoracin@semtech.com</t>

<t>Marc Le Gourrierec<vspace />
Sagemcom<vspace />
Email: marc.legourrierec@sagemcom.com</t>

<t>Nicolas Sornin<vspace />
Semtech<vspace />
Email: nsornin@semtech.com</t>

<t>Alper Yegin<vspace />
Actility<vspace />
Email: alper.yegin@actility.com</t>

</section>

  </middle>

  <back>

    <references title='Normative References'>

<reference  anchor="RFC2119" target='https://www.rfc-editor.org/info/rfc2119'>
<front>
<title>Key words for use in RFCs to Indicate Requirement Levels</title>
<author initials='S.' surname='Bradner' fullname='S. Bradner'><organization /></author>
<date year='1997' month='March' />
<abstract><t>In many standards track documents several words are used to signify the requirements in the specification.  These words are often capitalized. This document defines these words as they should be interpreted in IETF documents.  This document specifies an Internet Best Current Practices for the Internet Community, and requests discussion and suggestions for improvements.</t></abstract>
</front>
<seriesInfo name='BCP' value='14'/>
<seriesInfo name='RFC' value='2119'/>
<seriesInfo name='DOI' value='10.17487/RFC2119'/>
</reference>

<reference  anchor="RFC8174" target='https://www.rfc-editor.org/info/rfc8174'>
<front>
<title>Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words</title>
<author initials='B.' surname='Leiba' fullname='B. Leiba'><organization /></author>
<date year='2017' month='May' />
<abstract><t>RFC 2119 specifies common key words that may be used in protocol  specifications.  This document aims to reduce the ambiguity by clarifying that only UPPERCASE usage of the key words have the  defined special meanings.</t></abstract>
</front>
<seriesInfo name='BCP' value='14'/>
<seriesInfo name='RFC' value='8174'/>
<seriesInfo name='DOI' value='10.17487/RFC8174'/>
</reference>

<reference  anchor="RFC4291" target='https://www.rfc-editor.org/info/rfc4291'>
<front>
<title>IP Version 6 Addressing Architecture</title>
<author initials='R.' surname='Hinden' fullname='R. Hinden'><organization /></author>
<author initials='S.' surname='Deering' fullname='S. Deering'><organization /></author>
<date year='2006' month='February' />
<abstract><t>This specification defines the addressing architecture of the IP Version 6 (IPv6) protocol.  The document includes the IPv6 addressing model, text representations of IPv6 addresses, definition of IPv6 unicast addresses, anycast addresses, and multicast addresses, and an IPv6 node's required addresses.</t><t>This document obsoletes RFC 3513, &quot;IP Version 6 Addressing Architecture&quot;.   [STANDARDS-TRACK]</t></abstract>
</front>
<seriesInfo name='RFC' value='4291'/>
<seriesInfo name='DOI' value='10.17487/RFC4291'/>
</reference>

<reference  anchor="RFC4493" target='https://www.rfc-editor.org/info/rfc4493'>
<front>
<title>The AES-CMAC Algorithm</title>
<author initials='JH.' surname='Song' fullname='JH. Song'><organization /></author>
<author initials='R.' surname='Poovendran' fullname='R. Poovendran'><organization /></author>
<author initials='J.' surname='Lee' fullname='J. Lee'><organization /></author>
<author initials='T.' surname='Iwata' fullname='T. Iwata'><organization /></author>
<date year='2006' month='June' />
<abstract><t>The National Institute of Standards and Technology (NIST) has recently specified the Cipher-based Message Authentication Code (CMAC), which is equivalent to the One-Key CBC MAC1 (OMAC1) submitted by Iwata and Kurosawa.  This memo specifies an authentication algorithm based on CMAC with the 128-bit Advanced Encryption Standard (AES). This new authentication algorithm is named AES-CMAC. The purpose of this document is to make the AES-CMAC algorithm conveniently available to the Internet Community.  This memo provides information for the Internet community.</t></abstract>
</front>
<seriesInfo name='RFC' value='4493'/>
<seriesInfo name='DOI' value='10.17487/RFC4493'/>
</reference>

<reference  anchor="RFC8724" target='https://www.rfc-editor.org/info/rfc8724'>
<front>
<title>SCHC: Generic Framework for Static Context Header Compression and Fragmentation</title>
<author initials='A.' surname='Minaburo' fullname='A. Minaburo'><organization /></author>
<author initials='L.' surname='Toutain' fullname='L. Toutain'><organization /></author>
<author initials='C.' surname='Gomez' fullname='C. Gomez'><organization /></author>
<author initials='D.' surname='Barthel' fullname='D. Barthel'><organization /></author>
<author initials='JC.' surname='Zúñiga' fullname='JC. Zúñiga'><organization /></author>
<date year='2020' month='April' />
<abstract><t>This document defines the Static Context Header Compression and fragmentation (SCHC) framework, which provides both a header compression mechanism and an optional fragmentation mechanism. SCHC has been designed with Low-Power Wide Area Networks (LPWANs) in mind.</t><t>SCHC compression is based on a common static context stored both in the LPWAN device and in the network infrastructure side. This document defines a generic header compression mechanism and its application to compress IPv6/UDP headers.</t><t>This document also specifies an optional fragmentation and reassembly mechanism. It can be used to support the IPv6 MTU requirement over the LPWAN technologies. Fragmentation is needed for IPv6 datagrams that, after SCHC compression or when such compression was not possible, still exceed the Layer 2 maximum payload size.</t><t>The SCHC header compression and fragmentation mechanisms are independent of the specific LPWAN technology over which they are used. This document defines generic functionalities and offers flexibility with regard to parameter settings and mechanism choices. This document standardizes the exchange over the LPWAN between two SCHC entities. Settings and choices specific to a technology or a product are expected to be grouped into profiles, which are specified in other documents. Data models for the context and profiles are out of scope.</t></abstract>
</front>
<seriesInfo name='RFC' value='8724'/>
<seriesInfo name='DOI' value='10.17487/RFC8724'/>
</reference>

<reference anchor="lora-alliance-spec" target="https://lora-alliance.org/resource_hub/lorawan-104-specification-package/">
  <front>
    <title>LoRaWAN Specification Version V1.0.4</title>
    <author initials="L." surname="Alliance" fullname="LoRa Alliance">
      <organization></organization>
    </author>
    <date />
  </front>
</reference>

    </references>

    <references title='Informative References'>

<reference  anchor="RFC8064" target='https://www.rfc-editor.org/info/rfc8064'>
<front>
<title>Recommendation on Stable IPv6 Interface Identifiers</title>
<author initials='F.' surname='Gont' fullname='F. Gont'><organization /></author>
<author initials='A.' surname='Cooper' fullname='A. Cooper'><organization /></author>
<author initials='D.' surname='Thaler' fullname='D. Thaler'><organization /></author>
<author initials='W.' surname='Liu' fullname='W. Liu'><organization /></author>
<date year='2017' month='February' />
<abstract><t>This document changes the recommended default Interface Identifier (IID) generation scheme for cases where Stateless Address Autoconfiguration (SLAAC) is used to generate a stable IPv6 address. It recommends using the mechanism specified in RFC 7217 in such cases, and recommends against embedding stable link-layer addresses in IPv6 IIDs.  It formally updates RFC 2464, RFC 2467, RFC 2470, RFC 2491, RFC 2492, RFC 2497, RFC 2590, RFC 3146, RFC 3572, RFC 4291, RFC 4338, RFC 4391, RFC 5072, and RFC 5121.  This document does not change any existing recommendations concerning the use of temporary addresses as specified in RFC 4941.</t></abstract>
</front>
<seriesInfo name='RFC' value='8064'/>
<seriesInfo name='DOI' value='10.17487/RFC8064'/>
</reference>

<reference  anchor="RFC8065" target='https://www.rfc-editor.org/info/rfc8065'>
<front>
<title>Privacy Considerations for IPv6 Adaptation-Layer Mechanisms</title>
<author initials='D.' surname='Thaler' fullname='D. Thaler'><organization /></author>
<date year='2017' month='February' />
<abstract><t>This document discusses how a number of privacy threats apply to technologies designed for IPv6 over various link-layer protocols, and it provides advice to protocol designers on how to address such threats in adaptation-layer specifications for IPv6 over such links.</t></abstract>
</front>
<seriesInfo name='RFC' value='8065'/>
<seriesInfo name='DOI' value='10.17487/RFC8065'/>
</reference>

<reference  anchor="RFC8376" target='https://www.rfc-editor.org/info/rfc8376'>
<front>
<title>Low-Power Wide Area Network (LPWAN) Overview</title>
<author initials='S.' surname='Farrell' fullname='S. Farrell' role='editor'><organization /></author>
<date year='2018' month='May' />
<abstract><t>Low-Power Wide Area Networks (LPWANs) are wireless technologies with characteristics such as large coverage areas, low bandwidth, possibly very small packet and application-layer issues beyond those already identified in
<xref target="RFC8724" format="default"/>.
Moreover, SCHC data sizes, and long battery life operation.  This memo is an informational overview of (LoRaWAN payload) are protected at the set of LPWAN technologies being considered in LoRaWAN level by an AES-128
encryption with a session key shared by the IETF device and of the gaps that exist between the needs of those technologies and SCHC gateway. These session keys are renewed at each
LoRaWAN session (i.e., each join or rejoin to the goal of running IP in LPWANs.</t></abstract> LoRaWAN network).</t>
    </section>
    <section anchor="iana-considerations" numbered="true" toc="default">
      <name>IANA Considerations</name>
      <t>This document has no IANA actions.</t>
    </section>

  </middle>
  <back>
    <references>
      <name>References</name>
      <references>
        <name>Normative References</name>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8174.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.4291.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.4493.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8724.xml"/>

        <reference anchor="LORAWAN-SPEC" target="https://lora-alliance.org/resource_hub/lorawan-104-specification-package/">
          <front>
            <title>LoRaWAN 1.0.4 Specification Package</title>
            <author>
              <organization>LoRa Alliance</organization>
            </author>
            <date/>
          </front>
<seriesInfo name='RFC' value='8376'/>
<seriesInfo name='DOI' value='10.17487/RFC8376'/>
        </reference>
      </references>
      <references>
        <name>Informative References</name>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8064.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8065.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8376.xml"/>

        <reference anchor="lora-alliance-remote-multicast-set" target="https://lora-alliance.org/sites/default/files/2018-09/remote_multicast_setup_v1.0.0.pdf"> anchor="LORAWAN-REMOTE-MULTICAST-SET" target="https://lora-alliance.org/resource_hub/lorawan-remote-multicast-setup-specification-v1-0-0/">
          <front>
            <title>LoRaWAN Remote Multicast Setup Specification Version 1.0.0</title>
    <author initials="L." surname="Alliance" fullname="LoRa Alliance">
      <organization></organization> v1.0.0</title>
            <author>
              <organization>LoRa Alliance</organization>
            </author>
    <date />
            <date/>
          </front>
        </reference>

      </references>

    </references>
    <section anchor="examples" title="Examples"> numbered="true" toc="default">
      <name>Examples</name>
      <t>In the following examples “applicative data” examples, "applicative data" refers to the IPv6 payload
      sent by the application to the SCHC layer.</t>
      <section anchor="uplink-compression-example-no-fragmentation" title="Uplink numbered="true" toc="default">
        <name>Uplink - Compression example Example - No fragmentation"> Fragmentation</name>
        <t>This example represents an applicative data going through SCHC over LoRaWAN,
        LoRaWAN; no fragmentation required</t> required.</t>
        <t>An applicative data of 78 bytes is passed to the SCHC compression
        layer. Rule 1 is used by the SCHC C/D layer, allowing to compress it
        to 40 bytes and 5 bits: 1 byte RuleID, 21 bits residue + 37 bytes
        payload.</t>

        <figure title="Uplink example: SCHC Message" anchor="Fig-example-uplink-no-fragmentation-payload-schc-message"><artwork><![CDATA[ anchor="Fig-example-uplink-no-fragmentation-payload-schc-message">
          <name>Uplink Example: SCHC Message</name>
          <artwork name="" type="" align="left" alt=""><![CDATA[
| RuleID | Compression residue |  Payload  | Padding=b'000 |
+ ------ + ------------------- + --------- + ------------- +
|   1    |       21 bits       |  37 bytes |    3 bits     |
]]></artwork></figure>
]]></artwork>
        </figure>
        <t>The current LoRaWAN MTU is 51 bytes, although 2 bytes 2-byte FOpts are
        used by the LoRaWAN protocol: 49 bytes are available for SCHC payload; no
        need for fragmentation. The payload will be transmitted through FPort
        = 1.</t>

        <figure title="Uplink example: LoRaWAN packet" anchor="Fig-example-uplink-no-fragmentation-compression"><artwork><![CDATA[ anchor="Fig-example-uplink-no-fragmentation-compression">
          <name>Uplink Example: LoRaWAN Packet</name>
          <artwork name="" type="" align="left" alt=""><![CDATA[
| LoRaWAN Header            | LoRaWAN payload (40 bytes)              |
+ ------------------------- + --------------------------------------- +
|      |  FOpts  | RuleID=1 | Compression | Payload   | Padding=b'000 |
|      |         |          | residue     |           |               |
+ ---- + ------- + -------- + ----------- + --------- + ------------- +
| XXXX | 2 bytes | 1 byte   | 21 bits     |  37 bytes |    3 bits     |
]]></artwork></figure>
]]></artwork>
        </figure>
      </section>
      <section anchor="uplink-compression-and-fragmentation-example" title="Uplink numbered="true" toc="default">
        <name>Uplink - Compression and fragmentation example"> Fragmentation Example</name>
        <t>This example represents an applicative data going through SCHC, with
fragmentation.</t>
        <t>An applicative data of 300 bytes is passed to the SCHC compression layer. Rule 1
is used by the SCHC C/D layer,  allowing to compress it to 282 bytes and 5 bits: 1 byte
RuleID, 21 bits residue + 279 bytes payload.</t>
        <figure title="Uplink example: SCHC Message" anchor="Fig-example-uplink-fragmentation-schc-message"><artwork><![CDATA[ anchor="Fig-example-uplink-fragmentation-schc-message">
          <name>Uplink Example: SCHC Message</name>
          <artwork name="" type="" align="left" alt=""><![CDATA[
| RuleID | Compression residue |  Payload  |
+ ------ + ------------------- + --------- +
|   1    |       21 bits       | 279 bytes |
]]></artwork></figure>
]]></artwork>
        </figure>
        <t>The current LoRaWAN MTU is 11 bytes, 0 bytes bytes; 0-byte FOpts are used by
        the LoRaWAN protocol: 11 bytes are available for SCHC payload + 1 byte
        FPort field.  The SCHC header is 2 bytes (including FPort) FPort), so 1 tile is
        sent in the first fragment.</t>
        <figure title="Uplink example: anchor="Fig-example-uplink-fragmentation-lorawan-packet-1">
          <name>Uplink Example: LoRaWAN packet 1" anchor="Fig-example-uplink-fragmentation-lorawan-packet-1"><artwork><![CDATA[ Packet 1</name>
          <artwork name="" type="" align="left" alt=""><![CDATA[
| LoRaWAN Header             | LoRaWAN payload (11 bytes) |
+ -------------------------- + -------------------------- +
|                | RuleID=20 |   W   |  FCN   |  1 tile   |
+ -------------- + --------- + ----- + ------ + --------- +
|       XXXX     | 1 byte    | 0   0 |   62   | 10 bytes  |
]]></artwork></figure>
]]></artwork>
        </figure>
        <t>The tile content is described in <xref target="Fig-example-uplink-fragmentation-lorawan-packet-1-tile-content" format="default"/>
        </t>
        <figure title="Uplink example: LoRaWAN packet 1 - anchor="Fig-example-uplink-fragmentation-lorawan-packet-1-tile-content">
          <name>Uplink Example: First Tile content" anchor="Fig-example-uplink-fragmentation-lorawan-packet-1-tile-content"><artwork><![CDATA[ Content</name>
          <artwork name="" type="" align="left" alt=""><![CDATA[
Content of the tile is:
| RuleID | Compression residue |  Payload          |
+ ------ + ------------------- + ----------------- +
|   1    |       21 bits       |  6 bytes + 3 bits |
]]></artwork></figure>
]]></artwork>
        </figure>
        <t>Next transmission MTU is 11 bytes, although 2 bytes 2-byte FOpts are used
        by the LoRaWAN protocol: 9 bytes are available for SCHC payload + 1
        byte FPort field, a tile does not fit inside so the LoRaWAN stack will
        send only FOpts.</t>
        <t>Next transmission MTU is 242 bytes, 4 bytes 4-byte FOpts. 23 tiles are transmitted:</t>
        <figure title="Uplink example: anchor="Fig-example-uplink-fragmentation-lorawan-packet-2">
          <name>Uplink Example: LoRaWAN packet 2" anchor="Fig-example-uplink-fragmentation-lorawan-packet-2"><artwork><![CDATA[ Packet 2</name>
          <artwork name="" type="" align="left" alt=""><![CDATA[
| LoRaWAN Header                        | LoRaWAN payload (231 bytes) |
+ --------------------------------------+ --------------------------- +
|                |  FOpts  | RuleID=20  |   W   |  FCN  |  23 tiles   |
+ -------------- + ------- + ---------- + ----- + ----- + ----------- +
|       XXXX     | 4 bytes |  1 byte    | 0   0 |   61  | 230 bytes   |
]]></artwork></figure>
]]></artwork>
        </figure>
        <t>Next transmission MTU is 242 bytes, no FOpts. All 5 remaining tiles are
transmitted, the last tile is only 2 bytes + 5 bits. Padding is added for
the remaining 3 bits.</t>
        <figure title="Uplink example: anchor="Fig-example-uplink-fragmentation-lorawan-packet-3">
          <name>Uplink Example: LoRaWAN packet 3" anchor="Fig-example-uplink-fragmentation-lorawan-packet-3"><artwork><![CDATA[ Packet 3</name>
          <artwork name="" type="" align="left" alt=""><![CDATA[
| LoRaWAN Header    | LoRaWAN payload (44 bytes)                      |
+ ---- + ---------- + ----------------------------------------------- +
|      | RuleID=20  |   W   |  FCN  |    5 tiles      | Padding=b'000 |
+ ---- + ---------- + ----- + ----- + --------------- + ------------- +
| XXXX | 1 byte     | 0   0 |  38   | 42 bytes+5 bits |    3 bits     |
]]></artwork></figure>
]]></artwork>
        </figure>
        <t>Then All-1 message can be transmitted:</t>
        <figure title="Uplink example: anchor="Fig-example-uplink-fragmentation-lorawan-packet-4">
          <name>Uplink Example: LoRaWAN packet Packet 4 - All-1 SCHC message" anchor="Fig-example-uplink-fragmentation-lorawan-packet-4"><artwork><![CDATA[ Message</name>
          <artwork name="" type="" align="left" alt=""><![CDATA[
| LoRaWAN Header    | LoRaWAN payload (44 bytes) |
+ ---- + -----------+ -------------------------- +
|      | RuleID=20  |   W   |  FCN  |     RCS    |
+ ---- + ---------- + ----- + ----- + ---------- +
| XXXX | 1 byte     | 0   0 |   63  |  4 bytes   |
]]></artwork></figure>
]]></artwork>
        </figure>
        <t>All packets have been received by the SCHC gateway, computed RCS is
correct so the following ACK is sent to the device by the SCHC receiver:</t>
        <figure title="Uplink example: anchor="Fig-example-uplink-fragmentation-lorawan-packet-5">
          <name>Uplink Example: LoRaWAN packet Packet 5 - SCHC ACK" anchor="Fig-example-uplink-fragmentation-lorawan-packet-5"><artwork><![CDATA[ ACK</name>
          <artwork name="" type="" align="left" alt=""><![CDATA[
| LoRaWAN Header             | LoRaWAN payload     |
+ -------------- + --------- + ------------------- +
|                | RuleID=20 |   W   | C | Padding |
+ -------------- + --------- + ----- + - + ------- +
|       XXXX     | 1 byte    | 0   0 | 1 | 5 bits  |
]]></artwork></figure>
]]></artwork>
        </figure>
      </section>
      <section anchor="downlink" title="Downlink"> numbered="true" toc="default">
        <name>Downlink</name>
        <t>An applicative data of 155 bytes is passed to the SCHC compression layer. Rule 1
is used by the SCHC C/D layer, allowing to compress it to 130 bytes and 5 bits: 1 byte
RuleID, 21 bits residue + 127 bytes payload.</t>
        <figure title="Downlink example: SCHC Message" anchor="Fig-example-downlink-fragmentation-schc-message"><artwork><![CDATA[ anchor="Fig-example-downlink-fragmentation-schc-message">
          <name>Downlink Example: SCHC Message</name>
          <artwork name="" type="" align="left" alt=""><![CDATA[
| RuleID | Compression residue |  Payload  |
+ ------ + ------------------- + --------- +
|   1    |       21 bits       | 127 bytes |
]]></artwork></figure>
]]></artwork>
        </figure>
        <t>The current LoRaWAN MTU is 51 bytes, bytes; no FOpts are used by the
        LoRaWAN protocol: 51 bytes are available for SCHC payload + FPort field =&gt; it
        field; the applicative data has to be fragmented.</t>

        <figure title="Downlink example: anchor="Fig-example-downlink-fragmentation-lorawan-packet-1">
          <name>Downlink Example: LoRaWAN packet Packet 1 - SCHC Fragment 1" anchor="Fig-example-downlink-fragmentation-lorawan-packet-1"><artwork><![CDATA[ 1</name>
          <artwork name="" type="" align="left" alt=""><![CDATA[
| LoRaWAN Header    | LoRaWAN payload (51 bytes)             |
+ ---- + ---------- + -------------------------------------- +
|      | RuleID=21  |  W = 0 | FCN = 0 |       1 tile        |
+ ---- + ---------- + ------ + ------- + ------------------- +
| XXXX | 1 byte     |  1 bit |  1 bit  | 50 bytes and 6 bits |
]]></artwork></figure>

<t>Content of the
]]></artwork>
        </figure>
        <t>The tile is:</t> content is described in <xref target="Fig-example-downlink-fragmentation-lorawan-packet-1-tile-content" format="default"/>
        </t>

        <figure title="Downlink example: LoRaWAN packet 1: anchor="Fig-example-downlink-fragmentation-lorawan-packet-1-tile-content">
          <name>Downlink Example: First Tile content" anchor="Fig-example-downlink-fragmentation-lorawan-packet-1-tile-content"><artwork><![CDATA[ Content</name>
          <artwork name="" type="" align="left" alt=""><![CDATA[
| RuleID | Compression residue |        Payload     |
+ ------ + ------------------- + ------------------ +
|   1    |       21 bits       | 48 bytes and 1 bit |
]]></artwork></figure>
]]></artwork>
        </figure>
        <t>The receiver answers with a SCHC ACK:</t>
        <figure title="Downlink example: anchor="Fig-example-downlink-fragmentation-lorawan-packet-2">
          <name>Downlink Example: LoRaWAN packet Packet 2 -  SCHC ACK" anchor="Fig-example-downlink-fragmentation-lorawan-packet-2"><artwork><![CDATA[ ACK</name>
          <artwork name="" type="" align="left" alt=""><![CDATA[
| LoRaWAN Header   | LoRaWAN payload                  |
+ ---- + --------- + -------------------------------- +
|      | RuleID=21 | W = 0 | C = 1 | Padding=b'000000 |
+ ---- + --------- + ----- + ----- + ---------------- +
| XXXX |  1 byte   | 1 bit | 1 bit |     6 bits       |
]]></artwork></figure>
]]></artwork>
        </figure>
        <t>The second downlink is sent, two FOpts:</t>
        <figure title="Downlink example: anchor="Fig-example-downlink-fragmentation-lorawan-packet-3">
          <name>Downlink Example: LoRaWAN packet Packet 3 - SCHC Fragment 2" anchor="Fig-example-downlink-fragmentation-lorawan-packet-3"><artwork><![CDATA[ 2</name>
          <artwork name="" type="" align="left" alt=""><![CDATA[
| LoRaWAN Header              |  LoRaWAN payload (49 bytes)           |
+ --------------------------- + ------------------------------------- +
|      |  FOpts  | RuleID=21  | W = 1 | FCN = 0 |        1 tile       |
+ ---- + ------- + ---------- + ----- + ------- + ------------------- +
| XXXX | 2 bytes | 1 byte     | 1 bit |  1 bit  | 48 bytes and 6 bits |
]]></artwork></figure>
]]></artwork>
        </figure>
        <t>The receiver answers with an a SCHC ACK:</t>
        <figure title="Downlink example: anchor="Fig-example-downlink-fragmentation-lorawan-packet-4">
          <name>Downlink Example: LoRaWAN packet Packet 4 -  SCHC ACK" anchor="Fig-example-downlink-fragmentation-lorawan-packet-4"><artwork><![CDATA[ ACK</name>
          <artwork name="" type="" align="left" alt=""><![CDATA[
| LoRaWAN Header   | LoRaWAN payload                  |
+ ---- + --------- + -------------------------------- +
|      | RuleID=21 | W = 1 | C = 1 | Padding=b'000000 |
+ ---- + --------- + ----- + ----- + ---------------- +
| XXXX |  1 byte   | 1 bit | 1 bit |     6 bits       |
]]></artwork></figure>
]]></artwork>
        </figure>
        <t>The last downlink is sent, no FOpts:</t>
        <figure title="Downlink example: anchor="Fig-example-downlink-fragmentation-lorawan-packet-5">
          <name>Downlink Example: LoRaWAN packet Packet 5 - All-1 SCHC message" anchor="Fig-example-downlink-fragmentation-lorawan-packet-5"><artwork><![CDATA[ Message</name>
          <artwork name="" type="" align="left" alt=""><![CDATA[
| LoRaWAN Header | LoRaWAN payload (37 bytes)                         |
+ ---- + ------- + --------------------------------------------------- -------------------------------------------------- +
|      | RuleID  |   W   |  FCN  |   RCS   |      1 tile    | Padding |
|      |   21    |   0   |   1   |         |                | b'00000 |
+ ---- + ------- + ----- + ----- + ------- + --------------- -------------- + ------- +
| XXXX | 1 byte  | 1 bit | 1 bit | 4 bytes | 31 bytes+1 bits bit | 5 bits  |
]]></artwork></figure>
]]></artwork>
        </figure>
        <t>The receiver answers to the sender with an a SCHC ACK:</t>
        <figure title="Downlink example: anchor="Fig-example-downlink-fragmentation-lorawan-packet-6">
          <name>Downlink Example: LoRaWAN packet Packet 6 - SCHC ACK" anchor="Fig-example-downlink-fragmentation-lorawan-packet-6"><artwork><![CDATA[ ACK</name>
          <artwork name="" type="" align="left" alt=""><![CDATA[
| LoRaWAN Header   | LoRaWAN payload                  |
+ ---- + --------- + -------------------------------- +
|      | RuleID=21 | W = 0 | C = 1 | Padding=b'000000 |
+ ---- + --------- + ----- + ----- + ---------------- +
| XXXX |  1 byte   | 1 bit | 1 bit |     6 bits       |
]]></artwork></figure>
]]></artwork>
        </figure>
      </section>
    </section>

   <section numbered="false" anchor="acknowledgements" toc="default">
      <name>Acknowledgements</name>
      <t>Thanks to all those listed in the Contributors Section for the
      excellent text, insightful discussions, reviews, and suggestions, and
      also to (in alphabetical order) <contact fullname="Dominique Barthel"/>,
      <contact fullname="Arunprabhu Kandasamy"/>, <contact fullname="Rodrigo
      Munoz"/>, <contact fullname="Alexander Pelov"/>, <contact
      fullname="Pascal Thubert"/>, and <contact fullname="Laurent Toutain"/> for
      useful design considerations, reviews, and comments.</t>
      <t>LoRaWAN is a registered trademark of the LoRa Alliance.</t>
   </section>

    <section numbered="false" anchor="contributors" toc="default">
      <name>Contributors</name>
      <t>Contributors ordered by family name.</t>

<contact fullname="Vincent Audebert">
  <organization>EDF R&amp;D</organization>
  <address>
    <postal>
     <city></city>
     <country></country>
    </postal>
    <email>vincent.audebert@edf.fr</email>
  </address>
</contact>

<contact fullname="Julien Catalano">
  <organization>Kerlink</organization>
  <address>
    <postal>
     <city></city>
     <country></country>
    </postal>
    <email>j.catalano@kerlink.fr</email>
  </address>
</contact>

<contact fullname="Michael Coracin">
  <organization>Semtech</organization>
  <address>
    <postal>
     <city></city>
     <country></country>
    </postal>
    <email>mcoracin@semtech.com</email>
  </address>
</contact>

<contact fullname="Marc Le Gourrierec">
  <organization>Sagemcom</organization>
  <address>
    <postal>
     <city></city>
     <country></country>
    </postal>
    <email>marc.legourrierec@sagemcom.com</email>
  </address>
</contact>

<contact fullname="Nicolas Sornin">
  <organization>Chirp Foundation</organization>
  <address>
    <postal>
     <city></city>
     <country></country>
    </postal>
    <email>nicolas.sornin@chirpfoundation.org</email>
  </address>
</contact>

<contact fullname="Alper Yegin">
  <organization>Actility</organization>
  <address>
    <postal>
     <city></city>
     <country></country>
    </postal>
    <email>alper.yegin@actility.com</email>
  </address>
</contact>

    </section>

  </back>
</rfc>