lpwan Working Group O. Gimenez, Ed. Internet-Draft Semtech Intended status: Informational I. Petrov, Ed. Expires:January 9,April 11, 2020 AcklioJuly 08,J. Catalano Kerlink October 09, 2019 Static Context Header Compression (SCHC) over LoRaWANdraft-ietf-lpwan-schc-over-lorawan-02draft-ietf-lpwan-schc-over-lorawan-03 Abstract The Static Context Header Compression (SCHC) specification describes generic header compression and fragmentation techniques for LPWAN (Low Power Wide Area Networks) technologies. SCHC is a generic mechanism designed for greatflexibility,flexibility so that it can be adapted for any of the LPWAN technologies. This document provides the adaptation of SCHC for use in LoRaWAN networks, and provides elements such as efficient parameterization and modes of operation. This is called a profile. Status of This Memo This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79. Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet- Drafts is at https://datatracker.ietf.org/drafts/current/. Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress." This Internet-Draft will expire onJanuary 9,April 11, 2020. Copyright Notice Copyright (c) 2019 IETF Trust and the persons identified as the document authors. All rights reserved. This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License. Table of Contents 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 3 3. Static Context Header Compression Overview . . . . . . . . . 3 4. LoRaWAN Architecture . . . . . . . . . . . . . . . . . . . . 5 4.1. End-Device classes (A, B, C) and interactions . . . . . . 6 4.2. End-Device addressing . . . . . . . . . . . . . . . . . . 7 4.3. General Message Types . . . . . . . . . . . . . . . . . . 7 4.4. LoRaWAN MAC Frames . . . . . . . . . . . . . . . . . . . 8 5. SCHC-over-LoRaWAN . . . . . . . . . . . . . . . . . . . . . . 8 5.1. LoRaWAN FPort . . . . . . . . . . . . . . . . . . . . . . 8 5.2. Rule ID management . . . . . . . . . . . . . . . . . . . 9 5.3. IID computation . . . . . . . . . . . . . . . . . . . . . 9 5.4.FragmentationPadding . . . . . . . . . . . . . . . . . . . . . .9. . . 10 5.5.DTagCompression . . . . . . . . . . . . . . . . . . . . . . . 10 5.6. Fragmentation . . .9 5.5.1.. . . . . . . . . . . . . . . . . . . 10 5.6.1. DTag . . . . . . . . . . . . . . . . . . . . . . . . 10 5.6.2. Uplink fragmentation: From device to SCHC gateway . . 105.5.2.5.6.3. Downlink fragmentation: From SCHC gateway to a device.13 6. Security considerations . . . . . . . . . . . . . . . . . . . 16 Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . 17 Contributors . . . . . . . . . . . . . . . . . . . . . . . . . . 17 9. References . . . . . . . . . . . . . . . . . . . . . . . . . 17 9.1. Normative References . . . . . . . . . . . . . . . . . . 17 9.2. Informative References . . . . . . . . . . . . . . . . . 18 Appendix A. Examples . . . . . . . . . . . . . . . . . . . . . . 18 A.1. Uplink - Compression example - No fragmentation . . . . . 18 A.2. Uplink - Compression and fragmentation example . . . . . 19 A.3. Downlink . . . . . . . . . . . . . . . . . . . . . . . . 20 Appendix B. Note . . . . . . . . . . . . . . . . . . . . . . . . 22 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 22 1. Introduction The Static Context Header Compression (SCHC) specification [I-D.ietf-lpwan-ipv6-static-context-hc] describes generic header compression and fragmentation techniques that can be used on all LPWAN (Low Power Wide Area Networks) technologies defined in [RFC8376]. Even though those technologies share a great number of common features like star-oriented topologies, network architecture, devices with mostly quite predictable communications, etc; they do have some slight differences in respect of payload sizes, reactiveness, etc. SCHC gives a generic framework that enables those devices to communicate with other Internet networks. However, for efficient performance, some parameters and modes of operation need to be set appropriately for each of the LPWAN technologies. This document describes the efficient parameters and modes of operation when SCHC is used over LoRaWAN networks. 2. Terminology The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in[RFC2119].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 document. For all other definitions, please look up the SCHC specification [I-D.ietf-lpwan-ipv6-static-context-hc]. o DevEUI: an IEEE EUI-64 identifier used to identify the end-device during the procedure while joining the network (Join Procedure) o DevAddr: a 32-bit non-unique identifier assigned toaan end-device statically or dynamically after a Join Procedure (depending on the activation mode) o RCS: Reassembly Check Sequence. Used to verify the integrity of the fragmentation-reassembly process o TBD: all significant LoRaWAN-related terms. 3. Static Context Header Compression Overview This section contains a short overview of Static Context Header Compression (SCHC). For a detailed description, refer to the full specification [I-D.ietf-lpwan-ipv6-static-context-hc]. Static Context Header Compression (SCHC) avoids context synchronization, based on the fact that the nature of data flows is highly predictable in LPWAN networks, some static contexts may be stored on the Device (Dev). Thecontexts mustcontext MUST be stored in both ends, and it can either be learned by a provisioning protocol or byout-of-bandout-of- band means or it can be pre-provisioned, etc. The way the context is learned on both sides isout ofoutside the scope of this document. Dev App +----------------+ +----+ +----+ +----+ | App1 App2 App3 | |App1| |App2| |App3| | | | | | | | | | UDP | |UDP | |UDP | |UDP | | IPv6 | |IPv6| |IPv6| |IPv6| | | | | | | | | |SCHC C/D and F/R| | | | | | | +--------+-------+ +----+ +----+ +----+ |+--++---+ +----+ +----+ +----+ . . . +~|RG||RGW| === |NGW | == |SCHC| == |SCHC|...... Internet ....+--++---+ +----+ |F/R | |C/D | +----+ +----+ Figure 1: Architecture Figure 1 represents the architecture for compression/decompression, it is based on [RFC8376] terminology. The Device is sending applications flows using IPv6 or IPv6/UDP protocols. These flow might befragemented (SCHC F/R), andcompressed by an Static Context Header Compression Compressor/Decompressor (SCHC C/D) to reduce headerssize. Resultingsize and fragmented (SCHC F/R). The resulting information is sent on a layer two (L2) frame toaan LPWAN RadioNetwork (RG)Gateway (RGW) which forwards the frame to a Network Gateway (NGW). The NGW sends the data to a SCHC F/R for defragmentation, if required, then C/D for decompression which shares the same rules with the device. The SCHC F/R and C/D can be located on the Network Gateway (NGW) or in another place as long as a tunnel is established between the NGW and the SCHC F/R, then SCHC F/R and SCHC C/D. The SCHC C/D in both sidesmustMUST share the same set ofRules.rules. After decompression, the packet can be sent 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 principles can be applied in the other direction. 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 provided by the Network Server or any third party software. Figure 1 can bemapmapped in LoRaWAN terminology to: Dev App+----------------++--------------+ +----+ +----+ +----+| App1|App1 App2App3 |App3| |App1| |App2| |App3| | | | | | | | | | UDP | |UDP | |UDP | |UDP | | IPv6 | |IPv6| |IPv6| |IPv6| | | | | | | | | |SCHC C/Dand& F/R| | | | | | |+--------+-------++-------+------+ +----+ +----+ +----+ | +-------+ +-------++----------------++-----------+ . . . +~ |Gateway| === |Network| ==|Application |......|Application|..... Internet .... +-------+ |server | |server | +-------+ | F/R -C/D| +-------+ +----------------+C/D | +-----------+ Figure 2: SCHC Architecture mapped to LoRaWAN 4. LoRaWAN Architecture An overview of LoRaWAN [lora-alliance-spec] protocol and architecture is described in [RFC8376].MappingThe mapping between the LPWAN architecture entities as described in [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, actuators, etc.). There can be a very high density of devices per radio gateway (LoRaWAN gateway). This entity maps to the LoRaWAN End-Device. o The Radio Gateway (RGW), which is theend pointendpoint of the constrained link. This entity maps to the LoRaWAN Gateway. o The Network Gateway (NGW) is the interconnection node between the Radio Gateway and the Internet. This entity maps to the LoRaWAN Network Server. o LPWAN-AAA Server, which controls the user authentication and the applications. This entity maps to the LoRaWAN Join Server. o Application Server (App). The same terminology is used in LoRaWAN. In that case, the application server will be the SCHC gateway, doing C/D and F/R. () () () | +------+ () () () () / \ +---------+ | Join | () () () () () / \======| ^ |===|Server| +-----------+ () () () | | <--|--> | +------+ |Application| () () () () / \==========| v |=============| Server | () () () / \ +---------+ +-----------+ End-Devices Gateways Network Server Figure 3: LPWAN Architecture SCHC C/D (Compressor/Decompressor) and SCHC F/R (Fragmentation/ Reassembly) are performed on the LoRaWAN End-Device and the Application Server (called SCHC gateway). While the point-to-point link between the End-Device and the Application Server constitutes single IP hop, the ultimate end-point 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 IP router for the End-Device. The Application Server and Network Server may be co-located, which effectively turns the Network/Application Server into the first hop IP router. 4.1. End-Device classes (A, B, C) and interactions The LoRaWAN MAC layer supports 3 classes of end-devices named A, B and C. All end-devices implement theclassA,Class A, some end-devices may implementclassA+BClass B orclass A+C. ClassBClass C. Class B andclassCClass C are mutually exclusive. o*ClassA*:Class A: TheclassAClass A is the simplest class of end-devices. The end-device is allowed to transmit at any time, randomly selecting a communication channel. The network may reply with a downlink in one of the 2 receive windows immediately following the uplinks. Therefore, the network cannot initiate a downlink, it has to wait for the next uplink from the end-device to get a downlink opportunity. TheclassAClass A is the lowest power end-device class. o*ClassB*: classBClass B: Class B end-devices implement all the functionalities ofclassAClass A end-devices, but also schedule periodic listen windows. Therefore,asopposed to theclassAClass A end-devices,classBClass B end-devices can receivedownlinkdownlinks that are initiated by the network and not following an uplink. There is a trade-off between the periodicity of those scheduledclassBClass B listen windows and the power consumption of the end-device. The lower the downlink latency, the higher the power consumption. o*ClassC*: classCClass C: Class C end-devices implement all the functionalities ofclassAClass A end-devices, but keep their receiver open whenever they are not transmitting.ClassCClass C end-devices can receive downlinks at any time at the expense of a higher power consumption.Battery poweredBattery-powered end-devices can only operate inclassCClass C for a limited amount of time (for example for a firmware upgradeover-the-air).over- the-air). Most of theclassCClass C end-devices aremaingrid powered (for example Smart Plugs). 4.2. End-Device addressing LoRaWAN end-devices use a32 bits32-bit network address (devAddr) to communicate with the network over-the-air. However, that address might be reused severaltimetimes on the same network at the same time for different end-devices. End-devices using the same devAddr aredistinguishdistinguished by the Network Server based on the cryptographic signature appended to every single LoRaWAN MAC frame, as all end- devices use different security keys. To communicate with the SCHC gateway the Network Server MUST identify the end-devices by a unique64bits64-bit deviceIDidentifier called the devEUI. Unlike devAddr, devEUI is guaranteed to be unique for every single end-device across all networks. The devEUI is assigned to the end-device during the manufacturing process by the end-device's manufacturer. It is built like an Ethernet MAC address by concatenating the manufacturer's IEEE OUI field with a vendor unique number.ex: 24bitse.g.: 24-bit OUI is concatenated with a40 bits40-bit serial number. The Network Server translates the devAddr into a devEUI in the uplink direction and reciprocally on the downlink direction. +--------+ +----------+ +---------+ +----------+ | End- | <=====> | Network | <====> | SCHC | <========> | Internet | | Device | devAddr | Server | devEUI | Gateway | IPv6/UDP | | +--------+ +----------+ +---------+ +----------+ Figure 4: LoRaWAN addresses 4.3. General Message Types o*Confirmed messages*:Confirmed messages: The sender asks the receiver to acknowledge the message. o*Unconfirmed messages*:Unconfirmed messages: The sender does not ask the receiver to acknowledge the message. As SCHC defines its own acknowledgment mechanisms, SCHC does not require to use confirmed messages. 4.4. LoRaWAN MAC Frames o*JoinRequest*:JoinRequest: This message is used byaan end-device to join a network. It contains the end-device's unique identifier devEUI and a random nonce that will be used for session key derivation. o*JoinAccept*:JoinAccept: To on-boardaan end-device, the Network Server responds to the JoinRequest end-device's message with a JoinAccept message. That message is encrypted with the end-device's AppKey and contains (amongst other fields) the major network's settings and a network random nonce used to derive the session keys. o*Data*Data 5. SCHC-over-LoRaWAN 5.1. LoRaWAN FPort The LoRaWAN MAClayerslayer features a frame port field in all frames. This field (FPort) is 8-bit long and the values from 1 to 223 can be used. It allows LoRaWANnetworknetworks andapplicationapplications 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 device to server, is called uplink fragmentation session. It usesFPortUpShort or FPortUpDefaultan FPort for data uplink and its associated SCHC controldownlinks.downlinks, named FPortUp in this document. The other way, a fragmentation session with application payload transferred from server to device, is called downlink fragmentation session. It usesFPortDownanother FPort for data downlink and its associated SCHC controluplinks.uplinks, named FPortDown in this document. FPorts can use arbitrary values inside the allowed FPort range andmustMUST be shared by the end-device, the Network Server and SCHCgateway.gateway prior to the communication. The uplink and downlinkSCHC ports mustfragmentation FPorts MUST be different.In order5.2. Rule ID management 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 toimprove interoperability,223 application FPorts in the range [1;223] as defined in section 4.3.2 of [lora-alliance-spec], itis recommendedimplies 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. A RuleID SHOULD be reserved touse: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: oFPortUpShortRuleID = 20 (8-bit) for uplink fragmentation, named FPortUp oFPortUpDefaultRuleID = 21o(8-bit) for downlink fragmentation, named FPortDown o RuleID = 22Those(8-bit) for which SCHC compression was not possible The remaining RuleIDs arerecommended values andavailable for compression. RuleIDs areapplication defined. Also application can have multiple fragmentation sessionshared betweena deviceuplink andone or several SCHC gateways.downlink sessions. Aset of three FPort values is required for each gateway instanceRuleID different from FPortUp or FPortDown means that thedevicefragmentation isrequirednot used, thus the packet SHOULD be sent tocommunicate with.C/D layer. The only uplink messages using the FPortDown port are the fragmentation SCHC control messages of a downlink fragmentation session (ex ACKs). Similarly, the only downlink messages using theFPortUpShort or FPortUpDefault portsFPortUp port are the fragmentation SCHC control messages of an uplink fragmentation session.5.2. Rule ID management SCHC-over-LoRaWAN SHOULD support encoding RuleID on 6 bits (64 possible rules). The RuleID 0An application can have multiple fragmentation sessions between a device and one or several SCHC gateways. A set of FPort values isreservedREQUIRED forfragmentation. The RuleID 63each SCHC gateway instance the device isusedrequired totag packets for which SCHC compression was not possible (no matching Rule was found).communicate with. Theremaining RuleIDs are availablemechanism forcompression. RuleIDs are shared between uplink and downlink sessions. Asharing those RuleIDdifferent from 0 means that the fragmentationvalues isnot used, thusoutside thepacket should be send to C/D layer.scope of this document. 5.3. IID computation As LoRaWAN network uses unique EUI-64 per end-device, the Interface IDentifier is the LoRaWAN DevEUI. It is compliant with [RFC4291] and IID starting with binary 000 must enforce the64-bits64-bit rule. 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 fragmentation over LoRaWAN uses the ACK-on-Error for uplink fragmentation and Ack-Always for downlink fragmentation. A LoRaWAN end-device cannot support simultaneous interleaved fragmentation sessions in the same direction (uplink or downlink). This means that only a single fragmented IPv6 datagram may be transmitted and/or received by the end-device at a given moment. The fragmentation parameters are different for uplink and downlink fragmentation sessions and are successively described in the next sections.5.5.5.6.1. DTag A LoRaWAN device cannot interleave several fragmented SCHCdatagrams.datagrams on the same FPort. Thisone bitfield is not usedto distinguish two consecutive fragmentation sessions. _Note_: While itand its size isused to recover faster from transmission errors, it SHALL not be considered as the only way to distinguish two0. Note: The device can still have several parallel fragmentationsessions. 5.5.1.sessions with one or more SCHC gateway(s) thanks to distinct sets of FPorts, cf Section 5.2 5.6.2. Uplink fragmentation: From device to SCHC gateway In that case the device is the fragmentation transmitter, and the SCHC gateway the fragmentation receiver.TwoA single fragmentationrules are defined regardingrule is defined. SCHC F/R MUST concatenate FPort and LoRaWAN payload to retrieve the*FPort*:SCHC fragment as per Section 5.1. o*FPortUpShort*:Minimum SCHC header isonly one byte. Used when fragmentation is requiredtwo bytes (the FPort byte + 1 additional byte) andpayload size is less than 381 bytes. o *FPortUpDefault*: SCHCthe RECOMMENDED header size is two bytes.Used for all other cases: no fragmentation required or payloado RuleID: Recommended size isbetween 382 and 1524 byte. *Both rules share common parameters:*8 bits in SCHC header. o*SCHCSCHC fragmentation reliabilitymode*:mode: "ACK-on-Error" o*DTag*: sizeDTag: Size is1 bit.0 bit, not used o*FCN*:FCN: The FCN field is encoded on N =76 bits, so WINDOW_SIZE =12764 tiles are allowed in a window(FCN=All-1 is reserved for SCHC).o*MICWindow index: encoded on W = 2 bits. So 4 windows are available. o RCS calculationalgorithm*:algorithm: CRC32 using 0xEDB88320 (i.e. the reverse representation of the polynomial used e.g. in the Ethernet standard [RFC3385]) as suggested in [I-D.ietf-lpwan-ipv6-static-context-hc]. o*MAX_ACK_REQUESTS*:MAX_ACK_REQUESTS: 8 o*Tile*:Tile: size is35 bytes(24 bits)o*RetransmissionRetransmission and inactivitytimers*:timers: LoRaWAN end-devices do not implement a "retransmission timer". At the end of a window or a fragmentation session, corresponding ACK(s) is (are) transmitted by the network gateway (LoRaWAN application server) in the RX1 or RX2 receive slot of end-device. If this ACK is not received by the end-device at the end of its RX windows, it sends an all-0 (or an all-1) fragment with no payload to request an SCHC ACK retransmission. The periodicity between retransmission of the all-0/all-1 fragments is device/application specific andmayMAY be different for each device (not specified). The SCHC gateway implements an "inactivity timer". The defaultrecommendedRECOMMENDED duration of this timer is 12 hours. This value is mainly driven by application requirements andmayMAY be changed by the application.*The following fields are different:* o RuleID sizeoWindow 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 payloadLast tile: The last tile can betransported. o *RuleID*: size is 0 bitcarried inSCHC header, not used. o *Window index*: encoded on W = 0 bit, not usedthe All-1 fragment. With this set of parameters, the SCHC fragment header is 16 bits, including FPort; payload overhead will be 8 bits as FPort is1 byte (8 bits).already a part of LoRaWAN payload. MTU is:_127_4 windows * 64 tiles *35 bytes per tile =3811280 bytes_*Regular fragments* | DTag5.6.2.1. Regular fragments |FCNFPort |PayloadLoRaWAN 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 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 fragmented payload size less than 382 bytes. *Regular fragments*| RuleID |DTag |W | FCN | Payload | + ------ +----- +------ + ------ + ------- + |68 bits |1 bit |2 bits |76 bits | | Figure7:6: Allfragmentfragments except the last one.HeaderSCHC header size is 16bits (2 bytes). *Lastbits, including LoRaWAN FPort. 5.6.2.2. Last fragment(All-1)*(All-1) |RuleIDFPort |DTagLoRaWAN payload | + ------ + ------------------------------------------------ + | RuleID | W | FCN=All-1 |MICRCS | Payload | + ------ +----- +------ + --------- + ------- + ----------------- + |68 bits |1 bit |2 bits |76 bits | 32 bits | Last tile, if any | Figure8:7: All-1 fragment detailed format for the last fragment.*SCHC ACK*5.6.2.3. SCHC ACK |RuleIDFPort |DTagLoRaWAN payload | + ------ + ----------------------------------------- + | RuleID | W | C | Encoded bitmap (if C = 0) | + ------ + ----- + ----- +----- +------------------------- + |68 bits |1 bit |2 bit | 1 bit | 0 to 127 bits | Figure9:8: SCHC formats, failedMICRCS check.*Receiver-Abort*5.6.2.4. Receiver-Abort |RuleIDFPort |DTagLoRaWAN payload | + ------ + -------------------------------------------- + | RuleID | W = b'11 | C = 1 |b'111111b'11111 | 0xFF (all 1's) | + ------ +----- +-------- +------+---------------+-------- +---------------+----------------+ |68 bits |1 bit |2 bits | 1 bit |65 bits | 8 bits | next L2 Word boundary ->| <-- L2 Word --> | Figure10:9: Receiver-Abort format.*SCHC5.6.2.5. SCHC acknowledgerequest*request |RuleIDFPort |DTagLoRaWAN payload | +------- +------------------------- + | RuleID | W | FCN =b'0000000b'000000 | + ------ +----- +------ + --------------- + |68 bits |1 bit |2 bits |76 bits | Figure11:10: SCHC ACK REQ format.5.5.2.5.6.3. Downlink fragmentation: From SCHC gateway to a device In that case the device is the fragmentation receiver, and the SCHC gateway the fragmentation transmitter. The following fields are 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*SCHCSCHC fragmentation reliabilitymode*:mode: ACK-Always. o*RuleID*:RuleID: Recommended size is68 bits(64 possible rules, 62 for compression).in SCHC header. o*Window index*:Window index: encoded on W=1 bit, as per [I-D.ietf-lpwan-ipv6-static-context-hc]. o*DTag*: Not used, so its sizeDTag: Size is 0bit.bit, not used o*FCN*:FCN: The FCN field is encoded on N=1bits,bit, so WINDOW_SIZE = 1 tile (FCN=All-1 is reserved for SCHC). o*MICRCS calculationalgorithm*:algorithm: CRC32 using 0xEDB88320 (i.e. the reverse representation of the polynomial used e.g. in the Ethernet standard [RFC3385]), as per [I-D.ietf-lpwan-ipv6-static-context-hc]. o*MAX_ACK_REQUESTS*:MAX_ACK_REQUESTS: 8 As only 1 tile is used, its size can change for each downlink, and will be maximum availableMTU minus header (1 byte)MTU. _Note_: The Fpending bit included in LoRaWAN protocol SHOULDnotNOT be used for SCHC-over-LoRaWAN protocol. It might be set by the Network Server for other purposesinbut not SCHC needs.*Regular fragments*5.6.3.1. Regular fragments | FPort | LoRaWAN payload | + ------ + ----------------------------------- + | RuleID | W | FCN = b'0 | Payload | + ------ + ----- + --------- +---------------------- + |68 bits | 1 bit | 1bitsbit | X bytes | Figure12:11: All fragments but the last one. Header size1 byte (8 bits). *Last10 bits, including LoraWAN FPort. 5.6.3.2. Last fragment(All-1)*(All-1) | FPort | LoRaWAN payload | + ------ + ----------------------------------------------- + | RuleID | W | FCN = b'1 |MICRCS | Payload | + ------ + ----- + --------- + ------- + ----------------- + |68 bits | 1 bit | 1 bit | 32 bits | Last tile, if any | Figure13:12: All-1 SCHC ACK detailed format for the last fragment.*SCHC acknowledge*5.6.3.3. SCHC acknowledge | FPort | LoRaWAN payload | + ------ + ---------------------------------- + | RuleID | W | C = b'1 | Padding b'000000 | + ------ + ----- + ------- + ---------------- + |68 bits | 1 bit | 1 bit | 6 bits | Figure14:13: SCHC ACK format,MICRCS is correct.*Receiver-Abort*5.6.3.4. Receiver-Abort | FPort | LoRaWAN payload | + ------ + ---------------------------------------------- + | RuleID | W = b'1 | C =b'0b'1 |b'11111111b'111111 | 0xFF (all 1's) | + ------ +------------ + ------- +------------------ + --------------- + |68 bits | 1 bit | 1 bits | 6 bits | 8 bits | next L2 Word boundary ->| <-- L2 Word --> | Figure15:14: Receiver-Abort packet (following an all-1 packet with incorrectMIC).RCS). Class A andclassB&CClass B or Class C end-devices do not manage retransmissions and timers in the same way.5.5.2.1. ClassA5.6.3.5. Class A end-devices Class A end-devices can only receive in an RX slot following the transmission of an uplink. Therefore there cannot be a concept of "retransmission timer" for an SCHC gateway. The SCHC gateway cannot initiate communication to aclassAClass A end-device. The device replies with an ACK message to every single fragment received from the SCHC gateway (because the window size is 1). 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), the device MUST transmit the SCHC ACK fragment until it receives the fragment of the next window. The deviceshallSHALL transmit up to MAX_ACK_REQUESTS ACK messages before aborting. The device should transmit those ACK as soon as possible while taking into consideration potential local radio regulation on duty-cycle, to progress the fragmentation session as quickly as possible. The ACK bitmap is 1 bit long and is always 1. Following the reception ofaan FCN=All-1 fragment (the last fragment of a datagram) and if theMICRCS is correct, the deviceshallSHALL transmit the ACK with the"MIC"RCS is correct" indicator bit set (C=1). This message might be lost therefore the SCHC gatewaymayMAY request a retransmission of this ACK in the next downlink. The device SHALL keep this ACK message in memory until it receives a downlink, on SCHC FPortDown from the SCHC gateway different from an ACK-request: it indicates that the SCHC gateway 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 theMICRCS isNOTnot correct, the deviceshallSHALL transmit a Receiver-Abort fragment. The device SHALL keep this Abort message in memory until it receives a downlink, on SCHC FPortDown, from the SCHC gateway different from an ACK-request indicating that the SCHC gateway has received the Abort message. The fragmentation receiver (device) does not implement retransmission timer and inactivity timer. The fragmentation sender (the SCHC gateway) implements an inactivity timer with a default duration of 12 hours. Once a fragmentation session is started, if the SCHC gateway has not received any ACK or Receiver-Abort message 12 hours after the last message from the device was received, the SCHC gatewaymayMAY flush the fragmentation context. For devices with very low transmission rates (example 1 packet a day in normal operation) , that duration may be extended, but this is application specific.5.5.2.2.5.6.3.6. Class B or Class C end-devices ClassB&CB and Class C end-devices can receive in scheduled RX slots or in RX slots following the transmission of an uplink. The device replies with an ACK message to every single fragment received from the SCHC gateway (because the window size is 1). Following the reception ofaan FCN=0 fragment (fragment that is not the last fragment of the packet or ACK-request), the device MUST always transmit the corresponding SCHC ACK message even if that fragment has already been received. The ACK bitmap is 1 bit long and is always 1. If the SCHC gateway receives this ACK, it proceeds to send the next window fragment. If the retransmission timer elapses and the SCHC gateway has not received the ACK of the current window it retransmits the last fragment. The SCHC gateway tries retransmitting up to MAX_ACK_REQUESTS times before aborting. Following the reception ofaan FCN=All-1 fragment (the last fragment of a datagram) and if theMICRCS is correct, the deviceshallSHALL transmit the ACK with the"MIC"RCS is correct" indicator bit set. If the SCHC gateway receives this ACK, the current fragmentation session has succeeded and its context can be cleared. If the retransmission timer elapses and the SCHC gateway has not received the SCHC ACK it retransmits the last fragment with the payload (not an ACK-request without payload). The SCHC gateway tries retransmitting up to MAX_ACK_REQUESTS times before aborting.The device SHALL keep the SCHC ACK message in memory until it receives a downlink from the SCHC gateway different from the last (FCN>0 and different DTag) fragment indicating that the SCHC gateway has received the ACK message.Following the reception ofaan FCN=All-1 fragment (the last fragment of a datagram), if all fragments have been received and if theMICRCS is NOT correct, the deviceshallSHALL transmit a Receiver-Abort fragment. The retransmission timer is used by the SCHC gateway (the sender), the optimal value is very much application specific but here are some recommended default values. ForclassBClass B end-devices, this timer trigger is a function of the periodicity of theclassBClass B ping slots. TherecommendedRECOMMENDED value is equal to 3 times theclassBClass B ping slot periodicity. ForclassCClass C end-devices which are nearly constantly receiving, therecommendedRECOMMENDED value is 30 seconds. This means that the end-device shall try to transmit the ACK within 30 seconds of the reception of each fragment. The inactivity timer is implemented by the end-device to flush the context in-case it receives nothing from the SCHC gateway over an extended period of time. TherecommendedRECOMMENDED value is 12 hours for bothclassB&CClass B and Class C end-devices. 6. Security considerations This document is only providing parameters that are expected to be better suited for LoRaWAN networks for [I-D.ietf-lpwan-ipv6-static-context-hc]. As such, thisparametersdocument does not contribute to any new security issues in additionofto those identified in [I-D.ietf-lpwan-ipv6-static-context-hc]. Acknowledgements Thanks to all those listed in the Contributors section for the excellent text, insightful discussions, reviews and suggestions. Contributors Contributors ordered by family name. o ins: V. Audebert name: Vincent AUDEBERT org: EDF R&D street: 7 bd Gaspard Monge city: 91120 PALAISEAU country: FRANCE email: 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 Chemin des Clos city: Meylan country: France email: mcoracin@semtech.com o ins: M. Le Gourrierec name: Marc Le Gourrierec org: SagemCom street: 250 Route de l'Empereur city: 92500 Rueil Malmaison country: FRANCE email: marc.legourrierec@sagemcom.com o ins: N. Sornin name: Nicolas Sornin org: Semtech street: 14 Chemin des Clos city: Meylan country: France email: nsornin@semtech.com o ins: A. Yegin name: Alper Yegin org: Actility street: . city: Paris, Paris country: France email: alper.yegin@actility.com 9. References 9.1. Normative References [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/RFC2119, March 1997, <https://www.rfc-editor.org/info/rfc2119>. [RFC3385] Sheinwald, D., Satran, J., Thaler, P., and V. Cavanna, "Internet Protocol Small Computer System Interface (iSCSI) Cyclic Redundancy Check (CRC)/Checksum Considerations", RFC 3385, DOI 10.17487/RFC3385, September 2002, <https://www.rfc-editor.org/info/rfc3385>. [RFC4291] Hinden, R. and S. Deering, "IP Version 6 Addressing Architecture", RFC 4291, DOI 10.17487/RFC4291, February 2006, <https://www.rfc-editor.org/info/rfc4291>. [RFC4944] Montenegro, G., Kushalnagar, N., Hui, J., and D. Culler, "Transmission of IPv6 Packets over IEEE 802.15.4 Networks", RFC 4944, DOI 10.17487/RFC4944, September 2007, <https://www.rfc-editor.org/info/rfc4944>. [RFC5795] Sandlund, K., Pelletier, G., and L-E. Jonsson, "The RObust Header Compression (ROHC) Framework", RFC 5795, DOI 10.17487/RFC5795, March 2010, <https://www.rfc-editor.org/info/rfc5795>. [RFC7136] Carpenter, B. and S. Jiang, "Significance of IPv6 Interface Identifiers", RFC 7136, DOI 10.17487/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) Overview", RFC 8376, DOI 10.17487/RFC8376, May 2018, <https://www.rfc-editor.org/info/rfc8376>. 9.2. Informative References [I-D.ietf-lpwan-ipv6-static-context-hc] Minaburo, A., Toutain, L., Gomez, C., Barthel, D., and J. Zuniga, "Static Context Header Compression (SCHC) and fragmentation for LPWAN, application to UDP/IPv6", draft-ietf-lpwan-ipv6-static-context-hc-19ietf-lpwan-ipv6-static-context-hc-21 (work in progress), July 2019. [lora-alliance-spec] Alliance, L., "LoRaWAN Specification Version V1.0.3", <https://lora-alliance.org/sites/default/files/2018-07/ lorawan1.0.3.pdf>. Appendix A. Examples A.1. Uplink - Compression example - No fragmentation Figure1615 is representing an applicative payload going through SCHC, no fragmentation required An applicative payload of 78 bytes is passed to SCHC compression layer using rule 1, allowing to compress it to 40 bytes and 5 bits: 1 byte ruleID, 21 bits residue +3837 bytes payload. | RuleID | Compression residue | Payload |Padding=0b000Padding=b'000 | + ------ + ------------------- + --------- + ------------- + | 1 | 21 bits | 38 bytes | 3 bits | 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 fragmentation. The payload will be transmitted throughFPortUpDefaultFPort = 1 | LoRaWAN Header |RuleIDLoRaWAN payload (40 bytes) | + ------------------------- + --------------------------------------- + | | FOpts | RuleID=1 | Compressionresidue| Payload | Padding=b'000 | | | | | residue | | | +------------------ +------------- +--------------------------- + ----------- + --------- + ------------- + | XXXX | 2 bytes | 1 byte | 21 bits |3837 bytes | 3 bits | Figure16:15: Uplink example: compression without fragmentation A.2. Uplink - Compression and fragmentation example Figure1716 is representing an applicative payload going through SCHC, with fragmentation. An applicative payload of 478 bytes is passed to SCHC compression layer using rule 1, allowing to compress it to440 bytes:282 bytes and 5 bits: 1 byte ruleID, 21 bits residue +138279 bytes payload. | RuleID | Compression residue | Payload | + ------ + ------------------- + --------- + | 1 | 21 bits |138279 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 LoRaWAN protocol: 9 bytes are available for SCHCpayload.payload + 1 byte FPort field. SCHC header is 2 bytes (including FPort) so2 tiles are send1 tile is sent in first fragment. | LoRaWAN Header |FOptsLoRaWAN payload (6 bytes) |RuleID+ ------------------------------------- + ------------------------- + |DTag| FOpts | RuleID=20 | W | FCN |2 tiles1 tile | + -------------- + ------- +---------------- + ----- + ------ +------ + --------------- + | XXXX | 2 bytes |01 byte | 0|0 |12662 |65 bytes | Content of thetwo tilestile is: | RuleID | Compression residue | Payload | + ------ + ------------------- +----------------------------------- + | 1 | 21 bits |2 bytes1 byte +53 bits | Next transmission MTU is 242 bytes, no FOpts.8048 tiles are transmitted: | LoRaWAN Header |RuleIDLoRaWAN payload (241 bytes) |DTag+ -------------- + -----------+ --------------------------- + | | RuleID=20 | W | FCN |8048 tiles | + -------------- +---------------- + ----- + ------ +------ + ------------------- + | XXXX |01 byte | 0|0 |12461 | 240 bytes | Next transmission MTU is 242 bytes, no FOpts. All658 remaining tiles are transmitted, the last tile is only 2bytes.bytes + 5 bits. Padding is added for the remaining63 bits. | LoRaWAN Header |RuleIDLoRaWAN payload (39 bytes) |DTag+ ---- + -----------+ ----------------------------------------------- + | | RuleID=20 | W | FCN |MIC | 658 tiles | Padding=b'000 | +-------------- + ---------- +--------------- +-------- + ------ +----- + -------------------------- +----------------------------- + | XXXX |0 | 0 | 01 byte |12700 |CRC3213 |19437 bytes + 5 bits | 3 bits | All packets have been received by the SCHC gateway, computedMICRCS is correct so the following ACK issendsent to the device: | LoRaWAN Header |RuleIDLoRaWAN payload | + -------------- + --------- + ------------------- + |DTag| RuleID=20 | W | C | Padding | + -------------- +--------------- + ----- +------- +---------- + | XXXX |01 byte | 0|0 | 1 | 5 bits | Figure17:16: Uplink example: compression and fragmentation A.3. Downlink An applicative payload of43443 bytes is passed to SCHC compression layer using rule 1, allowing to compress it to24130 bytes and 5 bits: 1 byte ruleId, 21 bits residue +22127 bytes payload. | RuleID | Compression residue | Payload | + ------ + ------------------- + --------- + | 1 | 21 bits |18127 bytes | The current LoRaWAN MTU is1151 bytes,although 2 bytesno FOpts are used by LoRaWAN protocol:948 bytes are available for SCHC payload + FPort field => it has to be fragmented. | LoRaWAN Header |FOptsLoRaWAN payload (51 bytes) |RuleID+ ---- + ---------- + --------------------------------------------- + | | RuleID=21 | W | FCN | 1 tile | Padding=b'000000 | +------------------ +----------------- +--------- +--------- +-------------------- +----------------------- + | XXXX |2 bytes | 01 byte | 0 | 0 |850 bytes | 6 bits | Content of thetwo tilestile is: | RuleID | Compression residue | Payload | + ------ + ------------------- + ------------------ + | 1 | 21 bits |246 bytes +53 bits | The receiver answers with an SCHC ACK | FPortDown | LoRaWAN payload | + --------- + ---------------------------------- + | RuleID | W = 0 | C = b'1 | Padding=b'000000 | +--------------- + ----- + ------- + ---------------- + |6 bits1 byte | 1 bit | 1 bit | 6 bits | The second downlink issend, nosent, two FOpts: | LoRaWAN Header |RuleIDLoRaWAN payload (49 bytes) | + --------------------------- + ------------------ + ---------------- + | | FOpts | RuleID=21 | W | FCN | 1 tile | Padding=b'000000 | +------------------ +------------- +---------------- +------- + --- + -------- + ---------------- + | XXXX |02 bytes | 1 byte | 1 | 0 |1048 bytes | 6 bits | The receiver answers with an SCHC ACK | FPortDown | LoRaWAN payload | + --------- + ---------------------------------- + | RuleID | W = 1 | C = b'1 | Padding=b'000000 | +--------------- + ----- + ------- + ---------------- + |6 bits1 byte | 1 bit | 1 bit | 6 bits | Thethirdlast downlink issend,sent, no FOpts: | LoRaWAN Header |RuleID | W | FCN | 1 tile | + -------------- + ------ + ------ + ------ + -------- + | XXXX | 0 | 0 | 0 | 10 bytes | The receiver answers with an SCHC ACK | RuleID | W = 0 | C = 1LoRaWAN payload (33 bytes) | +---------- +--------------- +------------------------------------------------------ + |6 bits | 1 bit | 1 bit | The last downlink is send, no FOpts: | LoRaWAN Header|RuleIDRuleID=21 | W | FCN | 1 tile | Padding=b'0 | +------------------ +---------------- +--------- +--------- +----------------------------- + ----------- + | XXXX |0 |1 byte | 0 | 1 |232 bytes + 5 bits | 1 bit | The receiver answers with an SCHC ACK | FPortDown | LoRaWAN payload | + --------- + ---------------------------------- + | RuleID | W =10 | C =1b'1 | Padding=b'000000 | +--------------- + ----- + ------- + ---------------- + |6 bits1 byte | 1 bit | 1 bit | 6 bits | Figure18:17: Downlink example: compression and fragmentation Appendix B. Note Authors' Addresses Olivier Gimenez (editor) Semtech 14 Chemin des Clos Meylan France Email: ogimenez@semtech.com Ivaylo Petrov (editor) Acklio2bis rue de la Chataigneraie1137A Avenue des Champs Blancs 35510 Cesson-Sevigne Cedex France Email: ivaylo@ackl.io Julien Catalano Kerlink 1 rue Jacqueline Auriol 35235 Thorigne-Fouillard France Email: j.catalano@kerlink.fr