< draft-ietf-lpwan-schc-over-lorawan-02.txt   draft-ietf-lpwan-schc-over-lorawan-03.txt >
lpwan Working Group O. Gimenez, Ed. lpwan Working Group O. Gimenez, Ed.
Internet-Draft Semtech Internet-Draft Semtech
Intended status: Informational I. Petrov, Ed. Intended status: Informational I. Petrov, Ed.
Expires: January 9, 2020 Acklio Expires: April 11, 2020 Acklio
July 08, 2019 J. Catalano
Kerlink
October 09, 2019
Static Context Header Compression (SCHC) over LoRaWAN Static Context Header Compression (SCHC) over LoRaWAN
draft-ietf-lpwan-schc-over-lorawan-02 draft-ietf-lpwan-schc-over-lorawan-03
Abstract Abstract
The Static Context Header Compression (SCHC) specification describes The Static Context Header Compression (SCHC) specification describes
generic header compression and fragmentation techniques for LPWAN generic header compression and fragmentation techniques for LPWAN
(Low Power Wide Area Networks) technologies. SCHC is a generic (Low Power Wide Area Networks) technologies. SCHC is a generic
mechanism designed for great flexibility, so that it can be adapted mechanism designed for great flexibility so that it can be adapted
for any of the LPWAN technologies. for any of the LPWAN technologies.
This document provides the adaptation of SCHC for use in LoRaWAN This document provides the adaptation of SCHC for use in LoRaWAN
networks, and provides elements such as efficient parameterization networks, and provides elements such as efficient parameterization
and modes of operation. This is called a profile. and modes of operation. This is called a profile.
Status of This Memo Status of This Memo
This Internet-Draft is submitted in full conformance with the This Internet-Draft is submitted in full conformance with the
provisions of BCP 78 and BCP 79. provisions of BCP 78 and BCP 79.
skipping to change at page 1, line 39 skipping to change at page 1, line 41
Internet-Drafts are working documents of the Internet Engineering Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF). Note that other groups may also distribute Task Force (IETF). Note that other groups may also distribute
working documents as Internet-Drafts. The list of current Internet- working documents as Internet-Drafts. The list of current Internet-
Drafts is at https://datatracker.ietf.org/drafts/current/. Drafts is at https://datatracker.ietf.org/drafts/current/.
Internet-Drafts are draft documents valid for a maximum of six months Internet-Drafts are draft documents valid for a maximum of six months
and may be updated, replaced, or obsoleted by other documents at any and may be updated, replaced, or obsoleted by other documents at any
time. It is inappropriate to use Internet-Drafts as reference time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress." material or to cite them other than as "work in progress."
This Internet-Draft will expire on January 9, 2020. This Internet-Draft will expire on April 11, 2020.
Copyright Notice Copyright Notice
Copyright (c) 2019 IETF Trust and the persons identified as the Copyright (c) 2019 IETF Trust and the persons identified as the
document authors. All rights reserved. document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents Provisions Relating to IETF Documents
(https://trustee.ietf.org/license-info) in effect on the date of (https://trustee.ietf.org/license-info) in effect on the date of
publication of this document. Please review these documents publication of this document. Please review these documents
skipping to change at page 2, line 24 skipping to change at page 2, line 26
3. Static Context Header Compression Overview . . . . . . . . . 3 3. Static Context Header Compression Overview . . . . . . . . . 3
4. LoRaWAN Architecture . . . . . . . . . . . . . . . . . . . . 5 4. LoRaWAN Architecture . . . . . . . . . . . . . . . . . . . . 5
4.1. End-Device classes (A, B, C) and interactions . . . . . . 6 4.1. End-Device classes (A, B, C) and interactions . . . . . . 6
4.2. End-Device addressing . . . . . . . . . . . . . . . . . . 7 4.2. End-Device addressing . . . . . . . . . . . . . . . . . . 7
4.3. General Message Types . . . . . . . . . . . . . . . . . . 7 4.3. General Message Types . . . . . . . . . . . . . . . . . . 7
4.4. LoRaWAN MAC Frames . . . . . . . . . . . . . . . . . . . 8 4.4. LoRaWAN MAC Frames . . . . . . . . . . . . . . . . . . . 8
5. SCHC-over-LoRaWAN . . . . . . . . . . . . . . . . . . . . . . 8 5. SCHC-over-LoRaWAN . . . . . . . . . . . . . . . . . . . . . . 8
5.1. LoRaWAN FPort . . . . . . . . . . . . . . . . . . . . . . 8 5.1. LoRaWAN FPort . . . . . . . . . . . . . . . . . . . . . . 8
5.2. Rule ID management . . . . . . . . . . . . . . . . . . . 9 5.2. Rule ID management . . . . . . . . . . . . . . . . . . . 9
5.3. IID computation . . . . . . . . . . . . . . . . . . . . . 9 5.3. IID computation . . . . . . . . . . . . . . . . . . . . . 9
5.4. Fragmentation . . . . . . . . . . . . . . . . . . . . . . 9 5.4. Padding . . . . . . . . . . . . . . . . . . . . . . . . . 10
5.5. DTag . . . . . . . . . . . . . . . . . . . . . . . . . . 9 5.5. Compression . . . . . . . . . . . . . . . . . . . . . . . 10
5.5.1. Uplink fragmentation: From device to SCHC gateway . . 10 5.6. Fragmentation . . . . . . . . . . . . . . . . . . . . . . 10
5.5.2. Downlink fragmentation: From SCHC gateway to device . 13 5.6.1. DTag . . . . . . . . . . . . . . . . . . . . . . . . 10
5.6.2. Uplink fragmentation: From device to SCHC gateway . . 10
5.6.3. Downlink fragmentation: From SCHC gateway to a device 13
6. Security considerations . . . . . . . . . . . . . . . . . . . 16 6. Security considerations . . . . . . . . . . . . . . . . . . . 16
Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . 17 Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . 17
Contributors . . . . . . . . . . . . . . . . . . . . . . . . . . 17 Contributors . . . . . . . . . . . . . . . . . . . . . . . . . . 17
9. References . . . . . . . . . . . . . . . . . . . . . . . . . 17 9. References . . . . . . . . . . . . . . . . . . . . . . . . . 17
9.1. Normative References . . . . . . . . . . . . . . . . . . 17 9.1. Normative References . . . . . . . . . . . . . . . . . . 17
9.2. Informative References . . . . . . . . . . . . . . . . . 18 9.2. Informative References . . . . . . . . . . . . . . . . . 18
Appendix A. Examples . . . . . . . . . . . . . . . . . . . . . . 18 Appendix A. Examples . . . . . . . . . . . . . . . . . . . . . . 18
A.1. Uplink - Compression example - No fragmentation . . . . . 18 A.1. Uplink - Compression example - No fragmentation . . . . . 18
A.2. Uplink - Compression and fragmentation example . . . . . 19 A.2. Uplink - Compression and fragmentation example . . . . . 19
A.3. Downlink . . . . . . . . . . . . . . . . . . . . . . . . 20 A.3. Downlink . . . . . . . . . . . . . . . . . . . . . . . . 20
skipping to change at page 3, line 16 skipping to change at page 3, line 20
communicate with other Internet networks. However, for efficient communicate with other Internet networks. However, for efficient
performance, some parameters and modes of operation need to be set performance, some parameters and modes of operation need to be set
appropriately for each of the LPWAN technologies. appropriately for each of the LPWAN technologies.
This document describes the efficient parameters and modes of This document describes the efficient parameters and modes of
operation when SCHC is used over LoRaWAN networks. operation when SCHC is used over LoRaWAN networks.
2. Terminology 2. Terminology
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and
document are to be interpreted as described in [RFC2119]. "OPTIONAL" in this document are to be interpreted as described in BCP
14 [RFC2119] [RFC8174] when, and only when, they appear in all
capitals, as shown here.
This section defines the terminology and acronyms used in this This section defines the terminology and acronyms used in this
document. For all other definitions, please look up the SCHC document. For all other definitions, please look up the SCHC
specification [I-D.ietf-lpwan-ipv6-static-context-hc]. specification [I-D.ietf-lpwan-ipv6-static-context-hc].
o DevEUI: an IEEE EUI-64 identifier used to identify the end-device o DevEUI: an IEEE EUI-64 identifier used to identify the end-device
during the procedure while joining the network (Join Procedure) during the procedure while joining the network (Join Procedure)
o DevAddr: a 32-bit non-unique identifier assigned to a end-device o DevAddr: a 32-bit non-unique identifier assigned to an end-device
statically or dynamically after a Join Procedure (depending on the statically or dynamically after a Join Procedure (depending on the
activation mode) activation mode)
o RCS: Reassembly Check Sequence. Used to verify the integrity of
the fragmentation-reassembly process
o TBD: all significant LoRaWAN-related terms. o TBD: all significant LoRaWAN-related terms.
3. Static Context Header Compression Overview 3. Static Context Header Compression Overview
This section contains a short overview of Static Context Header This section contains a short overview of Static Context Header
Compression (SCHC). For a detailed description, refer to the full Compression (SCHC). For a detailed description, refer to the full
specification [I-D.ietf-lpwan-ipv6-static-context-hc]. specification [I-D.ietf-lpwan-ipv6-static-context-hc].
Static Context Header Compression (SCHC) avoids context Static Context Header Compression (SCHC) avoids context
synchronization, based on the fact that the nature of data flows is synchronization, based on the fact that the nature of data flows is
highly predictable in LPWAN networks, some static contexts may be highly predictable in LPWAN networks, some static contexts may be
stored on the Device (Dev). The contexts must be stored in both stored on the Device (Dev). The context MUST be stored in both ends,
ends, and it can either be learned by a provisioning protocol or by and it can either be learned by a provisioning protocol or by out-of-
out-of-band means or it can be pre-provisioned, etc. The way the band means or it can be pre-provisioned, etc. The way the context is
context is learned on both sides is out of the scope of this learned on both sides is outside the scope of this document.
document.
Dev App Dev App
+----------------+ +----+ +----+ +----+ +----------------+ +----+ +----+ +----+
| App1 App2 App3 | |App1| |App2| |App3| | App1 App2 App3 | |App1| |App2| |App3|
| | | | | | | | | | | | | | | |
| UDP | |UDP | |UDP | |UDP | | UDP | |UDP | |UDP | |UDP |
| IPv6 | |IPv6| |IPv6| |IPv6| | IPv6 | |IPv6| |IPv6| |IPv6|
| | | | | | | | | | | | | | | |
|SCHC C/D and F/R| | | | | | | |SCHC C/D and F/R| | | | | | |
+--------+-------+ +----+ +----+ +----+ +--------+-------+ +----+ +----+ +----+
| +--+ +----+ +----+ +----+ . . . | +---+ +----+ +----+ +----+ . . .
+~ |RG| === |NGW | == |SCHC| == |SCHC|...... Internet .... +~ |RGW| === |NGW | == |SCHC| == |SCHC|...... Internet ....
+--+ +----+ |F/R | |C/D | +---+ +----+ |F/R | |C/D |
+----+ +----+ +----+ +----+
Figure 1: Architecture Figure 1: Architecture
Figure 1 represents the architecture for compression/decompression, Figure 1 represents the architecture for compression/decompression,
it is based on [RFC8376] terminology. The Device is sending it is based on [RFC8376] terminology. The Device is sending
applications flows using IPv6 or IPv6/UDP protocols. These flow applications flows using IPv6 or IPv6/UDP protocols. These flow
might be fragemented (SCHC F/R), and compressed by an Static Context might be compressed by an Static Context Header Compression
Header Compression Compressor/Decompressor (SCHC C/D) to reduce Compressor/Decompressor (SCHC C/D) to reduce headers size and
headers size. Resulting information is sent on a layer two (L2) fragmented (SCHC F/R). The resulting information is sent on a layer
frame to a LPWAN Radio Network (RG) which forwards the frame to a two (L2) frame to an LPWAN Radio Gateway (RGW) which forwards the
Network Gateway (NGW). The NGW sends the data to a SCHC F/R for frame to a Network Gateway (NGW). The NGW sends the data to a SCHC
defragmentation, if required, then C/D for decompression which shares F/R for defragmentation, if required, then C/D for decompression
the same rules with the device. The SCHC F/R and C/D can be located which shares the same rules with the device. The SCHC F/R and C/D
on the Network Gateway (NGW) or in another place as long as a tunnel can be located on the Network Gateway (NGW) or in another place as
is established between the NGW and the SCHC F/R, then SCHC F/R and long as a tunnel is established between the NGW and the SCHC F/R,
SCHC C/D. The SCHC C/D in both sides must share the same set of then SCHC F/R and SCHC C/D. The SCHC C/D in both sides MUST share
Rules. After decompression, the packet can be sent on the Internet the same set of rules. After decompression, the packet can be sent
to one or several LPWAN Application Servers (App). on the Internet to one or several LPWAN Application Servers (App).
The SCHC F/R and SCHC C/D process is bidirectional, so the same The SCHC F/R and SCHC C/D process is bidirectional, so the same
principles can be applied in the other direction. principles can be applied in the other direction.
In a LoRaWAN network, the RG is called a Gateway, the NGW is Network In a LoRaWAN network, the RG is called a Gateway, the NGW is Network
Server, and the SCHC C/D is an Application Server. It can be Server, and the SCHC C/D is an Application Server. It can be
provided by the Network Server or any third party software. Figure 1 provided by the Network Server or any third party software. Figure 1
can be map in LoRaWAN terminology to: can be mapped in LoRaWAN terminology to:
Dev App Dev App
+----------------+ +----+ +----+ +----+ +--------------+ +----+ +----+ +----+
| App1 App2 App3 | |App1| |App2| |App3| |App1 App2 App3| |App1| |App2| |App3|
| | | | | | | | | | | | | | | |
| UDP | |UDP | |UDP | |UDP | | UDP | |UDP | |UDP | |UDP |
| IPv6 | |IPv6| |IPv6| |IPv6| | IPv6 | |IPv6| |IPv6| |IPv6|
| | | | | | | | | | | | | | | |
|SCHC C/D and F/R| | | | | | | |SCHC C/D & F/R| | | | | | |
+--------+-------+ +----+ +----+ +----+ +-------+------+ +----+ +----+ +----+
| +-------+ +-------+ +----------------+ . . . | +-------+ +-------+ +-----------+ . . .
+~ |Gateway| === |Network| == |Application |...... Internet .... +~ |Gateway| === |Network| == |Application|..... Internet ....
+-------+ |server | |server F/R - C/D| +-------+ |server | |server |
+-------+ +----------------+ +-------+ | F/R - C/D |
+-----------+
Figure 2: Architecture Figure 2: SCHC Architecture mapped to LoRaWAN
4. LoRaWAN Architecture 4. LoRaWAN Architecture
An overview of LoRaWAN [lora-alliance-spec] protocol and architecture An overview of LoRaWAN [lora-alliance-spec] protocol and architecture
is described in [RFC8376]. Mapping between the LPWAN architecture is described in [RFC8376]. The mapping between the LPWAN
entities as described in [I-D.ietf-lpwan-ipv6-static-context-hc] and architecture entities as described in
the ones in [lora-alliance-spec] is as follows: [I-D.ietf-lpwan-ipv6-static-context-hc] and the ones in
[lora-alliance-spec] is as follows:
o Devices (Dev) are the end-devices or hosts (e.g. sensors, o Devices (Dev) are the end-devices or hosts (e.g. sensors,
actuators, etc.). There can be a very high density of devices per actuators, etc.). There can be a very high density of devices per
radio gateway (LoRaWAN gateway). This entity maps to the LoRaWAN radio gateway (LoRaWAN gateway). This entity maps to the LoRaWAN
End-Device. End-Device.
o The Radio Gateway (RGW), which is the end point of the constrained o The Radio Gateway (RGW), which is the endpoint of the constrained
link. This entity maps to the LoRaWAN Gateway. link. This entity maps to the LoRaWAN Gateway.
o The Network Gateway (NGW) is the interconnection node between the o The Network Gateway (NGW) is the interconnection node between the
Radio Gateway and the Internet. This entity maps to the LoRaWAN Radio Gateway and the Internet. This entity maps to the LoRaWAN
Network Server. Network Server.
o LPWAN-AAA Server, which controls the user authentication and the o LPWAN-AAA Server, which controls the user authentication and the
applications. This entity maps to the LoRaWAN Join Server. applications. This entity maps to the LoRaWAN Join Server.
o Application Server (App). The same terminology is used in LoRaWAN. o Application Server (App). The same terminology is used in LoRaWAN.
skipping to change at page 6, line 29 skipping to change at page 6, line 29
single IP hop, the ultimate end-point of the IP communication may be single IP hop, the ultimate end-point of the IP communication may be
an Internet node beyond the Application Server. In other words, the an Internet node beyond the Application Server. In other words, the
LoRaWAN Application Server (SCHC gateway) acts as the first hop IP LoRaWAN Application Server (SCHC gateway) acts as the first hop IP
router for the End-Device. The Application Server and Network Server router for the End-Device. The Application Server and Network Server
may be co-located, which effectively turns the Network/Application may be co-located, which effectively turns the Network/Application
Server into the first hop IP router. Server into the first hop IP router.
4.1. End-Device classes (A, B, C) and interactions 4.1. End-Device classes (A, B, C) and interactions
The LoRaWAN MAC layer supports 3 classes of end-devices named A, B The LoRaWAN MAC layer supports 3 classes of end-devices named A, B
and C. All end-devices implement the classA, some end-devices and C. All end-devices implement the Class A, some end-devices may
implement classA+B or class A+C. ClassB and classC are mutually implement Class B or Class C. Class B and Class C are mutually
exclusive. exclusive.
o *ClassA*: The classA is the simplest class of end-devices. The o Class A: The Class A is the simplest class of end-devices. The
end-device is allowed to transmit at any time, randomly selecting end-device is allowed to transmit at any time, randomly selecting
a communication channel. The network may reply with a downlink in a communication channel. The network may reply with a downlink in
one of the 2 receive windows immediately following the uplinks. one of the 2 receive windows immediately following the uplinks.
Therefore, the network cannot initiate a downlink, it has to wait Therefore, the network cannot initiate a downlink, it has to wait
for the next uplink from the end-device to get a downlink for the next uplink from the end-device to get a downlink
opportunity. The classA is the lowest power end-device class. opportunity. The Class A is the lowest power end-device class.
o *ClassB*: classB end-devices implement all the functionalities of o Class B: Class B end-devices implement all the functionalities of
classA end-devices, but also schedule periodic listen windows. Class A end-devices, but also schedule periodic listen windows.
Therefore, as opposed the classA end-devices, classB end-devices Therefore, opposed to the Class A end-devices, Class B end-devices
can receive downlink that are initiated by the network and not can receive downlinks that are initiated by the network and not
following an uplink. There is a trade-off between the periodicity following an uplink. There is a trade-off between the periodicity
of those scheduled classB listen windows and the power consumption of those scheduled Class B listen windows and the power
of the end-device. The lower the downlink latency, the higher the consumption of the end-device. The lower the downlink latency,
power consumption. the higher the power consumption.
o *ClassC*: classC end-devices implement all the functionalities of o Class C: Class C end-devices implement all the functionalities of
classA end-devices, but keep their receiver open whenever they are Class A end-devices, but keep their receiver open whenever they
not transmitting. ClassC end-devices can receive downlinks at any are not transmitting. Class C end-devices can receive downlinks
time at the expense of a higher power consumption. Battery at any time at the expense of a higher power consumption.
powered end-devices can only operate in classC for a limited Battery-powered end-devices can only operate in Class C for a
amount of time (for example for a firmware upgrade over-the-air). limited amount of time (for example for a firmware upgrade over-
Most of the classC end-devices are main powered (for example Smart the-air). Most of the Class C end-devices are grid powered (for
Plugs). example Smart Plugs).
4.2. End-Device addressing 4.2. End-Device addressing
LoRaWAN end-devices use a 32 bits network address (devAddr) to LoRaWAN end-devices use a 32-bit network address (devAddr) to
communicate with the network over-the-air. However, that address communicate with the network over-the-air. However, that address
might be reused several time on the same network at the same time for might be reused several times on the same network at the same time
different end-devices. End-devices using the same devAddr are for different end-devices. End-devices using the same devAddr are
distinguish by the Network Server based on the cryptographic distinguished by the Network Server based on the cryptographic
signature appended to every single LoRaWAN MAC frame, as all end- signature appended to every single LoRaWAN MAC frame, as all end-
devices use different security keys. To communicate with the SCHC devices use different security keys. To communicate with the SCHC
gateway the Network Server MUST identify the end-devices by a unique gateway the Network Server MUST identify the end-devices by a unique
64bits device ID called the devEUI. Unlike devAddr, devEUI is 64-bit device identifier called the devEUI. Unlike devAddr, devEUI
guaranteed to be unique for every single end-device across all is guaranteed to be unique for every single end-device across all
networks. The devEUI is assigned to the end-device during the networks. The devEUI is assigned to the end-device during the
manufacturing process by the end-device's manufacturer. It is built manufacturing process by the end-device's manufacturer. It is built
like an Ethernet MAC address by concatenating the manufacturer's IEEE like an Ethernet MAC address by concatenating the manufacturer's IEEE
OUI field with a vendor unique number. ex: 24bits OUI is OUI field with a vendor unique number. e.g.: 24-bit OUI is
concatenated with a 40 bits serial number. The Network Server concatenated with a 40-bit serial number. The Network Server
translates the devAddr into a devEUI in the uplink direction and translates the devAddr into a devEUI in the uplink direction and
reciprocally on the downlink direction. reciprocally on the downlink direction.
+--------+ +----------+ +---------+ +----------+ +--------+ +----------+ +---------+ +----------+
| End- | <=====> | Network | <====> | SCHC | <========> | Internet | | End- | <=====> | Network | <====> | SCHC | <========> | Internet |
| Device | devAddr | Server | devEUI | Gateway | IPv6/UDP | | | Device | devAddr | Server | devEUI | Gateway | IPv6/UDP | |
+--------+ +----------+ +---------+ +----------+ +--------+ +----------+ +---------+ +----------+
Figure 4: LoRaWAN addresses Figure 4: LoRaWAN addresses
4.3. General Message Types 4.3. General Message Types
o *Confirmed messages*: The sender asks the receiver to acknowledge o Confirmed messages: The sender asks the receiver to acknowledge
the message. the message.
o *Unconfirmed messages*: The sender does not ask the receiver to o Unconfirmed messages: The sender does not ask the receiver to
acknowledge the message. acknowledge the message.
As SCHC defines its own acknowledgment mechanisms, SCHC does not As SCHC defines its own acknowledgment mechanisms, SCHC does not
require to use confirmed messages. require to use confirmed messages.
4.4. LoRaWAN MAC Frames 4.4. LoRaWAN MAC Frames
o *JoinRequest*: This message is used by a end-device to join a o JoinRequest: This message is used by an end-device to join a
network. It contains the end-device's unique identifier devEUI network. It contains the end-device's unique identifier devEUI
and a random nonce that will be used for session key derivation. and a random nonce that will be used for session key derivation.
o *JoinAccept*: To on-board a end-device, the Network Server o JoinAccept: To on-board an end-device, the Network Server responds
responds to the JoinRequest end-device's message with a JoinAccept to the JoinRequest end-device's message with a JoinAccept message.
message. That message is encrypted with the end-device's AppKey That message is encrypted with the end-device's AppKey and
and contains (amongst other fields) the major network's settings contains (amongst other fields) the major network's settings and a
and a network random nonce used to derive the session keys. network random nonce used to derive the session keys.
o *Data* o Data
5. SCHC-over-LoRaWAN 5. SCHC-over-LoRaWAN
5.1. LoRaWAN FPort 5.1. LoRaWAN FPort
The LoRaWAN MAC layers features a frame port field in all frames. The LoRaWAN MAC layer features a frame port field in all frames.
This field (FPort) is 8-bit long and the values from 1 to 223 can be This field (FPort) is 8-bit long and the values from 1 to 223 can be
used. It allows LoRaWAN network and application to identify data. used. It allows LoRaWAN networks and applications to identify data.
The FPort field is part of the SCHC Packet or the SCHC Fragment, as
shown in Figure 5. The SCHC C/D and the SCHC F/R SHALL concatenate
the FPort field with the LoRaWAN payload to retrieve their payload as
it is used as a part of the ruleId field.
| FPort | LoRaWAN payload |
+ ------------------------ +
| SCHC payload |
Figure 5: SCHC payload in LoRaWAN
A fragmentation session with application payload transferred from A fragmentation session with application payload transferred from
device to server, is called uplink fragmentation session. It uses device to server, is called uplink fragmentation session. It uses an
FPortUpShort or FPortUpDefault for data uplink and its associated FPort for data uplink and its associated SCHC control downlinks,
SCHC control downlinks. The other way, a fragmentation session with named FPortUp in this document. The other way, a fragmentation
application payload transferred from server to device, is called session with application payload transferred from server to device,
downlink fragmentation session. It uses FPortDown for data downlink is called downlink fragmentation session. It uses another FPort for
and its associated SCHC control uplinks. data downlink and its associated SCHC control uplinks, named
FPortDown in this document.
FPorts can use arbitrary values inside the allowed FPort range and FPorts can use arbitrary values inside the allowed FPort range and
must be shared by the end-device, the Network Server and SCHC MUST be shared by the end-device, the Network Server and SCHC gateway
gateway. The uplink and downlink SCHC ports must be different. In prior to the communication. The uplink and downlink fragmentation
order to improve interoperability, it is recommended to use: FPorts MUST be different.
o FPortUpShort = 20 5.2. Rule ID management
o FPortUpDefault = 21 RuleID minimum length MUST be 8 bits, and RECOMMENDED length is 8
bits. RuleID MSB is encoded in the LoRaWAN FPort as described in
Section 5.1. LoRaWAN supports up to 223 application FPorts in the
range [1;223] as defined in section 4.3.2 of [lora-alliance-spec], it
implies that RuleID MSB SHOULD be inside this range. An application
MAY reserve some FPort values for other needs as long as they don't
conflict with FPorts used for SCHC C/D and SCHC F/R.
o FPortDown = 22 A RuleID SHOULD be reserved to tag packets for which SCHC compression
was not possible (no matching Rule was found). RuleIDs FPortUp and
FPortDown are reserved for fragmentation, in order to improve
interoperability RECOMMENDED values are:
Those are recommended values and are application defined. Also o RuleID = 20 (8-bit) for uplink fragmentation, named FPortUp
application can have multiple fragmentation session between a device
and one or several SCHC gateways. A set of three FPort values is o RuleID = 21 (8-bit) for downlink fragmentation, named FPortDown
required for each gateway instance the device is required to
communicate with. o RuleID = 22 (8-bit) for which SCHC compression was not possible
The remaining RuleIDs are available for compression. RuleIDs are
shared between uplink and downlink sessions. A RuleID different from
FPortUp or FPortDown means that the fragmentation is not used, thus
the packet SHOULD be sent to C/D layer.
The only uplink messages using the FPortDown port are the The only uplink messages using the FPortDown port are the
fragmentation SCHC control messages of a downlink fragmentation fragmentation SCHC control messages of a downlink fragmentation
session (ex ACKs). Similarly, the only downlink messages using the session (ex ACKs). Similarly, the only downlink messages using the
FPortUpShort or FPortUpDefault ports are the fragmentation SCHC FPortUp port are the fragmentation SCHC control messages of an uplink
control messages of an uplink fragmentation session. fragmentation session.
5.2. Rule ID management
SCHC-over-LoRaWAN SHOULD support encoding RuleID on 6 bits (64
possible rules).
The RuleID 0 is reserved for fragmentation. The RuleID 63 is used to An application can have multiple fragmentation sessions between a
tag packets for which SCHC compression was not possible (no matching device and one or several SCHC gateways. A set of FPort values is
Rule was found). REQUIRED for each SCHC gateway instance the device is required to
communicate with.
The remaining RuleIDs are available for compression. RuleIDs are The mechanism for sharing those RuleID values is outside the scope of
shared between uplink and downlink sessions. A RuleID different from this document.
0 means that the fragmentation is not used, thus the packet should be
send to C/D layer.
5.3. IID computation 5.3. IID computation
As LoRaWAN network uses unique EUI-64 per end-device, the Interface As LoRaWAN network uses unique EUI-64 per end-device, the Interface
IDentifier is the LoRaWAN DevEUI. It is compliant with [RFC4291] and IDentifier is the LoRaWAN DevEUI. It is compliant with [RFC4291] and
IID starting with binary 000 must enforce the 64-bits rule. TODO: IID starting with binary 000 must enforce the 64-bit rule.
Derive IID from DevEUI with privacy constraints ? Ask working group ?
5.4. Fragmentation TODO: Derive IID from DevEUI with privacy constraints ? Ask working
group ?
5.4. Padding
All padding bits MUST be 0.
5.5. Compression
SCHC C/D MUST concatenate FPort and LoRaWAN payload to retrieve the
SCHC packet as per Section 5.1.
SCHC C/D RuleID size SHOULD be 8 bits to fit the LoRaWAN FPort field.
RuleIDs matching FPortUp and FPortDown are reserved for SCHC
Fragmentation.
5.6. Fragmentation
The L2 word size used by LoRaWAN is 1 byte (8 bits). The SCHC The L2 word size used by LoRaWAN is 1 byte (8 bits). The SCHC
fragmentation over LoRaWAN uses the ACK-on-Error for uplink fragmentation over LoRaWAN uses the ACK-on-Error for uplink
fragmentation and Ack-Always for downlink fragmentation. A LoRaWAN fragmentation and Ack-Always for downlink fragmentation. A LoRaWAN
end-device cannot support simultaneous interleaved fragmentation end-device cannot support simultaneous interleaved fragmentation
sessions in the same direction (uplink or downlink). This means that sessions in the same direction (uplink or downlink). This means that
only a single fragmented IPv6 datagram may be transmitted and/or only a single fragmented IPv6 datagram may be transmitted and/or
received by the end-device at a given moment. received by the end-device at a given moment.
The fragmentation parameters are different for uplink and downlink The fragmentation parameters are different for uplink and downlink
fragmentation sessions and are successively described in the next fragmentation sessions and are successively described in the next
sections. sections.
5.5. DTag 5.6.1. DTag
A LoRaWAN device cannot interleave several fragmented SCHC datagrams. A LoRaWAN device cannot interleave several fragmented SCHC datagrams
This one bit field is used to distinguish two consecutive on the same FPort. This field is not used and its size is 0.
fragmentation sessions.
_Note_: While it is used to recover faster from transmission errors, Note: The device can still have several parallel fragmentation
it SHALL not be considered as the only way to distinguish two sessions with one or more SCHC gateway(s) thanks to distinct sets of
fragmentation sessions. FPorts, cf Section 5.2
5.5.1. Uplink fragmentation: From device to SCHC gateway 5.6.2. Uplink fragmentation: From device to SCHC gateway
In that case the device is the fragmentation transmitter, and the In that case the device is the fragmentation transmitter, and the
SCHC gateway the fragmentation receiver. Two fragmentation rules are SCHC gateway the fragmentation receiver. A single fragmentation rule
defined regarding the *FPort*: is defined. SCHC F/R MUST concatenate FPort and LoRaWAN payload to
retrieve the SCHC fragment as per Section 5.1.
o *FPortUpShort*: SCHC header is only one byte. Used when o Minimum SCHC header is two bytes (the FPort byte + 1 additional
fragmentation is required and payload size is less than 381 bytes. byte) and the RECOMMENDED header size is two bytes.
o *FPortUpDefault*: SCHC header is two bytes. Used for all other o RuleID: Recommended size is 8 bits in SCHC header.
cases: no fragmentation required or payload size is between 382
and 1524 byte.
*Both rules share common parameters:* o SCHC fragmentation reliability mode: "ACK-on-Error"
o *SCHC fragmentation reliability mode*: "ACK-on-Error" o DTag: Size is 0 bit, not used
o *DTag*: size is 1 bit. o FCN: The FCN field is encoded on N = 6 bits, so WINDOW_SIZE = 64
tiles are allowed in a window
o *FCN*: The FCN field is encoded on N = 7 bits, so WINDOW_SIZE = o Window index: encoded on W = 2 bits. So 4 windows are available.
127 tiles are allowed in a window (FCN=All-1 is reserved for
SCHC).
o *MIC calculation algorithm*: CRC32 using 0xEDB88320 (i.e. the o RCS calculation algorithm: CRC32 using 0xEDB88320 (i.e. the
reverse representation of the polynomial used e.g. in the Ethernet reverse representation of the polynomial used e.g. in the Ethernet
standard [RFC3385]) as suggested in standard [RFC3385]) as suggested in
[I-D.ietf-lpwan-ipv6-static-context-hc]. [I-D.ietf-lpwan-ipv6-static-context-hc].
o *MAX_ACK_REQUESTS*: 8 o MAX_ACK_REQUESTS: 8
o *Tile*: size is 3 bytes (24 bits) o Tile: size is 5 bytes
o *Retransmission and inactivity timers*: LoRaWAN end-devices do not o Retransmission and inactivity timers: LoRaWAN end-devices do not
implement a "retransmission timer". At the end of a window or a implement a "retransmission timer". At the end of a window or a
fragmentation session, corresponding ACK(s) is (are) transmitted fragmentation session, corresponding ACK(s) is (are) transmitted
by the network gateway (LoRaWAN application server) in the RX1 or by the network gateway (LoRaWAN application server) in the RX1 or
RX2 receive slot of end-device. If this ACK is not received the RX2 receive slot of end-device. If this ACK is not received by
end-device sends an all-0 (or an all-1) fragment with no payload the end-device at the end of its RX windows, it sends an all-0 (or
to request an SCHC ACK retransmission. The periodicity between an all-1) fragment with no payload to request an SCHC ACK
retransmission of the all-0/all-1 fragments is device/application retransmission. The periodicity between retransmission of the
specific and may be different for each device (not specified). all-0/all-1 fragments is device/application specific and MAY be
The SCHC gateway implements an "inactivity timer". The default different for each device (not specified). The SCHC gateway
recommended duration of this timer is 12 hours. This value is implements an "inactivity timer". The default RECOMMENDED
mainly driven by application requirements and may be changed by duration of this timer is 12 hours. This value is mainly driven
the application. by application requirements and MAY be changed by the application.
*The following fields are different:*
o RuleID size
o Window index size W
5.5.1.1. FPortUpShort - 1 byte header
In that case RuleID size is 0, the rule is the FPort=FPortUpShort and
only fragmented payload can be transported.
o *RuleID*: size is 0 bit in SCHC header, not used.
o *Window index*: encoded on W = 0 bit, not used
With this set of parameters, the SCHC fragment header overhead is 1
byte (8 bits). MTU is: _127 tiles * 3 bytes per tile = 381 bytes_
*Regular fragments*
| DTag | FCN | Payload |
+ ----- + ------ + ------- +
| 1 bit | 7 bits | |
Figure 5: All fragment except the last one. Header size is 8 bits (1
byte).
*SCHC ACK*
| DTag | C | Encoded bitmap (if C = 0) | Padding (0s) |
+ ----- + ----- + ------------------------- + ------------ +
| 1 bit | 1 bit | 0 to 127 bits | 7 or 0 bits |
Figure 6: SCHC ACK format, failed mic check.
5.5.1.2. FPortUpDefault - 2 bytes header
o *RuleID*: size is 6 bits (64 possible rules, 62 available for
compression)
o *Window index*: encoded on W = 2 bits. So 4 windows are
available.
With this set of parameters, the SCHC fragment header overhead is 2 o Last tile: The last tile can be carried in the All-1 fragment.
bytes (16 bits). MTU is: _4 windows * 127 tiles * 3 bytes per tile =
1524 bytes_
_Note_: Even if it is less efficient, this rule can also be used for With this set of parameters, the SCHC fragment header is 16 bits,
fragmented payload size less than 382 bytes. including FPort; payload overhead will be 8 bits as FPort is already
a part of LoRaWAN payload. MTU is: _4 windows * 64 tiles * 5 bytes
per tile = 1280 bytes_
*Regular fragments* 5.6.2.1. Regular fragments
| FPort | LoRaWAN payload |
+ ------ + ------------------------- +
| RuleID | W | FCN | Payload |
+ ------ + ------ + ------ + ------- +
| 8 bits | 2 bits | 6 bits | |
| RuleID | DTag | W | FCN | Payload | Figure 6: All fragments except the last one. SCHC header size is 16
+ ------ + ----- + ------ + ------ + ------- + bits, including LoRaWAN FPort.
| 6 bits | 1 bit | 2 bits | 7 bits | |
Figure 7: All fragment except the last one. Header size is 16 bits 5.6.2.2. Last fragment (All-1)
(2 bytes).
*Last fragment (All-1)* | FPort | LoRaWAN payload |
+ ------ + ------------------------------------------------ +
| RuleID | W | FCN=All-1 | RCS | Payload |
+ ------ + ------ + --------- + ------- + ----------------- +
| 8 bits | 2 bits | 6 bits | 32 bits | Last tile, if any |
| RuleID | DTag | W | FCN=All-1 | MIC | Payload | Figure 7: All-1 fragment detailed format for the last fragment.
+ ------ + ----- + ------ + --------- + ------- + ----------------- +
| 6 bits | 1 bit | 2 bits | 7 bits | 32 bits | Last tile, if any |
Figure 8: All-1 fragment detailed format for the last fragment. 5.6.2.3. SCHC ACK
*SCHC ACK* | FPort | LoRaWAN payload |
+ ------ + ----------------------------------------- +
| RuleID | W | C | Encoded bitmap (if C = 0) |
+ ------ + ----- + ----- + ------------------------- +
| 8 bits | 2 bit | 1 bit | 0 to 127 bits |
| RuleID | DTag | W | C | Encoded bitmap (if C = 0) | Figure 8: SCHC formats, failed RCS check.
+ ------ + ----- + ----- + ----- + ------------------------- +
| 6 bits | 1 bit | 2 bit | 1 bit | 0 to 127 bits |
Figure 9: SCHC formats, failed MIC check. 5.6.2.4. Receiver-Abort
*Receiver-Abort* | 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 --> |
| RuleID | DTag | W = b'11 | C = 1 | b'111111 | 0xFF (all 1's) | Figure 9: Receiver-Abort format.
+ ------ + ----- + -------- + ------+--------- + ---------------+
| 6 bits | 1 bit | 2 bits | 1 bit | 6 bits | 8 bits |
Figure 10: Receiver-Abort format. 5.6.2.5. SCHC acknowledge request
*SCHC acknowledge request* | FPort | LoRaWAN payload |
| RuleID | DTag | W | FCN = b'0000000 | +------- +------------------------- +
+ ------ + ----- + ------ + --------------- + | RuleID | W | FCN = b'000000 |
| 6 bits | 1 bit | 2 bits | 7 bits | + ------ + ------ + --------------- +
| 8 bits | 2 bits | 6 bits |
Figure 11: SCHC ACK REQ format. Figure 10: SCHC ACK REQ format.
5.5.2. Downlink fragmentation: From SCHC gateway to device 5.6.3. Downlink fragmentation: From SCHC gateway to a device
In that case the device is the fragmentation receiver, and the SCHC In that case the device is the fragmentation receiver, and the SCHC
gateway the fragmentation transmitter. The following fields are gateway the fragmentation transmitter. The following fields are
common to all devices. common to all devices. SCHC F/R MUST concatenate FPort and LoRaWAN
payload to retrieve the SCHC fragment as described in Section 5.1.
o *SCHC fragmentation reliability mode*: ACK-Always. o SCHC fragmentation reliability mode: ACK-Always.
o *RuleID*: size is 6 bits (64 possible rules, 62 for compression). o RuleID: Recommended size is 8 bits in SCHC header.
o *Window index*: encoded on W=1 bit, as per o Window index: encoded on W=1 bit, as per
[I-D.ietf-lpwan-ipv6-static-context-hc]. [I-D.ietf-lpwan-ipv6-static-context-hc].
o *DTag*: Not used, so its size is 0 bit. o DTag: Size is 0 bit, not used
o *FCN*: The FCN field is encoded on N=1 bits, so WINDOW_SIZE = 1 o FCN: The FCN field is encoded on N=1 bit, so WINDOW_SIZE = 1 tile
tile (FCN=All-1 is reserved for SCHC). (FCN=All-1 is reserved for SCHC).
o *MIC calculation algorithm*: CRC32 using 0xEDB88320 (i.e. the o RCS calculation algorithm: CRC32 using 0xEDB88320 (i.e. the
reverse representation of the polynomial used e.g. in the Ethernet reverse representation of the polynomial used e.g. in the Ethernet
standard [RFC3385]), as per standard [RFC3385]), as per
[I-D.ietf-lpwan-ipv6-static-context-hc]. [I-D.ietf-lpwan-ipv6-static-context-hc].
o *MAX_ACK_REQUESTS*: 8 o MAX_ACK_REQUESTS: 8
As only 1 tile is used, its size can change for each downlink, and As only 1 tile is used, its size can change for each downlink, and
will be maximum available MTU minus header (1 byte) will be maximum available MTU.
_Note_: The Fpending bit included in LoRaWAN protocol SHOULD not be _Note_: The Fpending bit included in LoRaWAN protocol SHOULD NOT be
used for SCHC-over-LoRaWAN protocol. It might be set by the Network used for SCHC-over-LoRaWAN protocol. It might be set by the Network
Server for other purposes in but not SCHC needs. Server for other purposes but not SCHC needs.
*Regular fragments* 5.6.3.1. Regular fragments
| RuleID | W | FCN = b'0 | Payload |
+ ------ + ----- + --------- + ------- +
| 6 bits | 1 bit | 1 bits | X bytes |
Figure 12: All fragments but the last one. Header size 1 byte (8 | FPort | LoRaWAN payload |
bits). + ------ + ----------------------------------- +
| RuleID | W | FCN = b'0 | Payload |
+ ------ + ----- + --------- + --------------- +
| 8 bits | 1 bit | 1 bit | X bytes |
*Last fragment (All-1)* Figure 11: All fragments but the last one. Header size 10 bits,
including LoraWAN FPort.
| RuleID | W | FCN = b'1 | MIC | Payload | 5.6.3.2. Last fragment (All-1)
| FPort | LoRaWAN payload |
+ ------ + ----------------------------------------------- +
| RuleID | W | FCN = b'1 | RCS | Payload |
+ ------ + ----- + --------- + ------- + ----------------- + + ------ + ----- + --------- + ------- + ----------------- +
| 6 bits | 1 bit | 1 bit | 32 bits | Last tile, if any | | 8 bits | 1 bit | 1 bit | 32 bits | Last tile, if any |
Figure 13: All-1 SCHC ACK detailed format for the last fragment. Figure 12: All-1 SCHC ACK detailed format for the last fragment.
*SCHC acknowledge* 5.6.3.3. SCHC acknowledge
| RuleID | W | C = b'1 | | FPort | LoRaWAN payload |
+ ------ + ----- + ------- + + ------ + ---------------------------------- +
| 6 bits | 1 bit | 1 bit | | RuleID | W | C = b'1 | Padding b'000000 |
+ ------ + ----- + ------- + ---------------- +
| 8 bits | 1 bit | 1 bit | 6 bits |
Figure 14: SCHC ACK format, MIC is correct. Figure 13: SCHC ACK format, RCS is correct.
*Receiver-Abort* 5.6.3.4. Receiver-Abort
| RuleID | W | C = b'0 | b'11111111 | | FPort | LoRaWAN payload |
+ ------ + ----- + ------- + ---------- + + ------ + ---------------------------------------------- +
| 6 bits | 1 bit | 1 bits | 8 bits | | 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 --> |
Figure 15: Receiver-Abort packet (following an all-1 packet with Figure 14: Receiver-Abort packet (following an all-1 packet with
incorrect MIC). incorrect RCS).
Class A and classB&C end-devices do not manage retransmissions and Class A and Class B or Class C end-devices do not manage
timers in the same way. retransmissions and timers in the same way.
5.5.2.1. ClassA end-devices 5.6.3.5. Class A end-devices
Class A end-devices can only receive in an RX slot following the Class A end-devices can only receive in an RX slot following the
transmission of an uplink. Therefore there cannot be a concept of transmission of an uplink. Therefore there cannot be a concept of
"retransmission timer" for an SCHC gateway. The SCHC gateway cannot "retransmission timer" for an SCHC gateway. The SCHC gateway cannot
initiate communication to a classA end-device. initiate communication to a Class A end-device.
The device replies with an ACK message to every single fragment The device replies with an ACK message to every single fragment
received from the SCHC gateway (because the window size is 1). received from the SCHC gateway (because the window size is 1).
Following the reception of a FCN=0 fragment (fragment that is not the Following the reception of a FCN=0 fragment (fragment that is not the
last fragment of the packet or ACK-request, but the end of a window), last fragment of the packet or ACK-request, but the end of a window),
the device MUST transmit the SCHC ACK fragment until it receives the the device MUST transmit the SCHC ACK fragment until it receives the
fragment of the next window. The device shall transmit up to fragment of the next window. The device SHALL transmit up to
MAX_ACK_REQUESTS ACK messages before aborting. The device should MAX_ACK_REQUESTS ACK messages before aborting. The device should
transmit those ACK as soon as possible while taking into transmit those ACK as soon as possible while taking into
consideration potential local radio regulation on duty-cycle, to consideration potential local radio regulation on duty-cycle, to
progress the fragmentation session as quickly as possible. The ACK progress the fragmentation session as quickly as possible. The ACK
bitmap is 1 bit long and is always 1. bitmap is 1 bit long and is always 1.
Following the reception of a FCN=All-1 fragment (the last fragment of Following the reception of an FCN=All-1 fragment (the last fragment
a datagram) and if the MIC is correct, the device shall transmit the of a datagram) and if the RCS is correct, the device SHALL transmit
ACK with the "MIC is correct" indicator bit set (C=1). This message the ACK with the "RCS is correct" indicator bit set (C=1). This
might be lost therefore the SCHC gateway may request a retransmission message might be lost therefore the SCHC gateway MAY request a
of this ACK in the next downlink. The device SHALL keep this ACK retransmission of this ACK in the next downlink. The device SHALL
message in memory until it receives a downlink, on SCHC FPortDown keep this ACK message in memory until it receives a downlink, on SCHC
from the SCHC gateway different from an ACK-request: it indicates FPortDown from the SCHC gateway different from an ACK-request: it
that the SCHC gateway has received the ACK message. indicates that the SCHC gateway has received the ACK message.
Following the reception of a FCN=All-1 fragment (the last fragment of Following the reception of a FCN=All-1 fragment (the last fragment of
a datagram), if all fragments have been received and the MIC is NOT a datagram), if all fragments have been received and the RCS is not
correct, the device shall transmit a Receiver-Abort fragment. The correct, the device SHALL transmit a Receiver-Abort fragment. The
device SHALL keep this Abort message in memory until it receives a device SHALL keep this Abort message in memory until it receives a
downlink, on SCHC FPortDown, from the SCHC gateway different from an downlink, on SCHC FPortDown, from the SCHC gateway different from an
ACK-request indicating that the SCHC gateway has received the Abort ACK-request indicating that the SCHC gateway has received the Abort
message. The fragmentation receiver (device) does not implement message. The fragmentation receiver (device) does not implement
retransmission timer and inactivity timer. retransmission timer and inactivity timer.
The fragmentation sender (the SCHC gateway) implements an inactivity The fragmentation sender (the SCHC gateway) implements an inactivity
timer with default duration of 12 hours. Once a fragmentation timer with a default duration of 12 hours. Once a fragmentation
session is started, if the SCHC gateway has not received any ACK or session is started, if the SCHC gateway has not received any ACK or
Receiver-Abort message 12 hours after the last message from the Receiver-Abort message 12 hours after the last message from the
device was received, the SCHC gateway may flush the fragmentation device was received, the SCHC gateway MAY flush the fragmentation
context. For devices with very low transmission rates (example 1 context. For devices with very low transmission rates (example 1
packet a day in normal operation) , that duration may be extended, packet a day in normal operation) , that duration may be extended,
but this is application specific. but this is application specific.
5.5.2.2. Class B or C end-devices 5.6.3.6. Class B or Class C end-devices
Class B&C end-devices can receive in scheduled RX slots or in RX Class B and Class C end-devices can receive in scheduled RX slots or
slots following the transmission of an uplink. The device replies in RX slots following the transmission of an uplink. The device
with an ACK message to every single fragment received from the SCHC replies with an ACK message to every single fragment received from
gateway (because the window size is 1). Following the reception of a the SCHC gateway (because the window size is 1). Following the
FCN=0 fragment (fragment that is not the last fragment of the packet reception of an FCN=0 fragment (fragment that is not the last
or ACK-request), the device MUST always transmit the corresponding fragment of the packet or ACK-request), the device MUST always
SCHC ACK message even if that fragment has already been received. transmit the corresponding SCHC ACK message even if that fragment has
The ACK bitmap is 1 bit long and is always 1. If the SCHC gateway already been received. The ACK bitmap is 1 bit long and is always 1.
receives this ACK, it proceeds to send the next window fragment. If If the SCHC gateway receives this ACK, it proceeds to send the next
the retransmission timer elapses and the SCHC gateway has not window fragment. If the retransmission timer elapses and the SCHC
received the ACK of the current window it retransmits the last gateway has not received the ACK of the current window it retransmits
fragment. The SCHC gateway tries retransmitting up to the last fragment. The SCHC gateway tries retransmitting up to
MAX_ACK_REQUESTS times before aborting. MAX_ACK_REQUESTS times before aborting.
Following the reception of a FCN=All-1 fragment (the last fragment of Following the reception of an FCN=All-1 fragment (the last fragment
a datagram) and if the MIC is correct, the device shall transmit the of a datagram) and if the RCS is correct, the device SHALL transmit
ACK with the "MIC is correct" indicator bit set. If the SCHC gateway the ACK with the "RCS is correct" indicator bit set. If the SCHC
receives this ACK, the current fragmentation session has succeeded gateway receives this ACK, the current fragmentation session has
and its context can be cleared. succeeded and its context can be cleared.
If the retransmission timer elapses and the SCHC gateway has not If the retransmission timer elapses and the SCHC gateway has not
received the SCHC ACK it retransmits the last fragment with the received the SCHC ACK it retransmits the last fragment with the
payload (not an ACK-request without payload). The SCHC gateway tries payload (not an ACK-request without payload). The SCHC gateway tries
retransmitting up to MAX_ACK_REQUESTS times before aborting. retransmitting up to MAX_ACK_REQUESTS times before aborting.
The device SHALL keep the SCHC ACK message in memory until it Following the reception of an FCN=All-1 fragment (the last fragment
receives a downlink from the SCHC gateway different from the last of a datagram), if all fragments have been received and if the RCS is
(FCN>0 and different DTag) fragment indicating that the SCHC gateway NOT correct, the device SHALL transmit a Receiver-Abort fragment.
has received the ACK message.
Following the reception of a FCN=All-1 fragment (the last fragment of
a datagram), if all fragments have been received and if the MIC is
NOT correct, the device shall transmit a Receiver-Abort fragment.
The retransmission timer is used by the SCHC gateway (the sender), The retransmission timer is used by the SCHC gateway (the sender),
the optimal value is very much application specific but here are some the optimal value is very much application specific but here are some
recommended default values. For classB end-devices, this timer recommended default values. For Class B end-devices, this timer
trigger is a function of the periodicity of the classB ping slots. trigger is a function of the periodicity of the Class B ping slots.
The recommended value is equal to 3 times the classB ping slot The RECOMMENDED value is equal to 3 times the Class B ping slot
periodicity. For classC end-devices which are nearly constantly periodicity. For Class C end-devices which are nearly constantly
receiving, the recommended value is 30 seconds. This means that the receiving, the RECOMMENDED value is 30 seconds. This means that the
end-device shall try to transmit the ACK within 30 seconds of the end-device shall try to transmit the ACK within 30 seconds of the
reception of each fragment. The inactivity timer is implemented by reception of each fragment. The inactivity timer is implemented by
the end-device to flush the context in-case it receives nothing from the end-device to flush the context in-case it receives nothing from
the SCHC gateway over an extended period of time. The recommended the SCHC gateway over an extended period of time. The RECOMMENDED
value is 12 hours for both classB&C end-devices. value is 12 hours for both Class B and Class C end-devices.
6. Security considerations 6. Security considerations
This document is only providing parameters that are expected to be This document is only providing parameters that are expected to be
better suited for LoRaWAN networks for better suited for LoRaWAN networks for
[I-D.ietf-lpwan-ipv6-static-context-hc]. As such, this parameters [I-D.ietf-lpwan-ipv6-static-context-hc]. As such, this document does
does not contribute to any new security issues in addition of those not contribute to any new security issues in addition to those
identified in [I-D.ietf-lpwan-ipv6-static-context-hc]. identified in [I-D.ietf-lpwan-ipv6-static-context-hc].
Acknowledgements Acknowledgements
Thanks to all those listed in the Contributors section for the Thanks to all those listed in the Contributors section for the
excellent text, insightful discussions, reviews and suggestions. excellent text, insightful discussions, reviews and suggestions.
Contributors Contributors
Contributors ordered by family name. Contributors ordered by family name.
o ins: V. Audebert name: Vincent AUDEBERT org: EDF R&D street: 7 bd o ins: V. Audebert name: Vincent AUDEBERT org: EDF R&D street: 7 bd
Gaspard Monge city: 91120 PALAISEAU country: FRANCE email: Gaspard Monge city: 91120 PALAISEAU country: FRANCE email:
vincent.audebert@edf.fr vincent.audebert@edf.fr
o ins: J. Catalano name: Julien Catalano org: Kerlink street: 1 rue
Jacqueline Auriol city: 35235 Thorigne-Fouillard country: France
email: j.catalano@kerlink.fr
o ins: M. Coracin name: Michael Coracin org: Semtech street: 14 o ins: M. Coracin name: Michael Coracin org: Semtech street: 14
Chemin des Clos city: Meylan country: France email: Chemin des Clos city: Meylan country: France email:
mcoracin@semtech.com mcoracin@semtech.com
o ins: M. Le Gourrierec name: Marc Le Gourrierec org: SagemCom o ins: M. Le Gourrierec name: Marc Le Gourrierec org: SagemCom
street: 250 Route de l'Empereur city: 92500 Rueil Malmaison street: 250 Route de l'Empereur city: 92500 Rueil Malmaison
country: FRANCE email: marc.legourrierec@sagemcom.com country: FRANCE email: marc.legourrierec@sagemcom.com
o ins: N. Sornin name: Nicolas Sornin org: Semtech street: 14 o ins: N. Sornin name: Nicolas Sornin org: Semtech street: 14
Chemin des Clos city: Meylan country: France email: Chemin des Clos city: Meylan country: France email:
skipping to change at page 18, line 23 skipping to change at page 18, line 23
[RFC5795] Sandlund, K., Pelletier, G., and L-E. Jonsson, "The RObust [RFC5795] Sandlund, K., Pelletier, G., and L-E. Jonsson, "The RObust
Header Compression (ROHC) Framework", RFC 5795, Header Compression (ROHC) Framework", RFC 5795,
DOI 10.17487/RFC5795, March 2010, DOI 10.17487/RFC5795, March 2010,
<https://www.rfc-editor.org/info/rfc5795>. <https://www.rfc-editor.org/info/rfc5795>.
[RFC7136] Carpenter, B. and S. Jiang, "Significance of IPv6 [RFC7136] Carpenter, B. and S. Jiang, "Significance of IPv6
Interface Identifiers", RFC 7136, DOI 10.17487/RFC7136, Interface Identifiers", RFC 7136, DOI 10.17487/RFC7136,
February 2014, <https://www.rfc-editor.org/info/rfc7136>. February 2014, <https://www.rfc-editor.org/info/rfc7136>.
[RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC
2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174,
May 2017, <https://www.rfc-editor.org/info/rfc8174>.
[RFC8376] Farrell, S., Ed., "Low-Power Wide Area Network (LPWAN) [RFC8376] Farrell, S., Ed., "Low-Power Wide Area Network (LPWAN)
Overview", RFC 8376, DOI 10.17487/RFC8376, May 2018, Overview", RFC 8376, DOI 10.17487/RFC8376, May 2018,
<https://www.rfc-editor.org/info/rfc8376>. <https://www.rfc-editor.org/info/rfc8376>.
9.2. Informative References 9.2. Informative References
[I-D.ietf-lpwan-ipv6-static-context-hc] [I-D.ietf-lpwan-ipv6-static-context-hc]
Minaburo, A., Toutain, L., Gomez, C., Barthel, D., and J. Minaburo, A., Toutain, L., Gomez, C., Barthel, D., and J.
Zuniga, "Static Context Header Compression (SCHC) and Zuniga, "Static Context Header Compression (SCHC) and
fragmentation for LPWAN, application to UDP/IPv6", draft- fragmentation for LPWAN, application to UDP/IPv6", draft-
ietf-lpwan-ipv6-static-context-hc-19 (work in progress), ietf-lpwan-ipv6-static-context-hc-21 (work in progress),
July 2019. July 2019.
[lora-alliance-spec] [lora-alliance-spec]
Alliance, L., "LoRaWAN Specification Version V1.0.3", Alliance, L., "LoRaWAN Specification Version V1.0.3",
<https://lora-alliance.org/sites/default/files/2018-07/ <https://lora-alliance.org/sites/default/files/2018-07/
lorawan1.0.3.pdf>. lorawan1.0.3.pdf>.
Appendix A. Examples Appendix A. Examples
A.1. Uplink - Compression example - No fragmentation A.1. Uplink - Compression example - No fragmentation
Figure 16 is representing an applicative payload going through SCHC, Figure 15 is representing an applicative payload going through SCHC,
no fragmentation required no fragmentation required
An applicative payload of 78 bytes is passed to SCHC compression layer using An applicative payload of 78 bytes is passed to SCHC compression layer
rule 1, allowing to compress it to 40 bytes and 5 bits: 21 bits residue + 38 bytes using rule 1, allowing to compress it to 40 bytes and 5 bits: 1 byte
payload. ruleID, 21 bits residue + 37 bytes payload.
| RuleID | Compression residue | Payload | Padding=0b000 | | RuleID | Compression residue | Payload | Padding=b'000 |
+ ------ + ------------------- + --------- + ------------- + + ------ + ------------------- + --------- + ------------- +
| 1 | 21 bits | 38 bytes | 3 bits | | 1 | 21 bits | 38 bytes | 3 bits |
The current LoRaWAN MTU is 51 bytes, although 2 bytes FOpts are used by The current LoRaWAN MTU is 51 bytes, although 2 bytes FOpts are used by
LoRaWAN protocol: 49 bytes are available for SCHC payload; no need for LoRaWAN protocol: 49 bytes are available for SCHC payload; no need for
fragmentation. The payload will be transmitted through FPortUpDefault fragmentation. The payload will be transmitted through FPort = 1
| LoRaWAN Header | RuleID | Compression residue | Payload | Padding=b'000 | | LoRaWAN Header | LoRaWAN payload (40 bytes) |
+ -------------- + ------ + ------------------- + --------- + ------------- + + ------------------------- + --------------------------------------- +
| XXXX | 1 | 21 bits | 38 bytes | 3 bits | | | FOpts | RuleID=1 | Compression | Payload | Padding=b'000 |
| | | | residue | | |
+ ---- + ------- + -------- + ----------- + --------- + ------------- +
| XXXX | 2 bytes | 1 byte | 21 bits | 37 bytes | 3 bits |
Figure 16: Uplink example: compression without fragmentation Figure 15: Uplink example: compression without fragmentation
A.2. Uplink - Compression and fragmentation example A.2. Uplink - Compression and fragmentation example
Figure 17 is representing an applicative payload going through SCHC, Figure 16 is representing an applicative payload going through SCHC,
with fragmentation. with fragmentation.
An applicative payload of 478 bytes is passed to SCHC compression layer using An applicative payload of 478 bytes is passed to SCHC compression layer
rule 1, allowing to compress it to 440 bytes: 21 bits residue + 138 bytes using rule 1, allowing to compress it to 282 bytes and 5 bits: 1 byte
payload. ruleID, 21 bits residue + 279 bytes payload.
| RuleID | Compression residue | Payload | | RuleID | Compression residue | Payload |
+ ------ + ------------------- + --------- + + ------ + ------------------- + --------- +
| 1 | 21 bits | 138 bytes | | 1 | 21 bits | 279 bytes |
Given the size of the payload, FPortUpDefault will be used.
The current LoRaWAN MTU is 11 bytes, although 2 bytes FOpts are used by The current LoRaWAN MTU is 11 bytes, although 2 bytes FOpts are used by
LoRaWAN protocol: 9 bytes are available for SCHC payload. LoRaWAN protocol: 9 bytes are available for SCHC payload + 1 byte FPort
SCHC header is 2 bytes so 2 tiles are send in first fragment. field. SCHC header is 2 bytes (including FPort) so 1 tile is sent in
first fragment.
| LoRaWAN Header | FOpts | RuleID | DTag | W | FCN | 2 tiles | | LoRaWAN Header | LoRaWAN payload (6 bytes) |
+ -------------- + ------- + ------ + ----- + ------ + ------ + ------- + + ------------------------------------- + ------------------------- +
| XXXX | 2 bytes | 0 | 0 | 0 | 126 | 6 bytes | | | FOpts | RuleID=20 | W | FCN | 1 tile |
+ -------------- + ------- + ---------- + ----- + ------ + -------- +
| XXXX | 2 bytes | 1 byte | 0 0 | 62 | 5 bytes |
Content of the two tiles is: Content of the tile is:
| RuleID | Compression residue | Payload | | RuleID | Compression residue | Payload |
+ ------ + ------------------- + ------------------ + + ------ + ------------------- + ----------------- +
| 1 | 21 bits | 2 bytes + 5 bits | | 1 | 21 bits | 1 byte + 3 bits |
Next transmission MTU is 242 bytes, no FOpts. 80 tiles are transmitted: Next transmission MTU is 242 bytes, no FOpts. 48 tiles are transmitted:
| LoRaWAN Header | RuleID | DTag | W | FCN | 80 tiles | | LoRaWAN Header | LoRaWAN payload (241 bytes) |
+ -------------- + ------ + ----- + ------ + ------ + --------- + + -------------- + -----------+ --------------------------- +
| XXXX | 0 | 0 | 0 | 124 | 240 bytes | | | RuleID=20 | W | FCN | 48 tiles |
+ -------------- + ---------- + ----- + ------ + ---------- +
| XXXX | 1 byte | 0 0 | 61 | 240 bytes |
Next transmission MTU is 242 bytes, no FOpts. All 65 remaining tiles are Next transmission MTU is 242 bytes, no FOpts. All 8 remaining tiles are
transmitted, last tile is only 2 bytes. Padding is added for the remaining 6 bits. transmitted, the last tile is only 2 bytes + 5 bits. Padding is added for
the remaining 3 bits.
| LoRaWAN Header | RuleID | DTag | W | FCN | MIC | 65 tiles | Padding=b'000 | | LoRaWAN Header | LoRaWAN payload (39 bytes) |
+ -------------- + ------ + ----- + ------ + ------ + ----- + --------- + ---------------- + + ---- + -----------+ ----------------------------------------------- +
| XXXX | 0 | 0 | 0 | 127 | CRC32 | 194 bytes | 3 bits | | | RuleID=20 | W | FCN | 8 tiles | Padding=b'000 |
+ ---- + ---------- + -- + ------ + ----------------- + ------------- +
| XXXX | 1 byte | 00 | 13 | 37 bytes + 5 bits | 3 bits |
All packets have been received by the SCHC gateway, computed MIC is correct so All packets have been received by the SCHC gateway, computed RCS is
the following ACK is send to the device: correct so the following ACK is sent to the device:
| LoRaWAN Header | RuleID | DTag | W | C | | LoRaWAN Header | LoRaWAN payload |
+ -------------- + ------ + ----- + ------ + --- + + -------------- + --------- + ------------------- +
| XXXX | 0 | 0 | 0 | 1 | | | RuleID=20 | W | C | Padding |
+ -------------- + --------- + ----- + - + ------- +
| XXXX | 1 byte | 0 0 | 1 | 5 bits |
Figure 17: Uplink example: compression and fragmentation Figure 16: Uplink example: compression and fragmentation
A.3. Downlink A.3. Downlink
An applicative payload of 43 bytes is passed to SCHC compression layer using An applicative payload of 443 bytes is passed to SCHC compression layer
rule 1, allowing to compress it to 24 bytes and 5 bits: 21 bits residue + 22 bytes using rule 1, allowing to compress it to 130 bytes and 5 bits: 1 byte
payload. ruleId, 21 bits residue + 127 bytes payload.
| RuleID | Compression residue | Payload |
+ ------ + ------------------- + --------- +
| 1 | 21 bits | 18 bytes |
The current LoRaWAN MTU is 11 bytes, although 2 bytes FOpts are used by
LoRaWAN protocol: 9 bytes are available for SCHC payload => it has to be fragmented.
| LoRaWAN Header | FOpts | RuleID | W | FCN | 1 tile |
+ -------------- + ------- + ------ + ------ + ------ + ------- +
| XXXX | 2 bytes | 0 | 0 | 0 | 8 bytes |
Content of the two tiles is:
| RuleID | Compression residue | Payload |
+ ------ + ------------------- + ------------------ +
| 1 | 21 bits | 2 bytes + 5 bits |
The receiver answers with an SCHC ACK
| RuleID | W = 0 | C = b'1 | | RuleID | Compression residue | Payload |
+ ------ + ----- + ------- + + ------ + ------------------- + --------- +
| 6 bits | 1 bit | 1 bit | | 1 | 21 bits | 127 bytes |
The second downlink is send, no FOpts: The current LoRaWAN MTU is 51 bytes, no FOpts are used by LoRaWAN
protocol: 48 bytes are available for SCHC payload + FPort field => it
has to be fragmented.
| LoRaWAN Header | RuleID | W | FCN | 1 tile | | LoRaWAN Header | LoRaWAN payload (51 bytes) |
+ -------------- + ------ + ------ + ------ + -------- + + ---- + ---------- + --------------------------------------------- +
| XXXX | 0 | 1 | 0 | 10 bytes | | | RuleID=21 | W | FCN | 1 tile | Padding=b'000000 |
+ ---- + ---------- + --- + --- + -------------- + ---------------- +
| XXXX | 1 byte | 0 | 0 | 50 bytes | 6 bits |
The receiver answers with an SCHC ACK Content of the tile is:
| RuleID | Compression residue | Payload |
+ ------ + ------------------- + ------------------ +
| 1 | 21 bits | 46 bytes + 3 bits |
| RuleID | W = 1 | C = b'1 | The receiver answers with an SCHC ACK
+ ------ + ----- + ------- +
| 6 bits | 1 bit | 1 bit |
The third downlink is send, no FOpts: | FPortDown | LoRaWAN payload |
+ --------- + ---------------------------------- +
| RuleID | W = 0 | C = b'1 | Padding=b'000000 |
+ --------- + ----- + ------- + ---------------- +
| 1 byte | 1 bit | 1 bit | 6 bits |
| LoRaWAN Header | RuleID | W | FCN | 1 tile | The second downlink is sent, two FOpts:
+ -------------- + ------ + ------ + ------ + -------- +
| XXXX | 0 | 0 | 0 | 10 bytes |
The receiver answers with an SCHC ACK | LoRaWAN Header | LoRaWAN payload (49 bytes) |
+ --------------------------- + ------------------ + ---------------- +
| | FOpts | RuleID=21 | W | FCN | 1 tile | Padding=b'000000 |
+ ---- + ------- + ---------- + - + --- + -------- + ---------------- +
| XXXX | 2 bytes | 1 byte | 1 | 0 | 48 bytes | 6 bits |
| RuleID | W = 0 | C = 1 | The receiver answers with an SCHC ACK
+ ------ + ----- + ------- +
| 6 bits | 1 bit | 1 bit |
The last downlink is send, no FOpts: | FPortDown | LoRaWAN payload |
+ --------- + ---------------------------------- +
| RuleID | W = 1 | C = b'1 | Padding=b'000000 |
+ --------- + ----- + ------- + ---------------- +
| 1 byte | 1 bit | 1 bit | 6 bits |
The last downlink is sent, no FOpts:
| LoRaWAN Header | RuleID | W | FCN | 1 tile | | LoRaWAN Header | LoRaWAN payload (33 bytes) |
+ -------------- + ------ + ------ + ------ + -------- + + ---- + ---------- + ----------------------------------------------- +
| XXXX | 0 | 1 | 1 | 2 bytes | | | RuleID=21 | W | FCN | 1 tile | Padding=b'0 |
+ ---- + ---------- + --- + --- + --------------------- + ----------- +
| XXXX | 1 byte | 0 | 1 | 32 bytes + 5 bits | 1 bit |
The receiver answers with an SCHC ACK The receiver answers with an SCHC ACK
| RuleID | W = 1 | C = 1 | | FPortDown | LoRaWAN payload |
+ ------ + ----- + ------- + + --------- + ---------------------------------- +
| 6 bits | 1 bit | 1 bit | | RuleID | W = 0 | C = b'1 | Padding=b'000000 |
+ --------- + ----- + ------- + ---------------- +
| 1 byte | 1 bit | 1 bit | 6 bits |
Figure 18: Downlink example: compression and fragmentation Figure 17: Downlink example: compression and fragmentation
Appendix B. Note Appendix B. Note
Authors' Addresses Authors' Addresses
Olivier Gimenez (editor) Olivier Gimenez (editor)
Semtech Semtech
14 Chemin des Clos 14 Chemin des Clos
Meylan Meylan
France France
Email: ogimenez@semtech.com Email: ogimenez@semtech.com
Ivaylo Petrov (editor) Ivaylo Petrov (editor)
Acklio Acklio
2bis rue de la Chataigneraie 1137A Avenue des Champs Blancs
35510 Cesson-Sevigne Cedex 35510 Cesson-Sevigne Cedex
France France
Email: ivaylo@ackl.io Email: ivaylo@ackl.io
Julien Catalano
Kerlink
1 rue Jacqueline Auriol
35235 Thorigne-Fouillard
France
Email: j.catalano@kerlink.fr
 End of changes. 156 change blocks. 
417 lines changed or deleted 445 lines changed or added

This html diff was produced by rfcdiff 1.48. The latest version is available from http://tools.ietf.org/tools/rfcdiff/