idnits 2.17.00 (12 Aug 2021) /tmp/idnits41927/draft-ietf-lpwan-ipv6-static-context-hc-11.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 : ---------------------------------------------------------------------------- ** The document seems to lack an IANA Considerations section. (See Section 2.2 of https://www.ietf.org/id-info/checklist for how to handle the case when there are no actions for IANA.) ** The document seems to lack a both a reference to RFC 2119 and the recommended RFC 2119 boilerplate, even if it appears to use RFC 2119 keywords. RFC 2119 keyword, line 165: '... most of the time and MAY receive data...' RFC 2119 keyword, line 267: '... connected to the LPWAN. A Dev SHOULD...' RFC 2119 keyword, line 485: '...east one Rule ID MAY be reserved to th...' RFC 2119 keyword, line 496: '...etworks, static contexts MAY be stored...' RFC 2119 keyword, line 498: '... contexts MUST be stored at both end...' (92 more instances...) Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year == Line 1091 has weird spacing: '...long as the...' == Line 1313 has weird spacing: '... 1 byte next ...' == Using lowercase 'not' together with uppercase 'MUST', 'SHALL', 'SHOULD', or 'RECOMMENDED' is not an accepted usage according to RFC 2119. Please use uppercase 'NOT' together with RFC 2119 keywords (if that is what you mean). Found 'SHOULD not' in this paragraph: When an All-0 fragment is received, it indicates that all the SCHC Fragments have been sent in the current window. Since the sender is not obliged to always send a full window, some SCHC Fragment number not set in the receiver memory SHOULD not correspond to losses. The receiver sends the corresponding SCHC ACK, the Inactivity Timer is set and the transmission of the next window by the sender can start. -- The document date (April 13, 2018) is 1499 days in the past. Is this intentional? Checking references for intended status: Informational ---------------------------------------------------------------------------- -- Looks like a reference, but probably isn't: '1' on line 2157 -- Looks like a reference, but probably isn't: '2' on line 2160 -- Looks like a reference, but probably isn't: '8' on line 2182 -- Looks like a reference, but probably isn't: '4' on line 2189 ** Obsolete normative reference: RFC 2460 (Obsoleted by RFC 8200) == Outdated reference: draft-ietf-lpwan-overview has been published as RFC 8376 Summary: 3 errors (**), 0 flaws (~~), 5 warnings (==), 5 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 lpwan Working Group A. Minaburo 3 Internet-Draft Acklio 4 Intended status: Informational L. Toutain 5 Expires: October 15, 2018 IMT-Atlantique 6 C. Gomez 7 Universitat Politecnica de Catalunya 8 April 13, 2018 10 LPWAN Static Context Header Compression (SCHC) and fragmentation for 11 IPv6 and UDP 12 draft-ietf-lpwan-ipv6-static-context-hc-11 14 Abstract 16 This document defines the Static Context Header Compression (SCHC) 17 framework, which provides header compression and fragmentation 18 functionality. SCHC has been tailored for Low Power Wide Area 19 Networks (LPWAN). 21 SCHC compression is based on a common static context stored in both 22 LPWAN devices and in the network sides. This document defines SCHC 23 header compression mechanism and its deployment for IPv6/UDP headers. 24 This document also specifies a fragmentation and reassembly mechanism 25 that is used to support the IPv6 MTU requirement over the LPWAN 26 technologies. The Fragmentation is needed for IPv6 datagrams that, 27 after SCHC compression or when it has not been possible to apply such 28 compression, still exceed the layer two maximum payload size. 30 The SCHC header compression mechanism is independent of the specific 31 LPWAN technology over which it will be used. Note that this document 32 defines generic functionalities and advisedly offers flexibility with 33 regard to parameters settings and mechanism choices, that are 34 expected to be made in other technology-specific documents. 36 Status of This Memo 38 This Internet-Draft is submitted in full conformance with the 39 provisions of BCP 78 and BCP 79. 41 Internet-Drafts are working documents of the Internet Engineering 42 Task Force (IETF). Note that other groups may also distribute 43 working documents as Internet-Drafts. The list of current Internet- 44 Drafts is at https://datatracker.ietf.org/drafts/current/. 46 Internet-Drafts are draft documents valid for a maximum of six months 47 and may be updated, replaced, or obsoleted by other documents at any 48 time. It is inappropriate to use Internet-Drafts as reference 49 material or to cite them other than as "work in progress." 51 This Internet-Draft will expire on October 15, 2018. 53 Copyright Notice 55 Copyright (c) 2018 IETF Trust and the persons identified as the 56 document authors. All rights reserved. 58 This document is subject to BCP 78 and the IETF Trust's Legal 59 Provisions Relating to IETF Documents 60 (https://trustee.ietf.org/license-info) in effect on the date of 61 publication of this document. Please review these documents 62 carefully, as they describe your rights and restrictions with respect 63 to this document. Code Components extracted from this document must 64 include Simplified BSD License text as described in Section 4.e of 65 the Trust Legal Provisions and are provided without warranty as 66 described in the Simplified BSD License. 68 Table of Contents 70 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 71 2. LPWAN Architecture . . . . . . . . . . . . . . . . . . . . . 4 72 3. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 5 73 4. SCHC overview . . . . . . . . . . . . . . . . . . . . . . . . 8 74 5. Rule ID . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 75 6. Static Context Header Compression . . . . . . . . . . . . . . 12 76 6.1. SCHC C/D Rules . . . . . . . . . . . . . . . . . . . . . 13 77 6.2. Rule ID for SCHC C/D . . . . . . . . . . . . . . . . . . 15 78 6.3. Packet processing . . . . . . . . . . . . . . . . . . . . 15 79 6.4. Matching operators . . . . . . . . . . . . . . . . . . . 17 80 6.5. Compression Decompression Actions (CDA) . . . . . . . . . 17 81 6.5.1. not-sent CDA . . . . . . . . . . . . . . . . . . . . 19 82 6.5.2. value-sent CDA . . . . . . . . . . . . . . . . . . . 19 83 6.5.3. mapping-sent CDA . . . . . . . . . . . . . . . . . . 19 84 6.5.4. LSB(y) CDA . . . . . . . . . . . . . . . . . . . . . 19 85 6.5.5. DEViid, APPiid CDA . . . . . . . . . . . . . . . . . 20 86 6.5.6. Compute-* . . . . . . . . . . . . . . . . . . . . . . 20 87 7. Fragmentation . . . . . . . . . . . . . . . . . . . . . . . . 20 88 7.1. Overview . . . . . . . . . . . . . . . . . . . . . . . . 20 89 7.2. Fragmentation Tools . . . . . . . . . . . . . . . . . . . 21 90 7.3. Reliability modes . . . . . . . . . . . . . . . . . . . . 24 91 7.4. Fragmentation Formats . . . . . . . . . . . . . . . . . . 26 92 7.4.1. Fragment format . . . . . . . . . . . . . . . . . . . 26 93 7.4.2. All-1 and All-0 formats . . . . . . . . . . . . . . . 27 94 7.4.3. SCHC ACK format . . . . . . . . . . . . . . . . . . . 28 95 7.4.4. Abort formats . . . . . . . . . . . . . . . . . . . . 31 97 7.5. Baseline mechanism . . . . . . . . . . . . . . . . . . . 32 98 7.5.1. No-ACK . . . . . . . . . . . . . . . . . . . . . . . 33 99 7.5.2. ACK-Always . . . . . . . . . . . . . . . . . . . . . 34 100 7.5.3. ACK-on-Error . . . . . . . . . . . . . . . . . . . . 36 101 7.6. Supporting multiple window sizes . . . . . . . . . . . . 38 102 7.7. Downlink SCHC Fragment transmission . . . . . . . . . . . 38 103 8. Padding management . . . . . . . . . . . . . . . . . . . . . 39 104 9. SCHC Compression for IPv6 and UDP headers . . . . . . . . . . 40 105 9.1. IPv6 version field . . . . . . . . . . . . . . . . . . . 40 106 9.2. IPv6 Traffic class field . . . . . . . . . . . . . . . . 40 107 9.3. Flow label field . . . . . . . . . . . . . . . . . . . . 40 108 9.4. Payload Length field . . . . . . . . . . . . . . . . . . 41 109 9.5. Next Header field . . . . . . . . . . . . . . . . . . . . 41 110 9.6. Hop Limit field . . . . . . . . . . . . . . . . . . . . . 41 111 9.7. IPv6 addresses fields . . . . . . . . . . . . . . . . . . 41 112 9.7.1. IPv6 source and destination prefixes . . . . . . . . 42 113 9.7.2. IPv6 source and destination IID . . . . . . . . . . . 42 114 9.8. IPv6 extensions . . . . . . . . . . . . . . . . . . . . . 43 115 9.9. UDP source and destination port . . . . . . . . . . . . . 43 116 9.10. UDP length field . . . . . . . . . . . . . . . . . . . . 43 117 9.11. UDP Checksum field . . . . . . . . . . . . . . . . . . . 43 118 10. Security considerations . . . . . . . . . . . . . . . . . . . 44 119 10.1. Security considerations for header compression . . . . . 44 120 10.2. Security considerations for SCHC Fragmentation . . . . . 44 121 11. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 45 122 12. References . . . . . . . . . . . . . . . . . . . . . . . . . 45 123 12.1. Normative References . . . . . . . . . . . . . . . . . . 45 124 12.2. Informative References . . . . . . . . . . . . . . . . . 46 125 Appendix A. SCHC Compression Examples . . . . . . . . . . . . . 46 126 Appendix B. Fragmentation Examples . . . . . . . . . . . . . . . 49 127 Appendix C. Fragmentation State Machines . . . . . . . . . . . . 55 128 Appendix D. SCHC Parameters - Ticket #15 . . . . . . . . . . . . 62 129 Appendix E. Note . . . . . . . . . . . . . . . . . . . . . . . . 63 130 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 63 132 1. Introduction 134 This document defines a header compression scheme and fragmentation 135 functionality, both specially tailored for Low Power Wide Area 136 Networks (LPWAN). 138 Header compression is needed to efficiently bring Internet 139 connectivity to the node within an LPWAN network. Some LPWAN 140 networks properties can be exploited to get an efficient header 141 compression: 143 o The topology is star-oriented which means that all packets follow 144 the same path. For the necessity of this draft, the architecture 145 is simple and is described as Devices (Dev) exchanging information 146 with LPWAN Application Servers (App) through Network Gateways 147 (NGW). 149 o The traffic flows can be known in advance since devices embed 150 built-in applications. New applications cannot be easily 151 installed in LPWAN devices, as they would in computers or 152 smartphones. 154 The Static Context Header Compression (SCHC) is defined for this 155 environment. SCHC uses a context, where header information is kept 156 in the header format order. This context is static: the values of 157 the header fields do not change over time. This avoids complex 158 resynchronization mechanisms, that would be incompatible with LPWAN 159 characteristics. In most cases, a small context identifier is enough 160 to represent the full IPv6/UDP headers. The SCHC header compression 161 mechanism is independent of the specific LPWAN technology over which 162 it is used. 164 LPWAN technologies impose some strict limitations on traffic. For 165 instance, devices are sleeping most of the time and MAY receive data 166 during short periods of time after transmission to preserve battery. 167 LPWAN technologies are also characterized, among others, by a very 168 reduced data unit and/or payload size [I-D.ietf-lpwan-overview]. 169 However, some of these technologies do not provide fragmentation 170 functionality, therefore the only option for them to support the IPv6 171 MTU requirement of 1280 bytes [RFC2460] is to use a fragmentation 172 protocol at the adaptation layer, below IPv6. In response to this 173 need, this document also defines a fragmentation/reassembly 174 mechanism, which supports the IPv6 MTU requirement over LPWAN 175 technologies. Such functionality has been designed under the 176 assumption that data unit out-of-sequence delivery will not happen 177 between the entity performing fragmentation and the entity performing 178 reassembly. 180 Note that this document defines generic functionality and 181 purposefully offers flexibility with regard to parameter settings and 182 mechanism choices, that are expected to be made in other, technology- 183 specific documents. 185 2. LPWAN Architecture 187 LPWAN technologies have similar network architectures but different 188 terminology. We can identify different types of entities in a 189 typical LPWAN network, see Figure 1: 191 o Devices (Dev) are the end-devices or hosts (e.g. sensors, 192 actuators, etc.). There can be a very high density of devices per 193 radio gateway. 195 o The Radio Gateway (RGW), which is the end point of the constrained 196 link. 198 o The Network Gateway (NGW) is the interconnection node between the 199 Radio Gateway and the Internet. 201 o LPWAN-AAA Server, which controls the user authentication and the 202 applications. 204 o Application Server (App) 206 +------+ 207 () () () | |LPWAN-| 208 () () () () / \ +---------+ | AAA | 209 () () () () () () / \======| ^ |===|Server| +-----------+ 210 () () () | | <--|--> | +------+ |APPLICATION| 211 () () () () / \==========| v |=============| (App) | 212 () () () / \ +---------+ +-----------+ 213 Dev Radio Gateways NGW 215 Figure 1: LPWAN Architecture 217 3. Terminology 219 This section defines the terminology and acronyms used in this 220 document. 222 o Abort. A SCHC Fragment format to signal the other end-point that 223 the on-going fragment transmission is stopped and finished. 225 o All-0. The SCHC Fragment format for the last frame of a window 226 that is not the last one of a packet (see Window in this 227 glossary). 229 o All-1. The SCHC Fragment format for the last frame of the packet. 231 o All-0 empty. An All-0 SCHC Fragment without a payload. It is 232 used to request the SCHC ACK with the encoded Bitmap when the 233 Retransmission Timer expires, in a window that is not the last one 234 of a packet. 236 o All-1 empty. An All-1 SCHC Fragment without a payload. It is 237 used to request the SCHC ACK with the encoded Bitmap when the 238 Retransmission Timer expires in the last window of a packet. 240 o App: LPWAN Application. An application sending/receiving IPv6 241 packets to/from the Device. 243 o APP-IID: Application Interface Identifier. Second part of the 244 IPv6 address that identifies the application server interface. 246 o Bi: Bidirectional, a rule entry that applies to headers of packets 247 travelling in both directions (Up and Dw). 249 o Bitmap: a field of bits in an acknowledgment message that tells 250 the sender which SCHC Fragments of a window were correctly 251 received. 253 o C: Checked bit. Used in an acknowledgment (SCHC ACK) header to 254 determine if the MIC locally computed by the receiver matches (1) 255 the received MIC or not (0). 257 o CDA: Compression/Decompression Action. Describes the reciprocal 258 pair of actions that are performed at the compressor to compress a 259 header field and at the decompressor to recover the original 260 header field value. 262 o Compress Residue. The bytes that need to be sent after applying 263 the SCHC compression over each header field 265 o Context: A set of rules used to compress/decompress headers. 267 o Dev: Device. A node connected to the LPWAN. A Dev SHOULD 268 implement SCHC. 270 o Dev-IID: Device Interface Identifier. Second part of the IPv6 271 address that identifies the device interface. 273 o DI: Direction Indicator. This field tells which direction of 274 packet travel (Up, Dw or Bi) a rule applies to. This allows for 275 assymmetric processing. 277 o DTag: Datagram Tag. This SCHC Fragmentation header field is set to 278 the same value for all SCHC Fragments carrying the same IPv6 279 datagram. 281 o Dw: Dw: Downlink direction for compression/decompression in both 282 sides, from SCHC C/D in the network to SCHC C/D in the Dev. 284 o FCN: Fragment Compressed Number. This SCHC Fragmentation header 285 field carries an efficient representation of a larger-sized 286 fragment number. 288 o Field Description. A line in the Rule Table. 290 o FID: Field Identifier. This is an index to describe the header 291 fields in a Rule. 293 o FL: Field Length is the length of the field in bits for fixed 294 values or a type (variable, token length, ...) for length unknown 295 at the rule creation. The length of a header field is defined in 296 the specific protocol standard. 298 o FP: Field Position is a value that is used to identify the 299 position where each instance of a field appears in the header. 301 o IID: Interface Identifier. See the IPv6 addressing architecture 302 [RFC7136] 304 o Inactivity Timer. A timer used after receiving a SCHC Fragment to 305 detect when there is an error and there is no possibility to 306 continue an on-going SCHC Fragmented packet transmission. 308 o L2: Layer two. The immediate lower layer SCHC interfaces with. 309 It is provided by an underlying LPWAN technology. 311 o MIC: Message Integrity Check. A SCHC Fragmentation header field 312 computed over an IPv6 packet before fragmentation, used for error 313 detection after IPv6 packet reassembly. 315 o MO: Matching Operator. An operator used to match a value 316 contained in a header field with a value contained in a Rule. 318 o Retransmission Timer. A timer used by the SCHC Fragment sender 319 during an on-going SCHC Fragmented packet transmission to detect 320 possible link errors when waiting for a possible incoming SCHC 321 ACK. 323 o Rule: A set of header field values. 325 o Rule entry: A column in the rule that describes a parameter of the 326 header field. 328 o Rule ID: An identifier for a rule, SCHC C/D in both sides share 329 the same Rule ID for a specific packet. A set of Rule IDs are 330 used to support SCHC Fragmentation functionality. 332 o SCHC ACK: A SCHC acknowledgement for fragmentation, this format 333 used to report the success or unsuccess reception of a set of SCHC 334 Fragments. See Section 7 for more details. 336 o SCHC C/D: Static Context Header Compression Compressor/ 337 Decompressor. A mechanism used in both sides, at the Dev and at 338 the network to achieve Compression/Decompression of headers. SCHC 339 C/D uses SCHC rules to perform compression and decompression. 341 o SCHC Fragment: A data unit that carries a subset of a SCHC Packet. 342 SCHC Fragmentation is needed when the size of a SCHC packet 343 exceeds the available payload size of the underlying L2 technology 344 data unit.see Section 7. 346 o SCHC Packet: A packet (e.g. an IPv6 packet) whose header has been 347 compressed as per the header compression mechanism defined in this 348 document. If the header compression process is unable to actually 349 compress the packet header, the packet with the uncompressed 350 header is still called a SCHC Packet (in this case, a Rule ID is 351 used to indicate that the packet header has not been compressed). 352 See Section 6 for more details. 354 o TV: Target value. A value contained in the Rule that will be 355 matched with the value of a header field. 357 o Up: Uplink direction for compression/decompression in both sides, 358 from the Dev SCHC C/D to the network SCHC C/D. 360 o W: Window bit. A SCHC Fragment header field used in Window mode 361 Section 7, which carries the same value for all SCHC Fragments of 362 a window. 364 o Window: A subset of the SCHC Fragments needed to carry a packet 365 Section 7. 367 4. SCHC overview 369 SCHC can be abstracted as an adaptation layer between IPv6 and the 370 underlying LPWAN technology. SCHC comprises two sublayers (i.e. the 371 Compression sublayer and the Fragmentation sublayer), as shown in 372 Figure 2. 374 +----------------+ 375 | IPv6 | 376 +- +----------------+ 377 | | Compression | 378 SCHC < +----------------+ 379 | | Fragmentation | 380 +- +----------------+ 381 |LPWAN technology| 382 +----------------+ 384 Figure 2: Protocol stack comprising IPv6, SCHC and an LPWAN 385 technology 387 As per this document, when a packet (e.g. an IPv6 packet) needs to be 388 transmitted, header compression is first applied to the packet. The 389 resulting packet after header compression (whose header may or may 390 not actually be smaller than that of the original packet) is called a 391 SCHC Packet. If the SCHC Packet size exceeds the layer 2 (L2) MTU, 392 fragmentation is then applied to the SCHC Packet. The SCHC Packet or 393 the SCHC Fragments are then transmitted over the LPWAN. The 394 reciprocal operations take place at the receiver. This process is 395 illustrated by Figure 3. 397 A packet (e.g. an IPv6 packet) 398 | ^ 399 v | 400 +-------------------+ +--------------------+ 401 | SCHC Compression | | SCHC Decompression | 402 +------------------+ +--------------------+ 403 | | 404 | | 405 | | 406 | If no fragmentation (*) | 407 +----------------- SCHC Packet ------------>| 408 | | 409 | | 410 +--------------------+ +-----------------+ 411 | SCHC Fragmentation | | SCHC Reassembly | 412 +--------------------+ +-----------------+ 413 ^ | ^ | 414 | | | | 415 | | | | 416 | | | | 417 | | | | 418 | | | | 419 | +---------- SCHC Fragments ----------+ | 420 +-------------- SCHC ACK ------------------------+ 421 SENDER RECEIVER 423 *: see {{Frag}} to define the use of Fragmentation and the 424 technology-specific documents for the L2 decision. 426 Figure 3: SCHC operations taking place at the sender and the receiver 428 The SCHC Packet Compressed Header is formed by the Rule ID and the 429 Compress Residue both have a variable size, and in some cases, the 430 Compress Residue is not present depending on the Header Compression 431 achievement, see Section 6 for more details. The SCHC Packet has the 432 following format: 434 | Rule ID + Compress Residue | 435 +---------------------------------+--------------------+ 436 | Compressed Header | Payload | 437 +---------------------------------+--------------------+ 439 Figure 4: SCHC Packet 441 The Fragment Header size is variable and depends on the Fragmentation 442 parameters. The Fragment payload may contain: Compressed Header or 443 Payload or both and its size depends on the L2 data unit, see 444 Section 7. The SCHC Fragment has the following format: 446 | Rule ID + DTAG + W + FCN [+ MIC ] | Comp. Header | Payload | 447 +-----------------------------------+-------------------------+ 448 | Fragment Header | Fragment | 449 +-----------------------------------+-------------------------+ 451 Figure 5: SCHC Fragment 453 The SCHC ACK is byte aligned and the ACK Header and the encoded 454 Bitmap both have variable size. The SCHC ACK is used only in 455 Fragmentation and has the following format: 457 |Rule ID + DTag + W| 458 +------------------+-------- ... ---------+ 459 | ACK Header | encoded Bitmap | 460 +------------------+-------- ... ---------+ 462 Figure 6: SCHC ACK 464 5. Rule ID 466 Rule ID are identifiers used to select either the correct context to 467 be used for Compression/Decompression functionalities or for SCHC 468 Fragmentation or after trying to do SCHC C/D and SCHC Fragmentation 469 the packet is sent as is. The size of the Rule ID is not specified 470 in this document, as it is implementation-specific and can vary 471 according to the LPWAN technology and the number of Rules, among 472 others. 474 The Rule IDs identifiers are used: 476 o In the SCHC C/D context to keep the Field Description of the 477 header packet. 479 o In SCHC Fragmentation to identify the specific modes and settings. 480 In bidirectional SCHC Fragmentation at least two Rules 481 ID are needed. 483 o To identify the SCHC ACK in fragmentation 485 o And at least one Rule ID MAY be reserved to the case where no SCHC 486 C/D nor SCHC Fragmentation were possible. 488 6. Static Context Header Compression 490 In order to perform header compression, this document defines a 491 mechanism called Static Context Header Compression (SCHC), which is 492 based on using context, i.e. a set of rules to compress or decompress 493 headers. SCHC avoids context synchronization, which is the most 494 bandwidth-consuming operation in other header compression mechanisms 495 such as RoHC [RFC5795]. Since the nature of packets are highly 496 predictable in LPWAN networks, static contexts MAY be stored 497 beforehand to omit transmitting some information over the air. The 498 contexts MUST be stored at both ends, and they can either be learned 499 by a provisioning protocol, by out of band means, or they can be pre- 500 provisioned. The way the contexts are provisioned on both ends is 501 out of the scope of this document. 503 Dev App 504 +----------------+ +--------------+ 505 | APP1 APP2 APP3 | |APP1 APP2 APP3| 506 | | | | 507 | UDP | | UDP | 508 | IPv6 | | IPv6 | 509 | | | | 510 |SCHC Comp / Frag| | | 511 +--------+-------+ +-------+------+ 512 | +--+ +----+ +-----------+ . 513 +~~ |RG| === |NGW | === | SCHC |... Internet .. 514 +--+ +----+ |Comp / Frag| 515 +-----------+ 517 Figure 7: Architecture 519 Figure 7 The figure represents the architecture for SCHC (Static 520 Context Header Compression) Compression / Fragmentation where SCHC C/ 521 D (Compressor/Decompressor) and SCHC Fragmentation are performed. It 522 is based on [I-D.ietf-lpwan-overview] terminology. SCHC Compression 523 / Fragmentation is located on both sides of the transmission in the 524 Dev and in the Network side. In the Uplink direction, the Device 525 application packets use IPv6 or IPv6/UDP protocols. Before sending 526 these packets, the Dev compresses their headers using SCHC C/D and if 527 the SCHC Packet resulting from the compression exceeds the maximum 528 payload size of the underlying LPWAN technology, SCHC Fragmentation 529 is performed, see Section 7. The resulting SCHC Fragments are sent 530 as one or more L2 frames to an LPWAN Radio Gateway (RG) which 531 forwards the frame(s) to a Network Gateway (NGW). 533 The NGW sends the data to an SCHC Fragmentation and then to the SCHC 534 C/D for decompression. The SCHC C/D in the Network side can be 535 located in the Network Gateway (NGW) or somewhere else as long as a 536 tunnel is established between the NGW and the SCHC Compression / 537 Fragmentation. Note that, for some LPWAN technologies, it MAY be 538 suitable to locate SCHC Fragmentation and reassembly functionality 539 nearer the NGW, in order to better deal with time constraints of such 540 technologies. The SCHC C/Ds on both sides MUST share the same set of 541 Rules. After decompression, the packet can be sent over the Internet 542 to one or several LPWAN Application Servers (App). 544 The SCHC Compression / Fragmentation process is symmetrical, 545 therefore the same description applies to the reverse direction. 547 6.1. SCHC C/D Rules 549 The main idea of the SCHC compression scheme is to transmit the Rule 550 ID to the other end instead of sending known field values. This Rule 551 ID identifies a rule that provides the closest match to the original 552 packet values. Hence, when a value is known by both ends, it is only 553 necessary to send the corresponding Rule ID over the LPWAN network. 554 How Rules are generated is out of the scope of this document. The 555 rule MAY be changed but it will be specified in another document. 557 The context contains a list of rules (cf. Figure 8). Each Rule 558 contains itself a list of Fields Descriptions composed of a field 559 identifier (FID), a field length (FL), a field position (FP), a 560 direction indicator (DI), a target value (TV), a matching operator 561 (MO) and a Compression/Decompression Action (CDA). 563 /-----------------------------------------------------------------\ 564 | Rule N | 565 /-----------------------------------------------------------------\| 566 | Rule i || 567 /-----------------------------------------------------------------\|| 568 | (FID) Rule 1 ||| 569 |+-------+--+--+--+------------+-----------------+---------------+||| 570 ||Field 1|FL|FP|DI|Target Value|Matching Operator|Comp/Decomp Act|||| 571 |+-------+--+--+--+------------+-----------------+---------------+||| 572 ||Field 2|FL|FP|DI|Target Value|Matching Operator|Comp/Decomp Act|||| 573 |+-------+--+--+--+------------+-----------------+---------------+||| 574 ||... |..|..|..| ... | ... | ... |||| 575 |+-------+--+--+--+------------+-----------------+---------------+||/ 576 ||Field N|FL|FP|DI|Target Value|Matching Operator|Comp/Decomp Act||| 577 |+-------+--+--+--+------------+-----------------+---------------+|/ 578 | | 579 \-----------------------------------------------------------------/ 581 Figure 8: Compression/Decompression Context 583 The Rule does not describe how to delineate each field in the 584 original packet header. This MUST be known from the compressor/ 585 decompressor. The rule only describes the compression/decompression 586 behavior for each header field. In the rule, the Fields Descriptions 587 are listed in the order in which the fields appear in the packet 588 header. 590 The Rule also describes the Compression Residue sent regarding the 591 order of the Fields Descriptions in the Rule. 593 The Context describes the header fields and its values with the 594 following entries: 596 o Field ID (FID) is a unique value to define the header field. 598 o Field Length (FL) represents the length of the field in bits for 599 fixed values or a type (variable, token length, ...) for Field 600 Description length unknown at the rule creation. The length of a 601 header field is defined in the specific protocol standard. 603 o Field Position (FP): indicating if several instances of a field 604 exist in the headers which one is targeted. The default position 605 is 1. 607 o A direction indicator (DI) indicates the packet direction(s) this 608 Field Description applies to. Three values are possible: 610 * UPLINK (Up): this Field Description is only applicable to 611 packets sent by the Dev to the App, 613 * DOWNLINK (Dw): this Field Description is only applicable to 614 packets sent from the App to the Dev, 616 * BIDIRECTIONAL (Bi): this Field Description is applicable to 617 packets travelling both Up and Dw. 619 o Target Value (TV) is the value used to make the match with the 620 packet header field. The Target Value can be of any type 621 (integer, strings, etc.). For instance, it can be a single value 622 or a more complex structure (array, list, etc.), such as a JSON or 623 a CBOR structure. 625 o Matching Operator (MO) is the operator used to match the Field 626 Value and the Target Value. The Matching Operator may require 627 some parameters. MO is only used during the compression phase. 628 The set of MOs defined in this document can be found in 629 Section 6.4. 631 o Compression Decompression Action (CDA) describes the compression 632 and decompression processes to be performed after the MO 633 is applied. The CDA MAY require some parameters to be processed. 634 CDAs are used in both the compression and the decompression 635 functions. The set of CDAs defined in this document can be found 636 in Section 6.5. 638 6.2. Rule ID for SCHC C/D 640 Rule IDs are sent by the compression function in one side and are 641 received for the decompression function in the other side. In SCHC 642 C/D, the Rule IDs are specific to a Dev. Hence, multiple Dev 643 instances MAY use the same Rule ID to define different header 644 compression contexts. To identify the correct Rule ID, the SCHC C/D 645 needs to correlate the Rule ID with the Dev identifier to find the 646 appropriate Rule to be applied. 648 6.3. Packet processing 650 The compression/decompression process follows several steps: 652 o Compression Rule selection: The goal is to identify which Rule(s) 653 will be used to compress the packet's headers. When 654 doing decompression, in the network side the SCHC C/D needs to 655 find the correct Rule based on the L2 address and in this way, it 656 can use the Dev-ID and the Rule-ID. In the Dev side, only the 657 Rule ID is needed to identify the correct Rule since the Dev only 658 holds Rules that apply to itself. The Rule will be selected by 659 matching the Fields Descriptions to the packet header as described 660 below. When the selection of a Rule is done, this Rule is used to 661 compress the header. The detailed steps for compression Rule 662 selection are the following: 664 * The first step is to choose the Fields Descriptions by their 665 direction, using the direction indicator (DI). A Field 666 Description that does not correspond to the appropriate DI will 667 be ignored, if all the fields of the packet do not have a Field 668 Description with the correct DI the Rule is discarded and SCHC 669 C/D proceeds to explore the next Rule. 671 * When the DI has matched, then the next step is to identify the 672 fields according to Field Position (FP). If the Field Position 673 does not correspond, the Rule is not used and the SCHC C/D 674 proceeds to consider the next Rule. 676 * Once the DI and the FP correspond to the header information, 677 each field's value of the packet is then compared to the 678 corresponding Target Value (TV) stored in the Rule for that 679 specific field using the matching operator (MO). 681 If all the fields in the packet's header satisfy all the 682 matching operators (MO) of a Rule (i.e. all MO results are 683 True), the fields of the header are then compressed according 684 to the Compression/Decompression Actions (CDAs) and a 685 compressed header (with possibly a Compressed Residue) SHOULD 686 be obtained. Otherwise, the next Rule is tested. 688 * If no eligible Rule is found, then the header MUST be sent 689 without compression, depending on the L2 PDU size, this is one 690 of the case that MAY require the use of the SCHC Fragmentation 691 process. 693 o Sending: If an eligible Rule is found, the Rule ID is sent to the 694 other end followed by the Compression Residue (which could be 695 empty) and directly followed by the payload. The product of the 696 Compression Residue is sent in the order expressed in the Rule for 697 all the fields. The way the Rule ID is sent depends on the 698 specific LPWAN layer two technology. For example, it can be 699 either included in a Layer 2 header or sent in the first byte of 700 the L2 payload. (Cf. Figure 9). This process will be specified 701 in the LPWAN technology-specific document and is out of the scope 702 of the present document. On LPWAN technologies that are byte- 703 oriented, the compressed header concatenated with the original 704 packet payload is padded to a multiple of 8 bits, if needed. See 705 Section 8 for details. 707 o Decompression: When doing decompression, in the network side the 708 SCHC C/D needs to find the correct Rule based on the L2 address 709 and in this way, it can use the Dev-ID and the Rule-ID. In the 710 Dev side, only the Rule ID is needed to identify the correct Rule 711 since the Dev only holds Rules that apply to itself. 713 The receiver identifies the sender through its device-id (e.g. 714 MAC address, if exists) and selects the appropriate Rule 715 from the Rule ID. If a source identifier is present in the L2 716 technology, it is used to select the Rule ID. This Rule describes 717 the compressed header format and associates the values to the 718 header fields. The receiver applies the CDA action to reconstruct 719 the original header fields. The CDA application order can be 720 different from the order given by the Rule. For instance, 721 Compute-* SHOULD be applied at the end, after all the other CDAs. 723 +--- ... --+------- ... -------+------------------+~~~~~~~ 724 | Rule ID |Compression Residue| packet payload |padding 725 +--- ... --+------- ... -------+------------------+~~~~~~~ 726 (optional) 727 |----- compressed header ------| 729 Figure 9: SCHC C/D Packet Format 731 6.4. Matching operators 733 Matching Operators (MOs) are functions used by both SCHC C/D 734 endpoints involved in the header compression/decompression. They are 735 not typed and can be indifferently applied to integer, string or any 736 other data type. The result of the operation can either be True or 737 False. MOs are defined as follows: 739 o equal: The match result is True if a field value in a packet and 740 the value in the TV are equal. 742 o ignore: No check is done between a field value in a packet and a 743 TV in the Rule. The result of the matching is always true. 745 o MSB(x): A match is obtained if the most significant x bits of the 746 field value in the header packet are equal to the TV in the Rule. 747 The x parameter of the MSB Matching Operator indicates how many 748 bits are involved in the comparison. 750 o match-mapping: With match-mapping, the Target Value is a list of 751 values. Each value of the list is identified by a short ID (or 752 index). Compression is achieved by sending the index instead of 753 the original header field value. This operator matches if the 754 header field value is equal to one of the values in the target 755 list. 757 6.5. Compression Decompression Actions (CDA) 759 The Compression Decompression Action (CDA) describes the actions 760 taken during the compression of headers fields, and inversely, the 761 action taken by the decompressor to restore the original value. 763 /--------------------+-------------+----------------------------\ 764 | Action | Compression | Decompression | 765 | | | | 766 +--------------------+-------------+----------------------------+ 767 |not-sent |elided |use value stored in ctxt | 768 |value-sent |send |build from received value | 769 |mapping-sent |send index |value from index on a table | 770 |LSB(y) |send LSB |TV, received value | 771 |compute-length |elided |compute length | 772 |compute-checksum |elided |compute UDP checksum | 773 |Deviid |elided |build IID from L2 Dev addr | 774 |Appiid |elided |build IID from L2 App addr | 775 \--------------------+-------------+----------------------------/ 776 y=size of the transmitted bits 778 Figure 10: Compression and Decompression Functions 780 Figure 10 summarizes the basic functions that can be used to compress 781 and decompress a field. The first column lists the actions name. 782 The second and third columns outline the reciprocal compression/ 783 decompression behavior for each action. 785 Compression is done in order that Fields Descriptions appear in the 786 Rule. The result of each Compression/Decompression Action is 787 appended to the working Compression Residue in that same order. The 788 receiver knows the size of each compressed field which can be given 789 by the rule or MAY be sent with the compressed header. 791 If the field is identified as being variable in the Field 792 Description, then the size of the Compression Residue value in bytes 793 MUST be sent first using the following coding: 795 o If the size is between 0 and 14 bytes, it is sent as a 4-bits 796 integer. 798 o For values between 15 and 254, the first 4 bits sent are set to 1 799 and the size is sent using 8 bits integer. 801 o For higher values of size, the first 12 bits are set to 1 and the 802 next two bytes contain the size value as a 16 bits integer. 804 o If a field does not exist in the packet but in the Rule and its FL 805 is variable, the size zero MUST be used. 807 6.5.1. not-sent CDA 809 The not-sent function is generally used when the field value is 810 specified in the Rule and therefore known by both the Compressor and 811 the Decompressor. This action is generally used with the "equal" MO. 812 If MO is "ignore", there is a risk to have a decompressed field value 813 different from the compressed field. 815 The compressor does not send any value in the Compressed Residue for 816 a field on which not-sent compression is applied. 818 The decompressor restores the field value with the Target Value 819 stored in the matched Rule identified by the received Rule ID. 821 6.5.2. value-sent CDA 823 The value-sent action is generally used when the field value is not 824 known by both Compressor and Decompressor. The value is sent in the 825 compressed message header. Both Compressor and Decompressor MUST 826 know the size of the field, either implicitly (the size is known by 827 both sides) or explicitly in the compression residue by indicating 828 the length, as defined in Section 6.5. This function is generally 829 used with the "ignore" MO. 831 6.5.3. mapping-sent CDA 833 The mapping-sent is used to send a smaller index (the index into the 834 Target Value list of values) instead of the original value. This 835 function is used together with the "match-mapping" MO. 837 On the compressor side, the match-mapping Matching Operator searches 838 the TV for a match with the header field value and the mapping-sent 839 CDA appends the corresponding index to the Compression Residue to be 840 sent. On the decompressor side, the CDA uses the received index to 841 restore the field value by looking up the list in the TV. 843 The number of bits sent is the minimal size for coding all the 844 possible indices. 846 6.5.4. LSB(y) CDA 848 The LSB(y) action is used together with the "MSB(x)" MO to avoid 849 sending the higher part of the packet field if that part is already 850 known by the receiving end. A length can be specified in the rule to 851 indicate how many bits have to be sent. If the length is not 852 specified, the number of bits sent is the original header field 853 length minus the length specified in the MSB(x) MO. 855 The compressor sends the Least Significant Bits (e.g. LSB of the 856 length field). The decompressor combines the value received with the 857 Target Value depending on the field type. 859 If this action needs to be done on a variable length field, the size 860 of the Compressed Residue in bytes MUST be sent as described in 861 Section 6.5. 863 6.5.5. DEViid, APPiid CDA 865 These functions are used to process respectively the Dev and the App 866 Interface Identifiers (Deviid and Appiid) of the IPv6 addresses. 867 Appiid CDA is less common since current LPWAN technologies frames 868 contain a single address, which is the Dev's address. 870 The IID value MAY be computed from the Device ID present in the Layer 871 2 header, or from some other stable identifier. The computation is 872 specific for each LPWAN technology and MAY depend on the Device ID 873 size. 875 In the Downlink direction, these Deviid CDA is used to determine the 876 L2 addresses used by the LPWAN. 878 6.5.6. Compute-* 880 Some fields are elided during compression and reconstructed during 881 decompression. This is the case for length and Checksum, so: 883 o compute-length: computes the length assigned to this field. This 884 CDA MAY be used to compute IPv6 length or UDP length. 886 o compute-checksum: computes a checksum from the information already 887 received by the SCHC C/D. This field MAY be used to compute UDP 888 checksum. 890 7. Fragmentation 892 7.1. Overview 894 In LPWAN technologies, the L2 data unit size typically varies from 895 tens to hundreds of bytes. The SCHC Fragmentation MAY be used either 896 because after applying SCHC C/D or when SCHC C/D is not possible the 897 entire SCHC Packet still exceeds the L2 data unit. 899 The SCHC Fragmentation functionality defined in this document has 900 been designed under the assumption that data unit out-of- sequence 901 delivery will not happen between the entity performing fragmentation 902 and the entity performing reassembly. This assumption allows 903 reducing the complexity and overhead of the SCHC Fragmentation 904 mechanism. 906 To adapt the SCHC Fragmentation to the capabilities of LPWAN 907 technologies is required to enable optional SCHC Fragment 908 retransmission and to allow a stepper delivery for the reliability of 909 SCHC Fragments. This document does not make any decision with regard 910 to which SCHC Fragment delivery reliability mode will be used over a 911 specific LPWAN technology. These details will be defined in other 912 technology-specific documents. 914 7.2. Fragmentation Tools 916 This subsection describes the different tools that are used to enable 917 the SCHC Fragmentation functionality defined in this document, such 918 as fields in the SCHC Fragmentation header frames (see the related 919 formats in Section 7.4), and the different parameters supported in 920 the reliability modes such as timers and parameters. 922 o Rule ID. The Rule ID is present in the SCHC Fragment header and 923 in the SCHC ACK header format. The Rule ID in a SCHC fragment 924 header is used to identify that a SCHC Fragment is being carried, 925 which SCHC Fragmentation reliability mode is used and which window 926 size is used. The Rule ID in the SCHC Fragmentation header also 927 allows interleaving non-fragmented 928 packets and SCHC Fragments that carry other SCHC Packets. The 929 Rule ID in an SCHC ACK identifies the message as an SCHC ACK. 931 o Fragment Compressed Number (FCN). The FCN is included in all SCHC 932 Fragments. This field can be understood as a truncated, 933 efficient representation of a larger-sized fragment number, and 934 does not carry an absolute SCHC Fragment number. There are two 935 FCN reserved values that are used for controlling the SCHC 936 Fragmentation process, as described next: 938 * The FCN value with all the bits equal to 1 (All-1) denotes the 939 last SCHC Fragment of a packet. The last window of a packet is 940 called an All-1 window. 942 * The FCN value with all the bits equal to 0 (All-0) denotes the 943 last SCHC Fragment of a window that is not the last one of the 944 packet. Such a window is called an All-0 window. 946 The rest of the FCN values are assigned in a sequentially 947 decreasing order, which has the purpose to avoid possible 948 ambiguity for the receiver that might arise under certain 949 conditions. In the SCHC Fragments, this field is an unsigned 950 integer, with a size of N bits. In the No-ACK mode, it is set to 951 1 bit (N=1), All-0 is used in all SCHC Fragments and All-1 for the 952 last one. For the other reliability modes, it is recommended to 953 use a number of bits (N) equal to or greater than 3. 954 Nevertheless, the appropriate value of N MUST be defined in the 955 corresponding technology-specific profile documents. For windows 956 that are not the last one from a SCHC Fragmented packet, the FCN 957 for the last SCHC Fragment in such windows is an All-0. This 958 indicates that the window is finished and communication proceeds 959 according to the reliability mode in use. The FCN for the last 960 SCHC Fragment in the last window is an All-1, indicating the last 961 SCHC Fragment of the SCHC Packet. It is also important to note 962 that, in the No-ACK mode or when N=1, the last SCHC Fragment of 963 the packet will carry a FCN equal to 1, while all previous SCHC 964 Fragments will carry a FCN to 0. For further details see 965 Section 7.5. The highest FCN in the window, denoted MAX_WIND_FCN, 966 MUST be a value equal to or smaller than 2^N-2. (Example for N=5, 967 MAX_WIND_FCN MAY be set to 23, then subsequent FCNs are set 968 sequentially and in decreasing order, and the FCN will wrap from 0 969 back to 23). 971 o Datagram Tag (DTag). The DTag field, if present, is set to the 972 same value for all SCHC Fragments carrying the same SCHC 973 packet, and to different values for different SCHC Packets. Using 974 this field, the sender can interleave fragments from different 975 SCHC Packets, while the receiver can still tell them apart. In 976 the SCHC Fragment formats, the size of the DTag field is T bits, 977 which MAY be set to a value greater than or equal to 0 bits. For 978 each new SCHC Packet processed by the sender, DTag MUST be 979 sequentially increased, from 0 to 2^T - 1 wrapping back from 2^T - 980 1 to 0. In the SCHC ACK format, DTag carries the same value as 981 the DTag field in the SCHC Fragments for which this SCHC ACK is 982 intended. When there is no Dtag, there can be only 1 SCHC Packet 983 in transist. And only after all its fragments have been 984 transmitted another SCHC Packet could be sent. The length of 985 DTag, denoted T is not given in this document because is technolgy 986 dependant, and will be defined in the corresponding technology- 987 documents. DTag is based on the number of simultaneous packets 988 supported. 990 o W (window): W is a 1-bit field. This field carries the same value 991 for all SCHC Fragments of a window, and it is complemented for the 992 next window. The initial value for this field is 0. In the SCHC 993 ACK format, this field also has a size of 1 bit. In all SCHC 994 ACKs, the W bit carries the same value as the W bit carried by the 995 SCHC Fragments whose reception is being positively or negatively 996 acknowledged by the SCHC ACK. 998 o Message Integrity Check (MIC). This field is computed by the 999 sender over the complete SCHC Packet and before SCHC 1000 fragmentation. The MIC allows the receiver to check errors in the 1001 reassembled packet, while it also enables compressing the UDP 1002 checksum by use of SCHC compression. The CRC32 as 0xEDB88320 1003 (i.e. the reverse representation of the polynomial used e.g. in 1004 the Ethernet standard [RFC3385]) is recommended as the default 1005 algorithm for computing the MIC. Nevertheless, other algorithms 1006 MAY be required and are defined in the technology-specific 1007 documents as well as the length in bits of the MIC used. 1009 o C (MIC checked): C is a 1-bit field. This field is used in the 1010 SCHC ACK packets to report the outcome of the MIC check, i.e. 1011 whether the reassembled packet was correctly received or not. A 1012 value of 1 represents a positive MIC check at the receiver side 1013 (i.e. the MIC computed by the receiver matches the received MIC). 1015 o Retransmission Timer. A SCHC Fragment sender uses it after the 1016 transmission of a window to detect a transmission error of the 1017 SCHC ACK corresponding to this window. Depending on the 1018 reliability mode, it will lead to a request an SCHC ACK 1019 retransmission (in ACK-Always mode) or it will trigger the 1020 transmission of the next window (in ACK-on-Error mode). The 1021 duration of this timer is not defined in this document and MUST be 1022 defined in the corresponding technology documents. 1024 o Inactivity Timer. A SCHC Fragment receiver uses it to take action 1025 when there is a problem in the transmission of SCHC fragments. 1026 Such a problem could be detected by the receiver not getting a 1027 single SCHC Fragment during a given period of time or not getting 1028 a given number of packets in a given period of time. When this 1029 happens, an Abort message will be sent (see related text later in 1030 this section). Initially, and each time a SCHC Fragment is 1031 received, the timer is reinitialized. The duration of this timer 1032 is not defined in this document and MUST be defined in the 1033 specific technology document. 1035 o Attempts. This counter counts the requests for a missing SCHC 1036 ACK. When it reaches the value MAX_ACK_REQUESTS, the sender 1037 assume there are recurrent SCHC Fragment transmission errors and 1038 determines that an Abort is needed. The default value offered 1039 MAX_ACK_REQUESTS is not stated in this document, and it is 1040 expected to be defined in the specific technology document. The 1041 Attempts counter is defined per window. It is initialized each 1042 time a new window is used. 1044 o Bitmap. The Bitmap is a sequence of bits carried in an SCHC ACK. 1045 Each bit in the Bitmap corresponds to a SCHC fragment of the 1046 current window, and provides feedback on whether the SCHC Fragment 1047 has been received or not. The right-most position on the Bitmap 1048 reports if the All-0 or All-1 fragment has been received or not. 1049 Feedback on the SCHC fragment with the highest FCN value is 1050 provided by the bit in the left-most position of the Bitmap. In 1051 the Bitmap, a bit set to 1 indicates that the SCHC Fragment of FCN 1052 corresponding to that bit position has been correctly sent and 1053 received. The text above describes the internal representation of 1054 the Bitmap. When inserted in the SCHC ACK for transmission from 1055 the receiver to the sender, the Bitmap MAY be truncated for 1056 energy/bandwidth optimisation, see more details in 1057 Section 7.4.3.1. 1059 o Abort. On expiration of the Inactivity timer, or when Attempts 1060 reached MAX_ACK_REQUESTS or upon an occurrence of some other 1061 error, the sender or the receiver MUST use the Abort. When the 1062 receiver needs to abort the on-going SCHC Fragmented packet 1063 transmission, it sends the Receiver-Abort format. When the sender 1064 needs to abort the transmission, it sends the Sender-Abort format. 1065 None of the Abort are acknowledged. 1067 o Padding (P). If it is needed, the number of bits used for padding 1068 is not defined and depends on the size of the Rule ID, DTag and 1069 FCN fields, and on the L2 payload size (see Section 8). Some SCHC 1070 ACKs are byte-aligned and do not need padding (see 1071 Section 7.4.3.1). 1073 7.3. Reliability modes 1075 This specification defines three reliability modes: No-ACK, ACK- 1076 Always and ACK-on-Error. ACK-Always and ACK-on-Error operate on 1077 windows of SCHC Fragments. A window of SCHC Fragments is a subset of 1078 the full set of SCHC Fragments needed to carry a packet or an SCHC 1079 Packet. 1081 o No-ACK. No-ACK is the simplest SCHC Fragment reliability mode. 1082 The receiver does not generate overhead in the form of 1083 acknowledgments (ACKs). However, this mode does not enhance 1084 reliability beyond that offered by the underlying LPWAN 1085 technology. In the No-ACK mode, the receiver MUST NOT issue SCHC 1086 ACKs. See further details in Section 7.5.1. 1088 o ACK-Always. The ACK-Always mode provides flow control using a 1089 window scheme. This mode is also able to handle long bursts of 1090 lost SCHC Fragments since detection of such events can be done 1091 before the end of the SCHC Packet transmission as long as the 1092 window size is short enough. However, such benefit comes at the 1093 expense of SCHC ACK use. In ACK-Always the receiver sends an SCHC 1094 ACK after a window of SCHC Fragments has been received, where a 1095 window of SCHC Fragments is a subset of the whole number of SCHC 1096 Fragments needed to carry a complete SCHC Packet. The SCHC ACK is 1097 used to inform the sender if a SCHC fragment in the actual window 1098 has been lost or well received. Upon an SCHC ACK reception, the 1099 sender retransmits the lost SCHC Fragments. When an SCHC ACK is 1100 lost and the sender has not received it before the expiration of 1101 the Inactivity Timer, the sender uses an SCHC ACK request by 1102 sending the All-1 empty SCHC Fragment. The maximum number of SCHC 1103 ACK requests is MAX_ACK_REQUESTS. If the MAX_ACK_REQUEST is 1104 reached the transmission needs to be Aborted. See further details 1105 in {{ACK- Always-subsection}}. 1107 o ACK-on-Error. The ACK-on-Error mode is suitable for links 1108 offering relatively low L2 data unit loss probability. In this 1109 mode, the SCHC Fragment receiver reduces the number of SCHC ACKs 1110 transmitted, which MAY be especially beneficial in asymmetric 1111 scenarios. Because the SCHC Fragments use the uplink of the 1112 underlying LPWAN technology, which has higher capacity than 1113 downlink. The receiver transmits an SCHC ACK only after the 1114 complete window transmission and if at least one SCHC Fragment of 1115 this window has been lost. An exception to this behavior is in 1116 the last window, where the receiver MUST transmit an SCHC ACK, 1117 including the C bit set based on the MIC checked result, even if 1118 all the SCHC Fragments of the last window have been correctly 1119 received. The SCHC ACK gives the state of all the SCHC Fragments 1120 (received or lost). Upon an SCHC ACK reception, the sender 1121 retransmits the lost SCHC Fragments. If an SCHC ACK is not 1122 transmitted back by the receiver at the end of a window, the 1123 sender assumes that all SCHC Fragments have been correctly 1124 received. When the SCHC ACK is lost, the sender assumes that all 1125 SCHC Fragments covered by the lost SCHC ACK have been successfully 1126 delivered, so the sender continues transmitting the next window of 1127 SCHC Fragments. If the next SCHC Fragments received belong to the 1128 next window, the receiver will abort the on-going fragmented 1129 packet transmission. See further details in Section 7.5.3. 1131 The same reliability mode MUST be used for all SCHC Fragments of an 1132 SCHC Packet. The decision on which reliability mode will be used and 1133 whether the same reliability mode applies to all SCHC Packets is an 1134 implementation problem and is out of the scope of this document. 1136 Note that the reliability mode choice is not necessarily tied to a 1137 particular characteristic of the underlying L2 LPWAN technology, e.g. 1138 the No-ACK mode MAY be used on top of an L2 LPWAN technology with 1139 symmetric characteristics for uplink and downlink. This document 1140 does not make any decision as to which SCHC Fragment reliability 1141 mode(s) are supported by a specific LPWAN technology. 1143 Examples of the different reliability modes described are provided in 1144 Appendix B. 1146 7.4. Fragmentation Formats 1148 This section defines the SCHC Fragment format, the All-0 and All-1 1149 formats, the SCHC ACK format and the Abort formats. 1151 7.4.1. Fragment format 1153 A SCHC Fragment comprises a SCHC Fragment header, a SCHC Fragment 1154 payload and padding bits (if needed). A SCHC Fragment conforms to 1155 the general format shown in Figure 11. The SCHC Fragment payload 1156 carries a subset of SCHC Packet. A SCHC Fragment is the payload of 1157 the L2 protocol data unit (PDU). Padding MAY be added in SCHC 1158 Fragments and in SCHC ACKs if necessary, therefore a padding field is 1159 optional (this is explicitly indicated in Figure 11 for the sake of 1160 illustration clarity. 1162 +-----------------+-----------------------+~~~~~~~~~~~~~~~ 1163 | Fragment Header | Fragment payload | padding (opt.) 1164 +-----------------+-----------------------+~~~~~~~~~~~~~~~ 1166 Figure 11: Fragment general format. Presence of a padding field is 1167 optional 1169 In ACK-Always or ACK-on-Error, SCHC Fragments except the last one 1170 SHALL conform the detailed format defined in Figure 12. The total 1171 size of the fragment header is not byte aligned. 1173 |---Fragmentation Header----| 1174 |-- T --|1|-- N --| 1175 +-- ... --+- ... -+-+- ... -+--------...-------+ 1176 | Rule ID | DTag |W| FCN | Fragment payload | 1177 +-- ... --+- ... -+-+- ... -+--------...-------+ 1179 Figure 12: Fragment Detailed Format for Fragments except the Last 1180 One, Window mode 1182 In the No-ACK mode, SCHC Fragments except the last one SHALL conform 1183 to the detailed format defined in Figure 13. The total size of the 1184 fragment header is not byte aligned. 1186 |---Fragmentation Header---| 1187 |-- T --|-- N --| 1188 +-- ... --+- ... -+- ... -+--------...-------+ 1189 | Rule ID | DTag | FCN | Fragment payload | 1190 +-- ... --+- ... -+- ... -+--------...-------+ 1192 Figure 13: Fragment Detailed Format for Fragments except the Last 1193 One, No-ACK mode 1195 In all these cases, the total size of the fragment header is not byte 1196 aligned. 1198 7.4.2. All-1 and All-0 formats 1200 The All-0 format is used for sending the last SCHC Fragment of a 1201 window that is not the last window of the packet. 1203 |-- T --|1|-- N --| 1204 +-- ... --+- ... -+-+- ... -+--- ... ---+ 1205 | Rule ID | DTag |W| 0..0 | payload | 1206 +-- ... --+- ... -+-+- ... -+--- ... ---+ 1208 Figure 14: All-0 fragment detailed format 1210 The All-0 empty fragment format is used by a sender to request the 1211 retransmission of an SCHC ACK by the receiver. It is only used in 1212 ACK-Always mode. 1214 |-- T --|1|-- N --| 1215 +-- ... --+- ... -+-+- ... -+ 1216 | Rule ID | DTag |W| 0..0 | (no payload) 1217 +-- ... --+- ... -+-+- ... -+ 1219 Figure 15: All-0 empty fragment detailed format 1221 In the No-ACK mode, the last SCHC Fragment of an IPv6 datagram SHALL 1222 contain a SCHC Fragment header that conforms to the detaield format 1223 shown in Figure 16. 1225 |-- T --|-N=1-| 1226 +---- ... ---+- ... -+-----+---- ... ----+---...---+ 1227 | Rule ID | DTag | 1 | MIC | payload | 1228 +---- ... ---+- ... -+-----+---- ... ----+---...---+ 1230 Figure 16: All-1 Fragment Detailed Format for the Last Fragment, No- 1231 ACK mode 1233 In any of the Window modes, the last fragment of an IPv6 datagram 1234 SHALL contain a SCHC Fragment header that conforms to the detailed 1235 format shown in Figure 17. The total size of the SCHC Fragment 1236 header in this format is not byte aligned. 1238 |-- T --|1|-- N --| 1239 +-- ... --+- ... -+-+- ... -+---- ... ----+---...---+ 1240 | Rule ID | DTag |W| 11..1 | MIC | payload | 1241 +-- ... --+- ... -+-+- ... -+---- ... ----+---...---+ 1242 (FCN) 1244 Figure 17: All-1 Fragment Detailed Format for the Last Fragment, ACK- 1245 Always or ACK-on-Error 1247 In either ACK-Always or ACK-on-Error, in order to request a 1248 retransmission of the SCHC ACK for the All-1 window, the fragment 1249 sender uses the format shown in Figure 18. The total size of the 1250 SCHC Fragment header in not byte aligned. 1252 |-- T --|1|-- N --| 1253 +-- ... --+- ... -+-+- ... -+---- ... ----+ 1254 | Rule ID | DTag |W| 1..1 | MIC | (no payload) 1255 +-- ... --+- ... -+-+- ... -+---- ... ----+ 1257 Figure 18: All-1 for Retries format, also called All-1 empty 1259 The values for Fragmentation Header, N, T and the length of MIC are 1260 not specified in this document, and SHOULD be determined in other 1261 documents (e.g. technology-specific profile documents). 1263 7.4.3. SCHC ACK format 1265 The format of an SCHC ACK that acknowledges a window that is not the 1266 last one (denoted as All-0 window) is shown in Figure 19. 1268 |-- T --|1| 1269 +---- ... --+- ... -+-+---- ... -----+ 1270 | Rule ID | DTag |W|encoded Bitmap| (no payload) 1271 +---- ... --+- ... -+-+---- ... -----+ 1273 Figure 19: ACK format for All-0 windows 1275 To acknowledge the last window of a packet (denoted as All-1 window), 1276 a C bit (i.e. MIC checked) following the W bit is set to 1 to 1277 indicate that the MIC check computed by the receiver matches the MIC 1278 present in the All-1 fragment. If the MIC check fails, the C bit is 1279 set to 0 and the Bitmap for the All-1 window follows. 1281 |-- T --|1|1| 1282 +---- ... --+- ... -+-+-+ 1283 | Rule ID | DTag |W|1| (MIC correct) 1284 +---- ... --+- ... -+-+-+ 1286 +---- ... --+- ... -+-+-+----- ... -----+ 1287 | Rule ID | DTag |W|0|encoded Bitmap |(MIC Incorrect) 1288 +---- ... --+- ... -+-+-+----- ... -----+ 1289 C 1291 Figure 20: Format of an SCHC ACK for All-1 windows 1293 7.4.3.1. Bitmap Encoding 1295 The Bitmap is transmitted by a receiver as part of the SCHC ACK 1296 format. An SCHC ACK message MAY include padding at the end to align 1297 its number of transmitted bits to a multiple of 8 bits. 1299 Note that the SCHC ACK sent in response to an All-1 fragment includes 1300 the C bit. Therefore, the window size and thus the encoded Bitmap 1301 size need to be determined taking into account the available space in 1302 the layer two frame payload, where there will be 1 bit less for an 1303 SCHC ACK sent in response to an All-1 fragment than in other SCHC 1304 ACKs. Note that the maximum number of SCHC Fragments of the last 1305 window is one unit smaller than that of the previous windows. 1307 When the receiver transmits an encoded Bitmap with a SCHC Fragment 1308 that has not been sent during the transmission, the sender will Abort 1309 the transmission. 1311 |---- Bitmap bits ----| 1312 | Rule ID | DTag |W|1|0|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1| 1313 |--- byte boundary ----| 1 byte next | 1 byte next | 1315 Figure 21: A non-encoded Bitmap 1317 In order to reduce the resulting frame size, the encoded Bitmap is 1318 shortened by applying the following algorithm: all the right-most 1319 contiguous bytes in the encoded Bitmap that have all their bits set 1320 to 1 MUST NOT be transmitted. Because the SCHC Fragment sender knows 1321 the actual Bitmap size, it can reconstruct the original Bitmap with 1322 the trailing 1 bit optimized away. In the example shown in 1323 Figure 22, the last 2 bytes of the Bitmap shown in Figure 21 comprise 1324 bits that are all set to 1, therefore they are not sent. 1326 |-- T --|1| 1327 +---- ... --+- ... -+-+-+-+ 1328 | Rule ID | DTag |W|1|0| 1329 +---- ... --+- ... -+-+-+-+ 1330 |---- byte boundary -----| 1332 Figure 22: Optimized Bitmap format 1334 Figure 23 shows an example of an SCHC ACK with FCN ranging from 6 1335 down to 0, where the Bitmap indicates that the second and the fifth 1336 SCHC Fragments have not been correctly received. 1338 6 5 4 3 2 1 0 (*) 1339 |-- T --|1| 1340 +---------+-------+-+-+-+-+-+-+-+-----+ 1341 | Rule ID | DTag |W|1|0|1|1|0|1|all-0| Bitmap(before tx) 1342 +---------+-------+-+-+-+-+-+-+-+-----+ 1343 |<-- byte boundary ->|<---- 1 byte---->| 1344 (*)=(FCN values) 1346 +---------+------+-+-+-+-+-+-+-+-----+~~ 1347 | Rule ID | DTag |W|1|0|1|1|0|1|all-0|Padding(opt.) encoded Bitmap 1348 +---------+------+-+-+-+-+-+-+-+-----+~~ 1349 |<-- byte boundary ->|<---- 1 byte---->| 1351 Figure 23: Example of a Bitmap before transmission, and the 1352 transmitted one, in any window except the last one 1354 Figure 24 shows an example of an SCHC ACK with FCN ranging from 6 1355 down to 0, where the Bitmap indicates that the MIC check has failed 1356 but there are no missing SCHC Fragments. 1358 <------- R -------> 6 5 4 3 2 1 7 (*) 1359 |-- T --|1| 1360 | Rule ID | DTag |W|0|1|1|1|1|1|1|1|padding| Bitmap (before tx) 1361 |---- byte boundary -----| 1 byte next | 1362 C 1363 +---- ... --+-... -+-+-+-+ 1364 | Rule ID | DTag |W|0|1| encoded Bitmap 1365 +---- ... --+-... -+-+-+-+ 1366 |---- byte boundary -----| 1367 (*) = (FCN values indicating the order) 1369 Figure 24: Example of the Bitmap in ACK-Always or ACK-on-Error for 1370 the last window, for N=3) 1372 7.4.4. Abort formats 1374 Abort are coded as exceptions to the previous coding, a specific 1375 format is defined for each direction. When a SCHC Fragment sender 1376 needs to abort the transmission, it sends the Sender-Abort format 1377 Figure 25, that is an All-1 fragment with no MIC or payload. In 1378 regular cases All-1 fragment contains at least a MIC value. This 1379 absence of the MIC value indicates an Abort. 1381 When a SCHC Fragment receiver needs to abort the on-going SCHC 1382 Fragmented packet transmission, it transmits the Receiver- Abort 1383 format Figure 26, creating an exception in the encoded Bitmap coding. 1384 Encoded Bitmap avoid sending the rigth most bits of the Bitmap set to 1385 1. Abort is coded as an SCHC ACK message with a Bitmap set to 1 1386 until the byte boundary, followed by an extra 0xFF byte. Such 1387 message never occurs in a regular acknowledgement and is view as an 1388 abort. 1390 None of these messages are not acknowledged nor retransmitted. 1392 The sender uses the Sender-Abort when the MAX_ACK_REQUEST is reached. 1393 The receiver uses the Receiver-Abort when the Inactivity timer 1394 expires, or in the ACK-on-Error mode, SCHC ACK is lost and the sender 1395 transmits SCHC Fragments of a new window. Some other cases for Abort 1396 are explained in the Section 7.5 or Appendix C. 1398 |-- Fragmentation Header ---|--- 1 byte ----| 1399 +--- ... ---+- ... -+-+-...-+-+-+-+-+-+-+-+-+ 1400 | Rule ID | DTag |W| FCN | FF | (no MIC & no payload) 1401 +--- ... ---+- ... -+-+-...-+-+-+-+-+-+-+-+-+ 1403 Figure 25: Sender-Abort format. All FCN fields in this format are 1404 set to 1 1406 |----- byte boundary ------|---- 1 byte ---| 1408 +---- ... --+-... -+-+-+-+-+-+-+-+-+-+-+-+-+ 1409 | Rule ID | DTag |W| 1..1| FF | 1410 +---- ... --+-... -+-+-+-+-+-+-+-+-+-+-+-+-+ 1412 Figure 26: Receiver-Abort format 1414 7.5. Baseline mechanism 1416 If after applying SCHC header compression (or when SCHC header 1417 compression is not possible) the SCHC Packet does not fit within the 1418 payload of a single L2 data unit, the SCHC Packet SHALL be broken 1419 into SCHC Fragments and the fragments SHALL be sent to the fragment 1420 receiver. The fragment receiver needs to identify all the SCHC 1421 Fragments that belong to a given SCHC Packet. To this end, the 1422 receiver SHALL use: 1424 o The sender's L2 source address (if present), 1426 o The destination's L2 address (if present), 1428 o Rule ID, 1430 o DTag (if present). 1432 Then, the fragment receiver MAY determine the SCHC Fragment 1433 reliability mode that is used for this SCHC Fragment based on the 1434 Rule ID in that fragment. 1436 After a SCHC Fragment reception, the receiver starts constructing the 1437 SCHC Packet. It uses the FCN and the arrival order of each SCHC 1438 Fragment to determine the location of the individual fragments within 1439 the SCHC Packet. For example, the receiver MAY place the fragment 1440 payload within a payload datagram reassembly buffer at the location 1441 determined from the FCN, the arrival order of the SCHC Fragments, and 1442 the fragment payload sizes. In Window mode, the fragment receiver 1443 also uses the W bit in the received SCHC Fragments. Note that the 1444 size of the original, unfragmented packet cannot be determined from 1445 fragmentation headers. 1447 Fragmentation functionality uses the FCN value to transmit the SCHC 1448 Fragments. It has a length of N bits where the All-1 and All-0 FCN 1449 values are used to control the fragmentation transmission. The rest 1450 of the FCN numbers MUST be assigned sequentially in a decreasing 1451 order, the first FCN of a window is RECOMMENDED to be MAX_WIND_FCN, 1452 i.e. the highest possible FCN value depending on the FCN number of 1453 bits. 1455 In all modes, the last SCHC Fragment of a packet MUST contain a MIC 1456 which is used to check if there are errors or missing SCHC Fragments 1457 and MUST use the corresponding All-1 fragment format. Note that a 1458 SCHC Fragment with an All-0 format is considered the last SCHC 1459 Fragment of the current window. 1461 If the receiver receives the last fragment of a datagram (All-1), it 1462 checks for the integrity of the reassembled datagram, based on the 1463 MIC received. In No-ACK, if the integrity check indicates that the 1464 reassembled datagram does not match the original datagram (prior to 1465 fragmentation), the reassembled datagram MUST be discarded. In 1466 Window mode, a MIC check is also performed by the fragment receiver 1467 after reception of each subsequent SCHC Fragment retransmitted after 1468 the first MIC check. 1470 There are three reliability modes: No-ACK, ACK-Always and ACK-on- 1471 Error. In ACK-Always and ACK-on-Error, a jumping window protocol 1472 uses two windows alternatively, identified as 0 and 1. A SCHC 1473 Fragment with all FCN bits set to 0 (i.e. an All-0 fragment) 1474 indicates that the window is over (i.e. the SCHC Fragment is the last 1475 one of the window) and allows to switch from one window to the next 1476 one. The All-1 FCN in a SCHC Fragment indicates that it is the last 1477 fragment of the packet being transmitted and therefore there will not 1478 be another window for this packet. 1480 7.5.1. No-ACK 1482 In the No-ACK mode, there is no feedback communication from the 1483 fragment receiver. The sender will send all the SCHC fragments of a 1484 packet without any possibility of knowing if errors or losses have 1485 occurred. As, in this mode, there is no need to identify specific 1486 SCHC Fragments, a one-bit FCN MAY be used. Consequently, the FCN 1487 All-0 value is used in all SCHC fragments except the last one, which 1488 carries an All-1 FCN and the MIC. The receiver will wait for SCHC 1489 Fragments and will set the Inactivity timer. The receiver will use 1490 the MIC contained in the last SCHC Fragment to check for errors. 1491 When the Inactivity Timer expires or if the MIC check indicates that 1492 the reassembled packet does not match the original one, the receiver 1493 will release all resources allocated to reassembling this packet. 1494 The initial value of the Inactivity Timer will be determined based on 1495 the characteristics of the underlying LPWAN technology and will be 1496 defined in other documents (e.g. technology-specific profile 1497 documents). 1499 7.5.2. ACK-Always 1501 In ACK-Always, the sender transmits SCHC Fragments by using the two- 1502 jumping-windows procedure. A delay between each SCHC fragment can be 1503 added to respect local regulations or other constraints imposed by 1504 the applications. Each time a SCHC fragment is sent, the FCN is 1505 decreased by one. When the FCN reaches value 0 and there are more 1506 SCHC Fragments to be sent after, the sender transmits the last SCHC 1507 Fragment of this window using the All-0 fragment format, it starts 1508 the transmitted is the last SCHC Fragment of the SCHC Packet, the 1509 sender uses the All-1 fragment format, which includes a MIC. The 1510 sender sets the Retransmission Timer and waits for the SCHC ACK to 1511 know if transmission errors have occured. 1513 The Retransmission Timer is dimensioned based on the LPWAN technology 1514 in use. When the Retransmission Timer expires, the sender sends an 1515 All-0 empty (resp. All-1 empty) fragment to request again the SCHC 1516 ACK for the window that ended with the All-0 (resp. All-1) fragment 1517 just sent. The window number is not changed. 1519 After receiving an All-0 or All-1 fragment, the receiver sends an 1520 SCHC ACK with an encoded Bitmap reporting whether any SCHC fragments 1521 have been lost or not. When the sender receives an SCHC ACK, it 1522 checks the W bit carried by the SCHC ACK. Any SCHC ACK carrying an 1523 unexpected W bit value is discarded. If the W bit value of the 1524 received SCHC ACK is correct, the sender analyzes the rest of the 1525 SCHC ACK message, such as the encoded Bitmap and the MIC. If all the 1526 SCHC Fragments sent for this window have been well received, and if 1527 at least one more SCHC Fragment needs to be sent, the sender advances 1528 its sending window to the next window value and sends the next SCHC 1529 Fragments. If no more SCHC Fragments have to be sent, then the SCHC 1530 fragmented packet transmission is finished. 1532 However, if one or more SCHC Fragments have not been received as per 1533 the SCHC ACK (i.e. the corresponding bits are not set in the encoded 1534 Bitmap) then the sender resends the missing SCHC Fragments. When all 1535 missing SCHC Fragments have been retransmitted, the sender starts the 1536 Retransmission Timer, even if an All-0 or an All-1 has not been sent 1537 as part of this retransmission and waits for an SCHC ACK. Upon 1538 receipt of the SCHC ACK, if one or more SCHC Fragments have not yet 1539 been received, the counter Attempts is increased and the sender 1540 resends the missing SCHC Fragments again. When Attempts reaches 1541 MAX_ACK_REQUESTS, the sender aborts the on-going SCHC Fragmented 1542 packet transmission by sending an Abort message and releases any 1543 resources for transmission of the packet. The sender also aborts an 1544 on-going SCHC Fragmented packet transmission when a failed MIC check 1545 is reported by the receiver or when a SCHC Fragment that has not been 1546 sent is reported in the encoded Bitmap. 1548 On the other hand, at the beginning, the receiver side expects to 1549 receive window 0. Any SCHC Fragment received but not belonging to 1550 the current window is discarded. All SCHC Fragments belonging to the 1551 correct window are accepted, and the actual SCHC Fragment number 1552 managed by the receiver is computed based on the FCN value. The 1553 receiver prepares the encoded Bitmap to report the correctly received 1554 and the missing SCHC Fragments for the current window. After each 1555 SCHC Fragment is received the receiver initializes the Inactivity 1556 timer, if the Inactivity Timer expires the transmission is aborted. 1558 When an All-0 fragment is received, it indicates that all the SCHC 1559 Fragments have been sent in the current window. Since the sender is 1560 not obliged to always send a full window, some SCHC Fragment number 1561 not set in the receiver memory SHOULD not correspond to losses. The 1562 receiver sends the corresponding SCHC ACK, the Inactivity Timer is 1563 set and the transmission of the next window by the sender can start. 1565 If an All-0 fragment has been received and all SCHC Fragments of the 1566 current window have also been received, the receiver then expects a 1567 new Window and waits for the next SCHC Fragment. Upon receipt of a 1568 SCHC Fragment, if the window value has not changed, the received SCHC 1569 Fragments are part of a retransmission. A receiver that has already 1570 received a SCHC Fragment SHOULD discard it, otherwise, it updates the 1571 encoded Bitmap. If all the bits of the encoded Bitmap are set to 1572 one, the receiver MUST send an SCHC ACK without waiting for an All-0 1573 fragment and the Inactivity Timer is initialized. 1575 On the other hand, if the window value of the next received SCHC 1576 Fragment is set to the next expected window value, this means that 1577 the sender has received a correct encoded Bitmap reporting that all 1578 SCHC Fragments have been received. The receiver then updates the 1579 value of the next expected window. 1581 When an All-1 fragment is received, it indicates that the last SCHC 1582 Fragment of the packet has been sent. Since the last window is not 1583 always full, the MIC will be used to detect if all SCHC Fragments of 1584 the packet have been received. A correct MIC indicates the end of 1585 the transmission but the receiver MUST stay alive for an Inactivity 1586 Timer period to answer to any empty All-1 fragments the sender MAY 1587 send if SCHC ACKs sent by the receiver are lost. If the MIC is 1588 incorrect, some SCHC Fragments have been lost. The receiver sends 1589 the SCHC ACK regardless of successful SCHC Fragmented packet 1590 reception or not, the Inactitivity Timer is set. In case of an 1591 incorrect MIC, the receiver waits for SCHC Fragments belonging to the 1592 same window. After MAX_ACK_REQUESTS, the receiver will abort the on- 1593 going SCHC Fragmented packet transmission by transmitting a the 1594 Receiver-Abort format. The receiver also aborts upon Inactivity 1595 Timer expiration. 1597 7.5.3. ACK-on-Error 1599 The senders behavior for ACK-on-Error and ACK-Always are similar. 1600 The main difference is that in ACK-on-Error the SCHC ACK with the 1601 encoded Bitmap is not sent at the end of each window but only when at 1602 least one SCHC Fragment of the current window has been lost. Excepts 1603 for the last window where an SCHC ACK MUST be sent to finish the 1604 transmission. 1606 In ACK-on-Error, the Retransmission Timer expiration will be 1607 considered as a positive acknowledgment. This timer is set after 1608 sending an All-0 or an All-1 fragment. When the All-1 fragment has 1609 been sent, then the on-going SCHC Fragmentation process is finished 1610 and the sender waits for the last SCHC ACK. If the Retransmission 1611 Timer expires while waiting for the SCHC ACK for the last window, an 1612 All-1 empty MUST be sent to request the last SCHC ACK by the sender 1613 to complete the SCHC Fragmented packet transmission. When it expires 1614 the sender continue sending SCHC Fragments of the next window. 1616 If the sender receives an SCHC ACK, it checks the window value. SCHC 1617 ACKs with an unexpected window number are discarded. If the window 1618 number on the received encoded Bitmap is correct, the sender verifies 1619 if the receiver has received all SCHC fragments of the current 1620 window. When at least one SCHC Fragment has been lost, the counter 1621 Attempts is increased by one and the sender resends the missing SCHC 1622 Fragments again. When Attempts reaches MAX_ACK_REQUESTS, the sender 1623 sends an Abort message and releases all resources for the on-going 1624 SCHC Fragmented packet transmission. When the retransmission of the 1625 missing SCHC Fragments is finished, the sender starts listening for 1626 an SCHC ACK (even if an All-0 or an All-1 has not been sent during 1627 the retransmission) and initializes the Retransmission Timer. After 1628 sending an All-1 fragment, the sender listens for an SCHC ACK, 1629 initializes Attempts, and starts the Retransmission Timer. If the 1630 Retransmission Timer expires, Attempts is increased by one and an 1631 empty All-1 fragment is sent to request the SCHC ACK for the last 1632 window. If Attempts reaches MAX_ACK_REQUESTS, the sender aborts the 1633 on-going SCHC Fragmented packet transmission by transmitting the 1634 Sender-Abort fragment. 1636 Unlike the sender, the receiver for ACK-on-Error has a larger amount 1637 of differences compared with ACK-Always. First, an SCHC ACK is not 1638 sent unless there is a lost SCHC Fragment or an unexpected behavior. 1639 With the exception of the last window, where an SCHC ACK is always 1640 sent regardless of SCHC Fragment losses or not. The receiver starts 1641 by expecting SCHC Fragments from window 0 and maintains the 1642 information regarding which SCHC Fragments it receives. After 1643 receiving an SCHC Fragment, the Inactivity Timer is set. If no 1644 further SCHC Fragment are received and the Inactivity Timer expires, 1645 the SCHC Fragment receiver aborts the on-going SCHC Fragmented packet 1646 transmission by transmitting the Receiver-Abort data unit. 1648 Any SCHC Fragment not belonging to the current window is discarded. 1649 The actual SCHC Fragment number is computed based on the FCN value. 1650 When an All-0 fragment is received and all SCHC Fragments have been 1651 received, the receiver updates the expected window value and expects 1652 a new window and waits for the next SCHC Fragment. 1653 If the window value of the next SCHC Fragment has not changed, the 1654 received SCHC Fragment is a retransmission. A receiver that has 1655 already received an SCHC Fragment discard it. If all SCHC Fragments 1656 of a window (that is not the last one) have been received, the 1657 receiver does not send an SCHC ACK. While the receiver waits for the 1658 next window and if the window value is set to the next value, and if 1659 an All-1 fragment with the next value window arrived the receiver 1660 knows that the last SCHC Fragment of the packet has been sent. Since 1661 the last window is not always full, the MIC will be used to detect if 1662 all SCHC Fragments of the window have been received. A correct MIC 1663 check indicates the end of the SCHC Fragmented packet transmission. 1664 An ACK is sent by the SCHC Fragment receiver. In case of an 1665 incorrect MIC, the receiver waits for SCHC Fragments belonging to the 1666 same window or the expiration of the Inactivity Timer. The latter 1667 will lead the receiver to abort the on-going SCHC fragmented packet 1668 transmission. 1670 If after receiving an All-0 fragment the receiver missed some SCHC 1671 Fragments, the receiver uses an SCHC ACK with the encoded Bitmap to 1672 ask the retransmission of the missing fragments and expect to receive 1673 SCHC Fragments with the actual window. While waiting the 1674 retransmission an All-0 empty fragment is received, the receiver 1675 sends again the SCHC ACK with the encoded Bitmap, if the SCHC 1676 Fragments received belongs to another window or an All-1 fragment is 1677 received, the transmission is aborted by sending a Receiver-Abort 1678 fragment. Once it has received all the missing fragments it waits 1679 for the next window fragments. 1681 7.6. Supporting multiple window sizes 1683 For ACK-Always or ACK-on-Error, implementers MAY opt to support a 1684 single window size or multiple window sizes. The latter, when 1685 feasible, may provide performance optimizations. For example, a 1686 large window size SHOULD be used for packets that need to be carried 1687 by a large number of SCHC Fragments. However, when the number of 1688 SCHC Fragments required to carry a packet is low, a smaller window 1689 size, and thus a shorter Bitmap, MAY be sufficient to provide 1690 feedback on all SCHC Fragments. If multiple window sizes are 1691 supported, the Rule ID MAY be used to signal the window size in use 1692 for a specific packet transmission. 1694 Note that the same window size MUST be used for the transmission of 1695 all SCHC Fragments that belong to the same SCHC Packet. 1697 7.7. Downlink SCHC Fragment transmission 1699 In some LPWAN technologies, as part of energy-saving techniques, 1700 downlink transmission is only possible immediately after an uplink 1701 transmission. In order to avoid potentially high delay in the 1702 downlink transmission of a SCHC Fragmented datagram, the SCHC 1703 Fragment receiver MAY perform an uplink transmission as soon as 1704 possible after reception of a SCHC Fragment that is not the last one. 1705 Such uplink transmission MAY be triggered by the L2 (e.g. an L2 ACK 1706 sent in response to a SCHC Fragment encapsulated in a L2 frame that 1707 requires an L2 ACK) or it MAY be triggered from an upper layer. 1709 For downlink transmission of a SCHC Fragmented packet in ACK-Always 1710 mode, the SCHC Fragment receiver MAY support timer-based SCHC ACK 1711 retransmission. In this mechanism, the SCHC Fragment receiver 1712 initializes and starts a timer (the Inactivity Timer is used) after 1713 the transmission of an SCHC ACK, except when the SCHC ACK is sent in 1714 response to the last SCHC Fragment of a packet (All-1 fragment). In 1715 the latter case, the SCHC Fragment receiver does not start a timer 1716 after transmission of the SCHC ACK. 1718 If, after transmission of an SCHC ACK that is not an All-1 fragment, 1719 and before expiration of the corresponding Inactivity timer, the SCHC 1720 Fragment receiver receives a SCHC Fragment that belongs to the 1721 current window (e.g. a missing SCHC Fragment from the current window) 1722 or to the next window, the Inactivity timer for the SCHC ACK is 1723 stopped. However, if the Inactivity timer expires, the SCHC ACK is 1724 resent and the Inactivity timer is reinitialized and restarted. 1726 The default initial value for the Inactivity timer, as well as the 1727 maximum number of retries for a specific SCHC ACK, denoted 1728 MAX_ACK_RETRIES, are not defined in this document, and need to be 1729 defined in other documents (e.g. technology-specific profiles). The 1730 initial value of the Inactivity timer is expected to be greater than 1731 that of the Retransmission timer, in order to make sure that a 1732 (buffered) SCHC Fragment to be retransmitted can find an opportunity 1733 for that transmission. 1735 When the SCHC Fragment sender transmits the All-1 fragment, it starts 1736 its Retransmission Timer with a large timeout value (e.g. several 1737 times that of the initial Inactivity timer). If an SCHC ACK is 1738 received before expiration of this timer, the SCHC Fragment sender 1739 retransmits any lost SCHC Fragments reported by the SCHC ACK, or if 1740 the SCHC ACK confirms successful reception of all SCHC Fragments of 1741 the last window, the transmission of the SCHC Fragmented packet is 1742 considered complete. If the timer expires, and no SCHC ACK has been 1743 received since the start of the timer, the SCHC Fragment sender 1744 assumes that the All-1 fragment has been successfully received (and 1745 possibly, the last SCHC ACK has been lost: this mechanism assumes 1746 that the retransmission timer for the All-1 fragment is long enough 1747 to allow several SCHC ACK retries if the All-1 fragment has not been 1748 received by the SCHC Fragment receiver, and it also assumes that it 1749 is unlikely that several ACKs become all lost). 1751 8. Padding management 1753 Default padding is defined for L2 frame with a variable length of 1754 bytes. Padding is done twice, after compression and in the all-1 1755 fragmentation. 1757 In compression, the rule and the compression residues are not aligned 1758 on a byte, but payload following the residue is always a multiple of 1759 8 bits. In that case, padding bits can be added after the payload to 1760 reach the first byte boundary. Since the rule and the residue give 1761 the length of the SCHC header and payload is always a multiple of 8 1762 bits, the receiver can without ambiguity remove the padding bits 1763 which never excide 7 bits. 1765 SCHC Fragmentation works on a byte aligned (i.e. padded SCHC Packet). 1766 Fragmentation header may not be aligned on byte boundary, but each 1767 fragment except the last one (All-1 fragment) must sent the maximum 1768 bits as possible. Only the last fragment need to introduce padding 1769 to reach the next boundary limit. Since the SCHC is known to be a 1770 multiple of 8 bits, the receiver can remove the extra bit to reach 1771 this limit. 1773 Default padding mechanism do not need to send the padding length and 1774 can lead to a maximum of 14 bits of padding. 1776 The padding is not mandatory and is optional to the technology- 1777 specific document to give a different solution. In this docuement 1778 there are some inputs on how to manage the padding. 1780 9. SCHC Compression for IPv6 and UDP headers 1782 This section lists the different IPv6 and UDP header fields and how 1783 they can be compressed. 1785 9.1. IPv6 version field 1787 This field always holds the same value. Therefore, in the rule, TV 1788 is set to 6, MO to "equal" and CDA to "not-sent". 1790 9.2. IPv6 Traffic class field 1792 If the DiffServ field does not vary and is known by both sides, the 1793 Field Descriptor in the rule SHOULD contain a TV with this well-known 1794 value, an "equal" MO and a "not-sent" CDA. 1796 Otherwise, two possibilities can be considered depending on the 1797 variability of the value: 1799 o One possibility is to not compress the field and send the original 1800 value. In the rule, TV is not set to any particular value, MO is 1801 set to "ignore" and CDA is set to "value-sent". 1803 o If some upper bits in the field are constant and known, a better 1804 option is to only send the LSBs. In the rule, TV is set to a 1805 value with the stable known upper part, MO is set to MSB(x) and 1806 CDA to LSB(y). 1808 9.3. Flow label field 1810 If the Flow Label field does not vary and is known by both sides, the 1811 Field Descriptor in the rule SHOULD contain a TV with this well-known 1812 value, an "equal" MO and a "not-sent" CDA. 1814 Otherwise, two possibilities can be considered: 1816 o One possibility is to not compress the field and send the original 1817 value. In the rule, TV is not set to any particular value, MO is 1818 set to "ignore" and CDA is set to "value-sent". 1820 o If some upper bits in the field are constant and known, a better 1821 option is to only send the LSBs. In the rule, TV is set to a 1822 value with the stable known upper part, MO is set to MSB(x) and 1823 CDA to LSB(y). 1825 9.4. Payload Length field 1827 This field can be elided for the transmission on the LPWAN network. 1828 The SCHC C/D recomputes the original payload length value. In the 1829 Field Descriptor, TV is not set, MO is set to "ignore" and CDA is 1830 "compute-IPv6-length". 1832 If the payload length needs to be sent and does not need to be coded 1833 in 16 bits, the TV can be set to 0x0000, the MO set to MSB(16-s) 1834 where 's' is the number of bits to code the maximum length, and CDA 1835 is set to LSB(s). 1837 9.5. Next Header field 1839 If the Next Header field does not vary and is known by both sides, 1840 the Field Descriptor in the rule SHOULD contain a TV with this Next 1841 Header value, the MO SHOULD be "equal" and the CDA SHOULD be "not- 1842 sent". 1844 Otherwise, TV is not set in the Field Descriptor, MO is set to 1845 "ignore" and CDA is set to "value-sent". Alternatively, a matching- 1846 list MAY also be used. 1848 9.6. Hop Limit field 1850 The field behavior for this field is different for Uplink and 1851 Downlink. In Uplink, since there is no IP forwarding between the Dev 1852 and the SCHC C/D, the value is relatively constant. On the other 1853 hand, the Downlink value depends of Internet routing and MAY change 1854 more frequently. One neat way of processing this field is to use the 1855 Direction Indicator (DI) to distinguish both directions: 1857 o in the Uplink, elide the field: the TV in the Field Descriptor is 1858 set to the known constant value, the MO is set to "equal" and the 1859 CDA is set to "not-sent". 1861 o in the Downlink, send the value: TV is not set, MO is set to 1862 "ignore" and CDA is set to "value-sent". 1864 9.7. IPv6 addresses fields 1866 As in 6LoWPAN [RFC4944], IPv6 addresses are split into two 64-bit 1867 long fields; one for the prefix and one for the Interface Identifier 1868 (IID). These fields SHOULD be compressed. To allow for a single 1869 rule being used for both directions, these values are identified by 1870 their role (DEV or APP) and not by their position in the frame 1871 (source or destination). 1873 9.7.1. IPv6 source and destination prefixes 1875 Both ends MUST be synchronized with the appropriate prefixes. For a 1876 specific flow, the source and destination prefixes can be unique and 1877 stored in the context. It can be either a link-local prefix or a 1878 global prefix. In that case, the TV for the source and destination 1879 prefixes contain the values, the MO is set to "equal" and the CDA is 1880 set to "not-sent". 1882 If the rule is intended to compress packets with different prefix 1883 values, match-mapping SHOULD be used. The different prefixes are 1884 listed in the TV, the MO is set to "match-mapping" and the CDA is set 1885 to "mapping-sent". See Figure 28 1887 Otherwise, the TV contains the prefix, the MO is set to "equal" and 1888 the CDA is set to "value-sent". 1890 9.7.2. IPv6 source and destination IID 1892 If the DEV or APP IID are based on an LPWAN address, then the IID can 1893 be reconstructed with information coming from the LPWAN header. In 1894 that case, the TV is not set, the MO is set to "ignore" and the CDA 1895 is set to "DEViid" or "APPiid". Note that the LPWAN technology 1896 generally carries a single identifier corresponding to the DEV. 1897 Therefore Appiid cannot be used. 1899 For privacy reasons or if the DEV address is changing over time, a 1900 static value that is not equal to the DEV address SHOULD be used. In 1901 that case, the TV contains the static value, the MO operator is set 1902 to "equal" and the CDF is set to "not-sent". [RFC7217] provides some 1903 methods that MAY be used to derive this static identifier. 1905 If several IIDs are possible, then the TV contains the list of 1906 possible IIDs, the MO is set to "match-mapping" and the CDA is set to 1907 "mapping-sent". 1909 It MAY also happen that the IID variability only expresses itself on 1910 a few bytes. In that case, the TV is set to the stable part of the 1911 IID, the MO is set to "MSB" and the CDA is set to "LSB". 1913 Finally, the IID can be sent in extenso on the LPWAN. In that case, 1914 the TV is not set, the MO is set to "ignore" and the CDA is set to 1915 "value-sent". 1917 9.8. IPv6 extensions 1919 No rule is currently defined that processes IPv6 extensions. If such 1920 extensions are needed, their compression/decompression rules can be 1921 based on the MOs and CDAs described above. 1923 9.9. UDP source and destination port 1925 To allow for a single rule being used for both directions, the UDP 1926 port values are identified by their role (DEV or APP) and not by 1927 their position in the frame (source or destination). The SCHC C/D 1928 MUST be aware of the traffic direction (Uplink, Downlink) to select 1929 the appropriate field. The following rules apply for DEV and APP 1930 port numbers. 1932 If both ends know the port number, it can be elided. The TV contains 1933 the port number, the MO is set to "equal" and the CDA is set to "not- 1934 sent". 1936 If the port variation is on few bits, the TV contains the stable part 1937 of the port number, the MO is set to "MSB" and the CDA is set to 1938 "LSB". 1940 If some well-known values are used, the TV can contain the list of 1941 these values, the MO is set to "match-mapping" and the CDA is set to 1942 "mapping-sent". 1944 Otherwise the port numbers are sent over the LPWAN. The TV is not 1945 set, the MO is set to "ignore" and the CDA is set to "value-sent". 1947 9.10. UDP length field 1949 The UDP length can be computed from the received data. In that case, 1950 the TV is not set, the MO is set to "ignore" and the CDA is set to 1951 "compute-length". 1953 If the payload is small, the TV can be set to 0x0000, the MO set to 1954 "MSB" and the CDA to "LSB". 1956 In other cases, the length SHOULD be sent and the CDA is replaced by 1957 "value-sent". 1959 9.11. UDP Checksum field 1961 IPv6 mandates a checksum in the protocol above IP. Nevertheless, if 1962 a more efficient mechanism such as L2 CRC or MIC is carried by or 1963 over the L2 (such as in the LPWAN SCHC Fragmentation process (see 1964 Section 7)), the UDP checksum transmission can be avoided. In that 1965 case, the TV is not set, the MO is set to "ignore" and the CDA is set 1966 to "compute-checksum". 1968 In other cases, the checksum SHOULD be explicitly sent. The TV is 1969 not set, the MO is set to "ignore" and the CDF is set to "value- 1970 sent". 1972 10. Security considerations 1974 10.1. Security considerations for header compression 1976 A malicious header compression could cause the reconstruction of a 1977 wrong packet that does not match with the original one. Such a 1978 corruption MAY be detected with end-to-end authentication and 1979 integrity mechanisms. Header Compression does not add more security 1980 problem than what is already needed in a transmission. For instance, 1981 to avoid an attack, never re-construct a packet bigger than some 1982 configured size (with 1500 bytes as generic default). 1984 10.2. Security considerations for SCHC Fragmentation 1986 This subsection describes potential attacks to LPWAN SCHC 1987 Fragmentation and suggests possible countermeasures. 1989 A node can perform a buffer reservation attack by sending a first 1990 SCHC Fragment to a target. Then, the receiver will reserve buffer 1991 space for the IPv6 packet. Other incoming SCHC Fragmented packets 1992 will be dropped while the reassembly buffer is occupied during the 1993 reassembly timeout. Once that timeout expires, the attacker can 1994 repeat the same procedure, and iterate, thus creating a denial of 1995 service attack. The (low) cost to mount this attack is linear with 1996 the number of buffers at the target node. However, the cost for an 1997 attacker can be increased if individual SCHC Fragments of multiple 1998 packets can be stored in the reassembly buffer. To further increase 1999 the attack cost, the reassembly buffer can be split into SCHC 2000 Fragment-sized buffer slots. Once a packet is complete, it is 2001 processed normally. If buffer overload occurs, a receiver can 2002 discard packets based on the sender behavior, which MAY help identify 2003 which SCHC Fragments have been sent by an attacker. 2005 In another type of attack, the malicious node is required to have 2006 overhearing capabilities. If an attacker can overhear a SCHC 2007 Fragment, it can send a spoofed duplicate (e.g. with random payload) 2008 to the destination. If the LPWAN technology does not support 2009 suitable protection (e.g. source authentication and frame counters to 2010 prevent replay attacks), a receiver cannot distinguish legitimate 2011 from spoofed SCHC Fragments. Therefore, the original IPv6 packet 2012 will be considered corrupt and will be dropped. To protect resource- 2013 constrained nodes from this attack, it has been proposed to establish 2014 a binding among the SCHC Fragments to be transmitted by a node, by 2015 applying content-chaining to the different SCHC Fragments, based on 2016 cryptographic hash functionality. The aim of this technique is to 2017 allow a receiver to identify illegitimate SCHC Fragments. 2019 Further attacks MAY involve sending overlapped fragments (i.e. 2020 comprising some overlapping parts of the original IPv6 datagram). 2021 Implementers SHOULD make sure that the correct operation is not 2022 affected by such event. 2024 In Window mode - ACK on error, a malicious node MAY force a SCHC 2025 Fragment sender to resend a SCHC Fragment a number of times, with the 2026 aim to increase consumption of the SCHC Fragment sender's resources. 2027 To this end, the malicious node MAY repeatedly send a fake ACK to the 2028 SCHC Fragment sender, with a Bitmap that reports that one or more 2029 SCHC Fragments have been lost. In order to mitigate this possible 2030 attack, MAX_ACK_RETRIES MAY be set to a safe value which allows to 2031 limit the maximum damage of the attack to an acceptable extent. 2032 However, note that a high setting for MAX_ACK_RETRIES benefits SCHC 2033 Fragment reliability modes, therefore the trade-off needs to be 2034 carefully considered. 2036 11. Acknowledgements 2038 Thanks to Dominique Barthel, Carsten Bormann, Philippe Clavier, 2039 Eduardo Ingles Sanchez, Arunprabhu Kandasamy, Rahul Jadhav, Sergio 2040 Lopez Bernal, Antony Markovski, Alexander Pelov, Pascal Thubert, Juan 2041 Carlos Zuniga, Diego Dujovne, Edgar Ramos, and Shoichi Sakane for 2042 useful design consideration and comments. 2044 12. References 2046 12.1. Normative References 2048 [RFC2460] Deering, S. and R. Hinden, "Internet Protocol, Version 6 2049 (IPv6) Specification", RFC 2460, DOI 10.17487/RFC2460, 2050 December 1998, . 2052 [RFC3385] Sheinwald, D., Satran, J., Thaler, P., and V. Cavanna, 2053 "Internet Protocol Small Computer System Interface (iSCSI) 2054 Cyclic Redundancy Check (CRC)/Checksum Considerations", 2055 RFC 3385, DOI 10.17487/RFC3385, September 2002, 2056 . 2058 [RFC4944] Montenegro, G., Kushalnagar, N., Hui, J., and D. Culler, 2059 "Transmission of IPv6 Packets over IEEE 802.15.4 2060 Networks", RFC 4944, DOI 10.17487/RFC4944, September 2007, 2061 . 2063 [RFC5795] Sandlund, K., Pelletier, G., and L-E. Jonsson, "The RObust 2064 Header Compression (ROHC) Framework", RFC 5795, 2065 DOI 10.17487/RFC5795, March 2010, 2066 . 2068 [RFC7136] Carpenter, B. and S. Jiang, "Significance of IPv6 2069 Interface Identifiers", RFC 7136, DOI 10.17487/RFC7136, 2070 February 2014, . 2072 [RFC7217] Gont, F., "A Method for Generating Semantically Opaque 2073 Interface Identifiers with IPv6 Stateless Address 2074 Autoconfiguration (SLAAC)", RFC 7217, 2075 DOI 10.17487/RFC7217, April 2014, 2076 . 2078 12.2. Informative References 2080 [I-D.ietf-lpwan-overview] 2081 Farrell, S., "LPWAN Overview", draft-ietf-lpwan- 2082 overview-10 (work in progress), February 2018. 2084 Appendix A. SCHC Compression Examples 2086 This section gives some scenarios of the compression mechanism for 2087 IPv6/UDP. The goal is to illustrate the behavior of SCHC. 2089 The most common case using the mechanisms defined in this document 2090 will be a LPWAN Dev that embeds some applications running over CoAP. 2091 In this example, three flows are considered. The first flow is for 2092 the device management based on CoAP using Link Local IPv6 addresses 2093 and UDP ports 123 and 124 for Dev and App, respectively. The second 2094 flow will be a CoAP server for measurements done by the Device (using 2095 ports 5683) and Global IPv6 Address prefixes alpha::IID/64 to 2096 beta::1/64. The last flow is for legacy applications using different 2097 ports numbers, the destination IPv6 address prefix is gamma::1/64. 2099 Figure 27 presents the protocol stack for this Device. IPv6 and UDP 2100 are represented with dotted lines since these protocols are 2101 compressed on the radio link. 2103 Management Data 2104 +----------+---------+---------+ 2105 | CoAP | CoAP | legacy | 2106 +----||----+---||----+---||----+ 2107 . UDP . UDP | UDP | 2108 ................................ 2109 . IPv6 . IPv6 . IPv6 . 2110 +------------------------------+ 2111 | SCHC Header compression | 2112 | and fragmentation | 2113 +------------------------------+ 2114 | LPWAN L2 technologies | 2115 +------------------------------+ 2116 DEV or NGW 2118 Figure 27: Simplified Protocol Stack for LP-WAN 2120 Note that in some LPWAN technologies, only the Devs have a device ID. 2121 Therefore, when such technologies are used, it is necessary to 2122 statically define an IID for the Link Local address for the SCHC C/D. 2124 Rule 0 2125 +----------------+--+--+--+---------+--------+------------++------+ 2126 | Field |FL|FP|DI| Value | Match | Comp Decomp|| Sent | 2127 | | | | | | Opera. | Action ||[bits]| 2128 +----------------+--+--+--+---------+---------------------++------+ 2129 |IPv6 version |4 |1 |Bi|6 | equal | not-sent || | 2130 |IPv6 DiffServ |8 |1 |Bi|0 | equal | not-sent || | 2131 |IPv6 Flow Label |20|1 |Bi|0 | equal | not-sent || | 2132 |IPv6 Length |16|1 |Bi| | ignore | comp-length|| | 2133 |IPv6 Next Header|8 |1 |Bi|17 | equal | not-sent || | 2134 |IPv6 Hop Limit |8 |1 |Bi|255 | ignore | not-sent || | 2135 |IPv6 DEVprefix |64|1 |Bi|FE80::/64| equal | not-sent || | 2136 |IPv6 DEViid |64|1 |Bi| | ignore | DEViid || | 2137 |IPv6 APPprefix |64|1 |Bi|FE80::/64| equal | not-sent || | 2138 |IPv6 APPiid |64|1 |Bi|::1 | equal | not-sent || | 2139 +================+==+==+==+=========+========+============++======+ 2140 |UDP DEVport |16|1 |Bi|123 | equal | not-sent || | 2141 |UDP APPport |16|1 |Bi|124 | equal | not-sent || | 2142 |UDP Length |16|1 |Bi| | ignore | comp-length|| | 2143 |UDP checksum |16|1 |Bi| | ignore | comp-chk || | 2144 +================+==+==+==+=========+========+============++======+ 2146 Rule 1 2147 +----------------+--+--+--+---------+--------+------------++------+ 2148 | Field |FL|FP|DI| Value | Match | Action || Sent | 2149 | | | | | | Opera. | Action ||[bits]| 2150 +----------------+--+--+--+---------+--------+------------++------+ 2151 |IPv6 version |4 |1 |Bi|6 | equal | not-sent || | 2152 |IPv6 DiffServ |8 |1 |Bi|0 | equal | not-sent || | 2153 |IPv6 Flow Label |20|1 |Bi|0 | equal | not-sent || | 2154 |IPv6 Length |16|1 |Bi| | ignore | comp-length|| | 2155 |IPv6 Next Header|8 |1 |Bi|17 | equal | not-sent || | 2156 |IPv6 Hop Limit |8 |1 |Bi|255 | ignore | not-sent || | 2157 |IPv6 DEVprefix |64|1 |Bi|[alpha/64, match- |mapping-sent|| [1] | 2158 | | | | |fe80::/64] mapping| || | 2159 |IPv6 DEViid |64|1 |Bi| | ignore | DEViid || | 2160 |IPv6 APPprefix |64|1 |Bi|[beta/64,| match- |mapping-sent|| [2] | 2161 | | | | |alpha/64,| mapping| || | 2162 | | | | |fe80::64]| | || | 2163 |IPv6 APPiid |64|1 |Bi|::1000 | equal | not-sent || | 2164 +================+==+==+==+=========+========+============++======+ 2165 |UDP DEVport |16|1 |Bi|5683 | equal | not-sent || | 2166 |UDP APPport |16|1 |Bi|5683 | equal | not-sent || | 2167 |UDP Length |16|1 |Bi| | ignore | comp-length|| | 2168 |UDP checksum |16|1 |Bi| | ignore | comp-chk || | 2169 +================+==+==+==+=========+========+============++======+ 2171 Rule 2 2172 +----------------+--+--+--+---------+--------+------------++------+ 2173 | Field |FL|FP|DI| Value | Match | Action || Sent | 2174 | | | | | | Opera. | Action ||[bits]| 2175 +----------------+--+--+--+---------+--------+------------++------+ 2176 |IPv6 version |4 |1 |Bi|6 | equal | not-sent || | 2177 |IPv6 DiffServ |8 |1 |Bi|0 | equal | not-sent || | 2178 |IPv6 Flow Label |20|1 |Bi|0 | equal | not-sent || | 2179 |IPv6 Length |16|1 |Bi| | ignore | comp-length|| | 2180 |IPv6 Next Header|8 |1 |Bi|17 | equal | not-sent || | 2181 |IPv6 Hop Limit |8 |1 |Up|255 | ignore | not-sent || | 2182 |IPv6 Hop Limit |8 |1 |Dw| | ignore | value-sent || [8] | 2183 |IPv6 DEVprefix |64|1 |Bi|alpha/64 | equal | not-sent || | 2184 |IPv6 DEViid |64|1 |Bi| | ignore | DEViid || | 2185 |IPv6 APPprefix |64|1 |Bi|gamma/64 | equal | not-sent || | 2186 |IPv6 APPiid |64|1 |Bi|::1000 | equal | not-sent || | 2187 +================+==+==+==+=========+========+============++======+ 2188 |UDP DEVport |16|1 |Bi|8720 | MSB(12)| LSB(4) || [4] | 2189 |UDP APPport |16|1 |Bi|8720 | MSB(12)| LSB(4) || [4] | 2190 |UDP Length |16|1 |Bi| | ignore | comp-length|| | 2191 |UDP checksum |16|1 |Bi| | ignore | comp-chk || | 2192 +================+==+==+==+=========+========+============++======+ 2194 Figure 28: Context rules 2196 All the fields described in the three rules depicted on Figure 28 are 2197 present in the IPv6 and UDP headers. The DEViid-DID value is found 2198 in the L2 header. 2200 The second and third rules use global addresses. The way the Dev 2201 learns the prefix is not in the scope of the document. 2203 The third rule compresses port numbers to 4 bits. 2205 Appendix B. Fragmentation Examples 2207 This section provides examples for the different fragment reliability 2208 modes specified in this document. 2210 Figure 29 illustrates the transmission in No-ACK mode of an IPv6 2211 packet that needs 11 fragments. FCN is 1 bit wide. 2213 Sender Receiver 2214 |-------FCN=0-------->| 2215 |-------FCN=0-------->| 2216 |-------FCN=0-------->| 2217 |-------FCN=0-------->| 2218 |-------FCN=0-------->| 2219 |-------FCN=0-------->| 2220 |-------FCN=0-------->| 2221 |-------FCN=0-------->| 2222 |-------FCN=0-------->| 2223 |-------FCN=0-------->| 2224 |-----FCN=1 + MIC --->|MIC checked: success => 2226 Figure 29: Transmission in No-ACK mode of an IPv6 packet carried by 2227 11 fragments 2229 In the following examples, N (i.e. the size if the FCN field) is 3 2230 bits. Therefore, the All-1 FCN value is 7. 2232 Figure 30 illustrates the transmission in ACK-on-Error of an IPv6 2233 packet that needs 11 fragments, with MAX_WIND_FCN=6 and no fragment 2234 loss. 2236 Sender Receiver 2237 |-----W=0, FCN=6----->| 2238 |-----W=0, FCN=5----->| 2239 |-----W=0, FCN=4----->| 2240 |-----W=0, FCN=3----->| 2241 |-----W=0, FCN=2----->| 2242 |-----W=0, FCN=1----->| 2243 |-----W=0, FCN=0----->| 2244 (no ACK) 2245 |-----W=1, FCN=6----->| 2246 |-----W=1, FCN=5----->| 2247 |-----W=1, FCN=4----->| 2248 |--W=1, FCN=7 + MIC-->|MIC checked: success => 2249 |<---- ACK, W=1 ------| 2251 Figure 30: Transmission in ACK-on-Error mode of an IPv6 packet 2252 carried by 11 fragments, with MAX_WIND_FCN=6 and no loss. 2254 Figure 31 illustrates the transmission in ACK-on-Error mode of an 2255 IPv6 packet that needs 11 fragments, with MAX_WIND_FCN=6 and three 2256 lost fragments. 2258 Sender Receiver 2259 |-----W=0, FCN=6----->| 2260 |-----W=0, FCN=5----->| 2261 |-----W=0, FCN=4--X-->| 2262 |-----W=0, FCN=3----->| 2263 |-----W=0, FCN=2--X-->| 7 2264 |-----W=0, FCN=1----->| / 2265 |-----W=0, FCN=0----->| 6543210 2266 |<-----ACK, W=0-------|Bitmap:1101011 2267 |-----W=0, FCN=4----->| 2268 |-----W=0, FCN=2----->| 2269 (no ACK) 2270 |-----W=1, FCN=6----->| 2271 |-----W=1, FCN=5----->| 2272 |-----W=1, FCN=4--X-->| 2273 |- W=1, FCN=7 + MIC ->|MIC checked: failed 2274 |<-----ACK, W=1-------|C=0 Bitmap:1100001 2275 |-----W=1, FCN=4----->|MIC checked: success => 2276 |<---- ACK, W=1 ------|C=1, no Bitmap 2278 Figure 31: Transmission in ACK-on-Error mode of an IPv6 packet 2279 carried by 11 fragments, with MAX_WIND_FCN=6 and three lost 2280 fragments. 2282 Figure 32 illustrates the transmission in ACK-Always mode of an IPv6 2283 packet that needs 11 fragments, with MAX_WIND_FCN=6 and no loss. 2285 Sender Receiver 2286 |-----W=0, FCN=6----->| 2287 |-----W=0, FCN=5----->| 2288 |-----W=0, FCN=4----->| 2289 |-----W=0, FCN=3----->| 2290 |-----W=0, FCN=2----->| 2291 |-----W=0, FCN=1----->| 2292 |-----W=0, FCN=0----->| 2293 |<-----ACK, W=0-------| Bitmap:1111111 2294 |-----W=1, FCN=6----->| 2295 |-----W=1, FCN=5----->| 2296 |-----W=1, FCN=4----->| 2297 |--W=1, FCN=7 + MIC-->|MIC checked: success => 2298 |<-----ACK, W=1-------| C=1 no Bitmap 2299 (End) 2301 Figure 32: Transmission in ACK-Always mode of an IPv6 packet carried 2302 by 11 fragments, with MAX_WIND_FCN=6 and no lost fragment. 2304 Figure 33 illustrates the transmission in ACK-Always mode of an IPv6 2305 packet that needs 11 fragments, with MAX_WIND_FCN=6 and three lost 2306 fragments. 2308 Sender Receiver 2309 |-----W=1, FCN=6----->| 2310 |-----W=1, FCN=5----->| 2311 |-----W=1, FCN=4--X-->| 2312 |-----W=1, FCN=3----->| 2313 |-----W=1, FCN=2--X-->| 7 2314 |-----W=1, FCN=1----->| / 2315 |-----W=1, FCN=0----->| 6543210 2316 |<-----ACK, W=1-------|Bitmap:1101011 2317 |-----W=1, FCN=4----->| 2318 |-----W=1, FCN=2----->| 2319 |<-----ACK, W=1-------|Bitmap: 2320 |-----W=0, FCN=6----->| 2321 |-----W=0, FCN=5----->| 2322 |-----W=0, FCN=4--X-->| 2323 |--W=0, FCN=7 + MIC-->|MIC checked: failed 2324 |<-----ACK, W=0-------| C= 0 Bitmap:11000001 2325 |-----W=0, FCN=4----->|MIC checked: success => 2326 |<-----ACK, W=0-------| C= 1 no Bitmap 2327 (End) 2329 Figure 33: Transmission in ACK-Always mode of an IPv6 packet carried 2330 by 11 fragments, with MAX_WIND_FCN=6 and three lost fragments. 2332 Figure 34 illustrates the transmission in ACK-Always mode of an IPv6 2333 packet that needs 6 fragments, with MAX_WIND_FCN=6, three lost 2334 fragments and only one retry needed to recover each lost fragment. 2336 Sender Receiver 2337 |-----W=0, FCN=6----->| 2338 |-----W=0, FCN=5----->| 2339 |-----W=0, FCN=4--X-->| 2340 |-----W=0, FCN=3--X-->| 2341 |-----W=0, FCN=2--X-->| 2342 |--W=0, FCN=7 + MIC-->|MIC checked: failed 2343 |<-----ACK, W=0-------|C= 0 Bitmap:1100001 2344 |-----W=0, FCN=4----->|MIC checked: failed 2345 |-----W=0, FCN=3----->|MIC checked: failed 2346 |-----W=0, FCN=2----->|MIC checked: success 2347 |<-----ACK, W=0-------|C=1 no Bitmap 2348 (End) 2350 Figure 34: Transmission in ACK-Always mode of an IPv6 packet carried 2351 by 11 fragments, with MAX_WIND_FCN=6, three lost framents and only 2352 one retry needed for each lost fragment. 2354 Figure 35 illustrates the transmission in ACK-Always mode of an IPv6 2355 packet that needs 6 fragments, with MAX_WIND_FCN=6, three lost 2356 fragments, and the second ACK lost. 2358 Sender Receiver 2359 |-----W=0, FCN=6----->| 2360 |-----W=0, FCN=5----->| 2361 |-----W=0, FCN=4--X-->| 2362 |-----W=0, FCN=3--X-->| 2363 |-----W=0, FCN=2--X-->| 2364 |--W=0, FCN=7 + MIC-->|MIC checked: failed 2365 |<-----ACK, W=0-------|C=0 Bitmap:1100001 2366 |-----W=0, FCN=4----->|MIC checked: failed 2367 |-----W=0, FCN=3----->|MIC checked: failed 2368 |-----W=0, FCN=2----->|MIC checked: success 2369 | X---ACK, W=0-------|C= 1 no Bitmap 2370 timeout | | 2371 |--W=0, FCN=7 + MIC-->| 2372 |<-----ACK, W=0-------|C= 1 no Bitmap 2374 (End) 2376 Figure 35: Transmission in ACK-Always mode of an IPv6 packet carried 2377 by 11 fragments, with MAX_WIND_FCN=6, three lost fragments, and the 2378 second ACK lost. 2380 Figure 36 illustrates the transmission in ACK-Always mode of an IPv6 2381 packet that needs 6 fragments, with MAX_WIND_FCN=6, with three lost 2382 fragments, and one retransmitted fragment lost again. 2384 Sender Receiver 2385 |-----W=0, FCN=6----->| 2386 |-----W=0, FCN=5----->| 2387 |-----W=0, FCN=4--X-->| 2388 |-----W=0, FCN=3--X-->| 2389 |-----W=0, FCN=2--X-->| 2390 |--W=0, FCN=7 + MIC-->|MIC checked: failed 2391 |<-----ACK, W=0-------|C=0 Bitmap:1100001 2392 |-----W=0, FCN=4----->|MIC checked: failed 2393 |-----W=0, FCN=3----->|MIC checked: failed 2394 |-----W=0, FCN=2--X-->| 2395 timeout| | 2396 |--W=0, FCN=7 + MIC-->|All-0 empty 2397 |<-----ACK, W=0-------|C=0 Bitmap: 1111101 2398 |-----W=0, FCN=2----->|MIC checked: success 2399 |<-----ACK, W=0-------|C=1 no Bitmap 2400 (End) 2402 Figure 36: Transmission in ACK-Always mode of an IPv6 packet carried 2403 by 11 fragments, with MAX_WIND_FCN=6, with three lost fragments, and 2404 one retransmitted fragment lost again. 2406 Figure 37 illustrates the transmission in ACK-Always mode of an IPv6 2407 packet that needs 28 fragments, with N=5, MAX_WIND_FCN=23 and two 2408 lost fragments. Note that MAX_WIND_FCN=23 may be useful when the 2409 maximum possible Bitmap size, considering the maximum lower layer 2410 technology payload size and the value of R, is 3 bytes. Note also 2411 that the FCN of the last fragment of the packet is the one with 2412 FCN=31 (i.e. FCN=2^N-1 for N=5, or equivalently, all FCN bits set to 2413 1). 2415 Sender Receiver 2416 |-----W=0, FCN=23----->| 2417 |-----W=0, FCN=22----->| 2418 |-----W=0, FCN=21--X-->| 2419 |-----W=0, FCN=20----->| 2420 |-----W=0, FCN=19----->| 2421 |-----W=0, FCN=18----->| 2422 |-----W=0, FCN=17----->| 2423 |-----W=0, FCN=16----->| 2424 |-----W=0, FCN=15----->| 2425 |-----W=0, FCN=14----->| 2426 |-----W=0, FCN=13----->| 2427 |-----W=0, FCN=12----->| 2428 |-----W=0, FCN=11----->| 2429 |-----W=0, FCN=10--X-->| 2430 |-----W=0, FCN=9 ----->| 2431 |-----W=0, FCN=8 ----->| 2432 |-----W=0, FCN=7 ----->| 2433 |-----W=0, FCN=6 ----->| 2434 |-----W=0, FCN=5 ----->| 2435 |-----W=0, FCN=4 ----->| 2436 |-----W=0, FCN=3 ----->| 2437 |-----W=0, FCN=2 ----->| 2438 |-----W=0, FCN=1 ----->| 2439 |-----W=0, FCN=0 ----->| 2440 | |lcl-Bitmap:110111111111101111111111 2441 |<------ACK, W=0-------|encoded Bitmap:1101111111111011 2442 |-----W=0, FCN=21----->| 2443 |-----W=0, FCN=10----->| 2444 |<------ACK, W=0-------|no Bitmap 2445 |-----W=1, FCN=23----->| 2446 |-----W=1, FCN=22----->| 2447 |-----W=1, FCN=21----->| 2448 |--W=1, FCN=31 + MIC-->|MIC checked: sucess => 2449 |<------ACK, W=1-------|no Bitmap 2450 (End) 2452 Figure 37: Transmission in ACK-Always mode of an IPv6 packet carried 2453 by 28 fragments, with N=5, MAX_WIND_FCN=23 and two lost fragments. 2455 Appendix C. Fragmentation State Machines 2457 The fragmentation state machines of the sender and the receiver, one 2458 for each of the different reliability modes, are described in the 2459 following figures: 2461 +===========+ 2462 +------------+ Init | 2463 | FCN=0 +===========+ 2464 | No Window 2465 | No Bitmap 2466 | +-------+ 2467 | +========+==+ | More Fragments 2468 | | | <--+ ~~~~~~~~~~~~~~~~~~~~ 2469 +--------> | Send | send Fragment (FCN=0) 2470 +===+=======+ 2471 | last fragment 2472 | ~~~~~~~~~~~~ 2473 | FCN = 1 2474 v send fragment+MIC 2475 +============+ 2476 | END | 2477 +============+ 2479 Figure 38: Sender State Machine for the No-ACK Mode 2481 +------+ Not All-1 2482 +==========+=+ | ~~~~~~~~~~~~~~~~~~~ 2483 | + <--+ set Inactivity Timer 2484 | RCV Frag +-------+ 2485 +=+===+======+ |All-1 & 2486 All-1 & | | |MIC correct 2487 MIC wrong | |Inactivity | 2488 | |Timer Exp. | 2489 v | | 2490 +==========++ | v 2491 | Error |<-+ +========+==+ 2492 +===========+ | END | 2493 +===========+ 2495 Figure 39: Receiver State Machine for the No-ACK Mode 2496 +=======+ 2497 | INIT | FCN!=0 & more frags 2498 | | ~~~~~~~~~~~~~~~~~~~~~~ 2499 +======++ +--+ send Window + frag(FCN) 2500 W=0 | | | FCN- 2501 Clear local Bitmap | | v set local Bitmap 2502 FCN=max value | ++==+========+ 2503 +> | | 2504 +---------------------> | SEND | 2505 | +==+===+=====+ 2506 | FCN==0 & more frags | | last frag 2507 | ~~~~~~~~~~~~~~~~~~~~~ | | ~~~~~~~~~~~~~~~ 2508 | set local-Bitmap | | set local-Bitmap 2509 | send wnd + frag(all-0) | | send wnd+frag(all-1)+MIC 2510 | set Retrans_Timer | | set Retrans_Timer 2511 | | | 2512 |Recv_wnd == wnd & | | 2513 |Lcl_Bitmap==recv_Bitmap& | | +----------------------+ 2514 |more frag | | |lcl-Bitmap!=rcv-Bitmap| 2515 |~~~~~~~~~~~~~~~~~~~~~~ | | | ~~~~~~~~~ | 2516 |Stop Retrans_Timer | | | Attemp++ v 2517 |clear local_Bitmap v v | +=====+=+ 2518 |window=next_window +====+===+==+===+ |Resend | 2519 +---------------------+ | |Missing| 2520 +----+ Wait | |Frag | 2521 not expected wnd | | Bitmap | +=======+ 2522 ~~~~~~~~~~~~~~~~ +--->+ ++Retrans_Timer Exp | 2523 discard frag +==+=+===+=+==+=+| ~~~~~~~~~~~~~~~~~ | 2524 | | | ^ ^ |reSend(empty)All-* | 2525 | | | | | |Set Retrans_Timer | 2526 MIC_bit==1 & | | | | +--+Attemp++ | 2527 Recv_window==window & | | | +-------------------------+ 2528 Lcl_Bitmap==recv_Bitmap &| | | all missing frag sent 2529 no more frag| | | ~~~~~~~~~~~~~~~~~~~~~~ 2530 ~~~~~~~~~~~~~~~~~~~~~~~~| | | Set Retrans_Timer 2531 Stop Retrans_Timer| | | 2532 +=============+ | | | 2533 | END +<--------+ | | Attemp > MAX_ACK_REQUESTS 2534 +=============+ | | ~~~~~~~~~~~~~~~~~~ 2535 All-1 Window | v Send Abort 2536 ~~~~~~~~~~~~ | +=+===========+ 2537 MIC_bit ==0 & +>| ERROR | 2538 Lcl_Bitmap==recv_Bitmap +=============+ 2540 Figure 40: Sender State Machine for the ACK-Always Mode 2542 Not All- & w=expected +---+ +---+w = Not expected 2543 ~~~~~~~~~~~~~~~~~~~~~ | | | |~~~~~~~~~~~~~~~~ 2544 Set local_Bitmap(FCN) | v v |discard 2545 ++===+===+===+=+ 2546 +---------------------+ Rcv +--->* ABORT 2547 | +------------------+ Window | 2548 | | +=====+==+=====+ 2549 | | All-0 & w=expect | ^ w =next & not-All 2550 | | ~~~~~~~~~~~~~~~~~~ | |~~~~~~~~~~~~~~~~~~~~~ 2551 | | set lcl_Bitmap(FCN)| |expected = next window 2552 | | send local_Bitmap | |Clear local_Bitmap 2553 | | | | 2554 | | w=expct & not-All | | 2555 | | ~~~~~~~~~~~~~~~~~~ | | 2556 | | set lcl_Bitmap(FCN)+-+ | | +--+ w=next & All-0 2557 | | if lcl_Bitmap full | | | | | | ~~~~~~~~~~~~~~~ 2558 | | send lcl_Bitmap | | | | | | expct = nxt wnd 2559 | | v | v | | | Clear lcl_Bitmap 2560 | | w=expct & All-1 +=+=+=+==+=++ | set lcl_Bitmap(FCN) 2561 | | ~~~~~~~~~~~ +->+ Wait +<+ send lcl_Bitmap 2562 | | discard +--| Next | 2563 | | All-0 +---------+ Window +--->* ABORT 2564 | | ~~~~~ +-------->+========+=++ 2565 | | snd lcl_bm All-1 & w=next| | All-1 & w=nxt 2566 | | & MIC wrong| | & MIC right 2567 | | ~~~~~~~~~~~~~~~~~| | ~~~~~~~~~~~~~~~~~~ 2568 | | set local_Bitmap(FCN)| |set lcl_Bitmap(FCN) 2569 | | send local_Bitmap| |send local_Bitmap 2570 | | | +----------------------+ 2571 | |All-1 & w=expct | | 2572 | |& MIC wrong v +---+ w=expctd & | 2573 | |~~~~~~~~~~~~~~~~~~~~ +====+=====+ | MIC wrong | 2574 | |set local_Bitmap(FCN) | +<+ ~~~~~~~~~~~~~~ | 2575 | |send local_Bitmap | Wait End | set lcl_btmp(FCN)| 2576 | +--------------------->+ +--->* ABORT | 2577 | +===+====+=+-+ All-1&MIC wrong| 2578 | | ^ | ~~~~~~~~~~~~~~~| 2579 | w=expected & MIC right | +---+ send lcl_btmp | 2580 | ~~~~~~~~~~~~~~~~~~~~~~ | | 2581 | set local_Bitmap(FCN) | +-+ Not All-1 | 2582 | send local_Bitmap | | | ~~~~~~~~~ | 2583 | | | | discard | 2584 |All-1 & w=expctd & MIC right | | | | 2585 |~~~~~~~~~~~~~~~~~~~~~~~~~~~~ v | v +----+All-1 | 2586 |set local_Bitmap(FCN) +=+=+=+=+==+ |~~~~~~~~~ | 2587 |send local_Bitmap | +<+Send lcl_btmp | 2588 +-------------------------->+ END | | 2589 +==========+<---------------+ 2591 --->* ABORT 2592 ~~~~~~~ 2593 Inactivity_Timer = expires 2594 When DWN_Link 2595 IF Inactivity_Timer expires 2596 Send DWL Request 2597 Attemp++ 2599 Figure 41: Receiver State Machine for the ACK-Always Mode 2600 +=======+ 2601 | | 2602 | INIT | 2603 | | FCN!=0 & more frags 2604 +======++ +--+ ~~~~~~~~~~~~~~~~~~~~~~ 2605 W=0 | | | send Window + frag(FCN) 2606 ~~~~~~~~~~~~~~~~~~ | | | FCN- 2607 Clear local Bitmap | | v set local Bitmap 2608 FCN=max value | ++=============+ 2609 +> | | 2610 | SEND | 2611 +-------------------------> | | 2612 | ++=====+=======+ 2613 | FCN==0 & more frags| |last frag 2614 | ~~~~~~~~~~~~~~~~~~~~~~~| |~~~~~~~~~~~~~~~~~ 2615 | set local-Bitmap| |set local-Bitmap 2616 | send wnd + frag(all-0)| |send wnd+frag(all-1)+MIC 2617 | set Retrans_Timer| |set Retrans_Timer 2618 | | | 2619 |Retrans_Timer expires & | | lcl-Bitmap!=rcv-Bitmap 2620 |more fragments | | ~~~~~~~~~~~~~~~~~~~~~~ 2621 |~~~~~~~~~~~~~~~~~~~~ | | Attemp++ 2622 |stop Retrans_Timer | | +-----------------+ 2623 |clear local-Bitmap v v | v 2624 |window = next window +=====+=====+==+==+ +====+====+ 2625 +----------------------+ + | Resend | 2626 +--------------------->+ Wait Bitmap | | Missing | 2627 | +-- + | | Frag | 2628 | not expected wnd | ++=+===+===+===+==+ +======+==+ 2629 | ~~~~~~~~~~~~~~~~ | ^ | | | ^ | 2630 | discard frag +----+ | | | +-------------------+ 2631 | | | | all missing frag sent 2632 |Retrans_Timer expires & | | | ~~~~~~~~~~~~~~~~~~~~~ 2633 | No more Frag | | | Set Retrans_Timer 2634 | ~~~~~~~~~~~~~~~~~~~~~~~ | | | 2635 | Stop Retrans_Timer | | | 2636 | Send ALL-1-empty | | | 2637 +-------------------------+ | | 2638 | | 2639 Local_Bitmap==Recv_Bitmap| | 2640 ~~~~~~~~~~~~~~~~~~~~~~~~~| |Attemp > MAX_ACK_REQUESTS 2641 +=========+Stop Retrans_Timer | |~~~~~~~~~~~~~~~~~~~~~~~ 2642 | END +<------------------+ v Send Abort 2643 +=========+ +=+=========+ 2644 | ERROR | 2645 +===========+ 2647 Figure 42: Sender State Machine for the ACK-on-Error Mode 2649 Not All- & w=expected +---+ +---+w = Not expected 2650 ~~~~~~~~~~~~~~~~~~~~~ | | | |~~~~~~~~~~~~~~~~ 2651 Set local_Bitmap(FCN) | v v |discard 2652 ++===+===+===+=+ 2653 +-----------------------+ +--+ All-0 & full 2654 | ABORT *<---+ Rcv Window | | ~~~~~~~~~~~~ 2655 | +--------------------+ +<-+ w =next 2656 | | All-0 empty +->+=+=+===+======+ clear lcl_Bitmap 2657 | | ~~~~~~~~~~~ | | | ^ 2658 | | send bitmap +----+ | |w=expct & not-All & full 2659 | | | |~~~~~~~~~~~~~~~~~~~~~~~~ 2660 | | | |set lcl_Bitmap; w =nxt 2661 | | | | 2662 | | All-0 & w=expect | | w=next 2663 | | & no_full Bitmap | | ~~~~~~~~ +========+ 2664 | | ~~~~~~~~~~~~~~~~~ | | Send abort| Error/ | 2665 | | send local_Bitmap | | +---------->+ Abort | 2666 | | | | | +-------->+========+ 2667 | | v | | | all-1 ^ 2668 | | All-0 empty +====+===+==+=+=+ ~~~~~~~ | 2669 | | ~~~~~~~~~~~~~ +--+ Wait | Send abort | 2670 | | send lcl_btmp +->| Missing Fragm.| | 2671 | | +==============++ | 2672 | | +--------------+ 2673 | | Uplink Only & 2674 | | Inactivity_Timer = expires 2675 | | ~~~~~~~~~~~~~~~~~~~~~~~~~~ 2676 | | Send Abort 2677 | |All-1 & w=expect & MIC wrong 2678 | |~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +-+ All-1 2679 | |set local_Bitmap(FCN) | v ~~~~~~~~~~ 2680 | |send local_Bitmap +===========+==+ snd lcl_btmp 2681 | +--------------------->+ Wait End +-+ 2682 | +=====+=+====+=+ | w=expct & 2683 | w=expected & MIC right | | ^ | MIC wrong 2684 | ~~~~~~~~~~~~~~~~~~~~~~ | | +---+ ~~~~~~~~~ 2685 | set & send local_Bitmap(FCN) | | set lcl_Bitmap(FCN) 2686 | | | 2687 |All-1 & w=expected & MIC right | +-->* ABORT 2688 |~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ v 2689 |set & send local_Bitmap(FCN) +=+==========+ 2690 +---------------------------->+ END | 2691 +============+ 2692 --->* ABORT 2693 Only Uplink 2694 Inactivity_Timer = expires 2695 ~~~~~~~~~~~~~~~~~~~~~~~~~~ 2696 Send Abort 2698 Figure 43: Receiver State Machine for the ACK-on-Error Mode 2700 Appendix D. SCHC Parameters - Ticket #15 2702 This gives the list of parameters that need to be defined in the 2703 technology-specific documents, technology developper must evaluate 2704 that L2 has strong enough integrity checking to match SCHC's 2705 assumption: 2707 o LPWAN Architecture. Explain the SCHC entities (Compression and 2708 Fragmentation), how/where are they be represented in the 2709 corresponding technology architecture. 2711 o L2 fragmentation decision 2713 o Rule ID number of rules 2715 o Size of the Rule ID 2717 o The way the Rule ID is sent (L2 or L3) and how (describe) 2719 o Fragmentation delivery reliability mode used in which cases 2721 o Define the number of bits FCN (N) and DTag (T) 2723 o The MIC algorithm to be used and the size if different from the 2724 default CRC32 2726 o Retransmission Timer duration 2728 o Inactivity Timer duration 2730 o Define the MAX_ACK_REQUEST (number of attemps) 2732 o Use of padding or not and how and when to use it 2734 o Take into account that the length of rule-id + N + T + W when 2735 possible is good to have a multiple of 8 bits to complete a byte 2736 and avoid padding 2738 o In the ACK format to have a length for Rule-ID + T + W bit into a 2739 complete number of byte to do optimization more easily 2741 And the following parameters need to be addressed in another document 2742 but not forcely in the technology-specific one: 2744 o The way the contexts are provisioning 2745 o The way the Rules as generated 2747 Appendix E. Note 2749 Carles Gomez has been funded in part by the Spanish Government 2750 (Ministerio de Educacion, Cultura y Deporte) through the Jose 2751 Castillejo grant CAS15/00336, and by the ERDF and the Spanish 2752 Government through project TEC2016-79988-P. Part of his contribution 2753 to this work has been carried out during his stay as a visiting 2754 scholar at the Computer Laboratory of the University of Cambridge. 2756 Authors' Addresses 2758 Ana Minaburo 2759 Acklio 2760 2bis rue de la Chataigneraie 2761 35510 Cesson-Sevigne Cedex 2762 France 2764 Email: ana@ackl.io 2766 Laurent Toutain 2767 IMT-Atlantique 2768 2 rue de la Chataigneraie 2769 CS 17607 2770 35576 Cesson-Sevigne Cedex 2771 France 2773 Email: Laurent.Toutain@imt-atlantique.fr 2775 Carles Gomez 2776 Universitat Politecnica de Catalunya 2777 C/Esteve Terradas, 7 2778 08860 Castelldefels 2779 Spain 2781 Email: carlesgo@entel.upc.edu