idnits 2.17.1 draft-ietf-lpwan-schc-over-lorawan-13.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- No issues found here. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (October 30, 2020) is 1271 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) No issues found here. Summary: 0 errors (**), 0 flaws (~~), 1 warning (==), 1 comment (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 lpwan Working Group O. Gimenez, Ed. 3 Internet-Draft Semtech 4 Intended status: Standards Track I. Petrov, Ed. 5 Expires: May 3, 2021 Acklio 6 October 30, 2020 8 Static Context Header Compression (SCHC) over LoRaWAN 9 draft-ietf-lpwan-schc-over-lorawan-13 11 Abstract 13 The Static Context Header Compression (SCHC) specification describes 14 generic header compression and fragmentation techniques for Low Power 15 Wide Area Networks (LPWAN) technologies. SCHC is a generic mechanism 16 designed for great flexibility so that it can be adapted for any of 17 the LPWAN technologies. 19 This document specifies a profile of RFC8724 to use SCHC in LoRaWAN 20 networks, and provides elements such as efficient parameterization 21 and modes of operation. 23 Status of This Memo 25 This Internet-Draft is submitted in full conformance with the 26 provisions of BCP 78 and BCP 79. 28 Internet-Drafts are working documents of the Internet Engineering 29 Task Force (IETF). Note that other groups may also distribute 30 working documents as Internet-Drafts. The list of current Internet- 31 Drafts is at https://datatracker.ietf.org/drafts/current/. 33 Internet-Drafts are draft documents valid for a maximum of six months 34 and may be updated, replaced, or obsoleted by other documents at any 35 time. It is inappropriate to use Internet-Drafts as reference 36 material or to cite them other than as "work in progress." 38 This Internet-Draft will expire on May 3, 2021. 40 Copyright Notice 42 Copyright (c) 2020 IETF Trust and the persons identified as the 43 document authors. All rights reserved. 45 This document is subject to BCP 78 and the IETF Trust's Legal 46 Provisions Relating to IETF Documents 47 (https://trustee.ietf.org/license-info) in effect on the date of 48 publication of this document. Please review these documents 49 carefully, as they describe your rights and restrictions with respect 50 to this document. Code Components extracted from this document must 51 include Simplified BSD License text as described in Section 4.e of 52 the Trust Legal Provisions and are provided without warranty as 53 described in the Simplified BSD License. 55 Table of Contents 57 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 58 2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 3 59 3. Static Context Header Compression Overview . . . . . . . . . 4 60 4. LoRaWAN Architecture . . . . . . . . . . . . . . . . . . . . 6 61 4.1. Device classes (A, B, C) and interactions . . . . . . . . 7 62 4.2. Device addressing . . . . . . . . . . . . . . . . . . . . 8 63 4.3. General Frame Types . . . . . . . . . . . . . . . . . . . 8 64 4.4. LoRaWAN MAC Frames . . . . . . . . . . . . . . . . . . . 9 65 4.5. LoRaWAN FPort . . . . . . . . . . . . . . . . . . . . . . 9 66 4.6. LoRaWAN empty frame . . . . . . . . . . . . . . . . . . . 9 67 4.7. Unicast and multicast technology . . . . . . . . . . . . 9 68 5. SCHC-over-LoRaWAN . . . . . . . . . . . . . . . . . . . . . . 10 69 5.1. LoRaWAN FPort and RuleID . . . . . . . . . . . . . . . . 10 70 5.2. Rule ID management . . . . . . . . . . . . . . . . . . . 10 71 5.3. Interface IDentifier (IID) computation . . . . . . . . . 11 72 5.4. Padding . . . . . . . . . . . . . . . . . . . . . . . . . 12 73 5.5. Decompression . . . . . . . . . . . . . . . . . . . . . . 12 74 5.6. Fragmentation . . . . . . . . . . . . . . . . . . . . . . 12 75 5.6.1. DTag . . . . . . . . . . . . . . . . . . . . . . . . 13 76 5.6.2. Uplink fragmentation: From device to SCHC gateway . . 13 77 5.6.3. Downlink fragmentation: From SCHC gateway to device . 16 78 5.7. SCHC Fragment Format . . . . . . . . . . . . . . . . . . 20 79 5.7.1. All-0 SCHC fragment . . . . . . . . . . . . . . . . . 20 80 5.7.2. All-1 SCHC fragment . . . . . . . . . . . . . . . . . 21 81 5.7.3. Delay after each LoRaWAN frame to respect local 82 regulation . . . . . . . . . . . . . . . . . . . . . 21 83 6. Security Considerations . . . . . . . . . . . . . . . . . . . 21 84 7. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 21 85 Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . 21 86 Contributors . . . . . . . . . . . . . . . . . . . . . . . . . . 21 87 10. References . . . . . . . . . . . . . . . . . . . . . . . . . 22 88 10.1. Normative References . . . . . . . . . . . . . . . . . . 22 89 10.2. Informative References . . . . . . . . . . . . . . . . . 23 90 Appendix A. Examples . . . . . . . . . . . . . . . . . . . . . . 23 91 A.1. Uplink - Compression example - No fragmentation . . . . . 23 92 A.2. Uplink - Compression and fragmentation example . . . . . 24 93 A.3. Downlink . . . . . . . . . . . . . . . . . . . . . . . . 26 94 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 28 96 1. Introduction 98 SCHC specification [RFC8724] describes generic header compression and 99 fragmentation techniques that can be used on all LPWAN technologies 100 defined in [RFC8376]. Even though those technologies share a great 101 number of common features like star-oriented topologies, network 102 architecture, devices with mostly quite predictable communications, 103 etc; they do have some slight differences with respect to payload 104 sizes, reactiveness, etc. 106 SCHC provides a generic framework that enables those devices to 107 communicate on IP networks. However, for efficient performance, some 108 parameters and modes of operation need to be set appropriately for 109 each of the LPWAN technologies. 111 This document describes the parameters and modes of operation when 112 SCHC is used over LoRaWAN networks. 114 2. Terminology 116 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 117 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 118 "OPTIONAL" in this document are to be interpreted as described in BCP 119 14 [RFC2119] [RFC8174] when, and only when, they appear in all 120 capitals, as shown here. 122 This section defines the terminology and acronyms used in this 123 document. For all other definitions, please look up the SCHC 124 specification [RFC8724]. 126 o DevEUI: an IEEE EUI-64 identifier used to identify the device 127 during the procedure while joining the network (Join Procedure). 128 It is assigned by the manufacturer or the device owner and 129 provisioned on the Network Gateway. 131 o DevAddr: a 32-bit non-unique identifier assigned to a device 132 either: 134 * Statically: by the device manufacturer in _Activation by 135 Personalization_ mode. 137 * Dynamically: after a Join Procedure by the Network Gateway in 138 _Over The Air Activation_ mode. 140 o Downlink: LoRaWAN term for a frame transmitted by the network and 141 received by the device. 143 o FRMPayload: Application data in a LoRaWAN frame. 145 o MSB: Most Significant Byte 147 o OUI: Organisation Unique Identifier. IEEE assigned prefix for 148 EUI. 150 o RCS: Reassembly Check Sequence. Used to verify the integrity of 151 the fragmentation-reassembly process. 153 o RX: Device's reception window. 155 o RX1/RX2: LoRaWAN class A end-devices open two RX windows following 156 an uplink, called RX1 and RX2. 158 o SCHC gateway: It corresponds to the LoRaWAN Application Server. 159 It manages translation between IPv6 network and the Network 160 Gateway (LoRaWAN Network Server). 162 o Tile: Piece of a fragmented packet as described in [RFC8724] 163 section 8.2.2.1 165 o Uplink: LoRaWAN term for a frame transmitted by the device and 166 received by the network. 168 3. Static Context Header Compression Overview 170 This section contains a short overview of SCHC. For a detailed 171 description, refer to the full specification [RFC8724]. 173 It defines: 175 1. Compression mechanisms to avoid transporting information known by 176 both sender and receiver over the air. Known information is part 177 of the "context". This component is called SCHC Compressor/ 178 Decompressor (SCHC C/D). 180 2. Fragmentation mechanisms to allow SCHC Packet transportation on 181 small, and potentially variable, MTU. This component is called 182 SCHC Fragmentation/Reassembly (SCHC F/R). 184 Context exchange or pre-provisioning is out of scope of this 185 document. 187 Device App 188 +----------------+ +----+ +----+ +----+ 189 | App1 App2 App3 | |App1| |App2| |App3| 190 | | | | | | | | 191 | UDP | |UDP | |UDP | |UDP | 192 | IPv6 | |IPv6| |IPv6| |IPv6| 193 | | | | | | | | 194 |SCHC C/D and F/R| | | | | | | 195 +--------+-------+ +----+ +----+ +----+ 196 | +---+ +----+ +----+ +----+ . . . 197 +~ |RGW| === |NGW | == |SCHC| == |SCHC|...... Internet .... 198 +---+ +----+ |F/R | |C/D | 199 +----+ +----+ 201 Figure 1: Architecture 203 Figure 1 represents the architecture for compression/decompression, 204 it is based on [RFC8376] terminology. The device is sending 205 applications flows using IPv6 or IPv6/UDP protocols. These flows 206 might be compressed by a Static Context Header Compression 207 Compressor/Decompressor (SCHC C/D) to reduce headers size and 208 fragmented by the SCHC Fragmentation/Reassembly (SCHC F/R). The 209 resulting information is sent on a layer two (L2) frame to an LPWAN 210 Radio Gateway (RGW) that forwards the frame to a Network Gateway 211 (NGW). The NGW sends the data to a SCHC F/R for reassembly, if 212 required, then to SCHC C/D for decompression. The SCHC C/D shares 213 the same rules with the device. The SCHC C/D and F/R can be located 214 on the Network Gateway (NGW) or in another place as long as a 215 communication is established between the NGW and the SCHC F/R, then 216 SCHC F/R and C/D. The SCHC C/D and F/R in the device and the SCHC 217 gateway MUST share the same set of rules. After decompression, the 218 packet can be sent on the Internet to one or several LPWAN 219 Application Servers (App). 221 The SCHC C/D and F/R process is bidirectional, so the same principles 222 can be applied to the other direction. 224 In a LoRaWAN network, the RGW is called a Gateway, the NGW is Network 225 Server, and the SCHC C/D and F/R are an Application Server. It can 226 be provided by the Network Gateway or any third party software. 227 Figure 1 can be mapped in LoRaWAN terminology to: 229 End Device App 230 +--------------+ +----+ +----+ +----+ 231 |App1 App2 App3| |App1| |App2| |App3| 232 | | | | | | | | 233 | UDP | |UDP | |UDP | |UDP | 234 | IPv6 | |IPv6| |IPv6| |IPv6| 235 | | | | | | | | 236 |SCHC C/D & F/R| | | | | | | 237 +-------+------+ +----+ +----+ +----+ 238 | +-------+ +-------+ +-----------+ . . . 239 +~ |Gateway| === |Network| == |Application|..... Internet .... 240 +-------+ |server | |server | 241 +-------+ | F/R - C/D | 242 +-----------+ 244 Figure 2: SCHC Architecture mapped to LoRaWAN 246 4. LoRaWAN Architecture 248 An overview of LoRaWAN [lora-alliance-spec] protocol and architecture 249 is described in [RFC8376]. The mapping between the LPWAN 250 architecture entities as described in [RFC8724] and the ones in 251 [lora-alliance-spec] is as follows: 253 o Devices are LoRaWAN End Devices (e.g. sensors, actuators, etc.). 254 There can be a very high density of devices per radio gateway 255 (LoRaWAN gateway). This entity maps to the LoRaWAN end-device. 257 o The Radio Gateway (RGW), which is the endpoint of the constrained 258 link. This entity maps to the LoRaWAN Gateway. 260 o The Network Gateway (NGW) is the interconnection node between the 261 Radio Gateway and the SCHC gateway (LoRaWAN Application server). 262 This entity maps to the LoRaWAN Network Server. 264 o SCHC C/D and F/R are handled by LoRaWAN Application Server; ie the 265 LoRaWAN application server will do the SCHC C/D and F/R. 267 o The LPWAN-AAA Server is the LoRaWAN Join Server. Its role is to 268 manage and deliver security keys in a secure way, so that the devices 269 root key is never exposed. 271 (LPWAN-AAA Server) 272 () () () | +------+ 273 () () () () / \ +---------+ | Join | 274 () () () () () / \======| ^ |===|Server| +-----------+ 275 () () () | | <--|--> | +------+ |Application| 276 () () () () / \==========| v |=============| Server | 277 () () () / \ +---------+ +-----------+ 278 End-devices Gateways Network Server (SCHC C/D and F/R) 279 (devices) (RGW) (NGW) 281 Figure 3: LPWAN Architecture 283 _Note_: Figure 3 terms are from LoRaWAN, with [RFC8376] terminology 284 in brackets. 286 SCHC Compressor/Decompressor (SCHC C/D) and SCHC Fragmentation/ 287 Reassembly (SCHC F/R) are performed on the LoRaWAN end-device and the 288 Application Server (called SCHC gateway). While the point-to-point 289 link between the device and the Application Server constitutes a 290 single IP hop, the ultimate end-point of the IP communication may be 291 an Internet node beyond the Application Server. In other words, the 292 LoRaWAN Application Server (SCHC gateway) acts as the first hop IP 293 router for the device. The Application Server and Network Server may 294 be co-located, which effectively turns the Network/Application Server 295 into the first hop IP router. 297 4.1. Device classes (A, B, C) and interactions 299 The LoRaWAN MAC layer supports 3 classes of devices named A, B and C. 300 All devices implement the Class A, some devices may implement Class B 301 or Class C. Class B and Class C are mutually exclusive. 303 o Class A: The Class A is the simplest class of devices. The device 304 is allowed to transmit at any time, randomly selecting a 305 communication channel. The Network Gateway may reply with a 306 downlink in one of the 2 receive windows immediately following the 307 uplinks. Therefore, the Network Gateway cannot initiate a 308 downlink, it has to wait for the next uplink from the device to 309 get a downlink opportunity. The Class A is the lowest power 310 consumption class. 312 o Class B: Class B devices implement all the functionalities of 313 Class A devices, but also schedule periodic listen windows. 314 Therefore, opposed to the Class A devices, Class B devices can 315 receive downlinks that are initiated by the Network Gateway and 316 not following an uplink. There is a trade-off between the 317 periodicity of those scheduled Class B listen windows and the 318 power consumption of the device: if the periodicity is high 319 downlinks from the NGW will be sent faster, but the device wakes 320 up more often: it will have higher power consumption. 322 o Class C: Class C devices implement all the functionalities of 323 Class A devices, but keep their receiver open whenever they are 324 not transmitting. Class C devices can receive downlinks at any 325 time at the expense of a higher power consumption. Battery- 326 powered devices can only operate in Class C for a limited amount 327 of time (for example for a firmware upgrade over-the-air). Most 328 of the Class C devices are grid powered (for example Smart Plugs). 330 4.2. Device addressing 332 LoRaWAN end-devices use a 32-bit network address (devAddr) to 333 communicate with the Network Gateway over-the-air, this address might 334 not be unique in a LoRaWAN network; devices using the same devAddr 335 are distinguished by the Network Gateway based on the cryptographic 336 signature appended to every LoRaWAN frame. 338 To communicate with the SCHC gateway, the Network Gateway MUST 339 identify the devices by a unique 64-bit device identifier called the 340 DevEUI. 342 The DevEUI is assigned to the device during the manufacturing process 343 by the device's manufacturer. It is built like an Ethernet MAC 344 address by concatenating the manufacturer's IEEE OUI field with a 345 vendor unique number. e.g.: 24-bit OUI is concatenated with a 40-bit 346 serial number. The Network Gateway translates the devAddr into a 347 DevEUI in the uplink direction and reciprocally on the downlink 348 direction. 350 +--------+ +---------+ +---------+ +----------+ 351 | Device | <=====> | Network | <====> | SCHC | <======> | Internet | 352 | | devAddr | Gateway | DevEUI | Gateway | IPv6/UDP | | 353 +--------+ +---------+ +---------+ +----------+ 355 Figure 4: LoRaWAN addresses 357 4.3. General Frame Types 359 LoRaWAN implements the possibility to send confirmed or unconfirmed 360 frames: 362 o Confirmed frame: The sender asks the receiver to acknowledge the 363 frame. 365 o Unconfirmed frame: The sender does not ask the receiver to 366 acknowledge the frame. 368 As SCHC defines its own acknowledgment mechanisms, SCHC does not 369 require to use LoRaWAN Confirmed frames. 371 4.4. LoRaWAN MAC Frames 373 In addition to regular data frames, LoRaWAN implements JoinRequest 374 and JoinAccept frame types, which are used by a device to join a 375 network: 377 o JoinRequest: This frame is used by a device to join a network. It 378 contains the device's unique identifier DevEUI and a random nonce 379 that will be used for session key derivation. 381 o JoinAccept: To on-board a device, the Network Gateway responds to 382 the JoinRequest issued by a device with a JoinAccept frame. That 383 frame is encrypted with the device's AppKey and contains (amongst 384 other fields) the network's major settings and a random nonce used 385 to derive the session keys. 387 o Data: MAC and application data. Application data are protected 388 with AES-128 encryption, MAC related data are AES-128 encrypted 389 with another key. 391 4.5. LoRaWAN FPort 393 The LoRaWAN MAC layer features a frame port field in all frames. 394 This field (FPort) is 8 bits long and the values from 1 to 223 can be 395 used. It allows LoRaWAN networks and applications to identify data. 397 4.6. LoRaWAN empty frame 399 A LoRaWAN empty frame is a LoRaWAN frame without FPort (cf 400 Section 5.1) and FRMPayload. 402 4.7. Unicast and multicast technology 404 LoRaWAN technology supports unicast downlinks, but also multicast: a 405 packet sent over LoRaWAN radio link can be received by several 406 devices. It is useful to address many devices with same content, 407 either a large binary file (firmware upgrade), or same command (e.g: 408 lighting control). As IPv6 is also a multicast technology this 409 feature can be used to address a group of devices. 411 _Note 1_: IPv6 multicast addresses must be defined as per [RFC4291]. 412 LoRaWAN multicast group definition in a Network Gateway and the 413 relation between those groups and IPv6 groupID are out of scope of 414 this document. 416 _Note 2_: LoRa Alliance defined [lora-alliance-remote-multicast-set] 417 as the RECOMMENDED way to setup multicast groups on devices and 418 create a synchronized reception window. 420 5. SCHC-over-LoRaWAN 422 5.1. LoRaWAN FPort and RuleID 424 The FPort field is part of the SCHC Message, as shown in Figure 5. 425 The SCHC C/D and the SCHC F/R SHALL concatenate the FPort field with 426 the LoRaWAN payload to recompose the SCHC Message. 428 | FPort | LoRaWAN payload | 429 + ------------------------ + 430 | SCHC Message | 432 Figure 5: SCHC Message in LoRaWAN 434 Note: SCHC Message is any datagram sent by SCHC C/D or F/R layers. 436 A fragmented datagram with application payload transferred from 437 device to Network Gateway, is called uplink fragmented datagram. It 438 uses an FPort for data uplink and its associated SCHC control 439 downlinks, named FPortUp in this document. The other way, a 440 fragmented datagram with application payload transferred from Network 441 Gateway to device, is called downlink fragmented datagram. It uses 442 another FPort for data downlink and its associated SCHC control 443 uplinks, named FPortDown in this document. 445 All RuleID can use arbitrary values inside the FPort range allowed by 446 LoRaWAN specification and MUST be shared by the device and SCHC 447 gateway prior to the communication with the selected rule. The 448 uplink and downlink fragmentation FPorts MUST be different. 450 5.2. Rule ID management 452 RuleID MUST be 8 bits, encoded in the LoRaWAN FPort as described in 453 Section 5.1. LoRaWAN supports up to 223 application FPorts in the 454 range [1;223] as defined in section 4.3.2 of [lora-alliance-spec], it 455 implies that RuleID MSB SHOULD be inside this range. An application 456 can send non SCHC traffic by using FPort values different from the 457 ones used for SCHC. 459 In order to improve interoperability, RECOMMENDED fragmentation 460 RuleID values are: 462 o RuleID = 20 (8-bit) for uplink fragmentation, named FPortUp. 464 o RuleID = 21 (8-bit) for downlink fragmentation, named FPortDown. 466 o RuleID = 22 (8-bit) for which SCHC compression was not possible 467 (i.e., no matching compression Rule was found), as described in 468 [RFC8724] section 6. 470 FPortUp value MUST be different from FPortDown. The remaining 471 RuleIDs are available for compression. RuleIDs are shared between 472 uplink and downlink sessions. A RuleID not in the set(s) of FPortUp 473 or FPortDown means that the fragmentation is not used, thus, on 474 reception, the SCHC Message MUST be sent to the SCHC C/D layer. 476 The only uplink frames using the FPortDown port are the fragmentation 477 SCHC control messages of a downlink fragmented datagram (for example, 478 SCHC ACKs). Similarly, the only downlink frames using the FPortUp 479 port are the fragmentation SCHC control messages of an uplink 480 fragmented datagram. 482 An application can have multiple fragmented datagrams between a 483 device and one or several SCHC gateways. A set of FPort values is 484 REQUIRED for each SCHC gateway instance the device is required to 485 communicate with. The application can use additional uplinks or 486 downlink fragmented parameters but SHALL implement at least the 487 parameters defined in this document. 489 The mechanism for context distribution across devices and gateways is 490 outside the scope of this document. 492 5.3. Interface IDentifier (IID) computation 494 In order to mitigate the risks described in [RFC8064] and [RFC8065], 495 IID MUST be created regarding the following algorithm: 497 1. key = LoRaWAN AppSKey 499 2. cmac = aes128_cmac(key, DevEUI) 501 3. IID = cmac[0..7] 503 aes128_cmac algorithm is described in [RFC4493]. It has been chosen 504 as it is already used by devices for LoRaWAN protocol. 506 As AppSKey is renewed each time a device joins or rejoins a LoRaWAN 507 network, the IID will change over time; this mitigates privacy, 508 location tracking and correlation over time risks. Join periodicity 509 is defined at the application level. 511 Address scan risk is mitigated thanks to AES-128, which provides 512 enough entropy bits of the IID. 514 Using this algorithm will also ensure that there is no correlation 515 between the hardware identifier (IEEE-64 DevEUI) and the IID, so an 516 attacker cannot use manufacturer OUI to target devices. 518 Example with: 520 o DevEUI: 0x1122334455667788 522 o appSKey: 0x00AABBCCDDEEFF00AABBCCDDEEFFAABB 524 1. key: 0x00AABBCCDDEEFF00AABBCCDDEEFFAABB 525 2. cmac: 0xBA59F4B196C6C3432D9383C145AD412A 526 3. IID: 0xBA59F4B196C6C343 528 Figure 6: Example of IID computation. 530 There is a small probability of IID collision in a LoRaWAN network. 531 If this occurs, the IID can be changed by rekeying the device at L2 532 level (ie: trigger a LoRaWAN join). The way the device is rekeyed is 533 out of scope of this document and left to the implementation. 535 5.4. Padding 537 All padding bits MUST be 0. 539 5.5. Decompression 541 SCHC C/D MUST concatenate FPort and LoRaWAN payload to retrieve the 542 SCHC Packet as per Section 5.1. 544 RuleIDs matching FPortUp and FPortDown are reserved for SCHC 545 Fragmentation. 547 5.6. Fragmentation 549 The L2 Word Size used by LoRaWAN is 1 byte (8 bits). The SCHC 550 fragmentation over LoRaWAN uses the ACK-on-Error mode for uplink 551 fragmentation and Ack-Always mode for downlink fragmentation. A 552 LoRaWAN device cannot support simultaneous interleaved fragmented 553 datagrams in the same direction (uplink or downlink). 555 The fragmentation parameters are different for uplink and downlink 556 fragmented datagrams and are successively described in the next 557 sections. 559 5.6.1. DTag 561 [RFC8724] section 8.2.4 describes the possibility to interleave 562 several fragmented SCHC datagrams for the same RuleID. This is not 563 used in SCHC over LoRaWAN profile. A device cannot interleave 564 several fragmented SCHC datagrams on the same FPort. This field is 565 not used and its size is 0. 567 Note: The device can still have several parallel fragmented datagrams 568 with more than one SCHC gateway thanks to distinct sets of FPorts, cf 569 Section 5.2. 571 5.6.2. Uplink fragmentation: From device to SCHC gateway 573 In this case, the device is the fragment transmitter, and the SCHC 574 gateway the fragment receiver. A single fragmentation rule is 575 defined. SCHC F/R MUST concatenate FPort and LoRaWAN payload to 576 retrieve the SCHC Packet, as per Section 5.1. 578 o SCHC header size is two bytes (the FPort byte + 1 additional 579 byte). 581 o RuleID: 8 bits stored in LoRaWAN FPort. 583 o SCHC fragmentation reliability mode: "ACK-on-Error". 585 o DTag: Size is 0 bit, not used. 587 o FCN: The FCN field is encoded on N = 6 bits, so WINDOW_SIZE = 63 588 tiles are allowed in a window. 590 o Window index: encoded on W = 2 bits. So 4 windows are available. 592 o RCS: Use recommended calculation algorithm in [RFC8724]. 594 o MAX_ACK_REQUESTS: 8. 596 o Tile: size is 10 bytes. 598 o Retransmission timer: Set by the implementation depending on the 599 application requirements. 601 o Inactivity timer: The SCHC gateway implements an "inactivity 602 timer". The default RECOMMENDED duration of this timer is 12 603 hours; this value is mainly driven by application requirements and 604 MAY be changed by the application. 606 o Penultimate tile MUST be equal to the regular size. 608 o Last tile: it can be carried in a Regular SCHC Fragment, alone in 609 an All-1 SCHC Fragment or with any of these two methods. 610 Implementation must ensure that: 612 * The sender MUST ascertain that the receiver will not receive 613 the last tile through both a Regular SCHC Fragment and an All-1 614 SCHC Fragment during the same session. 616 * If the last tile is in All-1 SCHC message: current L2 MTU MUST 617 be big enough to fit the All-1 header and the last tile. 619 With this set of parameters, the SCHC fragment header is 16 bits, 620 including FPort; payload overhead will be 8 bits as FPort is already 621 a part of LoRaWAN payload. MTU is: _4 windows * 63 tiles * 10 bytes 622 per tile = 2520 bytes_ 624 For battery powered devices, it is RECOMMENDED to use the ACK 625 mechanism at the end of each window instead of waiting until the end 626 of all windows: 628 o the SCHC receiver SHOULD send a SCHC ACK after every window even 629 if there is no missing tile. 631 o the SCHC sender SHOULD wait for the SCHC ACK from the SCHC 632 receiver before sending tiles from the next window. If the SCHC 633 ACK is not received, it SHOULD send a SCHC ACK REQ up to 634 MAX_ACK_REQUESTS times, as described previously. 636 This will avoid useless uplinks if the device has lost network 637 coverage. 639 For non-battery powered devices, the SCHC receiver MAY also choose to 640 send a SCHC ACK only at the end of all windows. This will reduce 641 downlink load on the LoRaWAN network, by reducing the number of 642 downlinks. 644 SCHC implementations MUST be compatible with both behaviors, and this 645 selection is part of the rule context. 647 5.6.2.1. Regular fragments 649 | FPort | LoRaWAN payload | 650 + ------ + ------------------------- + 651 | RuleID | W | FCN | Payload | 652 + ------ + ------ + ------ + ------- + 653 | 8 bits | 2 bits | 6 bits | | 655 Figure 7: All fragments except the last one. SCHC header size is 16 656 bits, including LoRaWAN FPort. 658 5.6.2.2. Last fragment (All-1) 660 | FPort | LoRaWAN payload | 661 + ------ + ---------------------------- + 662 | RuleID | W | FCN=All-1 | RCS | 663 + ------ + ------ + --------- + ------- + 664 | 8 bits | 2 bits | 6 bits | 32 bits | 666 Figure 8: All-1 SCHC Message: the last fragment without last tile. 668 | FPort | LoRaWAN payload | 669 + ------ + ---------------------------------------------------------- + 670 | RuleID | W | FCN=All-1 | RCS | Last tile | Opt. padding | 671 + ------ + ------ + --------- + ------- + ------------ + ------------ + 672 | 8 bits | 2 bits | 6 bits | 32 bits | 1 to 80 bits | 0 to 7 bits | 674 Figure 9: All-1 SCHC Message: the last fragment with last tile. 676 5.6.2.3. SCHC ACK 678 | FPort | LoRaWAN payload | 679 + ------ + --------------------------+ 680 | RuleID | W | C = 1 | padding | 681 | | | | (b'00000) | 682 + ------ + ----- + ----- + --------- + 683 | 8 bits | 2 bit | 1 bit | 5 bits | 685 Figure 10: SCHC ACK format, correct RCS check. 687 | FPort | LoRaWAN payload | 688 + ------ + --------------------------------- + ---------------- + 689 | RuleID | W | C = 0 | Compressed bitmap | Optional padding | 690 | | | | (C = 0) | (b'0...0) | 691 + ------ + ----- + ----- + ----------------- + ---------------- + 692 | 8 bits | 2 bit | 1 bit | 5 to 63 bits | 0, 6 or 7 bits | 694 Figure 11: SCHC ACK format, failed RCS check. 696 Note: Because of the bitmap compression mechanism and L2 byte 697 alignment, only the following discrete values are possible for the 698 compressed bitmap size: 5, 13, 21, 29, 37, 45, 53, 61, 62 and 63. 699 Bitmaps of 63 bits will require 6 bits of padding. 701 5.6.2.4. Receiver-Abort 703 | FPort | LoRaWAN payload | 704 + ------ + -------------------------------------------- + 705 | RuleID | W = b'11 | C = 1 | b'11111 | 0xFF (all 1's) | 706 + ------ + -------- + ------+-------- + ----------------+ 707 | 8 bits | 2 bits | 1 bit | 5 bits | 8 bits | 708 next L2 Word boundary ->| <-- L2 Word --> | 710 Figure 12: Receiver-Abort format. 712 5.6.2.5. SCHC acknowledge request 714 | FPort | LoRaWAN payload | 715 +------- +------------------------- + 716 | RuleID | W | FCN = b'000000 | 717 + ------ + ------ + --------------- + 718 | 8 bits | 2 bits | 6 bits | 720 Figure 13: SCHC ACK REQ format. 722 5.6.3. Downlink fragmentation: From SCHC gateway to device 724 In this case, the device is the fragmentation receiver, and the SCHC 725 gateway the fragmentation transmitter. The following fields are 726 common to all devices. SCHC F/R MUST concatenate FPort and LoRaWAN 727 payload to retrieve the SCHC Packet as described in Section 5.1. 729 o SCHC fragmentation reliability mode: 731 * Unicast downlinks: ACK-Always. 733 * Multicast downlinks: No-ACK, reliability has to be ensured by 734 the upper layer. This feature is OPTIONAL and may not be 735 implemented by SCHC gateway. 737 o RuleID: 8 bits stored in LoRaWAN FPort. 739 o Window index (unicast only): encoded on W=1 bit, as per [RFC8724]. 741 o DTag: Size is 0 bit, not used. 743 o FCN: The FCN field is encoded on N=1 bit, so WINDOW_SIZE = 1 tile. 745 o RCS: Use recommended calculation algorithm in [RFC8724]. 747 o MAX_ACK_REQUESTS: 8. 749 o Retransmission timer: See Section 5.6.3.5. 751 o Inactivity timer: The default RECOMMENDED duration of this timer 752 is 12 hours; this value is mainly driven by application 753 requirements and MAY be changed by the application. 755 As only 1 tile is used, its size can change for each downlink, and 756 will be the currently available MTU. 758 Class A devices can only receive during an RX slot, following the 759 transmission of an uplink. Therefore the SCHC gateway cannot 760 initiate communication (e.g., start a new SCHC session). In order to 761 create a downlink opportunity it is RECOMMENDED for Class A devices 762 to send an uplink every 24 hours when no SCHC session is started, 763 this is application specific and can be disabled. The RECOMMENDED 764 uplink is a LoRaWAN empty frame as defined Section 4.6. As this 765 uplink is to open an RX window, any LoRaWAN uplink frame from the 766 device MAY reset this counter. 768 _Note_: The Fpending bit included in LoRaWAN protocol SHOULD NOT be 769 used for SCHC-over-LoRaWAN protocol. It might be set by the Network 770 Gateway for other purposes but not SCHC needs. 772 5.6.3.1. Regular fragments 773 | FPort | LoRaWAN payload | 774 + ------ + ------------------------------------ + 775 | RuleID | W | FCN = b'0 | Payload | 776 + ------ + ----- + --------- + ---------------- + 777 | 8 bits | 1 bit | 1 bit | X bytes + 6 bits | 779 Figure 14: All fragments but the last one. Header size 10 bits, 780 including LoRaWAN FPort. 782 5.6.3.2. Last fragment (All-1) 784 | FPort | LoRaWAN payload | 785 + ------ + --------------------------- + ------------------------- + 786 | RuleID | W | FCN = b'1 | RCS | Payload | Opt padding | 787 + ------ + ----- + --------- + ------- + ----------- + ----------- + 788 | 8 bits | 1 bit | 1 bit | 32 bits | 6 to X bits | 0 to 7 bits | 790 Figure 15: All-1 SCHC Message: the last fragment. 792 5.6.3.3. SCHC ACK 794 | FPort | LoRaWAN payload | 795 + ------ + ---------------------------------- + 796 | RuleID | W | C = b'1 | Padding b'000000 | 797 + ------ + ----- + ------- + ---------------- + 798 | 8 bits | 1 bit | 1 bit | 6 bits | 800 Figure 16: SCHC ACK format, RCS is correct. 802 | FPort | LoRaWAN payload | 803 + ------ + ------------------------------------------------- + 804 | RuleID | W | C = b'0 | Bitmap = b'1 | Padding b'000000 | 805 + ------ + ----- + ------- + ------------ + ---------------- + 806 | 8 bits | 1 bit | 1 bit | 1 bit | 5 bits | 808 Figure 17: SCHC ACK format, RCS is incorrect. 810 5.6.3.4. Receiver-Abort 811 | FPort | LoRaWAN payload | 812 + ------ + ---------------------------------------------- + 813 | RuleID | W = b'1 | C = b'1 | b'111111 | 0xFF (all 1's) | 814 + ------ + ------- + ------- + -------- + --------------- + 815 | 8 bits | 1 bit | 1 bits | 6 bits | 8 bits | 816 next L2 Word boundary ->| <-- L2 Word --> | 818 Figure 18: Receiver-Abort packet (following an All-1 SCHC Fragment 819 with incorrect RCS). 821 5.6.3.5. Downlink retransmission timer 823 Class A and Class B or Class C devices do not manage retransmissions 824 and timers the same way. 826 5.6.3.5.1. Class A devices 828 Class A devices can only receive in an RX slot following the 829 transmission of an uplink. 831 The SCHC gateway implements an inactivity timer with a RECOMMENDED 832 duration of 36 hours. For devices with very low transmission rates 833 (example 1 packet a day in normal operation), that duration may be 834 extended: it is application specific. 836 RETRANSMISSION_TIMER is application specific and its RECOMMENDED 837 value is INACTIVITY_TIMER/(MAX_ACK_REQUESTS + 1). 839 *SCHC All-0 (FCN=0)* All fragments but the last have an FCN=0 840 (because window size is 1). Following an All-0 SCHC Fragment, the 841 device MUST transmit the SCHC ACK message. It MUST transmit up to 842 MAX_ACK_REQUESTS SCHC ACK messages before aborting. In order to 843 progress the fragmented datagram, the SCHC layer should immediately 844 queue for transmission those SCHC ACK if no SCHC downlink have been 845 received during RX1 and RX2 window. LoRaWAN layer will respect the 846 applicable local spectrum regulation. 848 _Note_: The ACK bitmap is 1 bit long and is always 1. 850 *SCHC All-1 (FCN=1)* SCHC All-1 is the last fragment of a datagram, 851 the corresponding SCHC ACK message might be lost; therefore the SCHC 852 gateway MUST request a retransmission of this ACK when the 853 retransmission timer expires. To open a downlink opportunity the 854 device MUST transmit an uplink every 855 RETRANSMISSION_TIMER/(MAX_ACK_REQUESTS * 856 SCHC_ACK_REQ_DN_OPPORTUNITY). The format of this uplink is 857 application specific. It is RECOMMENDED for a device to send an 858 empty frame (see Section 4.6) but it is application specific and will 859 be used by the NGW to transmit a potential SCHC ACK REQ. 860 SCHC_ACK_REQ_DN_OPPORTUNITY is application specific and its 861 recommended value is 2. It MUST be greater than 1. This allows to 862 open a downlink opportunity to any downlink with higher priority than 863 the SCHC ACK REQ message. 865 _Note_: The device MUST keep this SCHC ACK message in memory until it 866 receives a downlink SCHC Fragmentation Message (with FPort == 867 FPortDown) that is not a SCHC ACK REQ: it indicates that the SCHC 868 gateway has received the SCHC ACK message. 870 5.6.3.6. Class B or Class C devices 872 Class B devices can receive in scheduled RX slots or in RX slots 873 following the transmission of an uplink. Class C devices are almost 874 in constant reception. 876 RECOMMENDED retransmission timer value: 878 o Class B: 3 times the ping slot periodicity. 880 o Class C: 30 seconds. 882 The RECOMMENDED inactivity timer value is 12 hours for both Class B 883 and Class C devices. 885 5.7. SCHC Fragment Format 887 5.7.1. All-0 SCHC fragment 889 *Uplink fragmentation (Ack-On-Error)*: 891 All-0 is distinguishable from a SCHC ACK REQ as [RFC8724] states 892 _This condition is also met if the SCHC Fragment Header is a multiple 893 of L2 Words_; this condition met: SCHC header is 2 bytes. 895 *Downlink fragmentation (Ack-always)*: 897 As per [RFC8724] the SCHC All-1 MUST contain the last tile, 898 implementation must ensure that SCHC All-0 message Payload will be at 899 least the size of an L2 Word. 901 5.7.2. All-1 SCHC fragment 903 All-1 is distinguishable from a SCHC Sender-Abort as [RFC8724] states 904 _This condition is met if the RCS is present and is at least the size 905 of an L2 Word_; this condition met: RCS is 4 bytes. 907 5.7.3. Delay after each LoRaWAN frame to respect local regulation 909 This profile does not define a delay to be added after each LoRaWAN 910 frame, local regulation compliance is expected to be enforced by 911 LoRaWAN stack. 913 6. Security Considerations 915 This document is only providing parameters that are expected to be 916 best suited for LoRaWAN networks for [RFC8724]. IID security is 917 discussed in Section 5.3. As such, this document does not contribute 918 to any new security issues beyond those already identified in 919 [RFC8724]. Moreover, SCHC data (LoRaWAN payload) are protected at 920 the LoRaWAN level by an AES-128 encryption with a session key shared 921 by the device and the SCHC gateway. These session keys are renewed 922 at each LoRaWAN session (ie: each join or rejoin to the LoRaWAN 923 network) 925 7. IANA Considerations 927 This document has no IANA actions. 929 Acknowledgements 931 Thanks to all those listed in the Contributors section for the 932 excellent text, insightful discussions, reviews and suggestions, and 933 also to (in alphabetical order) Dominique Barthel, Arunprabhu 934 Kandasamy, Rodrigo Munoz, Alexander Pelov, Pascal Thubert, Laurent 935 Toutain for useful design considerations, reviews and comments. 937 Contributors 939 Contributors ordered by family name. 941 Vincent Audebert 942 EDF R&D 943 Email: vincent.audebert@edf.fr 945 Julien Catalano 946 Kerlink 947 Email: j.catalano@kerlink.fr 948 Michael Coracin 949 Semtech 950 Email: mcoracin@semtech.com 952 Marc Le Gourrierec 953 Sagemcom 954 Email: marc.legourrierec@sagemcom.com 956 Nicolas Sornin 957 Semtech 958 Email: nsornin@semtech.com 960 Alper Yegin 961 Actility 962 Email: alper.yegin@actility.com 964 10. References 966 10.1. Normative References 968 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 969 Requirement Levels", BCP 14, RFC 2119, 970 DOI 10.17487/RFC2119, March 1997, 971 . 973 [RFC4291] Hinden, R. and S. Deering, "IP Version 6 Addressing 974 Architecture", RFC 4291, DOI 10.17487/RFC4291, February 975 2006, . 977 [RFC8064] Gont, F., Cooper, A., Thaler, D., and W. Liu, 978 "Recommendation on Stable IPv6 Interface Identifiers", 979 RFC 8064, DOI 10.17487/RFC8064, February 2017, 980 . 982 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 983 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 984 May 2017, . 986 [RFC8724] Minaburo, A., Toutain, L., Gomez, C., Barthel, D., and JC. 987 Zuniga, "SCHC: Generic Framework for Static Context Header 988 Compression and Fragmentation", RFC 8724, 989 DOI 10.17487/RFC8724, April 2020, 990 . 992 10.2. Informative References 994 [lora-alliance-remote-multicast-set] 995 Alliance, L., "LoRaWAN Remote Multicast Setup 996 Specification Version 1.0.0", . 1000 [lora-alliance-spec] 1001 Alliance, L., "LoRaWAN Specification Version V1.0.3", 1002 . 1005 [RFC4493] Song, JH., Poovendran, R., Lee, J., and T. Iwata, "The 1006 AES-CMAC Algorithm", RFC 4493, DOI 10.17487/RFC4493, June 1007 2006, . 1009 [RFC8065] Thaler, D., "Privacy Considerations for IPv6 Adaptation- 1010 Layer Mechanisms", RFC 8065, DOI 10.17487/RFC8065, 1011 February 2017, . 1013 [RFC8376] Farrell, S., Ed., "Low-Power Wide Area Network (LPWAN) 1014 Overview", RFC 8376, DOI 10.17487/RFC8376, May 2018, 1015 . 1017 Appendix A. Examples 1019 In following examples "applicative payload" refers to the IPv6 1020 payload sent by the application to the SCHC layer. 1022 A.1. Uplink - Compression example - No fragmentation 1024 This example represents an applicative payload going through SCHC 1025 over LoRaWAN, no fragmentation required 1027 An applicative payload of 78 bytes is passed to SCHC compression 1028 layer. Rule 1 is used by SCHC C/D layer, allowing to compress it to 1029 40 bytes and 5 bits: 1 byte RuleID, 21 bits residue + 37 bytes 1030 payload. 1032 | RuleID | Compression residue | Payload | Padding=b'000 | 1033 + ------ + ------------------- + --------- + ------------- + 1034 | 1 | 21 bits | 37 bytes | 3 bits | 1036 Figure 19: Uplink example: SCHC Message 1038 The current LoRaWAN MTU is 51 bytes, although 2 bytes FOpts are used 1039 by LoRaWAN protocol: 49 bytes are available for SCHC payload; no need 1040 for fragmentation. The payload will be transmitted through FPort = 1041 1. 1043 | LoRaWAN Header | LoRaWAN payload (40 bytes) | 1044 + ------------------------- + --------------------------------------- + 1045 | | FOpts | RuleID=1 | Compression | Payload | Padding=b'000 | 1046 | | | | residue | | | 1047 + ---- + ------- + -------- + ----------- + --------- + ------------- + 1048 | XXXX | 2 bytes | 1 byte | 21 bits | 37 bytes | 3 bits | 1050 Figure 20: Uplink example: LoRaWAN packet 1052 A.2. Uplink - Compression and fragmentation example 1054 This example represents an applicative payload going through SCHC, 1055 with fragmentation. 1057 An applicative payload of 478 bytes is passed to SCHC compression 1058 layer. Rule 1 is used by SCHC C/D layer, allowing to compress it to 1059 282 bytes and 5 bits: 1 byte RuleID, 21 bits residue + 279 bytes 1060 payload. 1062 | RuleID | Compression residue | Payload | 1063 + ------ + ------------------- + --------- + 1064 | 1 | 21 bits | 279 bytes | 1066 Figure 21: Uplink example: SCHC Message 1068 The current LoRaWAN MTU is 11 bytes, 0 bytes FOpts are used by 1069 LoRaWAN protocol: 11 bytes are available for SCHC payload + 1 byte 1070 FPort field. SCHC header is 2 bytes (including FPort) so 1 tile is 1071 sent in first fragment. 1073 | LoRaWAN Header | LoRaWAN payload (11 bytes) | 1074 + -------------------------- + -------------------------- + 1075 | | RuleID=20 | W | FCN | 1 tile | 1076 + -------------- + --------- + ----- + ------ + --------- + 1077 | XXXX | 1 byte | 0 0 | 62 | 10 bytes | 1079 Figure 22: Uplink example: LoRaWAN packet 1 1081 Content of the tile is: 1082 | RuleID | Compression residue | Payload | 1083 + ------ + ------------------- + ----------------- + 1084 | 1 | 21 bits | 6 bytes + 3 bits | 1086 Figure 23: Uplink example: LoRaWAN packet 1 - Tile content 1088 Next transmission MTU is 11 bytes, although 2 bytes FOpts are used by 1089 LoRaWAN protocol: 9 bytes are available for SCHC payload + 1 byte 1090 FPort field, a tile does not fit inside so LoRaWAN stack will send 1091 only FOpts. 1093 Next transmission MTU is 242 bytes, 4 bytes FOpts. 23 tiles are 1094 transmitted: 1096 | LoRaWAN Header | LoRaWAN payload (231 bytes) | 1097 + --------------------------------------+ --------------------------- + 1098 | | FOpts | RuleID=20 | W | FCN | 23 tiles | 1099 + -------------- + ------- + ---------- + ----- + ----- + ----------- + 1100 | XXXX | 4 bytes | 1 byte | 0 0 | 61 | 230 bytes | 1102 Figure 24: Uplink example: LoRaWAN packet 2 1104 Next transmission MTU is 242 bytes, no FOpts. All 5 remaining tiles 1105 are transmitted, the last tile is only 2 bytes + 5 bits. Padding is 1106 added for the remaining 3 bits. 1108 | LoRaWAN Header | LoRaWAN payload (44 bytes) | 1109 + ---- + ---------- + ----------------------------------------------- + 1110 | | RuleID=20 | W | FCN | 5 tiles | Padding=b'000 | 1111 + ---- + ---------- + ----- + ----- + --------------- + ------------- + 1112 | XXXX | 1 byte | 0 0 | 38 | 42 bytes+5 bits | 3 bits | 1114 Figure 25: Uplink example: LoRaWAN packet 3 1116 Then All-1 message can be transmitted: 1118 | LoRaWAN Header | LoRaWAN payload (44 bytes) | 1119 + ---- + -----------+ -------------------------- + 1120 | | RuleID=20 | W | FCN | RCS | 1121 + ---- + ---------- + ----- + ----- + ---------- + 1122 | XXXX | 1 byte | 0 0 | 63 | 4 bytes | 1124 Figure 26: Uplink example: LoRaWAN packet 4 - All-1 SCHC message 1126 All packets have been received by the SCHC gateway, computed RCS is 1127 correct so the following ACK is sent to the device by the SCHC 1128 receiver: 1130 | LoRaWAN Header | LoRaWAN payload | 1131 + -------------- + --------- + ------------------- + 1132 | | RuleID=20 | W | C | Padding | 1133 + -------------- + --------- + ----- + - + ------- + 1134 | XXXX | 1 byte | 0 0 | 1 | 5 bits | 1136 Figure 27: Uplink example: LoRaWAN packet 5 - SCHC ACK 1138 A.3. Downlink 1140 An applicative payload of 443 bytes is passed to SCHC compression 1141 layer. Rule 1 is used by SCHC C/D layer, allowing to compress it to 1142 130 bytes and 5 bits: 1 byte RuleID, 21 bits residue + 127 bytes 1143 payload. 1145 | RuleID | Compression residue | Payload | 1146 + ------ + ------------------- + --------- + 1147 | 1 | 21 bits | 127 bytes | 1149 Figure 28: Downlink example: SCHC Message 1151 The current LoRaWAN MTU is 51 bytes, no FOpts are used by LoRaWAN 1152 protocol: 51 bytes are available for SCHC payload + FPort field => it 1153 has to be fragmented. 1155 | LoRaWAN Header | LoRaWAN payload (51 bytes) | 1156 + ---- + ---------- + -------------------------------------- + 1157 | | RuleID=21 | W = 0 | FCN = 0 | 1 tile | 1158 + ---- + ---------- + ------ + ------- + ------------------- + 1159 | XXXX | 1 byte | 1 bit | 1 bit | 50 bytes and 6 bits | 1161 Figure 29: Downlink example: LoRaWAN packet 1 - SCHC Fragment 1 1163 Content of the tile is: 1165 | RuleID | Compression residue | Payload | 1166 + ------ + ------------------- + ------------------ + 1167 | 1 | 21 bits | 48 bytes and 1 bit | 1169 Figure 30: Downlink example: LoRaWAN packet 1: Tile content 1171 The receiver answers with a SCHC ACK: 1173 | LoRaWAN Header | LoRaWAN payload | 1174 + ---- + --------- + -------------------------------- + 1175 | | RuleID=21 | W = 0 | C = 1 | Padding=b'000000 | 1176 + ---- + --------- + ----- + ----- + ---------------- + 1177 | XXXX | 1 byte | 1 bit | 1 bit | 6 bits | 1179 Figure 31: Downlink example: LoRaWAN packet 2 - SCHC ACK 1181 The second downlink is sent, two FOpts: 1183 | LoRaWAN Header | LoRaWAN payload (49 bytes) | 1184 + --------------------------- + ------------------------------------- + 1185 | | FOpts | RuleID=21 | W = 1 | FCN = 0 | 1 tile | 1186 + ---- + ------- + ---------- + ----- + ------- + ------------------- + 1187 | XXXX | 2 bytes | 1 byte | 1 bit | 1 bit | 48 bytes and 6 bits | 1189 Figure 32: Downlink example: LoRaWAN packet 3 - SCHC Fragment 2 1191 The receiver answers with an SCHC ACK: 1193 | LoRaWAN Header | LoRaWAN payload | 1194 + ---- + --------- + -------------------------------- + 1195 | | RuleID=21 | W = 1 | C = 1 | Padding=b'000000 | 1196 + ---- + --------- + ----- + ----- + ---------------- + 1197 | XXXX | 1 byte | 1 bit | 1 bit | 6 bits | 1199 Figure 33: Downlink example: LoRaWAN packet 4 - SCHC ACK 1201 The last downlink is sent, no FOpts: 1203 | LoRaWAN Header | LoRaWAN payload (37 bytes) | 1204 + ---- + ------- + --------------------------------------------------- + 1205 | | RuleID | W | FCN | RCS | 1 tile | Padding | 1206 | | 21 | 0 | 1 | | | b'00000 | 1207 + ---- + ------- + ----- + ----- + ------- + --------------- + ------- + 1208 | XXXX | 1 byte | 1 bit | 1 bit | 4 bytes | 31 bytes+1 bits | 5 bits | 1210 Figure 34: Downlink example: LoRaWAN packet 5 - All-1 SCHC message 1212 The receiver answers to the sender with an SCHC ACK: 1214 | LoRaWAN Header | LoRaWAN payload | 1215 + ---- + --------- + -------------------------------- + 1216 | | RuleID=21 | W = 0 | C = 1 | Padding=b'000000 | 1217 + ---- + --------- + ----- + ----- + ---------------- + 1218 | XXXX | 1 byte | 1 bit | 1 bit | 6 bits | 1220 Figure 35: Downlink example: LoRaWAN packet 6 - SCHC ACK 1222 Authors' Addresses 1224 Olivier Gimenez (editor) 1225 Semtech 1226 14 Chemin des Clos 1227 Meylan 1228 France 1230 Email: ogimenez@semtech.com 1232 Ivaylo Petrov (editor) 1233 Acklio 1234 1137A Avenue des Champs Blancs 1235 35510 Cesson-Sevigne Cedex 1236 France 1238 Email: ivaylo@ackl.io