idnits 2.17.00 (12 Aug 2021) /tmp/idnits36135/draft-ietf-lpwan-ipv6-static-context-hc-14.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.) ** There is 1 instance of too long lines in the document, the longest one being 4 characters in excess of 72. ** 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 172: '... most of the time and MAY receive data...' RFC 2119 keyword, line 282: '...e connected to an LPWAN. A Dev SHOULD...' RFC 2119 keyword, line 527: '...technologies, it MAY be suitable to lo...' RFC 2119 keyword, line 530: '... MUST share the same set of Rules. ...' RFC 2119 keyword, line 552: '...east one Rule ID MAY be allocated to t...' (106 more instances...) Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year == 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 'MUST not' in this paragraph: A Receiver-Abort is aligned to L2 Words, by design. Therefore, padding MUST not be appended. == 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 (June 29, 2018) is 1422 days in the past. Is this intentional? Checking references for intended status: Informational ---------------------------------------------------------------------------- -- Looks like a reference, but probably isn't: '1' on line 2352 -- Looks like a reference, but probably isn't: '2' on line 2355 -- Looks like a reference, but probably isn't: '8' on line 2377 -- Looks like a reference, but probably isn't: '4' on line 2384 ** Obsolete normative reference: RFC 2460 (Obsoleted by RFC 8200) Summary: 4 errors (**), 0 flaws (~~), 3 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: December 31, 2018 IMT-Atlantique 6 C. Gomez 7 Universitat Politecnica de Catalunya 8 D. Barthel 9 Orange Labs 10 June 29, 2018 12 LPWAN Static Context Header Compression (SCHC) and fragmentation for 13 IPv6 and UDP 14 draft-ietf-lpwan-ipv6-static-context-hc-14 16 Abstract 18 This document defines the Static Context Header Compression (SCHC) 19 framework, which provides both header compression and fragmentation 20 functionalities. SCHC has been tailored for Low Power Wide Area 21 Networks (LPWAN). 23 SCHC compression is based on a common static context stored in both 24 the LPWAN devices and the network side. This document defines a 25 header compression mechanism and its application to compress IPv6/UDP 26 headers. 28 This document also specifies a fragmentation and reassembly mechanism 29 that is used to support the IPv6 MTU requirement over the LPWAN 30 technologies. Fragmentation is needed for IPv6 datagrams that, after 31 SCHC compression or when such compression was not possible, still 32 exceed the layer two maximum payload size. 34 The SCHC header compression and fragmentation mechanisms are 35 independent of the specific LPWAN technology over which they are 36 used. Note that this document defines generic functionalities and 37 advisedly offers flexibility with regard to parameter settings and 38 mechanism choices. Such settings and choices are expected to be made 39 in other technology-specific documents. 41 Status of This Memo 43 This Internet-Draft is submitted in full conformance with the 44 provisions of BCP 78 and BCP 79. 46 Internet-Drafts are working documents of the Internet Engineering 47 Task Force (IETF). Note that other groups may also distribute 48 working documents as Internet-Drafts. The list of current Internet- 49 Drafts is at https://datatracker.ietf.org/drafts/current/. 51 Internet-Drafts are draft documents valid for a maximum of six months 52 and may be updated, replaced, or obsoleted by other documents at any 53 time. It is inappropriate to use Internet-Drafts as reference 54 material or to cite them other than as "work in progress." 56 This Internet-Draft will expire on December 31, 2018. 58 Copyright Notice 60 Copyright (c) 2018 IETF Trust and the persons identified as the 61 document authors. All rights reserved. 63 This document is subject to BCP 78 and the IETF Trust's Legal 64 Provisions Relating to IETF Documents 65 (https://trustee.ietf.org/license-info) in effect on the date of 66 publication of this document. Please review these documents 67 carefully, as they describe your rights and restrictions with respect 68 to this document. Code Components extracted from this document must 69 include Simplified BSD License text as described in Section 4.e of 70 the Trust Legal Provisions and are provided without warranty as 71 described in the Simplified BSD License. 73 Table of Contents 75 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 76 2. LPWAN Architecture . . . . . . . . . . . . . . . . . . . . . 5 77 3. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 5 78 4. SCHC overview . . . . . . . . . . . . . . . . . . . . . . . . 9 79 5. Rule ID . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 80 6. Static Context Header Compression . . . . . . . . . . . . . . 12 81 6.1. SCHC C/D Rules . . . . . . . . . . . . . . . . . . . . . 13 82 6.2. Rule ID for SCHC C/D . . . . . . . . . . . . . . . . . . 15 83 6.3. Packet processing . . . . . . . . . . . . . . . . . . . . 15 84 6.4. Matching operators . . . . . . . . . . . . . . . . . . . 17 85 6.5. Compression Decompression Actions (CDA) . . . . . . . . . 17 86 6.5.1. not-sent CDA . . . . . . . . . . . . . . . . . . . . 19 87 6.5.2. value-sent CDA . . . . . . . . . . . . . . . . . . . 19 88 6.5.3. mapping-sent CDA . . . . . . . . . . . . . . . . . . 19 89 6.5.4. LSB CDA . . . . . . . . . . . . . . . . . . . . . . . 19 90 6.5.5. DevIID, AppIID CDA . . . . . . . . . . . . . . . . . 20 91 6.5.6. Compute-* . . . . . . . . . . . . . . . . . . . . . . 20 92 7. Fragmentation . . . . . . . . . . . . . . . . . . . . . . . . 20 93 7.1. Overview . . . . . . . . . . . . . . . . . . . . . . . . 20 94 7.2. Fragmentation Tools . . . . . . . . . . . . . . . . . . . 21 95 7.3. Reliability modes . . . . . . . . . . . . . . . . . . . . 24 96 7.4. Fragmentation Formats . . . . . . . . . . . . . . . . . . 26 97 7.4.1. Fragments that are not the last one . . . . . . . . . 26 98 7.4.2. All-1 fragment . . . . . . . . . . . . . . . . . . . 28 99 7.4.3. SCHC ACK format . . . . . . . . . . . . . . . . . . . 30 100 7.4.4. Abort formats . . . . . . . . . . . . . . . . . . . . 32 101 7.5. Baseline mechanism . . . . . . . . . . . . . . . . . . . 34 102 7.5.1. No-ACK . . . . . . . . . . . . . . . . . . . . . . . 35 103 7.5.2. ACK-Always . . . . . . . . . . . . . . . . . . . . . 35 104 7.5.3. ACK-on-Error . . . . . . . . . . . . . . . . . . . . 38 105 7.6. Supporting multiple window sizes . . . . . . . . . . . . 40 106 7.7. Downlink SCHC Fragment transmission . . . . . . . . . . . 40 107 8. Padding management . . . . . . . . . . . . . . . . . . . . . 41 108 9. SCHC Compression for IPv6 and UDP headers . . . . . . . . . . 42 109 9.1. IPv6 version field . . . . . . . . . . . . . . . . . . . 42 110 9.2. IPv6 Traffic class field . . . . . . . . . . . . . . . . 42 111 9.3. Flow label field . . . . . . . . . . . . . . . . . . . . 43 112 9.4. Payload Length field . . . . . . . . . . . . . . . . . . 43 113 9.5. Next Header field . . . . . . . . . . . . . . . . . . . . 43 114 9.6. Hop Limit field . . . . . . . . . . . . . . . . . . . . . 44 115 9.7. IPv6 addresses fields . . . . . . . . . . . . . . . . . . 44 116 9.7.1. IPv6 source and destination prefixes . . . . . . . . 44 117 9.7.2. IPv6 source and destination IID . . . . . . . . . . . 45 118 9.8. IPv6 extensions . . . . . . . . . . . . . . . . . . . . . 45 119 9.9. UDP source and destination port . . . . . . . . . . . . . 45 120 9.10. UDP length field . . . . . . . . . . . . . . . . . . . . 46 121 9.11. UDP Checksum field . . . . . . . . . . . . . . . . . . . 46 122 10. Security considerations . . . . . . . . . . . . . . . . . . . 47 123 10.1. Security considerations for SCHC 124 Compression/Decompression . . . . . . . . . . . . . . . 47 125 10.2. Security considerations for SCHC 126 Fragmentation/Reassembly . . . . . . . . . . . . . . . . 47 127 11. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 48 128 12. References . . . . . . . . . . . . . . . . . . . . . . . . . 49 129 12.1. Normative References . . . . . . . . . . . . . . . . . . 49 130 12.2. Informative References . . . . . . . . . . . . . . . . . 50 131 Appendix A. SCHC Compression Examples . . . . . . . . . . . . . 50 132 Appendix B. Fragmentation Examples . . . . . . . . . . . . . . . 52 133 Appendix C. Fragmentation State Machines . . . . . . . . . . . . 58 134 Appendix D. SCHC Parameters - Ticket #15 . . . . . . . . . . . . 65 135 Appendix E. Note . . . . . . . . . . . . . . . . . . . . . . . . 66 136 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 67 138 1. Introduction 140 This document defines the Static Context Header Compression (SCHC) 141 framework, which provides both header compression and fragmentation 142 functionalities. SCHC has been tailored for Low Power Wide Area 143 Networks (LPWAN). 145 Header compression is needed to efficiently bring Internet 146 connectivity to the node within an LPWAN network. Some LPWAN 147 networks properties can be exploited to get an efficient header 148 compression: 150 o The network topology is star-oriented, which means that all 151 packets follow the same path. For the needs of this document, the 152 architecture can simply be described as Devices (Dev) exchanging 153 information with LPWAN Application Servers (App) through Network 154 Gateways (NGW). 156 o Because devices embed built-in applications, the traffic flows to 157 be compressed are known in advance. Indeed, new applications 158 cannot be easily installed in LPWAN devices, as they would in 159 computers or smartphones. 161 The Static Context Header Compression (SCHC) is defined for this 162 environment. SCHC uses a context, in which information about header 163 fieds is stored. This context is static: the values of the header 164 fields do not change over time. This avoids complex 165 resynchronization mechanisms, that would be incompatible with LPWAN 166 characteristics. In most cases, a small context identifier is enough 167 to represent the full IPv6/UDP headers. The SCHC header compression 168 mechanism is independent of the specific LPWAN technology over which 169 it is used. 171 LPWAN technologies impose some strict limitations on traffic. For 172 instance, devices are sleeping most of the time and MAY receive data 173 during short periods of time after transmission to preserve battery. 174 LPWAN technologies are also characterized, among others, by a very 175 reduced data unit and/or payload size (see [RFC8376]). However, some 176 of these technologies do not provide fragmentation functionality, 177 therefore the only option for them to support the IPv6 MTU 178 requirement of 1280 bytes [RFC2460] is to use a fragmentation 179 protocol at the adaptation layer, below IPv6. In response to this 180 need, this document also defines a fragmentation/reassembly 181 mechanism, which supports the IPv6 MTU requirement over LPWAN 182 technologies. Such functionality has been designed under the 183 assumption that there is no out-of-sequence delivery of data units 184 between the entity performing fragmentation and the entity performing 185 reassembly. 187 Note that this document defines generic functionality and 188 purposefully offers flexibility with regard to parameter settings and 189 mechanism choices. Such settings and choices are expected to be made 190 in other, technology-specific documents. 192 2. LPWAN Architecture 194 LPWAN technologies have similar network architectures but different 195 terminologies. Using the terminology defined in [RFC8376], we can 196 identify different types of entities in a typical LPWAN network, see 197 Figure 1: 199 o Devices (Dev) are the end-devices or hosts (e.g. sensors, 200 actuators, etc.). There can be a very high density of devices per 201 radio gateway. 203 o The Radio Gateway (RGW), which is the end point of the constrained 204 link. 206 o The Network Gateway (NGW) is the interconnection node between the 207 Radio Gateway and the Internet. 209 o LPWAN-AAA Server, which controls the user authentication and the 210 applications. 212 o Application Server (App) 214 +------+ 215 () () () | |LPWAN-| 216 () () () () / \ +---------+ | AAA | 217 () () () () () () / \======| ^ |===|Server| +-----------+ 218 () () () | | <--|--> | +------+ |APPLICATION| 219 () () () () / \==========| v |=============| (App) | 220 () () () / \ +---------+ +-----------+ 221 Dev Radio Gateways NGW 223 Figure 1: LPWAN Architecture 225 3. Terminology 227 This section defines the terminology and acronyms used in this 228 document. 230 Note that the SCHC acronym is pronounced like "sheek" in English (or 231 "chic" in French). Therefore, this document writes "a SCHC Packet" 232 instead of "an SCHC Packet". 234 o Abort. A SCHC Fragment format to signal the other end-point that 235 the on-going fragment transmission is stopped and finished. 237 o All-0. The SCHC Fragment format for the last fragment of a window 238 that is not the last one of a SCHC Packet (see window in this 239 glossary). 241 o All-1. The SCHC Fragment format for the last fragment of the SCHC 242 Packet. 244 o All-0 empty. An All-0 SCHC Fragment without payload. It is used 245 to request the SCHC ACK with the encoded Bitmap when the 246 Retransmission Timer expires, in a window that is not the last one 247 of a packet. 249 o All-1 empty. An All-1 SCHC Fragment without payload. It is used 250 to request the SCHC ACK with the encoded Bitmap when the 251 Retransmission Timer expires in the last window of a packet. 253 o App: LPWAN Application. An application sending/receiving IPv6 254 packets to/from the Device. 256 o AppIID: Application Interface Identifier. The IID that identifies 257 the application server interface. 259 o Bi: Bidirectional. Characterises a Rule Entry that applies to 260 headers of packets travelling in either direction (Up and Dw, see 261 this glossary). 263 o Bitmap: a bit field in the SCHC ACK message that tells the sender 264 which SCHC Fragments in a window of fragments were correctly 265 received. 267 o C: Checked bit. Used in an acknowledgement (SCHC ACK) header to 268 determine if the MIC locally computed by the receiver matches (1) 269 the received MIC or not (0). 271 o CDA: Compression/Decompression Action. Describes the reciprocal 272 pair of actions that are performed at the compressor to compress a 273 header field and at the decompressor to recover the original 274 header field value. 276 o Compression Residue. The bits that need to be sent (beyond the 277 Rule ID itself) after applying the SCHC compression over each 278 header field. 280 o Context: A set of Rules used to compress/decompress headers. 282 o Dev: Device. A node connected to an LPWAN. A Dev SHOULD 283 implement SCHC. 285 o DevIID: Device Interface Identifier. The IID that identifies the 286 Dev interface. 288 o DI: Direction Indicator. This field tells which direction of 289 packet travel (Up, Dw or Bi) a Rule applies to. This allows for 290 assymmetric processing. 292 o DTag: Datagram Tag. This SCHC F/R header field is set to the same 293 value for all SCHC Fragments carrying the same SCHC Packet. 295 o Dw: Downlink direction for compression/decompression in both 296 sides, from SCHC C/D in the network to SCHC C/D in the Dev. 298 o FCN: Fragment Compressed Number. This SCHC F/R header field 299 carries an efficient representation of a larger-sized fragment 300 number. 302 o Field Description. A line in the Rule table. 304 o FID: Field Identifier. This is an index to describe the header 305 fields in a Rule. 307 o FL: Field Length is the length of the packet header field. It is 308 expressed in bits for header fields of fixed lengths or as a type 309 (e.g. variable, token length, ...) for field lengths that are 310 unknown at the time of Rule creation. The length of a header 311 field is defined in the corresponding protocol specification. 313 o FP: Field Position is a value that is used to identify the 314 position where each instance of a field appears in the header. 316 o IID: Interface Identifier. See the IPv6 addressing architecture 317 [RFC7136] 319 o Inactivity Timer. A timer used after receiving a SCHC Fragment to 320 detect when, due to a communication error, there is no possibility 321 to continue an on-going fragmented SCHC Packet transmission. 323 o L2: Layer two. The immediate lower layer SCHC interfaces with. 324 It is provided by an underlying LPWAN technology. 326 o L2 Word: this is the minimum subdivision of payload data that the 327 L2 will carry. In most L2 technologies, the L2 Word is an octet. 328 In bit-oriented radio technologies, the L2 Word might be a single 329 bit. The L2 Word size is assumed to be constant over time for 330 each device. 332 o MIC: Message Integrity Check. A SCHC F/R header field computed 333 over the fragmented SCHC Packet and potential fragment padding, 334 used for error detection after SCHC Packet reassembly. 336 o MO: Matching Operator. An operator used to match a value 337 contained in a header field with a value contained in a Rule. 339 o Padding (P). Extra bits that may be appended by SCHC to a data 340 unit that it passes to the underlying Layer 2 for transmission. 341 SCHC itself operates on bits, not bytes, and does not have any 342 alignment prerequisite. See Section 8. 344 o Retransmission Timer. A timer used by the SCHC Fragment sender 345 during an on-going fragmented SCHC Packet transmission to detect 346 possible link errors when waiting for a possible incoming SCHC 347 ACK. 349 o Rule: A set of header field values. 351 o Rule entry: A column in a Rule that describes a parameter of the 352 header field. 354 o Rule ID: An identifier for a Rule. SCHC C/D on both sides share 355 the same Rule ID for a given packet. A set of Rule IDs are used 356 to support SCHC F/R functionality. 358 o SCHC ACK: A SCHC acknowledgement for fragmentation. This message 359 is used to report on the success of reception of a set of SCHC 360 Fragments. See Section 7 for more details. 362 o SCHC C/D: Static Context Header Compression Compressor/ 363 Decompressor. A mechanism used on both sides, at the Dev and at 364 the network, to achieve Compression/Decompression of headers. 365 SCHC C/D uses Rules to perform compression and decompression. 367 o SCHC F/R: Static Context Header Compression Fragmentation/ 368 Reassembly. A protocol used on both sides, at the Dev and at the 369 network, to achieve Fragmentation/Reassembly of SCHC Packets. 370 SCHC F/R has three reliability modes. 372 o SCHC Fragment: A data unit that carries a subset of a SCHC Packet. 373 SCHC F/R is needed when the size of a SCHC packet exceeds the 374 available payload size of the underlying L2 technology data unit. 375 See Section 7. 377 o SCHC Packet: A packet (e.g. an IPv6 packet) whose header has been 378 compressed as per the header compression mechanism defined in this 379 document. If the header compression process is unable to actually 380 compress the packet header, the packet with the uncompressed 381 header is still called a SCHC Packet (in this case, a Rule ID is 382 used to indicate that the packet header has not been compressed). 383 See Section 6 for more details. 385 o TV: Target value. A value contained in a Rule that will be 386 matched with the value of a header field. 388 o Up: Uplink direction for compression/decompression in both sides, 389 from the Dev SCHC C/D to the network SCHC C/D. 391 o W: Window bit. A SCHC Fragment header field used in ACK-on-Error 392 or ACK-Always mode Section 7, which carries the same value for all 393 SCHC Fragments of a window. 395 o Window: A subset of the SCHC Fragments needed to carry a SCHC 396 Packet (see Section 7). 398 4. SCHC overview 400 SCHC can be abstracted as an adaptation layer between IPv6 and the 401 underlying LPWAN technology. SCHC comprises two sublayers (i.e. the 402 Compression sublayer and the Fragmentation sublayer), as shown in 403 Figure 2. 405 +----------------+ 406 | IPv6 | 407 +- +----------------+ 408 | | Compression | 409 SCHC < +----------------+ 410 | | Fragmentation | 411 +- +----------------+ 412 |LPWAN technology| 413 +----------------+ 415 Figure 2: Protocol stack comprising IPv6, SCHC and an LPWAN 416 technology 418 As per this document, when a packet (e.g. an IPv6 packet) needs to be 419 transmitted, header compression is first applied to the packet. The 420 resulting packet after header compression (whose header may or may 421 not actually be smaller than that of the original packet) is called a 422 SCHC Packet. If the SCHC Packet size exceeds the layer 2 (L2) MTU, 423 fragmentation is then applied to the SCHC Packet. The SCHC Packet or 424 the SCHC Fragments are then transmitted over the LPWAN. The 425 reciprocal operations take place at the receiver. This process is 426 illustrated in Figure 3. 428 A packet (e.g. an IPv6 packet) 429 | ^ 430 v | 431 +------------------+ +--------------------+ 432 | SCHC Compression | | SCHC Decompression | 433 +------------------+ +--------------------+ 434 | ^ 435 | If no fragmentation (*) | 436 +-------------- SCHC Packet -------------->| 437 | | 438 v | 439 +--------------------+ +-----------------+ 440 | SCHC Fragmentation | | SCHC Reassembly | 441 +--------------------+ +-----------------+ 442 | ^ | ^ 443 | | | | 444 | +-------------- SCHC ACK -------------+ | 445 | | 446 +-------------- SCHC Fragments -------------------+ 448 SENDER RECEIVER 450 *: the decision to use Fragmentation or not is left to each LPWAN technology 451 over which SCHC is applied. See LPWAN technology-specific documents. 453 Figure 3: SCHC operations taking place at the sender and the receiver 455 The SCHC Packet is composed of the Compressed Header followed by the 456 payload from the original packet (see Figure 4). The Compressed 457 Header itself is composed of a Rule ID and a Compression Residue. 458 The Compression Residue may be absent, see Section 6. Both the Rule 459 ID and the Compression Residue potentially have a variable size, and 460 generally are not a mutiple of bytes in size. 462 | Rule ID + Compression Residue | 463 +---------------------------------+--------------------+ 464 | Compressed Header | Payload | 465 +---------------------------------+--------------------+ 467 Figure 4: SCHC Packet 469 The Fragment Header size is variable and depends on the Fragmentation 470 parameters. The Fragment payload contains a part of the SCHC Packet 471 Compressed Header, a part of the SCHC Packet Payload or both. Its 472 size depends on the L2 data unit, see Section 7. The SCHC Fragment 473 has the following format: 475 | Rule ID + DTAG + W + FCN [+ MIC ] | Partial SCHC Packet | 476 +-----------------------------------+-------------------------+ 477 | Fragment Header | Fragment Payload | 478 +-----------------------------------+-------------------------+ 480 Figure 5: SCHC Fragment 482 The SCHC ACK is only used for Fragmentation. It has the following 483 format: 485 |Rule ID + DTag + W| 486 +------------------+-------- ... ---------+ 487 | ACK Header | encoded Bitmap | 488 +------------------+-------- ... ---------+ 490 Figure 6: SCHC ACK 492 The SCHC ACK Header and the encoded Bitmap both have variable size. 494 Figure 7 below maps the functional elements of Figure 3 onto the 495 LPWAN architecture elements of Figure 1. 497 Dev App 498 +----------------+ +--------------+ 499 | APP1 APP2 APP3 | |APP1 APP2 APP3| 500 | | | | 501 | UDP | | UDP | 502 | IPv6 | | IPv6 | 503 | | | | 504 |SCHC C/D and F/R| | | 505 +--------+-------+ +-------+------+ 506 | +--+ +----+ +-----------+ . 507 +~~ |RG| === |NGW | === | SCHC |... Internet .. 508 +--+ +----+ |F/R and C/D| 509 +-----------+ 511 Figure 7: Architecture 513 SCHC C/D and SCHC F/R are located on both sides of the LPWAN 514 transmission, i.e. on the Dev side and on the Network side. 516 Let's describe the operation in the Uplink direction. The Device 517 application packets use IPv6 or IPv6/UDP protocols. Before sending 518 these packets, the Dev compresses their headers using SCHC C/D and, 519 if the SCHC Packet resulting from the compression exceeds the maximum 520 payload size of the underlying LPWAN technology, SCHC F/R is 521 performed (see Section 7). The resulting SCHC Fragments are sent as 522 one or more L2 frames to an LPWAN Radio Gateway (RG) which forwards 523 them to a Network Gateway (NGW). The NGW sends the data to a SCHC F/ 524 R and then to the SCHC C/D for decompression. The SCHC F/R and C/D 525 on the Network side can be located in the NGW or somewhere else as 526 long as a tunnel is established between them and the NGW. Note that, 527 for some LPWAN technologies, it MAY be suitable to locate the SCHC F/ 528 R functionality nearer the NGW, in order to better deal with time 529 constraints of such technologies. The SCHC C/D and F/R on both sides 530 MUST share the same set of Rules. After decompression, the packet 531 can be sent over the Internet to one or several LPWAN Application 532 Servers (App). 534 The SCHC C/D and F/R process is symmetrical, therefore the 535 description of the Downlink direction trivially derives from the one 536 above. 538 5. Rule ID 540 Rule IDs are identifiers used to select the correct context either 541 for Compression/Decompression or for Fragmentation/Reassembly. 543 The size of the Rule IDs is not specified in this document, as it is 544 implementation-specific and can vary according to the LPWAN 545 technology and the number of Rules, among others. 547 The Rule IDs are used: 549 o In the SCHC C/D context, to identify the Rule (i.e., the set of 550 Field Descriptions) that is used to compress a packet header. 552 o At least one Rule ID MAY be allocated to tagging packets for which 553 SCHC compression was not possible (no matching Rule was found). 555 o In SCHC F/R, to identify the specific modes and settings of SCHC 556 Fragments being transmitted, and to identify the SCK ACKs, 557 including their modes and settings. Note that in the case of 558 bidirectional communication, at least two Rule ID values are 559 therefore needed for F/R. 561 6. Static Context Header Compression 563 In order to perform header compression, this document defines a 564 mechanism called Static Context Header Compression (SCHC), which is 565 based on using context, i.e. a set of Rules to compress or decompress 566 headers. SCHC avoids context synchronization, which is the most 567 bandwidth-consuming operation in other header compression mechanisms 568 such as RoHC [RFC5795]. Since the nature of packets is highly 569 predictable in LPWAN networks, static contexts MAY be stored 570 beforehand to omit transmitting some information over the air. The 571 contexts MUST be stored at both ends, and they can be learned by a 572 provisioning protocol or by out of band means, or they can be pre- 573 provisioned. The way the contexts are provisioned on both ends is 574 out of the scope of this document. 576 6.1. SCHC C/D Rules 578 The main idea of the SCHC compression scheme is to transmit the Rule 579 ID to the other end instead of sending known field values. This Rule 580 ID identifies a Rule that provides the closest match to the original 581 packet values. Hence, when a value is known by both ends, it is only 582 necessary to send the corresponding Rule ID over the LPWAN network. 583 How Rules are generated is out of the scope of this document. The 584 Rules MAY be changed at run-time but the way to do this will be 585 specified in another document. 587 The context contains a list of Rules (cf. Figure 8). Each Rule 588 itself contains a list of Field Descriptions composed of a Field 589 Identifier (FID), a Field Length (FL), a Field Position (FP), a 590 Direction Indicator (DI), a Target Value (TV), a Matching Operator 591 (MO) and a Compression/Decompression Action (CDA). 593 /-----------------------------------------------------------------\ 594 | Rule N | 595 /-----------------------------------------------------------------\| 596 | Rule i || 597 /-----------------------------------------------------------------\|| 598 | (FID) Rule 1 ||| 599 |+-------+--+--+--+------------+-----------------+---------------+||| 600 ||Field 1|FL|FP|DI|Target Value|Matching Operator|Comp/Decomp Act|||| 601 |+-------+--+--+--+------------+-----------------+---------------+||| 602 ||Field 2|FL|FP|DI|Target Value|Matching Operator|Comp/Decomp Act|||| 603 |+-------+--+--+--+------------+-----------------+---------------+||| 604 ||... |..|..|..| ... | ... | ... |||| 605 |+-------+--+--+--+------------+-----------------+---------------+||/ 606 ||Field N|FL|FP|DI|Target Value|Matching Operator|Comp/Decomp Act||| 607 |+-------+--+--+--+------------+-----------------+---------------+|/ 608 | | 609 \-----------------------------------------------------------------/ 611 Figure 8: Compression/Decompression Context 613 A Rule does not describe how to parse a packet header to find each 614 field. This MUST be known from the compressor/decompressor. Rules 615 only describe the compression/decompression behavior for each header 616 field. In a Rule, the Field Descriptions are listed in the order in 617 which the fields appear in the packet header. 619 A Rule also describes what Compression Residue is sent. The 620 Compression Residue is assembled by concatenating the residues for 621 each field, in the order the Field Descriptions appear in the Rule. 623 The Context describes the header fields and its values with the 624 following entries: 626 o Field ID (FID) is a unique value to define the header field. 628 o Field Length (FL) represents the length of the field. It can be 629 either a fixed value (in bits) if the length is known when the 630 Rule is created or a type if the length is variable. The length 631 of a header field is defined in the corresponding protocol 632 specification. The type defines the process to compute the 633 length, its unit (bits, bytes,...) and the value to be sent before 634 the Compression Residue. 636 o Field Position (FP): most often, a field only occurs once in a 637 packet header. Some fields may occur multiple times in a header. 638 FP indicates which occurrence this Field Description applies to. 639 The default value is 1 (first occurence). 641 o A Direction Indicator (DI) indicates the packet direction(s) this 642 Field Description applies to. Three values are possible: 644 * UPLINK (Up): this Field Description is only applicable to 645 packets sent by the Dev to the App, 647 * DOWNLINK (Dw): this Field Description is only applicable to 648 packets sent from the App to the Dev, 650 * BIDIRECTIONAL (Bi): this Field Description is applicable to 651 packets travelling both Up and Dw. 653 o Target Value (TV) is the value used to make the match with the 654 packet header field. The Target Value can be of any type 655 (integer, strings, etc.). For instance, it can be a single value 656 or a more complex structure (array, list, etc.), such as a JSON or 657 a CBOR structure. 659 o Matching Operator (MO) is the operator used to match the Field 660 Value and the Target Value. The Matching Operator may require 661 some parameters. MO is only used during the compression phase. 662 The set of MOs defined in this document can be found in 663 Section 6.4. 665 o Compression Decompression Action (CDA) describes the compression 666 and decompression processes to be performed after the MO is 667 applied. Some CDAs MAY require parameter values for their 668 operation. CDAs are used in both the compression and the 669 decompression functions. The set of CDAs defined in this document 670 can be found in Section 6.5. 672 6.2. Rule ID for SCHC C/D 674 Rule IDs are sent by the compression function in one side and are 675 received for the decompression function in the other side. In SCHC 676 C/D, the Rule IDs are specific to a Dev. Hence, multiple Dev 677 instances MAY use the same Rule ID to define different header 678 compression contexts. To identify the correct Rule ID, the SCHC C/D 679 needs to correlate the Rule ID with the Dev identifier to find the 680 appropriate Rule to be applied. 682 6.3. Packet processing 684 The compression/decompression process follows several steps: 686 o Compression Rule selection: The goal is to identify which Rule(s) 687 will be used to compress the packet's headers. When doing 688 decompression, on the network side the SCHC C/D needs to find the 689 correct Rule based on the L2 address and in this way, it can use 690 the DevIID and the Rule ID. On the Dev side, only the Rule ID is 691 needed to identify the correct Rule since the Dev only holds Rules 692 that apply to itself. The Rule will be selected by matching the 693 Fields Descriptions to the packet header as described below. When 694 the selection of a Rule is done, this Rule is used to compress the 695 header. The detailed steps for compression Rule selection are the 696 following: 698 * The first step is to choose the Field Descriptions by their 699 direction, using the Direction Indicator (DI). A Field 700 Description that does not correspond to the appropriate DI will 701 be ignored. If all the fields of the packet do not have a 702 Field Description with the correct DI, the Rule is discarded 703 and SCHC C/D proceeds to explore the next Rule. 705 * When the DI has matched, then the next step is to identify the 706 fields according to Field Position (FP). If FP does not 707 correspond, the Rule is not used and the SCHC C/D proceeds to 708 consider the next Rule. 710 * Once the DI and the FP correspond to the header information, 711 each packet field's value is then compared to the corresponding 712 Target Value (TV) stored in the Rule for that specific field 713 using the matching operator (MO). 715 If all the fields in the packet's header satisfy all the 716 matching operators (MO) of a Rule (i.e. all MO results are 717 True), the fields of the header are then compressed according 718 to the Compression/Decompression Actions (CDAs) and a 719 compressed header (with possibly a Compression Residue) SHOULD 720 be obtained. Otherwise, the next Rule is tested. 722 * If no eligible Rule is found, then the header MUST be sent 723 without compression. This MAY require the use of the SCHC F/R 724 process. 726 o Sending: If an eligible Rule is found, the Rule ID is sent to the 727 other end followed by the Compression Residue (which could be 728 empty) and directly followed by the payload. The Compression 729 Residue is the concatenation of the Compression Residues for each 730 field according to the CDAs for that Rule. The way the Rule ID is 731 sent depends on the specific underlying LPWAN technology. For 732 example, it can be either included in an L2 header or sent in the 733 first byte of the L2 payload. (Cf. Figure 9). This process will 734 be specified in the LPWAN technology-specific document and is out 735 of the scope of the present document. On LPWAN technologies that 736 are byte-oriented, the compressed header concatenated with the 737 original packet payload is padded to a multiple of 8 bits, if 738 needed. See Section 8 for details. 740 o Decompression: When doing decompression, on the network side the 741 SCHC C/D needs to find the correct Rule based on the L2 address 742 and in this way, it can use the DevIID and the Rule ID. On the 743 Dev side, only the Rule ID is needed to identify the correct Rule 744 since the Dev only holds Rules that apply to itself. 746 The receiver identifies the sender through its device-id (e.g. 747 MAC address, if exists) and selects the appropriate Rule from the 748 Rule ID. If a source identifier is present in the L2 technology, 749 it is used to select the Rule ID. This Rule describes the 750 compressed header format and associates the values to the header 751 fields. The receiver applies the CDA action to reconstruct the 752 original header fields. The CDA application order can be 753 different from the order given by the Rule. For instance, 754 Compute-* SHOULD be applied at the end, after all the other CDAs. 756 +--- ... --+------- ... -------+------------------+ 757 | Rule ID |Compression Residue| packet payload | 758 +--- ... --+------- ... -------+------------------+ 760 |----- compressed header ------| 762 Figure 9: SCHC C/D Packet Format 764 6.4. Matching operators 766 Matching Operators (MOs) are functions used by both SCHC C/D 767 endpoints involved in the header compression/decompression. They are 768 not typed and can be indifferently applied to integer, string or any 769 other data type. The result of the operation can either be True or 770 False. MOs are defined as follows: 772 o equal: The match result is True if a field value in a packet and 773 the value in the TV are equal. 775 o ignore: No check is done between a field value in a packet and a 776 TV in the Rule. The result of the matching is always true. 778 o MSB(x): A match is obtained if the most significant x bits of the 779 packet header field value are equal to the TV in the Rule. The x 780 parameter of the MSB MO indicates how many bits are involved in 781 the comparison. If the FL is described as variable, the length 782 must be a multiple of the unit. For example, x must be multiple 783 of 8 if the unit of the variable length is in bytes. 785 o match-mapping: With match-mapping, the Target Value is a list of 786 values. Each value of the list is identified by a short ID (or 787 index). Compression is achieved by sending the index instead of 788 the original header field value. This operator matches if the 789 header field value is equal to one of the values in the target 790 list. 792 6.5. Compression Decompression Actions (CDA) 794 The Compression Decompression Action (CDA) describes the actions 795 taken during the compression of headers fields, and inversely, the 796 action taken by the decompressor to restore the original value. 798 /--------------------+-------------+----------------------------\ 799 | Action | Compression | Decompression | 800 | | | | 801 +--------------------+-------------+----------------------------+ 802 |not-sent |elided |use value stored in context | 803 |value-sent |send |build from received value | 804 |mapping-sent |send index |value from index on a table | 805 |LSB |send LSB |TV, received value | 806 |compute-length |elided |compute length | 807 |compute-checksum |elided |compute UDP checksum | 808 |DevIID |elided |build IID from L2 Dev addr | 809 |AppIID |elided |build IID from L2 App addr | 810 \--------------------+-------------+----------------------------/ 812 Figure 10: Compression and Decompression Actions 814 Figure 10 summarizes the basic functions that can be used to compress 815 and decompress a field. The first column lists the actions name. 816 The second and third columns outline the reciprocal compression/ 817 decompression behavior for each action. 819 Compression is done in order that Fields Descriptions appear in a 820 Rule. The result of each Compression/Decompression Action is 821 appended to the working Compression Residue in that same order. The 822 receiver knows the size of each compressed field which can be given 823 by the Rule or MAY be sent with the compressed header. 825 If the field is identified as being variable in the Field 826 Description, then the size of the Compression Residue value (using 827 the unit defined in the FL) MUST be sent first using the following 828 coding: 830 o If the size is between 0 and 14, it is sent as a 4-bits integer. 832 o For values between 15 and 254, the first 4 bits sent are set to 1 833 and the size is sent using 8 bits integer. 835 o For higher values of size, the first 12 bits are set to 1 and the 836 next two bytes contain the size value as a 16 bits integer. 838 If a field is not present in the packet but exists in the Rule and 839 its FL is specified as being variable, size 0 MUST be sent to denote 840 its absence. 842 6.5.1. not-sent CDA 844 The not-sent function is generally used when the field value is 845 specified in a Rule and therefore known by both the Compressor and 846 the Decompressor. This action is generally used with the "equal" MO. 847 If MO is "ignore", there is a risk to have a decompressed field value 848 different from the original field that was compressed. 850 The compressor does not send any Compression Residue for a field on 851 which not-sent compression is applied. 853 The decompressor restores the field value with the Target Value 854 stored in the matched Rule identified by the received Rule ID. 856 6.5.2. value-sent CDA 858 The value-sent action is generally used when the field value is not 859 known by both the Compressor and the Decompressor. The value is sent 860 as a residue in the compressed message header. Both Compressor and 861 Decompressor MUST know the size of the field, either implicitly (the 862 size is known by both sides) or by explicitly indicating the length 863 in the Compression Residue, as defined in Section 6.5. This function 864 is generally used with the "ignore" MO. 866 6.5.3. mapping-sent CDA 868 The mapping-sent is used to send a smaller index (the index into the 869 Target Value list of values) instead of the original value. This 870 function is used together with the "match-mapping" MO. 872 On the compressor side, the match-mapping Matching Operator searches 873 the TV for a match with the header field value and the mapping-sent 874 CDA appends the corresponding index to the Compression Residue to be 875 sent. On the decompressor side, the CDA uses the received index to 876 restore the field value by looking up the list in the TV. 878 The number of bits sent is the minimal size for coding all the 879 possible indices. 881 6.5.4. LSB CDA 883 The LSB action is used together with the "MSB(x)" MO to avoid sending 884 the most significant part of the packet field if that part is already 885 known by the receiving end. The number of bits sent is the original 886 header field length minus the length specified in the MSB(x) MO. 888 The compressor sends the Least Significant Bits (e.g. LSB of the 889 length field). The decompressor concatenates the x most significant 890 bits of Target Value and the received residue. 892 If this action needs to be done on a variable length field, the size 893 of the Compression Residue in bytes MUST be sent as described in 894 Section 6.5. 896 6.5.5. DevIID, AppIID CDA 898 These functions are used to process respectively the Dev and the App 899 Interface Identifiers (DevIID and AppIID) of the IPv6 addresses. 900 AppIID CDA is less common since current LPWAN technologies frames 901 contain a single address, which is the Dev's address. 903 The IID value MAY be computed from the Device ID present in the L2 904 header, or from some other stable identifier. The computation is 905 specific to each LPWAN technology and MAY depend on the Device ID 906 size. 908 In the downlink direction (Dw), at the compressor, this DevIID CDA 909 may be used to generate the L2 addresses on the LPWAN, based on the 910 packet destination address. 912 6.5.6. Compute-* 914 Some fields are elided during compression and reconstructed during 915 decompression. This is the case for length and checksum, so: 917 o compute-length: computes the length assigned to this field. This 918 CDA MAY be used to compute IPv6 length or UDP length. 920 o compute-checksum: computes a checksum from the information already 921 received by the SCHC C/D. This field MAY be used to compute UDP 922 checksum. 924 7. Fragmentation 926 7.1. Overview 928 In LPWAN technologies, the L2 data unit size typically varies from 929 tens to hundreds of bytes. The SCHC F/R (Fragmentation /Reassembly) 930 MAY be used either because after applying SCHC C/D or when SCHC C/D 931 is not possible the entire SCHC Packet still exceeds the L2 data 932 unit. 934 The SCHC F/R functionality defined in this document has been designed 935 under the assumption that data unit out-of-sequence delivery will not 936 happen between the entity performing fragmentation and the entity 937 performing reassembly. This assumption allows reducing the 938 complexity and overhead of the SCHC F/R mechanism. 940 This document also assumes that the L2 data unit size does not vary 941 while a fragmented SCHC Packet is being transmitted. 943 To adapt the SCHC F/R to the capabilities of LPWAN technologies, it 944 is required to enable optional SCHC Fragment retransmission and to 945 allow for a range of reliability options for sending the SCHC 946 Fragments. This document does not make any decision with regard to 947 which SCHC Fragment delivery reliability mode will be used over a 948 specific LPWAN technology. These details will be defined in other 949 technology-specific documents. 951 SCHC F/R uses the knowledge of the L2 Word size (see Section 3) to 952 encode some messages. Therefore, SCHC MUST know the L2 Word size. 953 SCHC F/R generates SCHC Fragments and SCHC ACKs that are, for most of 954 them, multiples of L2 Words. The padding overhead is kept to the 955 absolute minimum. See Section 8. 957 7.2. Fragmentation Tools 959 This subsection describes the different tools that are used to enable 960 the SCHC F/R functionality defined in this document, such as fields 961 in the SCHC F/R header frames (see the related formats in 962 Section 7.4), windows and timers. 964 o Rule ID. The Rule ID is present in the SCHC Fragment header and 965 in the SCHC ACK header formats. The Rule ID in a SCHC Fragment 966 header is used to identify that a SCHC Fragment is being carried, 967 which SCHC F/R reliability mode is used and which window size is 968 used. The Rule ID in the SCHC Fragment header also allows 969 interleaving non-fragmented SCHC Packets and SCHC Fragments that 970 carry other SCHC Packets. The Rule ID in a SCHC ACK identifies 971 the message as a SCHC ACK. 973 o Fragment Compressed Number (FCN). The FCN is included in all SCHC 974 Fragments. This field can be understood as a truncated, efficient 975 representation of a larger-sized fragment number, and does not 976 carry an absolute SCHC Fragment number. There are two FCN 977 reserved values that are used for controlling the SCHC F/R 978 process, as described next: 980 * The FCN value with all the bits equal to 1 (All-1) denotes the 981 last SCHC Fragment of a packet. The last window of a packet is 982 called an All-1 window. 984 * The FCN value with all the bits equal to 0 (All-0) denotes the 985 last SCHC Fragment of a window that is not the last one of the 986 packet. Such a window is called an All-0 window. 988 The rest of the FCN values are assigned in a sequentially 989 decreasing order, which has the purpose to avoid possible 990 ambiguity for the receiver that might arise under certain 991 conditions. In the SCHC Fragments, this field is an unsigned 992 integer, with a size of N bits. In the No-ACK mode, the size is 993 set to 1 bit (N=1), All-0 is used in all SCHC Fragments and All-1 994 for the last one. For the other reliability modes, it is 995 recommended to use a number of bits (N) equal to or greater than 996 3. Nevertheless, the appropriate value of N MUST be defined in 997 the corresponding technology-specific profile documents. For 998 windows that are not the last one of a fragmented SCHC Packet, the 999 FCN for the last SCHC Fragment in such windows is an All-0. This 1000 indicates that the window is finished and communication proceeds 1001 according to the reliability mode in use. The FCN for the last 1002 SCHC Fragment in the last window is an All-1, indicating the last 1003 SCHC Fragment of the SCHC Packet. It is also important to note 1004 that, in the No-ACK mode or when N=1, the last SCHC Fragment of 1005 the packet will carry a FCN equal to 1, while all previous SCHC 1006 Fragments will carry a FCN to 0. For further details see 1007 Section 7.5. The highest FCN in the window, denoted MAX_WIND_FCN, 1008 MUST be a value equal to or smaller than 2^N-2. (Example for N=5, 1009 MAX_WIND_FCN MAY be set to 23, then subsequent FCNs are set 1010 sequentially and in decreasing order, and the FCN will wrap from 0 1011 back to 23). 1013 o Datagram Tag (DTag). The DTag field, if present, is set to the 1014 same value for all SCHC Fragments carrying the same SCHC 1015 packet, and to different values for different SCHC Packets. Using 1016 this field, the sender can interleave fragments from different 1017 SCHC Packets, while the receiver can still tell them apart. In 1018 the SCHC Fragment formats, the size of the DTag field is T bits, 1019 which MAY be set to a value greater than or equal to 0 bits. For 1020 each new SCHC Packet processed by the sender, DTag MUST be 1021 sequentially increased, from 0 to 2^T - 1 wrapping back from 2^T - 1022 1 to 0. In the SCHC ACK format, DTag carries the same value as 1023 the DTag field in the SCHC Fragments for which this SCHC ACK is 1024 intended. When there is no Dtag, there can be only one SCHC 1025 Packet in transit. Only after all its fragments have been 1026 transmitted can another SCHC Packet be sent. The length of DTag, 1027 denoted T, is not specified in this document because it is 1028 technology dependant. It will be defined in the corresponding 1029 technology-specific documents, based on the number of simultaneous 1030 packets that are to be supported. 1032 o W (window): W is a 1-bit field. This field carries the same value 1033 for all SCHC Fragments of a window, and it is complemented for the 1034 next window. The initial value for this field is 0. In the SCHC 1035 ACK format, this field also has a size of 1 bit. In all SCHC 1036 ACKs, the W bit carries the same value as the W bit carried by the 1037 SCHC Fragments whose reception is being positively or negatively 1038 acknowledged by the SCHC ACK. 1040 o Message Integrity Check (MIC). This field is computed by the 1041 sender over the complete SCHC Packet and before SCHC 1042 fragmentation. The MIC allows the receiver to check errors in the 1043 reassembled packet, while it also enables compressing the UDP 1044 checksum by use of SCHC compression. The CRC32 as 0xEDB88320 1045 (i.e. the reverse representation of the polynomial used e.g. in 1046 the Ethernet standard [RFC3385]) is recommended as the default 1047 algorithm for computing the MIC. Nevertheless, other algorithms 1048 MAY be required and are defined in the technology-specific 1049 documents as well as the length in bits of the MIC used. 1051 o C (MIC checked): C is a 1-bit field. This field is used in the 1052 SCHC ACK packets to report the outcome of the MIC check, i.e. 1053 whether the reassembled packet was correctly received or not. A 1054 value of 1 represents a positive MIC check at the receiver side 1055 (i.e. the MIC computed by the receiver matches the received MIC). 1057 o Retransmission Timer. A SCHC Fragment sender uses it after the 1058 transmission of a window to detect a transmission error of the 1059 SCHC ACK corresponding to this window. Depending on the 1060 reliability mode, it will lead to a request a SCHC ACK 1061 retransmission (in ACK-Always mode) or it will trigger the 1062 transmission of the next window (in ACK-on-Error mode). The 1063 duration of this timer is not defined in this document and MUST be 1064 defined in the corresponding technology-specific documents. 1066 o Inactivity Timer. A SCHC Fragment receiver uses it to take action 1067 when there is a problem in the transmission of SCHC fragments. 1068 Such a problem could be detected by the receiver not getting a 1069 single SCHC Fragment during a given period of time. When this 1070 happens, an Abort message will be sent (see related text later in 1071 this section). Initially, and each time a SCHC Fragment is 1072 received, the timer is reinitialized. The duration of this timer 1073 is not defined in this document and MUST be defined in the 1074 corresponding technology-specific document. 1076 o Attempts. This counter counts the requests for a missing SCHC 1077 ACK. When it reaches the value MAX_ACK_REQUESTS, the sender 1078 assumes there are recurrent SCHC Fragment transmission errors and 1079 determines that an Abort is needed. The default value 1080 MAX_ACK_REQUESTS is not stated in this document, and it is 1081 expected to be defined in the corresponding technology-specific 1082 document. The Attempts counter is defined per window. It is 1083 initialized each time a new window is used. 1085 o Bitmap. The Bitmap is a sequence of bits carried in a SCHC ACK. 1086 Each bit in the Bitmap corresponds to a SCHC fragment of the 1087 current window, and provides feedback on whether the SCHC Fragment 1088 has been received or not. The right-most position on the Bitmap 1089 reports if the All-0 or All-1 fragment has been received or not. 1090 Feedback on the SCHC fragment with the highest FCN value is 1091 provided by the bit in the left-most position of the Bitmap. In 1092 the Bitmap, a bit set to 1 indicates that the SCHC Fragment of FCN 1093 corresponding to that bit position has been correctly sent and 1094 received. The text above describes the internal representation of 1095 the Bitmap. When inserted in the SCHC ACK for transmission from 1096 the receiver to the sender, the Bitmap is shortened for energy/ 1097 bandwidth optimisation, see more details in Section 7.4.3.1. 1099 o Abort. On expiration of the Inactivity timer, or when Attempts 1100 reaches MAX_ACK_REQUESTS or upon occurrence of some other error, 1101 the sender or the receiver may use the Abort. When the receiver 1102 needs to abort the on-going fragmented SCHC Packet transmission, 1103 it sends the Receiver-Abort format. When the sender needs to 1104 abort the transmission, it sends the Sender-Abort format. None of 1105 the Aborts are acknowledged. 1107 7.3. Reliability modes 1109 This specification defines three reliability modes: No-ACK, ACK- 1110 Always, and ACK-on-Error. ACK-Always and ACK-on-Error operate on 1111 windows of SCHC Fragments. A window of SCHC Fragments is a subset of 1112 the full set of SCHC Fragments needed to carry a SCHC Packet. 1114 o No-ACK. No-ACK is the simplest SCHC Fragment reliability mode. 1115 The receiver does not generate overhead in the form of 1116 acknowledgements (ACKs). However, this mode does not enhance 1117 reliability beyond that offered by the underlying LPWAN 1118 technology. In the No-ACK mode, the receiver MUST NOT issue SCHC 1119 ACKs. See further details in Section 7.5.1. 1121 o ACK-Always. The ACK-Always mode provides flow control using a 1122 windowing scheme. This mode is also able to handle long bursts of 1123 lost SCHC Fragments since detection of such events can be done 1124 before the end of the SCHC Packet transmission as long as the 1125 window size is short enough. However, such benefit comes at the 1126 expense of SCHC ACK use. In ACK-Always, the receiver sends a SCHC 1127 ACK after a window of SCHC Fragments has been received. The SCHC 1128 ACK is used to inform the sender which SCHC Fragments in the 1129 current window have been well received. Upon a SCHC ACK 1130 reception, the sender retransmits the lost SCHC Fragments. When a 1131 SCHC ACK is lost and the sender has not received it by the 1132 expiration of the Retransmission Timer, the sender uses a SCHC ACK 1133 request by sending the All-0 empty SCHC Fragment when it is not 1134 the last window and the All-1 empty Fragment when it is the last 1135 window. The maximum number of SCHC ACK requests is 1136 MAX_ACK_REQUESTS. If MAX_ACK_REQUESTS is reached, the 1137 transmission needs to be aborted. See further details in 1138 Section 7.5.2. 1140 o ACK-on-Error. The ACK-on-Error mode is suitable for links 1141 offering relatively low L2 data unit loss probability. In this 1142 mode, the SCHC Fragment receiver reduces the number of SCHC ACKs 1143 transmitted, which MAY be especially beneficial in asymmetric 1144 scenarios. The receiver transmits a SCHC ACK only after the 1145 complete window transmission and if at least one SCHC Fragment of 1146 this window has been lost. An exception to this behavior is in 1147 the last window, where the receiver MUST transmit a SCHC ACK, 1148 including the C bit set based on the MIC checked result, even if 1149 all the SCHC Fragments of the last window have been correctly 1150 received. The SCHC ACK gives the state of all the SCHC Fragments 1151 of the current window (received or lost). Upon a SCHC ACK 1152 reception, the sender retransmits any lost SCHC Fragments based on 1153 the SCHC ACK. If a SCHC ACK is not transmitted back by the 1154 receiver at the end of a window, the sender assumes that all SCHC 1155 Fragments have been correctly received. When a SCHC ACK is lost, 1156 the sender assumes that all SCHC Fragments covered by the lost 1157 SCHC ACK have been successfully delivered, so the sender continues 1158 transmitting the next window of SCHC Fragments. If the next SCHC 1159 Fragments received belong to the next window and it is still 1160 expecting fragments from the previous window, the receiver will 1161 abort the on-going fragmented packet transmission. See further 1162 details in Section 7.5.3. 1164 The same reliability mode MUST be used for all SCHC Fragments of a 1165 SCHC Packet. The decision on which reliability mode will be used and 1166 whether the same reliability mode applies to all SCHC Packets is an 1167 implementation problem and is out of the scope of this document. 1169 Note that the reliability mode choice is not necessarily tied to a 1170 particular characteristic of the underlying L2 LPWAN technology, e.g. 1171 the No-ACK mode MAY be used on top of an L2 LPWAN technology with 1172 symmetric characteristics for uplink and downlink. This document 1173 does not make any decision as to which SCHC Fragment reliability 1174 modes are relevant for a specific LPWAN technology. 1176 Examples of the different reliability modes described are provided in 1177 Appendix B. 1179 7.4. Fragmentation Formats 1181 This section defines the SCHC Fragment format, including the All-0 1182 and All-1 formats and their "empty" variations, the SCHC ACK format 1183 and the Abort formats. 1185 A SCHC Fragment conforms to the general format shown in Figure 11. 1186 It comprises a SCHC Fragment Header and a SCHC Fragment Payload. In 1187 addition, the last SCHC Fragment carries as many padding bits as 1188 needed to fill up an L2 Word. The SCHC Fragment Payload carries a 1189 subset of the SCHC Packet. The SCHC Fragment is the data unit passed 1190 on to the L2 for transmission. 1192 +-----------------+-----------------------+~~~~~~~~~~~~~~~~~~~~~ 1193 | Fragment Header | Fragment payload | padding (as needed) 1194 +-----------------+-----------------------+~~~~~~~~~~~~~~~~~~~~~ 1196 Figure 11: SCHC Fragment general format. Presence of a padding field 1197 is optional 1199 7.4.1. Fragments that are not the last one 1201 In ACK-Always or ACK-on-Error, SCHC Fragments except the last one 1202 SHALL conform to the detailed format defined in Figure 12. 1204 |----- Fragment Header -----| 1205 |-- T --|1|-- N --| 1206 +-- ... --+- ... -+-+- ... -+--------...-------+ 1207 | Rule ID | DTag |W| FCN | Fragment payload | 1208 +-- ... --+- ... -+-+- ... -+--------...-------+ 1210 Figure 12: Fragment Detailed Format for Fragments except the Last 1211 One, ACK-Always and ACK-on-Error 1213 In the No-ACK mode, SCHC Fragments except the last one SHALL conform 1214 to the detailed format defined in Figure 13. 1216 |---- Fragment Header ----| 1217 |-- T --|-- N --| 1218 +-- ... --+- ... -+- ... -+--------...-------+ 1219 | Rule ID | DTag | FCN | Fragment payload | 1220 +-- ... --+- ... -+- ... -+--------...-------+ 1222 Figure 13: Fragment Detailed Format for Fragments except the Last 1223 One, No-ACK mode 1225 The total size of the fragment header is not necessarily a multiple 1226 of the L2 Word size. To build the fragment payload, SCHC F/R MUST 1227 take from the SCHC Packet a number of bits that makes the SCHC 1228 Fragment an exact multiple of L2 Words. As a consequence, no padding 1229 bit is used for these fragments. 1231 7.4.1.1. All-0 fragment 1233 The All-0 format is used for sending the last SCHC Fragment of a 1234 window that is not the last window of the SCHC Packet. 1236 |----- Fragment Header -----| 1237 |-- T --|1|-- N --| 1238 +-- ... --+- ... -+-+- ... -+--------...-------+ 1239 | Rule ID | DTag |W| 0..0 | Fragment payload | 1240 +-- ... --+- ... -+-+- ... -+--------...-------+ 1242 Figure 14: All-0 fragment detailed format 1244 This is simply an instance of the format described in Figure 12. An 1245 All-0 fragment payload MUST be at least the size of an L2 Word. The 1246 rationale is that the All-0 empty fragment (see Section 7.4.1.2) 1247 needs to be distinguishable from the All-0 regular fragment, even in 1248 the presence of padding. 1250 7.4.1.2. All-0 empty fragment 1252 The All-0 empty fragment is an exception to the All-0 fragment 1253 described above. It is used by a sender to request the 1254 retransmission of a SCHC ACK by the receiver. It is only used in 1255 ACK-Always mode. 1257 |----- Fragment Header -----| 1258 |-- T --|1|-- N --| 1259 +-- ... --+- ... -+-+- ... -+~~~~~~~~~~~~~~~~~~~~~ 1260 | Rule ID | DTag |W| 0..0 | padding (as needed) (no payload) 1261 +-- ... --+- ... -+-+- ... -+~~~~~~~~~~~~~~~~~~~~~ 1263 Figure 15: All-0 empty fragment detailed format 1265 The size of the All-0 fragment header is generally not a multiple of 1266 the L2 Word size. Therefore, an All-0 empty fragment generally needs 1267 padding bits. The padding bits are always less than an L2 Word. 1269 Since an All-0 payload MUST be at least the size of an L2 Word, a 1270 receiver can distinguish an All-0 empty fragment from a regular All-0 1271 fragment, even in the presence of padding. 1273 7.4.2. All-1 fragment 1275 In the No-ACK mode, the last SCHC Fragment of a SCHC Packet SHALL 1276 contain a SCHC Fragment header that conforms to the detailed format 1277 shown in Figure 16. 1279 |---------- Fragment Header ----------| 1280 |-- T --|-N=1-| 1281 +---- ... ---+- ... -+-----+-- ... --+---...---+~~~~~~~~~~~~~~~~~~~~~ 1282 | Rule ID | DTag | 1 | MIC | payload | padding (as needed) 1283 +---- ... ---+- ... -+-----+-- ... --+---...---+~~~~~~~~~~~~~~~~~~~~~ 1285 Figure 16: All-1 Fragment Detailed Format for the Last Fragment, No- 1286 ACK mode 1288 In ACK-Always or ACK-on-Error mode, the last fragment of a SCHC 1289 Packet SHALL contain a SCHC Fragment header that conforms to the 1290 detailed format shown in Figure 17. 1292 |---------- Fragment Header ----------| 1293 |-- T --|1|-- N --| 1294 +-- ... --+- ... -+-+- ... -+-- ... --+---...---+~~~~~~~~~~~~~~~~~~~~~ 1295 | Rule ID | DTag |W| 11..1 | MIC | payload | padding (as needed) 1296 +-- ... --+- ... -+-+- ... -+-- ... --+---...---+~~~~~~~~~~~~~~~~~~~~~ 1297 (FCN) 1299 Figure 17: All-1 Fragment Detailed Format for the Last Fragment, ACK- 1300 Always or ACK-on-Error 1302 The total size of the All-1 SCHC Fragment header is generally not a 1303 multiple of the L2 Word size. The All-1 fragment being the last one 1304 of the SCHC Packet, SCHC F/R cannot freely choose the payload size to 1305 align the fragment to an L2 Word. Therefore, padding bits are 1306 generally appended to the All-1 fragment to make it a multiple of L2 1307 Words in size. 1309 The MIC MUST be computed on the payload and the padding bits. The 1310 rationale is that the SCHC Reassembler needs to check the correctness 1311 of the reassembled SCHC packet but has no way of knowing where the 1312 payload ends. Indeed, the latter requires decompressing the SCHC 1313 Packet. 1315 An All-1 fragment payload MUST be at least the size of an L2 Word. 1316 The rationale is that the All-1 empty fragment (see Section 7.4.2.1) 1317 needs to be distinguishable from the All-1 fragment, even in the 1318 presence of padding. This may entail saving an L2 Word from the 1319 previous fragment payload to make the payload of this All-1 fragment 1320 big enough. 1322 The values for N, T and the length of MIC are not specified in this 1323 document, and SHOULD be determined in other documents (e.g. 1324 technology-specific profile documents). 1326 The length of the MIC MUST be at least an L2 Word size. The 1327 rationale is to be able to distinguish a Sender-Abort (see 1328 Section 7.4.4) from an All-1 Fragment, even in the presence of 1329 padding. 1331 7.4.2.1. All-1 empty fragment 1333 The All-1 empty fragment format is an All-1 fragment format without a 1334 payload (see Figure 18). It is used by a fragment sender, in either 1335 ACK-Always or ACK-on-Error, to request a retransmission of the SCHC 1336 ACK for the All-1 window. 1338 The size of the All-1 empty fragment header is generally not a 1339 multiple of the L2 Word size. Therefore, an All-1 empty fragment 1340 generally needs padding bits. The padding bits are always less than 1341 an L2 Word. 1343 Since an All-1 payload MUST be at least the size of an L2 Word, a 1344 receiver can distinguish an All-1 empty fragment from a regular All-1 1345 fragment, even in the presence of padding. 1347 |---------- Fragment Header --------| 1348 |-- T --|1|-- N --| 1349 +-- ... --+- ... -+-+- ... -+- ... -+~~~~~~~~~~~~~~~~~~~ 1350 | Rule ID | DTag |W| 1..1 | MIC | padding as needed (no payload) 1351 +-- ... --+- ... -+-+- ... -+- ... -+~~~~~~~~~~~~~~~~~~~ 1353 Figure 18: All-1 for Retries format, also called All-1 empty 1355 7.4.3. SCHC ACK format 1357 The format of a SCHC ACK that acknowledges a window that is not the 1358 last one (denoted as All-0 window) is shown in Figure 19. 1360 |-- T --|1| 1361 +---- ... --+- ... -+-+---- ... -----+ 1362 | Rule ID | DTag |W|encoded Bitmap| (no payload) 1363 +---- ... --+- ... -+-+---- ... -----+ 1365 Figure 19: ACK format for All-0 windows 1367 To acknowledge the last window of a packet (denoted as All-1 window), 1368 a C bit (i.e. MIC checked) following the W bit is set to 1 to 1369 indicate that the MIC check computed by the receiver matches the MIC 1370 present in the All-1 fragment. If the MIC check fails, the C bit is 1371 set to 0 and the Bitmap for the All-1 window follows. 1373 |-- T --|1|1| 1374 +---- ... --+- ... -+-+-+ 1375 | Rule ID | DTag |W|1| (MIC correct) 1376 +---- ... --+- ... -+-+-+ 1378 +---- ... --+- ... -+-+-+----- ... -----+ 1379 | Rule ID | DTag |W|0|encoded Bitmap |(MIC Incorrect) 1380 +---- ... --+- ... -+-+-+----- ... -----+ 1381 C 1383 Figure 20: Format of a SCHC ACK for All-1 windows 1385 The Rule ID and Dtag values in the SCHC ACK messages MUST be 1386 identical to the ones used in the SCHC Fragments that are being 1387 acknowledged. This allows matching the SCHC ACK and the 1388 corresponding SCHC Fragments. 1390 The Bitmap carries information on the reception of each fragment of 1391 the window as described in Section 7.2. 1393 See Appendix D for a discussion on the size of the Bitmaps. 1395 In order to reduce the SCK ACK size, the Bitmap that is actually 1396 transmitted is shortened ("encoded") as explained in Section 7.4.3.1. 1398 7.4.3.1. Bitmap Encoding 1400 The SCHC ACK that is transmitted is truncated by applying the 1401 following algorithm: the longest contiguous sequence of bits that 1402 starts at an L2 Word boundary of the SCHC ACK, where the bits of that 1403 sequence are all set to 1, are all part of the Bitmap and finish 1404 exactly at the end of the Bitmap, if one such sequence exists, MUST 1405 NOT be transmitted. Because the SCHC Fragment sender knows the 1406 actual Bitmap size, it can reconstruct the original Bitmap from the 1407 shortened bitmap. 1409 When shortening effectively takes place, the SCHC ACK is a multiple 1410 of L2 Words, and padding MUST NOT be appended. When shortening does 1411 not happen, padding bits MUST be appended as needed to fill up the 1412 last L2 Word. 1414 Figure 21 shows an example where L2 Words are actually bytes and 1415 where the original Bitmap contains 17 bits, the last 15 of which are 1416 all set to 1. 1418 |-- SCHC ACK Header --|-------- Bitmap --------| 1419 | Rule ID | DTag |W|1|0|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1| 1420 next L2 Word boundary ->| next L2 Word | next L2 Word | 1422 Figure 21: A non-encoded Bitmap 1424 Figure 22 shows that the last 14 bits are not sent. 1426 |-- T --|1| 1427 +---- ... --+- ... -+-+-+-+-+ 1428 | Rule ID | DTag |W|1|0|1| 1429 +---- ... --+- ... -+-+-+-+-+ 1430 next L2 Word boundary ->| 1432 Figure 22: Optimized Bitmap format 1434 Figure 23 shows an example of a SCHC ACK with FCN ranging from 6 down 1435 to 0, where the Bitmap indicates that the second and the fifth SCHC 1436 Fragments have not been correctly received. 1438 6 5 4 3 2 1 0 (*) 1439 |-- T --|1| 1440 +-----------+-------+-+-+-+-+-+-+-+-+ 1441 | Rule ID | DTag |W|1|0|1|1|0|1|1| Bitmap before tx 1442 +-----------+-------+-+-+-+-+-+-+-+-+ 1443 next L2 Word boundary ->|<-- L2 Word -->| 1444 (*)=(FCN values) 1446 +-----------+-------+-+-+-+-+-+-+-+-+~~~+ 1447 | Rule ID | DTag |W|1|0|1|1|0|1|1|Pad| Encoded Bitmap 1448 +-----------+-------+-+-+-+-+-+-+-+-+~~~+ 1449 next L2 Word boundary ->|<-- L2 Word -->| 1451 Figure 23: Example of a Bitmap before transmission, and the 1452 transmitted one, for a window that is not the last one 1454 Figure 24 shows an example of a SCHC ACK with FCN ranging from 6 down 1455 to 0, where MIC check has failed but the Bitmap indicates that there 1456 is no missing SCHC Fragment. 1458 |- Fragmentation Header-|6 5 4 3 2 1 7 (*) 1459 |-- T --|1| 1460 | Rule ID | DTag |W|0|1|1|1|1|1|1|1| Bitmap before tx 1461 next L2 Word boundary ->|<-- L2 Word -->| 1462 C 1463 +---- ... --+- ... -+-+-+-+ 1464 | Rule ID | DTag |W|0|1| Encoded Bitmap 1465 +---- ... --+- ... -+-+-+-+ 1466 next L2 Word boundary ->| 1467 (*) = (FCN values indicating the order) 1469 Figure 24: Example of the Bitmap in ACK-Always or ACK-on-Error for 1470 the last window 1472 7.4.4. Abort formats 1474 When a SCHC Fragment sender needs to abort the on-going fragmented 1475 SCHC Packet transmission, it sends a Sender-Abort. The Sender-Abort 1476 format (see Figure 25) is a variation of the All-1 fragment, with 1477 neither a MIC nor a payload. All-1 fragments contain at least a MIC. 1478 The absence of the MIC indicates a Sender-Abort. 1480 |--- Sender-Abort Header ---| 1481 +--- ... ---+- ... -+-+-...-+~~~~~~~~~~~~~~~~~~~~~ 1482 | Rule ID | DTag |W| FCN | padding (as needed) 1483 +--- ... ---+- ... -+-+-...-+~~~~~~~~~~~~~~~~~~~~~ 1485 Figure 25: Sender-Abort format. All FCN field bits in this format 1486 are set to 1 1488 The size of the Sender-Abort header is generally not a multiple of 1489 the L2 Word size. Therefore, a Sender-Abort generally needs padding 1490 bits. 1492 Since an All-1 fragment MIC MUST be at least the size of an L2 Word, 1493 a receiver can distinguish a Sender-Abort from an All-1 fragment, 1494 even in the presence of padding. 1496 When a SCHC Fragment receiver needs to abort the on-going fragmented 1497 SCHC Packet transmission, it transmits a Receiver-Abort. The 1498 Receiver-Abort format is a variation on the SCHC ACK format, creating 1499 an exception in the encoded Bitmap algorithm. As shown in Figure 26, 1500 a Receiver-Abort is coded as a SCHC ACK message with a shortened 1501 Bitmap set to 1 up to the first L2 Word boundary, followed by an 1502 extra L2 Word full of 1's. Such a message never occurs in a regular 1503 acknowledgement and is detected as a Receiver-Abort. 1505 The Rule ID and Dtag values in the Receive-Abort message MUST be 1506 identical to the ones used in the fragments of the SCHC Packet the 1507 transmission of which is being aborted. 1509 A Receiver-Abort is aligned to L2 Words, by design. Therefore, 1510 padding MUST not be appended. 1512 |- Receiver-Abort Header -| 1514 +---- ... ----+-- ... --+-+-+-+-+-+-+-+-+-+-+-+-+ 1515 | Rule ID | DTag |W| 1..1| 1..1 | 1516 +---- ... ----+-- ... --+-+-+-+-+-+-+-+-+-+-+-+-+ 1517 next L2 Word boundary ->|<-- L2 Word -->| 1519 Figure 26: Receiver-Abort format 1521 Neither the Sender-Abort nor the Receiver-Abort messages are ever 1522 acknowledged or retransmitted. 1524 Use cases for the Sender-Abort and Receiver-Abort messages are 1525 explained in Section 7.5 or Appendix C. 1527 7.5. Baseline mechanism 1529 If after applying SCHC header compression (or when SCHC header 1530 compression is not possible) the SCHC Packet does not fit within the 1531 payload of a single L2 data unit, the SCHC Packet SHALL be broken 1532 into SCHC Fragments and the fragments SHALL be sent to the fragment 1533 receiver. The fragment receiver needs to identify all the SCHC 1534 Fragments that belong to a given SCHC Packet. To this end, the 1535 receiver SHALL use: 1537 o The sender's L2 source address (if present), 1539 o The destination's L2 address (if present), 1541 o Rule ID, 1543 o DTag (if present). 1545 Then, the fragment receiver MAY determine the SCHC Fragment 1546 reliability mode that is used for this SCHC Fragment based on the 1547 Rule ID in that fragment. 1549 After a SCHC Fragment reception, the receiver starts constructing the 1550 SCHC Packet. It uses the FCN and the arrival order of each SCHC 1551 Fragment to determine the location of the individual fragments within 1552 the SCHC Packet. For example, the receiver MAY place the fragment 1553 payload within a payload reassembly buffer at the location determined 1554 from the FCN, the arrival order of the SCHC Fragments, and the 1555 fragment payload sizes. In ACK-on-Error or ACK-Always, the fragment 1556 receiver also uses the W bit in the received SCHC Fragments. Note 1557 that the size of the original, unfragmented packet cannot be 1558 determined from fragmentation headers. 1560 Fragmentation functionality uses the FCN value to transmit the SCHC 1561 Fragments. It has a length of N bits where the All-1 and All-0 FCN 1562 values are used to control the fragmentation transmission. The rest 1563 of the FCN numbers MUST be assigned sequentially in a decreasing 1564 order, the first FCN of a window is RECOMMENDED to be MAX_WIND_FCN, 1565 i.e. the highest possible FCN value depending on the FCN number of 1566 bits. 1568 In all modes, the last SCHC Fragment of a packet MUST contain a MIC 1569 which is used to check if there are errors or missing SCHC Fragments 1570 and MUST use the corresponding All-1 fragment format. Note that a 1571 SCHC Fragment with an All-0 format is considered the last SCHC 1572 Fragment of the current window. 1574 If the receiver receives the last fragment of a SCHC Packet (All-1), 1575 it checks for the integrity of the reassembled SCHC Packet, based on 1576 the MIC received. In No-ACK, if the integrity check indicates that 1577 the reassembled SCHC Packet does not match the original SCHC Packet 1578 (prior to fragmentation), the reassembled SCHC Packet MUST be 1579 discarded. In ACK-on-Error or ACK-Always, a MIC check is also 1580 performed by the fragment receiver after reception of each subsequent 1581 SCHC Fragment retransmitted after the first MIC check. 1583 Notice that the SCHC ACK for the All-1 window carries one more bit 1584 (the C bit) compared to the SCHC ACKs for the previous windows. See 1585 Appendix D for a discussion on various options to deal with this 1586 "bump" in the SCHC ACK. 1588 There are three reliability modes: No-ACK, ACK-Always and ACK-on- 1589 Error. In ACK-Always and ACK-on-Error, a jumping window protocol 1590 uses two windows alternatively, identified as 0 and 1. A SCHC 1591 Fragment with all FCN bits set to 0 (i.e. an All-0 fragment) 1592 indicates that the window is over (i.e. the SCHC Fragment is the last 1593 one of the window) and allows to switch from one window to the next 1594 one. The All-1 FCN in a SCHC Fragment indicates that it is the last 1595 fragment of the packet being transmitted and therefore there will not 1596 be another window for this packet. 1598 7.5.1. No-ACK 1600 In the No-ACK mode, there is no feedback communication from the 1601 fragment receiver. The sender will send all the SCHC fragments of a 1602 packet without any possibility of knowing if errors or losses have 1603 occurred. As, in this mode, there is no need to identify specific 1604 SCHC Fragments, a one-bit FCN MAY be used. Consequently, the FCN 1605 All-0 value is used in all SCHC fragments except the last one, which 1606 carries an All-1 FCN and the MIC. The receiver will wait for SCHC 1607 Fragments and will set the Inactivity timer. The receiver will use 1608 the MIC contained in the last SCHC Fragment to check for errors. 1609 When the Inactivity Timer expires or if the MIC check indicates that 1610 the reassembled packet does not match the original one, the receiver 1611 will release all resources allocated to reassembling this packet. 1612 The initial value of the Inactivity Timer will be determined based on 1613 the characteristics of the underlying LPWAN technology and will be 1614 defined in other documents (e.g. technology-specific profile 1615 documents). 1617 7.5.2. ACK-Always 1619 In ACK-Always, the sender transmits SCHC Fragments by using the two- 1620 jumping-windows procedure. A delay between each SCHC fragment can be 1621 added to respect local regulations or other constraints imposed by 1622 the applications. Each time a SCHC fragment is sent, the FCN is 1623 decreased by one. When the FCN reaches value 0, if there are more 1624 SCHC Fragments remaining to be sent, the sender transmits the last 1625 SCHC Fragment of this window using the All-0 fragment format. It 1626 then starts the Retransmission Timer and waits for a SCHC ACK. 1627 Otherwise, if FCN reaches 0 and the sender transmits the last SCHC 1628 Fragment of the SCHC Packet, the sender uses the All-1 fragment 1629 format, which includes a MIC. The sender sets the Retransmission 1630 Timer and waits for the SCHC ACK to know if transmission errors have 1631 occurred. 1633 The Retransmission Timer is dimensioned based on the LPWAN technology 1634 in use. When the Retransmission Timer expires, the sender sends an 1635 All-0 empty (resp. All-1 empty) fragment to request again the SCHC 1636 ACK for the window that ended with the All-0 (resp. All-1) fragment 1637 just sent. The window number is not changed. 1639 After receiving an All-0 or All-1 fragment, the receiver sends a SCHC 1640 ACK with an encoded Bitmap reporting whether any SCHC fragments have 1641 been lost or not. When the sender receives a SCHC ACK, it checks the 1642 W bit carried by the SCHC ACK. Any SCHC ACK carrying an unexpected W 1643 bit value is discarded. If the W bit value of the received SCHC ACK 1644 is correct, the sender analyzes the rest of the SCHC ACK message, 1645 such as the encoded Bitmap and the MIC. If all the SCHC Fragments 1646 sent for this window have been well received, and if at least one 1647 more SCHC Fragment needs to be sent, the sender advances its sending 1648 window to the next window value and sends the next SCHC Fragments. 1649 If no more SCHC Fragments have to be sent, then the fragmented SCHC 1650 Packet transmission is finished. 1652 However, if one or more SCHC Fragments have not been received as per 1653 the SCHC ACK (i.e. the corresponding bits are not set in the encoded 1654 Bitmap) then the sender resends the missing SCHC Fragments. When all 1655 missing SCHC Fragments have been retransmitted, the sender starts the 1656 Retransmission Timer, even if an All-0 or an All-1 has not been sent 1657 as part of this retransmission and waits for a SCHC ACK. Upon 1658 receipt of the SCHC ACK, if one or more SCHC Fragments have not yet 1659 been received, the counter Attempts is increased and the sender 1660 resends the missing SCHC Fragments again. When Attempts reaches 1661 MAX_ACK_REQUESTS, the sender aborts the on-going fragmented SCHC 1662 Packet transmission by sending a Sender-Abort message and releases 1663 any resources for transmission of the packet. The sender also aborts 1664 an on-going fragmented SCHC Packet transmission when a failed MIC 1665 check is reported by the receiver or when a SCHC Fragment that has 1666 not been sent is reported in the encoded Bitmap. 1668 On the other hand, at the beginning, the receiver side expects to 1669 receive window 0. Any SCHC Fragment received but not belonging to 1670 the current window is discarded. All SCHC Fragments belonging to the 1671 correct window are accepted, and the actual SCHC Fragment number 1672 managed by the receiver is computed based on the FCN value. The 1673 receiver prepares the encoded Bitmap to report the correctly received 1674 and the missing SCHC Fragments for the current window. After each 1675 SCHC Fragment is received, the receiver initializes the Inactivity 1676 Timer. When the Inactivity Timer expires, the transmission is 1677 aborted by the receiver sending a Receiver-Abort message. 1679 When an All-0 fragment is received, it indicates that all the SCHC 1680 Fragments have been sent in the current window. Since the sender is 1681 not obliged to always send a full window, some SCHC Fragment number 1682 not set in the receiver memory SHOULD not correspond to losses. The 1683 receiver sends the corresponding SCHC ACK, the Inactivity Timer is 1684 set and the transmission of the next window by the sender can start. 1686 If an All-0 fragment has been received and all SCHC Fragments of the 1687 current window have also been received, the receiver then expects a 1688 new Window and waits for the next SCHC Fragment. Upon receipt of a 1689 SCHC Fragment, if the window value has not changed, the received SCHC 1690 Fragments are part of a retransmission. A receiver that has already 1691 received a SCHC Fragment SHOULD discard it, otherwise, it updates the 1692 encoded Bitmap. If all the bits of the encoded Bitmap are set to 1693 one, the receiver MUST send a SCHC ACK without waiting for an All-0 1694 fragment and the Inactivity Timer is initialized. 1696 On the other hand, if the window value of the next received SCHC 1697 Fragment is set to the next expected window value, this means that 1698 the sender has received a correct encoded Bitmap reporting that all 1699 SCHC Fragments have been received. The receiver then updates the 1700 value of the next expected window. 1702 When an All-1 fragment is received, it indicates that the last SCHC 1703 Fragment of the packet has been sent. Since the last window is not 1704 always full, the MIC will be used by the receiver to detect if all 1705 SCHC Fragments of the packet have been received. A correct MIC 1706 indicates the end of the transmission but the receiver MUST stay 1707 alive for an Inactivity Timer period to answer to any empty All-1 1708 fragments the sender MAY send if SCHC ACKs sent by the receiver are 1709 lost. If the MIC is incorrect, some SCHC Fragments have been lost. 1710 The receiver sends the SCHC ACK regardless of successful fragmented 1711 SCHC Packet reception or not, the Inactitivity Timer is set. In case 1712 of an incorrect MIC, the receiver waits for SCHC Fragments belonging 1713 to the same window. After MAX_ACK_REQUESTS, the receiver will abort 1714 the on-going fragmented SCHC Packet transmission by transmitting a 1715 the Receiver-Abort format. The receiver also aborts upon Inactivity 1716 Timer expiration by sending a Receiver-Abort message. 1718 If the sender receives a SCK ACK with a Bitmap containing a bit set 1719 for a SCHC Fragment that it has not sent during the transmission 1720 phase of this window, it MUST abort the whole fragmentation and 1721 transmission of this SCHC Packet. 1723 7.5.3. ACK-on-Error 1725 The senders behavior for ACK-on-Error and ACK-Always are similar. 1726 The main difference is that in ACK-on-Error the SCHC ACK with the 1727 encoded Bitmap is not sent at the end of each window but only when at 1728 least one SCHC Fragment of the current window has been lost. Except 1729 for the last window where a SCHC ACK MUST be sent to finish the 1730 transmission. 1732 In ACK-on-Error, the Retransmission Timer expiration is considered as 1733 a positive acknowledgement for all windows but the last one. This 1734 timer is set after sending an All-0 or an All-1 fragment. For an 1735 All-0 fragment, on timer expiration, the sender resumes operation and 1736 sends the SCHC Fragments of the next window. 1738 If the sender receives a SCHC ACK, it checks the window value. SCHC 1739 ACKs with an unexpected window number are discarded. If the window 1740 number on the received encoded Bitmap is correct, the sender verifies 1741 if the receiver has received all SCHC fragments of the current 1742 window. When at least one SCHC Fragment has been lost, the counter 1743 Attempts is increased by one and the sender resends the missing SCHC 1744 Fragments again. When Attempts reaches MAX_ACK_REQUESTS, the sender 1745 sends a Sender-Abort message and releases all resources for the on- 1746 going fragmented SCHC Packet transmission. When the retransmission 1747 of the missing SCHC Fragments is finished, the sender starts 1748 listening for a SCHC ACK (even if an All-0 or an All-1 has not been 1749 sent during the retransmission) and initializes the Retransmission 1750 Timer. 1752 After sending an All-1 fragment, the sender listens for a SCHC ACK, 1753 initializes Attempts, and starts the Retransmission Timer. If the 1754 Retransmission Timer expires, Attempts is increased by one and an 1755 empty All-1 fragment is sent to request the SCHC ACK for the last 1756 window. If Attempts reaches MAX_ACK_REQUESTS, the sender aborts the 1757 on-going fragmented SCHC Packet transmission by transmitting the 1758 Sender-Abort fragment. 1760 At the end of any window, if the sender receives a SCK ACK with a 1761 Bitmap containing a bit set for a SCHC Fragment that it has not sent 1762 during the transmission phase of that window, it MUST abort the whole 1763 fragmentation and transmission of this SCHC Packet. 1765 Unlike the sender, the receiver for ACK-on-Error has a larger amount 1766 of differences compared with ACK-Always. First, a SCHC ACK is not 1767 sent unless there is a lost SCHC Fragment or an unexpected behavior. 1768 With the exception of the last window, where a SCHC ACK is always 1769 sent regardless of SCHC Fragment losses or not. The receiver starts 1770 by expecting SCHC Fragments from window 0 and maintains the 1771 information regarding which SCHC Fragments it receives. After 1772 receiving a SCHC Fragment, the Inactivity Timer is set. If no 1773 further SCHC Fragment are received and the Inactivity Timer expires, 1774 the SCHC Fragment receiver aborts the on-going fragmented SCHC Packet 1775 transmission by transmitting the Receiver-Abort data unit. 1777 Any SCHC Fragment not belonging to the current window is discarded. 1778 The actual SCHC Fragment number is computed based on the FCN value. 1779 When an All-0 fragment is received and all SCHC Fragments have been 1780 received, the receiver updates the expected window value and expects 1781 a new window and waits for the next SCHC Fragment. 1782 If the window value of the next SCHC Fragment has not changed, the 1783 received SCHC Fragment is a retransmission. A receiver that has 1784 already received a Fragment discard it. If all SCHC Fragments of a 1785 window (that is not the last one) have been received, the receiver 1786 does not send a SCHC ACK. While the receiver waits for the next 1787 window and if the window value is set to the next value, and if an 1788 All-1 fragment with the next value window arrived the receiver knows 1789 that the last SCHC Fragment of the packet has been sent. Since the 1790 last window is not always full, the MIC will be used to detect if all 1791 SCHC Fragments of the window have been received. A correct MIC check 1792 indicates the end of the fragmented SCHC Packet transmission. An ACK 1793 is sent by the SCHC Fragment receiver. In case of an incorrect MIC, 1794 the receiver waits for SCHC Fragments belonging to the same window or 1795 the expiration of the Inactivity Timer. The latter will lead the 1796 receiver to abort the on-going SCHC fragmented packet transmission by 1797 transmitting the Receiver-Abort message. 1799 If, after receiving an All-0 fragment the receiver missed some SCHC 1800 Fragments, the receiver uses a SCHC ACK with the encoded Bitmap to 1801 ask the retransmission of the missing fragments and expect to receive 1802 SCHC Fragments with the actual window. While waiting the 1803 retransmission an All-0 empty fragment is received, the receiver 1804 sends again the SCHC ACK with the encoded Bitmap, if the SCHC 1805 Fragments received belongs to another window or an All-1 fragment is 1806 received, the transmission is aborted by sending a Receiver-Abort 1807 fragment. Once it has received all the missing fragments it waits 1808 for the next window fragments. 1810 7.6. Supporting multiple window sizes 1812 For ACK-Always or ACK-on-Error, implementers MAY opt to support a 1813 single window size or multiple window sizes. The latter, when 1814 feasible, may provide performance optimizations. For example, a 1815 large window size SHOULD be used for packets that need to be carried 1816 by a large number of SCHC Fragments. However, when the number of 1817 SCHC Fragments required to carry a packet is low, a smaller window 1818 size, and thus a shorter Bitmap, MAY be sufficient to provide 1819 feedback on all SCHC Fragments. If multiple window sizes are 1820 supported, the Rule ID MAY be used to signal the window size in use 1821 for a specific packet transmission. 1823 Note that the same window size MUST be used for the transmission of 1824 all SCHC Fragments that belong to the same SCHC Packet. 1826 7.7. Downlink SCHC Fragment transmission 1828 In some LPWAN technologies, as part of energy-saving techniques, 1829 downlink transmission is only possible immediately after an uplink 1830 transmission. In order to avoid potentially high delay in the 1831 downlink transmission of a fragmented SCHC Packet, the SCHC Fragment 1832 receiver MAY perform an uplink transmission as soon as possible after 1833 reception of a SCHC Fragment that is not the last one. Such uplink 1834 transmission MAY be triggered by the L2 (e.g. an L2 ACK sent in 1835 response to a SCHC Fragment encapsulated in a L2 frame that requires 1836 an L2 ACK) or it MAY be triggered from an upper layer. 1838 For downlink transmission of a fragmented SCHC Packet in ACK-Always 1839 mode, the SCHC Fragment receiver MAY support timer-based SCHC ACK 1840 retransmission. In this mechanism, the SCHC Fragment receiver 1841 initializes and starts a timer (the Inactivity Timer is used) after 1842 the transmission of a SCHC ACK, except when the SCHC ACK is sent in 1843 response to the last SCHC Fragment of a packet (All-1 fragment). In 1844 the latter case, the SCHC Fragment receiver does not start a timer 1845 after transmission of the SCHC ACK. 1847 If, after transmission of a SCHC ACK that is not an All-1 fragment, 1848 and before expiration of the corresponding Inactivity timer, the SCHC 1849 Fragment receiver receives a SCHC Fragment that belongs to the 1850 current window (e.g. a missing SCHC Fragment from the current window) 1851 or to the next window, the Inactivity timer for the SCHC ACK is 1852 stopped. However, if the Inactivity timer expires, the SCHC ACK is 1853 resent and the Inactivity timer is reinitialized and restarted. 1855 The default initial value for the Inactivity timer, as well as the 1856 maximum number of retries for a specific SCHC ACK, denoted 1857 MAX_ACK_RETRIES, are not defined in this document, and need to be 1858 defined in other documents (e.g. technology-specific profiles). The 1859 initial value of the Inactivity timer is expected to be greater than 1860 that of the Retransmission timer, in order to make sure that a 1861 (buffered) SCHC Fragment to be retransmitted can find an opportunity 1862 for that transmission. 1864 When the SCHC Fragment sender transmits the All-1 fragment, it starts 1865 its Retransmission Timer with a large timeout value (e.g. several 1866 times that of the initial Inactivity timer). If a SCHC ACK is 1867 received before expiration of this timer, the SCHC Fragment sender 1868 retransmits any lost SCHC Fragments reported by the SCHC ACK, or if 1869 the SCHC ACK confirms successful reception of all SCHC Fragments of 1870 the last window, the transmission of the fragmented SCHC Packet is 1871 considered complete. If the timer expires, and no SCHC ACK has been 1872 received since the start of the timer, the SCHC Fragment sender 1873 assumes that the All-1 fragment has been successfully received (and 1874 possibly, the last SCHC ACK has been lost: this mechanism assumes 1875 that the retransmission timer for the All-1 fragment is long enough 1876 to allow several SCHC ACK retries if the All-1 fragment has not;been 1877 received by the SCHC Fragment receiver, and it also assumes that it 1878 is unlikely that several ACKs become all lost). 1880 8. Padding management 1882 SCHC C/D and SCHC F/R operate on bits, not bytes. SCHC itself does 1883 not have any alignment prerequisite. If the Layer 2 below SCHC 1884 constrains the L2 Data Unit to align to some boundary, called L2 1885 Words (for example, bytes), SCHC will meet that constraint and 1886 produce messages with the correct alignement. This may entail adding 1887 extra bits (called padding bits). 1889 When padding occurs, the number of appended bits is strictly less 1890 than the L2 Word size. 1892 Padding happens at most once for each Packet going through the full 1893 SCHC chain, i.e. Compression and (optionally) SCHC Fragmentation (see 1894 Figure 2). If a SCHC Packet is sent unfragmented (see Figure 27), it 1895 is padded as needed. If a SCHC Packet is fragmented, only the last 1896 fragment is padded as needed. 1898 A packet (e.g. an IPv6 packet) 1899 | ^ (padding bits 1900 v | dropped) 1901 +------------------+ +--------------------+ 1902 | SCHC Compression | | SCHC Decompression | 1903 +------------------+ +--------------------+ 1904 | ^ 1905 | If no fragmentation | 1906 +---- SCHC Packet + padding as needed ----->| 1907 | | (MIC checked 1908 v | and removed) 1909 +--------------------+ +-----------------+ 1910 | SCHC Fragmentation | | SCHC Reassembly | 1911 +--------------------+ +-----------------+ 1912 | ^ | ^ 1913 | | | | 1914 | +------------- SCHC ACK ------------+ | 1915 | | 1916 +--------------- SCHC Fragments --------------------+ 1917 +--- last SCHC Frag with MIC + padding as needed ---+ 1919 SENDER RECEIVER 1921 Figure 27: SCHC operations, including padding as needed 1923 Each technology-specific document MUST specify the size of the L2 1924 Word. The L2 Word might actually be a single bit, in which case at 1925 most zero bits of padding will be appended to any message, i.e. no 1926 padding will take place at all. 1928 9. SCHC Compression for IPv6 and UDP headers 1930 This section lists the different IPv6 and UDP header fields and how 1931 they can be compressed. 1933 9.1. IPv6 version field 1935 This field always holds the same value. Therefore, in the Rule, TV 1936 is set to 6, MO to "equal" and CDA to "not-sent". 1938 9.2. IPv6 Traffic class field 1940 If the DiffServ field does not vary and is known by both sides, the 1941 Field Descriptor in the Rule SHOULD contain a TV with this well-known 1942 value, an "equal" MO and a "not-sent" CDA. 1944 Otherwise, two possibilities can be considered depending on the 1945 variability of the value: 1947 o One possibility is to not compress the field and send the original 1948 value. In the Rule, TV is not set to any particular value, MO is 1949 set to "ignore" and CDA is set to "value-sent". 1951 o If some upper bits in the field are constant and known, a better 1952 option is to only send the LSBs. In the Rule, TV is set to a 1953 value with the stable known upper part, MO is set to MSB(x) and 1954 CDA to LSB(y). 1956 9.3. Flow label field 1958 If the Flow Label field does not vary and is known by both sides, the 1959 Field Descriptor in the Rule SHOULD contain a TV with this well-known 1960 value, an "equal" MO and a "not-sent" CDA. 1962 Otherwise, two possibilities can be considered: 1964 o One possibility is to not compress the field and send the original 1965 value. In the Rule, TV is not set to any particular value, MO is 1966 set to "ignore" and CDA is set to "value-sent". 1968 o If some upper bits in the field are constant and known, a better 1969 option is to only send the LSBs. In the Rule, TV is set to a 1970 value with the stable known upper part, MO is set to MSB(x) and 1971 CDA to LSB(y). 1973 9.4. Payload Length field 1975 This field can be elided for the transmission on the LPWAN network. 1976 The SCHC C/D recomputes the original payload length value. In the 1977 Field Descriptor, TV is not set, MO is set to "ignore" and CDA is 1978 "compute-IPv6-length". 1980 If the payload length needs to be sent and does not need to be coded 1981 in 16 bits, the TV can be set to 0x0000, the MO set to MSB(16-s) 1982 where 's' is the number of bits to code the maximum length, and CDA 1983 is set to LSB(s). 1985 9.5. Next Header field 1987 If the Next Header field does not vary and is known by both sides, 1988 the Field Descriptor in the Rule SHOULD contain a TV with this Next 1989 Header value, the MO SHOULD be "equal" and the CDA SHOULD be "not- 1990 sent". 1992 Otherwise, TV is not set in the Field Descriptor, MO is set to 1993 "ignore" and CDA is set to "value-sent". Alternatively, a matching- 1994 list MAY also be used. 1996 9.6. Hop Limit field 1998 The field behavior for this field is different for Uplink and 1999 Downlink. In Uplink, since there is no IP forwarding between the Dev 2000 and the SCHC C/D, the value is relatively constant. On the other 2001 hand, the Downlink value depends of Internet routing and MAY change 2002 more frequently. One neat way of processing this field is to use the 2003 Direction Indicator (DI) to distinguish both directions: 2005 o in the Uplink, elide the field: the TV in the Field Descriptor is 2006 set to the known constant value, the MO is set to "equal" and the 2007 CDA is set to "not-sent". 2009 o in the Downlink, send the value: TV is not set, MO is set to 2010 "ignore" and CDA is set to "value-sent". 2012 9.7. IPv6 addresses fields 2014 As in 6LoWPAN [RFC4944], IPv6 addresses are split into two 64-bit 2015 long fields; one for the prefix and one for the Interface Identifier 2016 (IID). These fields SHOULD be compressed. To allow for a single 2017 Rule being used for both directions, these values are identified by 2018 their role (DEV or APP) and not by their position in the frame 2019 (source or destination). 2021 9.7.1. IPv6 source and destination prefixes 2023 Both ends MUST be synchronized with the appropriate prefixes. For a 2024 specific flow, the source and destination prefixes can be unique and 2025 stored in the context. It can be either a link-local prefix or a 2026 global prefix. In that case, the TV for the source and destination 2027 prefixes contain the values, the MO is set to "equal" and the CDA is 2028 set to "not-sent". 2030 If the Rule is intended to compress packets with different prefix 2031 values, match-mapping SHOULD be used. The different prefixes are 2032 listed in the TV, the MO is set to "match-mapping" and the CDA is set 2033 to "mapping-sent". See Figure 29 2035 Otherwise, the TV contains the prefix, the MO is set to "equal" and 2036 the CDA is set to "value-sent". 2038 9.7.2. IPv6 source and destination IID 2040 If the DEV or APP IID are based on an LPWAN address, then the IID can 2041 be reconstructed with information coming from the LPWAN header. In 2042 that case, the TV is not set, the MO is set to "ignore" and the CDA 2043 is set to "DevIID" or "AppIID". Note that the LPWAN technology 2044 generally carries a single identifier corresponding to the DEV. 2045 Therefore AppIID cannot be used. 2047 For privacy reasons or if the DEV address is changing over time, a 2048 static value that is not equal to the DEV address SHOULD be used. In 2049 that case, the TV contains the static value, the MO operator is set 2050 to "equal" and the CDF is set to "not-sent". [RFC7217] provides some 2051 methods that MAY be used to derive this static identifier. 2053 If several IIDs are possible, then the TV contains the list of 2054 possible IIDs, the MO is set to "match-mapping" and the CDA is set to 2055 "mapping-sent". 2057 It MAY also happen that the IID variability only expresses itself on 2058 a few bytes. In that case, the TV is set to the stable part of the 2059 IID, the MO is set to "MSB" and the CDA is set to "LSB". 2061 Finally, the IID can be sent in extenso on the LPWAN. In that case, 2062 the TV is not set, the MO is set to "ignore" and the CDA is set to 2063 "value-sent". 2065 9.8. IPv6 extensions 2067 No Rule is currently defined that processes IPv6 extensions. If such 2068 extensions are needed, their compression/decompression Rules can be 2069 based on the MOs and CDAs described above. 2071 9.9. UDP source and destination port 2073 To allow for a single Rule being used for both directions, the UDP 2074 port values are identified by their role (DEV or APP) and not by 2075 their position in the frame (source or destination). The SCHC C/D 2076 MUST be aware of the traffic direction (Uplink, Downlink) to select 2077 the appropriate field. The following Rules apply for DEV and APP 2078 port numbers. 2080 If both ends know the port number, it can be elided. The TV contains 2081 the port number, the MO is set to "equal" and the CDA is set to "not- 2082 sent". 2084 If the port variation is on few bits, the TV contains the stable part 2085 of the port number, the MO is set to "MSB" and the CDA is set to 2086 "LSB". 2088 If some well-known values are used, the TV can contain the list of 2089 these values, the MO is set to "match-mapping" and the CDA is set to 2090 "mapping-sent". 2092 Otherwise the port numbers are sent over the LPWAN. The TV is not 2093 set, the MO is set to "ignore" and the CDA is set to "value-sent". 2095 9.10. UDP length field 2097 The UDP length can be computed from the received data. In that case, 2098 the TV is not set, the MO is set to "ignore" and the CDA is set to 2099 "compute-length". 2101 If the payload is small, the TV can be set to 0x0000, the MO set to 2102 "MSB" and the CDA to "LSB". 2104 In other cases, the length SHOULD be sent and the CDA is replaced by 2105 "value-sent". 2107 9.11. UDP Checksum field 2109 The UDP checksum operation is mandatory with IPv6 [RFC8200] for most 2110 packets but recognizes that there are exceptions to that default 2111 behavior. 2113 For instance, protocols that use UDP as a tunnel encapsulation may 2114 enable zero-checksum mode for a specific port (or set of ports) for 2115 sending and/or receiving. [RFC8200] also stipulates that any node 2116 implementing zero-checksum mode must follow the requirements 2117 specified in "Applicability Statement for the Use of IPv6 UDP 2118 Datagrams with Zero Checksums" [RFC6936]. 2120 6LoWPAN Header Compression [RFC6282] also authorizes to send UDP 2121 datagram that are deprived of the checksum protection when an upper 2122 layer guarantees the integrity of the UDP payload and pseudo-header 2123 all the way between the compressor that elides the UDP checksum and 2124 the decompressor that computes again it. A specific example of this 2125 is when a Message Integrity Check (MIC) protects the compressed 2126 message all along that path with a strength that is identical or 2127 better to the UDP checksum. 2129 In a similar fashion, this specification allows a SCHC compressor to 2130 elide the UDP checks when another layer guarantees an identical or 2131 better integrity protection for the UDP payload and the pseudo- 2132 header. In this case, the TV is not set, the MO is set to "ignore" 2133 and the CDA is set to "compute-checksum". 2135 In particular, when SCHC fragmentation is used, a fragmentation MIC 2136 of 2 bytes or more provides equal or better protection than the UDP 2137 checksum; in that case, if the compressor is collocated with the 2138 fragmentation point and the decompressor is collocated with the 2139 packet reassembly point, then compressor MAY elide the UDP checksum. 2140 Whether and when the UDP Checksum is elided is to be specified in the 2141 technology-specific documents. 2143 Since the compression happens before the fragmentation, implementors 2144 should understand the risks when dealing with unprotected data below 2145 the transport layer and take special care when manipulating that 2146 data. 2148 In other cases, the checksum SHOULD be explicitly sent. The TV is 2149 not set, the MO is set to "ignore" and the CDA is set to "value- 2150 sent". 2152 10. Security considerations 2154 10.1. Security considerations for SCHC Compression/Decompression 2156 A malicious header compression could cause the reconstruction of a 2157 wrong packet that does not match with the original one. Such a 2158 corruption MAY be detected with end-to-end authentication and 2159 integrity mechanisms. Header Compression does not add more security 2160 problem than what is already needed in a transmission. For instance, 2161 to avoid an attack, never re-construct a packet bigger than some 2162 configured size (with 1500 bytes as generic default). 2164 10.2. Security considerations for SCHC Fragmentation/Reassembly 2166 This subsection describes potential attacks to LPWAN SCHC F/R and 2167 suggests possible countermeasures. 2169 A node can perform a buffer reservation attack by sending a first 2170 SCHC Fragment to a target. Then, the receiver will reserve buffer 2171 space for the IPv6 packet. Other incoming fragmented SCHC Packets 2172 will be dropped while the reassembly buffer is occupied during the 2173 reassembly timeout. Once that timeout expires, the attacker can 2174 repeat the same procedure, and iterate, thus creating a denial of 2175 service attack. The (low) cost to mount this attack is linear with 2176 the number of buffers at the target node. However, the cost for an 2177 attacker can be increased if individual SCHC Fragments of multiple 2178 packets can be stored in the reassembly buffer. To further increase 2179 the attack cost, the reassembly buffer can be split into SCHC 2180 Fragment-sized buffer slots. Once a packet is complete, it is 2181 processed normally. If buffer overload occurs, a receiver can 2182 discard packets based on the sender behavior, which MAY help identify 2183 which SCHC Fragments have been sent by an attacker. 2185 In another type of attack, the malicious node is required to have 2186 overhearing capabilities. If an attacker can overhear a SCHC 2187 Fragment, it can send a spoofed duplicate (e.g. with random payload) 2188 to the destination. If the LPWAN technology does not support 2189 suitable protection (e.g. source authentication and frame counters to 2190 prevent replay attacks), a receiver cannot distinguish legitimate 2191 from spoofed SCHC Fragments. Therefore, the original IPv6 packet 2192 will be considered corrupt and will be dropped. To protect resource- 2193 constrained nodes from this attack, it has been proposed to establish 2194 a binding among the SCHC Fragments to be transmitted by a node, by 2195 applying content-chaining to the different SCHC Fragments, based on 2196 cryptographic hash functionality. The aim of this technique is to 2197 allow a receiver to identify illegitimate SCHC Fragments. 2199 Further attacks MAY involve sending overlapped fragments (i.e. 2200 comprising some overlapping parts of the original IPv6 datagram). 2201 Implementers SHOULD make sure that the correct operation is not 2202 affected by such event. 2204 In ACK-on-Error, a malicious node MAY force a SCHC Fragment sender to 2205 resend a SCHC Fragment a number of times, with the aim to increase 2206 consumption of the SCHC Fragment sender's resources. To this end, 2207 the malicious node MAY repeatedly send a fake ACK to the SCHC 2208 Fragment sender, with a Bitmap that reports that one or more SCHC 2209 Fragments have been lost. In order to mitigate this possible attack, 2210 MAX_ACK_RETRIES MAY be set to a safe value which allows to limit the 2211 maximum damage of the attack to an acceptable extent. However, note 2212 that a high setting for MAX_ACK_RETRIES benefits SCHC Fragment 2213 reliability modes, therefore the trade-off needs to be carefully 2214 considered. 2216 11. Acknowledgements 2218 Thanks to Carsten Bormann, Philippe Clavier, Eduardo Ingles Sanchez, 2219 Arunprabhu Kandasamy, Rahul Jadhav, Sergio Lopez Bernal, Antony 2220 Markovski, Alexander Pelov, Pascal Thubert, Juan Carlos Zuniga, Diego 2221 Dujovne, Edgar Ramos, and Shoichi Sakane for useful design 2222 consideration and comments. 2224 12. References 2226 12.1. Normative References 2228 [RFC2460] Deering, S. and R. Hinden, "Internet Protocol, Version 6 2229 (IPv6) Specification", RFC 2460, DOI 10.17487/RFC2460, 2230 December 1998, . 2232 [RFC3385] Sheinwald, D., Satran, J., Thaler, P., and V. Cavanna, 2233 "Internet Protocol Small Computer System Interface (iSCSI) 2234 Cyclic Redundancy Check (CRC)/Checksum Considerations", 2235 RFC 3385, DOI 10.17487/RFC3385, September 2002, 2236 . 2238 [RFC4944] Montenegro, G., Kushalnagar, N., Hui, J., and D. Culler, 2239 "Transmission of IPv6 Packets over IEEE 802.15.4 2240 Networks", RFC 4944, DOI 10.17487/RFC4944, September 2007, 2241 . 2243 [RFC5795] Sandlund, K., Pelletier, G., and L-E. Jonsson, "The RObust 2244 Header Compression (ROHC) Framework", RFC 5795, 2245 DOI 10.17487/RFC5795, March 2010, 2246 . 2248 [RFC6936] Fairhurst, G. and M. Westerlund, "Applicability Statement 2249 for the Use of IPv6 UDP Datagrams with Zero Checksums", 2250 RFC 6936, DOI 10.17487/RFC6936, April 2013, 2251 . 2253 [RFC7136] Carpenter, B. and S. Jiang, "Significance of IPv6 2254 Interface Identifiers", RFC 7136, DOI 10.17487/RFC7136, 2255 February 2014, . 2257 [RFC7217] Gont, F., "A Method for Generating Semantically Opaque 2258 Interface Identifiers with IPv6 Stateless Address 2259 Autoconfiguration (SLAAC)", RFC 7217, 2260 DOI 10.17487/RFC7217, April 2014, 2261 . 2263 [RFC8200] Deering, S. and R. Hinden, "Internet Protocol, Version 6 2264 (IPv6) Specification", STD 86, RFC 8200, 2265 DOI 10.17487/RFC8200, July 2017, 2266 . 2268 12.2. Informative References 2270 [RFC6282] Hui, J., Ed. and P. Thubert, "Compression Format for IPv6 2271 Datagrams over IEEE 802.15.4-Based Networks", RFC 6282, 2272 DOI 10.17487/RFC6282, September 2011, 2273 . 2275 [RFC8376] Farrell, S., Ed., "Low-Power Wide Area Network (LPWAN) 2276 Overview", RFC 8376, DOI 10.17487/RFC8376, May 2018, 2277 . 2279 Appendix A. SCHC Compression Examples 2281 This section gives some scenarios of the compression mechanism for 2282 IPv6/UDP. The goal is to illustrate the behavior of SCHC. 2284 The most common case using the mechanisms defined in this document 2285 will be a LPWAN Dev that embeds some applications running over CoAP. 2286 In this example, three flows are considered. The first flow is for 2287 the device management based on CoAP using Link Local IPv6 addresses 2288 and UDP ports 123 and 124 for Dev and App, respectively. The second 2289 flow will be a CoAP server for measurements done by the Device (using 2290 ports 5683) and Global IPv6 Address prefixes alpha::IID/64 to 2291 beta::1/64. The last flow is for legacy applications using different 2292 ports numbers, the destination IPv6 address prefix is gamma::1/64. 2294 Figure 28 presents the protocol stack for this Device. IPv6 and UDP 2295 are represented with dotted lines since these protocols are 2296 compressed on the radio link. 2298 Management Data 2299 +----------+---------+---------+ 2300 | CoAP | CoAP | legacy | 2301 +----||----+---||----+---||----+ 2302 . UDP . UDP | UDP | 2303 ................................ 2304 . IPv6 . IPv6 . IPv6 . 2305 +------------------------------+ 2306 | SCHC Header compression | 2307 | and fragmentation | 2308 +------------------------------+ 2309 | LPWAN L2 technologies | 2310 +------------------------------+ 2311 DEV or NGW 2313 Figure 28: Simplified Protocol Stack for LP-WAN 2315 Note that in some LPWAN technologies, only the Devs have a device ID. 2316 Therefore, when such technologies are used, it is necessary to 2317 statically define an IID for the Link Local address for the SCHC C/D. 2319 Rule 0 2320 +----------------+--+--+--+---------+--------+------------++------+ 2321 | Field |FL|FP|DI| Value | Match | Comp Decomp|| Sent | 2322 | | | | | | Opera. | Action ||[bits]| 2323 +----------------+--+--+--+---------+---------------------++------+ 2324 |IPv6 version |4 |1 |Bi|6 | equal | not-sent || | 2325 |IPv6 DiffServ |8 |1 |Bi|0 | equal | not-sent || | 2326 |IPv6 Flow Label |20|1 |Bi|0 | equal | not-sent || | 2327 |IPv6 Length |16|1 |Bi| | ignore | comp-length|| | 2328 |IPv6 Next Header|8 |1 |Bi|17 | equal | not-sent || | 2329 |IPv6 Hop Limit |8 |1 |Bi|255 | ignore | not-sent || | 2330 |IPv6 DEVprefix |64|1 |Bi|FE80::/64| equal | not-sent || | 2331 |IPv6 DevIID |64|1 |Bi| | ignore | DevIID || | 2332 |IPv6 APPprefix |64|1 |Bi|FE80::/64| equal | not-sent || | 2333 |IPv6 AppIID |64|1 |Bi|::1 | equal | not-sent || | 2334 +================+==+==+==+=========+========+============++======+ 2335 |UDP DEVport |16|1 |Bi|123 | equal | not-sent || | 2336 |UDP APPport |16|1 |Bi|124 | equal | not-sent || | 2337 |UDP Length |16|1 |Bi| | ignore | comp-length|| | 2338 |UDP checksum |16|1 |Bi| | ignore | comp-chk || | 2339 +================+==+==+==+=========+========+============++======+ 2341 Rule 1 2342 +----------------+--+--+--+---------+--------+------------++------+ 2343 | Field |FL|FP|DI| Value | Match | Action || Sent | 2344 | | | | | | Opera. | Action ||[bits]| 2345 +----------------+--+--+--+---------+--------+------------++------+ 2346 |IPv6 version |4 |1 |Bi|6 | equal | not-sent || | 2347 |IPv6 DiffServ |8 |1 |Bi|0 | equal | not-sent || | 2348 |IPv6 Flow Label |20|1 |Bi|0 | equal | not-sent || | 2349 |IPv6 Length |16|1 |Bi| | ignore | comp-length|| | 2350 |IPv6 Next Header|8 |1 |Bi|17 | equal | not-sent || | 2351 |IPv6 Hop Limit |8 |1 |Bi|255 | ignore | not-sent || | 2352 |IPv6 DEVprefix |64|1 |Bi|[alpha/64, match- |mapping-sent|| [1] | 2353 | | | | |fe80::/64] mapping| || | 2354 |IPv6 DevIID |64|1 |Bi| | ignore | DevIID || | 2355 |IPv6 APPprefix |64|1 |Bi|[beta/64,| match- |mapping-sent|| [2] | 2356 | | | | |alpha/64,| mapping| || | 2357 | | | | |fe80::64]| | || | 2358 |IPv6 AppIID |64|1 |Bi|::1000 | equal | not-sent || | 2359 +================+==+==+==+=========+========+============++======+ 2360 |UDP DEVport |16|1 |Bi|5683 | equal | not-sent || | 2361 |UDP APPport |16|1 |Bi|5683 | equal | not-sent || | 2362 |UDP Length |16|1 |Bi| | ignore | comp-length|| | 2363 |UDP checksum |16|1 |Bi| | ignore | comp-chk || | 2364 +================+==+==+==+=========+========+============++======+ 2366 Rule 2 2367 +----------------+--+--+--+---------+--------+------------++------+ 2368 | Field |FL|FP|DI| Value | Match | Action || Sent | 2369 | | | | | | Opera. | Action ||[bits]| 2370 +----------------+--+--+--+---------+--------+------------++------+ 2371 |IPv6 version |4 |1 |Bi|6 | equal | not-sent || | 2372 |IPv6 DiffServ |8 |1 |Bi|0 | equal | not-sent || | 2373 |IPv6 Flow Label |20|1 |Bi|0 | equal | not-sent || | 2374 |IPv6 Length |16|1 |Bi| | ignore | comp-length|| | 2375 |IPv6 Next Header|8 |1 |Bi|17 | equal | not-sent || | 2376 |IPv6 Hop Limit |8 |1 |Up|255 | ignore | not-sent || | 2377 |IPv6 Hop Limit |8 |1 |Dw| | ignore | value-sent || [8] | 2378 |IPv6 DEVprefix |64|1 |Bi|alpha/64 | equal | not-sent || | 2379 |IPv6 DevIID |64|1 |Bi| | ignore | DevIID || | 2380 |IPv6 APPprefix |64|1 |Bi|gamma/64 | equal | not-sent || | 2381 |IPv6 AppIID |64|1 |Bi|::1000 | equal | not-sent || | 2382 +================+==+==+==+=========+========+============++======+ 2383 |UDP DEVport |16|1 |Bi|8720 | MSB(12)| LSB || [4] | 2384 |UDP APPport |16|1 |Bi|8720 | MSB(12)| LSB || [4] | 2385 |UDP Length |16|1 |Bi| | ignore | comp-length|| | 2386 |UDP checksum |16|1 |Bi| | ignore | comp-chk || | 2387 +================+==+==+==+=========+========+============++======+ 2389 Figure 29: Context Rules 2391 All the fields described in the three Rules depicted on Figure 29 are 2392 present in the IPv6 and UDP headers. The DevIID-DID value is found 2393 in the L2 header. 2395 The second and third Rules use global addresses. The way the Dev 2396 learns the prefix is not in the scope of the document. 2398 The third Rule compresses port numbers to 4 bits. 2400 Appendix B. Fragmentation Examples 2402 This section provides examples for the different fragment reliability 2403 modes specified in this document. 2405 Figure 30 illustrates the transmission in No-ACK mode of an IPv6 2406 packet that needs 11 fragments. FCN is 1 bit wide. 2408 Sender Receiver 2409 |-------FCN=0-------->| 2410 |-------FCN=0-------->| 2411 |-------FCN=0-------->| 2412 |-------FCN=0-------->| 2413 |-------FCN=0-------->| 2414 |-------FCN=0-------->| 2415 |-------FCN=0-------->| 2416 |-------FCN=0-------->| 2417 |-------FCN=0-------->| 2418 |-------FCN=0-------->| 2419 |-----FCN=1 + MIC --->|MIC checked: success => 2421 Figure 30: Transmission in No-ACK mode of an IPv6 packet carried by 2422 11 fragments 2424 In the following examples, N (i.e. the size if the FCN field) is 3 2425 bits. Therefore, the All-1 FCN value is 7. 2427 Figure 31 illustrates the transmission in ACK-on-Error of an IPv6 2428 packet that needs 11 fragments, with MAX_WIND_FCN=6 and no fragment 2429 loss. 2431 Sender Receiver 2432 |-----W=0, FCN=6----->| 2433 |-----W=0, FCN=5----->| 2434 |-----W=0, FCN=4----->| 2435 |-----W=0, FCN=3----->| 2436 |-----W=0, FCN=2----->| 2437 |-----W=0, FCN=1----->| 2438 |-----W=0, FCN=0----->| 2439 (no ACK) 2440 |-----W=1, FCN=6----->| 2441 |-----W=1, FCN=5----->| 2442 |-----W=1, FCN=4----->| 2443 |--W=1, FCN=7 + MIC-->|MIC checked: success => 2444 |<---- ACK, W=1 ------| 2446 Figure 31: Transmission in ACK-on-Error mode of an IPv6 packet 2447 carried by 11 fragments, with MAX_WIND_FCN=6 and no loss. 2449 Figure 32 illustrates the transmission in ACK-on-Error mode of an 2450 IPv6 packet that needs 11 fragments, with MAX_WIND_FCN=6 and three 2451 lost fragments. 2453 Sender Receiver 2454 |-----W=0, FCN=6----->| 2455 |-----W=0, FCN=5----->| 2456 |-----W=0, FCN=4--X-->| 2457 |-----W=0, FCN=3----->| 2458 |-----W=0, FCN=2--X-->| 7 2459 |-----W=0, FCN=1----->| / 2460 |-----W=0, FCN=0----->| 6543210 2461 |<-----ACK, W=0-------|Bitmap:1101011 2462 |-----W=0, FCN=4----->| 2463 |-----W=0, FCN=2----->| 2464 (no ACK) 2465 |-----W=1, FCN=6----->| 2466 |-----W=1, FCN=5----->| 2467 |-----W=1, FCN=4--X-->| 2468 |- W=1, FCN=7 + MIC ->|MIC checked: failed 2469 |<-----ACK, W=1-------|C=0 Bitmap:1100001 2470 |-----W=1, FCN=4----->|MIC checked: success => 2471 |<---- ACK, W=1 ------|C=1, no Bitmap 2473 Figure 32: Transmission in ACK-on-Error mode of an IPv6 packet 2474 carried by 11 fragments, with MAX_WIND_FCN=6 and three lost 2475 fragments. 2477 Figure 33 illustrates the transmission in ACK-Always mode of an IPv6 2478 packet that needs 11 fragments, with MAX_WIND_FCN=6 and no loss. 2480 Sender Receiver 2481 |-----W=0, FCN=6----->| 2482 |-----W=0, FCN=5----->| 2483 |-----W=0, FCN=4----->| 2484 |-----W=0, FCN=3----->| 2485 |-----W=0, FCN=2----->| 2486 |-----W=0, FCN=1----->| 2487 |-----W=0, FCN=0----->| 2488 |<-----ACK, W=0-------| Bitmap:1111111 2489 |-----W=1, FCN=6----->| 2490 |-----W=1, FCN=5----->| 2491 |-----W=1, FCN=4----->| 2492 |--W=1, FCN=7 + MIC-->|MIC checked: success => 2493 |<-----ACK, W=1-------| C=1 no Bitmap 2494 (End) 2496 Figure 33: Transmission in ACK-Always mode of an IPv6 packet carried 2497 by 11 fragments, with MAX_WIND_FCN=6 and no lost fragment. 2499 Figure 34 illustrates the transmission in ACK-Always mode of an IPv6 2500 packet that needs 11 fragments, with MAX_WIND_FCN=6 and three lost 2501 fragments. 2503 Sender Receiver 2504 |-----W=1, FCN=6----->| 2505 |-----W=1, FCN=5----->| 2506 |-----W=1, FCN=4--X-->| 2507 |-----W=1, FCN=3----->| 2508 |-----W=1, FCN=2--X-->| 7 2509 |-----W=1, FCN=1----->| / 2510 |-----W=1, FCN=0----->| 6543210 2511 |<-----ACK, W=1-------|Bitmap:1101011 2512 |-----W=1, FCN=4----->| 2513 |-----W=1, FCN=2----->| 2514 |<-----ACK, W=1-------|Bitmap: 2515 |-----W=0, FCN=6----->| 2516 |-----W=0, FCN=5----->| 2517 |-----W=0, FCN=4--X-->| 2518 |--W=0, FCN=7 + MIC-->|MIC checked: failed 2519 |<-----ACK, W=0-------| C= 0 Bitmap:11000001 2520 |-----W=0, FCN=4----->|MIC checked: success => 2521 |<-----ACK, W=0-------| C= 1 no Bitmap 2522 (End) 2524 Figure 34: Transmission in ACK-Always mode of an IPv6 packet carried 2525 by 11 fragments, with MAX_WIND_FCN=6 and three lost fragments. 2527 Figure 35 illustrates the transmission in ACK-Always mode of an IPv6 2528 packet that needs 6 fragments, with MAX_WIND_FCN=6, three lost 2529 fragments and only one retry needed to recover each lost fragment. 2531 Sender Receiver 2532 |-----W=0, FCN=6----->| 2533 |-----W=0, FCN=5----->| 2534 |-----W=0, FCN=4--X-->| 2535 |-----W=0, FCN=3--X-->| 2536 |-----W=0, FCN=2--X-->| 2537 |--W=0, FCN=7 + MIC-->|MIC checked: failed 2538 |<-----ACK, W=0-------|C= 0 Bitmap:1100001 2539 |-----W=0, FCN=4----->|MIC checked: failed 2540 |-----W=0, FCN=3----->|MIC checked: failed 2541 |-----W=0, FCN=2----->|MIC checked: success 2542 |<-----ACK, W=0-------|C=1 no Bitmap 2543 (End) 2545 Figure 35: Transmission in ACK-Always mode of an IPv6 packet carried 2546 by 11 fragments, with MAX_WIND_FCN=6, three lost framents and only 2547 one retry needed for each lost fragment. 2549 Figure 36 illustrates the transmission in ACK-Always mode of an IPv6 2550 packet that needs 6 fragments, with MAX_WIND_FCN=6, three lost 2551 fragments, and the second ACK lost. 2553 Sender Receiver 2554 |-----W=0, FCN=6----->| 2555 |-----W=0, FCN=5----->| 2556 |-----W=0, FCN=4--X-->| 2557 |-----W=0, FCN=3--X-->| 2558 |-----W=0, FCN=2--X-->| 2559 |--W=0, FCN=7 + MIC-->|MIC checked: failed 2560 |<-----ACK, W=0-------|C=0 Bitmap:1100001 2561 |-----W=0, FCN=4----->|MIC checked: failed 2562 |-----W=0, FCN=3----->|MIC checked: failed 2563 |-----W=0, FCN=2----->|MIC checked: success 2564 | X---ACK, W=0-------|C= 1 no Bitmap 2565 timeout | | 2566 |--W=0, FCN=7 + MIC-->| 2567 |<-----ACK, W=0-------|C= 1 no Bitmap 2569 (End) 2571 Figure 36: Transmission in ACK-Always mode of an IPv6 packet carried 2572 by 11 fragments, with MAX_WIND_FCN=6, three lost fragments, and the 2573 second ACK lost. 2575 Figure 37 illustrates the transmission in ACK-Always mode of an IPv6 2576 packet that needs 6 fragments, with MAX_WIND_FCN=6, with three lost 2577 fragments, and one retransmitted fragment lost again. 2579 Sender Receiver 2580 |-----W=0, FCN=6----->| 2581 |-----W=0, FCN=5----->| 2582 |-----W=0, FCN=4--X-->| 2583 |-----W=0, FCN=3--X-->| 2584 |-----W=0, FCN=2--X-->| 2585 |--W=0, FCN=7 + MIC-->|MIC checked: failed 2586 |<-----ACK, W=0-------|C=0 Bitmap:1100001 2587 |-----W=0, FCN=4----->|MIC checked: failed 2588 |-----W=0, FCN=3----->|MIC checked: failed 2589 |-----W=0, FCN=2--X-->| 2590 timeout| | 2591 |--W=0, FCN=7 + MIC-->|All-0 empty 2592 |<-----ACK, W=0-------|C=0 Bitmap: 1111101 2593 |-----W=0, FCN=2----->|MIC checked: success 2594 |<-----ACK, W=0-------|C=1 no Bitmap 2595 (End) 2597 Figure 37: Transmission in ACK-Always mode of an IPv6 packet carried 2598 by 11 fragments, with MAX_WIND_FCN=6, with three lost fragments, and 2599 one retransmitted fragment lost again. 2601 Figure 38 illustrates the transmission in ACK-Always mode of an IPv6 2602 packet that needs 28 fragments, with N=5, MAX_WIND_FCN=23 and two 2603 lost fragments. Note that MAX_WIND_FCN=23 may be useful when the 2604 maximum possible Bitmap size, considering the maximum lower layer 2605 technology payload size and the value of R, is 3 bytes. Note also 2606 that the FCN of the last fragment of the packet is the one with 2607 FCN=31 (i.e. FCN=2^N-1 for N=5, or equivalently, all FCN bits set to 2608 1). 2610 Sender Receiver 2611 |-----W=0, FCN=23----->| 2612 |-----W=0, FCN=22----->| 2613 |-----W=0, FCN=21--X-->| 2614 |-----W=0, FCN=20----->| 2615 |-----W=0, FCN=19----->| 2616 |-----W=0, FCN=18----->| 2617 |-----W=0, FCN=17----->| 2618 |-----W=0, FCN=16----->| 2619 |-----W=0, FCN=15----->| 2620 |-----W=0, FCN=14----->| 2621 |-----W=0, FCN=13----->| 2622 |-----W=0, FCN=12----->| 2623 |-----W=0, FCN=11----->| 2624 |-----W=0, FCN=10--X-->| 2625 |-----W=0, FCN=9 ----->| 2626 |-----W=0, FCN=8 ----->| 2627 |-----W=0, FCN=7 ----->| 2628 |-----W=0, FCN=6 ----->| 2629 |-----W=0, FCN=5 ----->| 2630 |-----W=0, FCN=4 ----->| 2631 |-----W=0, FCN=3 ----->| 2632 |-----W=0, FCN=2 ----->| 2633 |-----W=0, FCN=1 ----->| 2634 |-----W=0, FCN=0 ----->| 2635 | |lcl-Bitmap:110111111111101111111111 2636 |<------ACK, W=0-------|encoded Bitmap:1101111111111011 2637 |-----W=0, FCN=21----->| 2638 |-----W=0, FCN=10----->| 2639 |<------ACK, W=0-------|no Bitmap 2640 |-----W=1, FCN=23----->| 2641 |-----W=1, FCN=22----->| 2642 |-----W=1, FCN=21----->| 2643 |--W=1, FCN=31 + MIC-->|MIC checked: sucess => 2644 |<------ACK, W=1-------|no Bitmap 2645 (End) 2647 Figure 38: Transmission in ACK-Always mode of an IPv6 packet carried 2648 by 28 fragments, with N=5, MAX_WIND_FCN=23 and two lost fragments. 2650 Appendix C. Fragmentation State Machines 2652 The fragmentation state machines of the sender and the receiver, one 2653 for each of the different reliability modes, are described in the 2654 following figures: 2656 +===========+ 2657 +------------+ Init | 2658 | FCN=0 +===========+ 2659 | No Window 2660 | No Bitmap 2661 | +-------+ 2662 | +========+==+ | More Fragments 2663 | | | <--+ ~~~~~~~~~~~~~~~~~~~~ 2664 +--------> | Send | send Fragment (FCN=0) 2665 +===+=======+ 2666 | last fragment 2667 | ~~~~~~~~~~~~ 2668 | FCN = 1 2669 v send fragment+MIC 2670 +============+ 2671 | END | 2672 +============+ 2674 Figure 39: Sender State Machine for the No-ACK Mode 2676 +------+ Not All-1 2677 +==========+=+ | ~~~~~~~~~~~~~~~~~~~ 2678 | + <--+ set Inactivity Timer 2679 | RCV Frag +-------+ 2680 +=+===+======+ |All-1 & 2681 All-1 & | | |MIC correct 2682 MIC wrong | |Inactivity | 2683 | |Timer Exp. | 2684 v | | 2685 +==========++ | v 2686 | Error |<-+ +========+==+ 2687 +===========+ | END | 2688 +===========+ 2690 Figure 40: Receiver State Machine for the No-ACK Mode 2691 +=======+ 2692 | INIT | FCN!=0 & more frags 2693 | | ~~~~~~~~~~~~~~~~~~~~~~ 2694 +======++ +--+ send Window + frag(FCN) 2695 W=0 | | | FCN- 2696 Clear local Bitmap | | v set local Bitmap 2697 FCN=max value | ++==+========+ 2698 +> | | 2699 +---------------------> | SEND | 2700 | +==+===+=====+ 2701 | FCN==0 & more frags | | last frag 2702 | ~~~~~~~~~~~~~~~~~~~~~ | | ~~~~~~~~~~~~~~~ 2703 | set local-Bitmap | | set local-Bitmap 2704 | send wnd + frag(all-0) | | send wnd+frag(all-1)+MIC 2705 | set Retrans_Timer | | set Retrans_Timer 2706 | | | 2707 |Recv_wnd == wnd & | | 2708 |Lcl_Bitmap==recv_Bitmap& | | +----------------------+ 2709 |more frag | | |lcl-Bitmap!=rcv-Bitmap| 2710 |~~~~~~~~~~~~~~~~~~~~~~ | | | ~~~~~~~~~ | 2711 |Stop Retrans_Timer | | | Attemp++ v 2712 |clear local_Bitmap v v | +=====+=+ 2713 |window=next_window +====+===+==+===+ |Resend | 2714 +---------------------+ | |Missing| 2715 +----+ Wait | |Frag | 2716 not expected wnd | | Bitmap | +=======+ 2717 ~~~~~~~~~~~~~~~~ +--->+ ++Retrans_Timer Exp | 2718 discard frag +==+=+===+=+==+=+| ~~~~~~~~~~~~~~~~~ | 2719 | | | ^ ^ |reSend(empty)All-* | 2720 | | | | | |Set Retrans_Timer | 2721 | | | | +--+Attemp++ | 2722 MIC_bit==1 & | | | +-------------------------+ 2723 Recv_window==window & | | | all missing frags sent 2724 no more frag| | | ~~~~~~~~~~~~~~~~~~~~~~ 2725 ~~~~~~~~~~~~~~~~~~~~~~~~| | | Set Retrans_Timer 2726 Stop Retrans_Timer| | | 2727 +=============+ | | | 2728 | END +<--------+ | | 2729 +=============+ | | Attemp > MAX_ACK_REQUESTS 2730 All-1 Window & | | ~~~~~~~~~~~~~~~~~~ 2731 MIC_bit ==0 & | v Send Abort 2732 Lcl_Bitmap==recv_Bitmap | +=+===========+ 2733 ~~~~~~~~~~~~ +>| ERROR | 2734 Send Abort +=============+ 2736 Figure 41: Sender State Machine for the ACK-Always Mode 2738 Not All- & w=expected +---+ +---+w = Not expected 2739 ~~~~~~~~~~~~~~~~~~~~~ | | | |~~~~~~~~~~~~~~~~ 2740 Set local_Bitmap(FCN) | v v |discard 2741 ++===+===+===+=+ 2742 +---------------------+ Rcv +--->* ABORT 2743 | +------------------+ Window | 2744 | | +=====+==+=====+ 2745 | | All-0 & w=expect | ^ w =next & not-All 2746 | | ~~~~~~~~~~~~~~~~~~ | |~~~~~~~~~~~~~~~~~~~~~ 2747 | | set lcl_Bitmap(FCN)| |expected = next window 2748 | | send local_Bitmap | |Clear local_Bitmap 2749 | | | | 2750 | | w=expct & not-All | | 2751 | | ~~~~~~~~~~~~~~~~~~ | | 2752 | | set lcl_Bitmap(FCN)+-+ | | +--+ w=next & All-0 2753 | | if lcl_Bitmap full | | | | | | ~~~~~~~~~~~~~~~ 2754 | | send lcl_Bitmap | | | | | | expct = nxt wnd 2755 | | v | v | | | Clear lcl_Bitmap 2756 | | w=expct & All-1 +=+=+=+==+=++ | set lcl_Bitmap(FCN) 2757 | | ~~~~~~~~~~~ +->+ Wait +<+ send lcl_Bitmap 2758 | | discard +--| Next | 2759 | | All-0 +---------+ Window +--->* ABORT 2760 | | ~~~~~ +-------->+========+=++ 2761 | | snd lcl_bm All-1 & w=next| | All-1 & w=nxt 2762 | | & MIC wrong| | & MIC right 2763 | | ~~~~~~~~~~~~~~~~~| | ~~~~~~~~~~~~~~~~~~ 2764 | | set local_Bitmap(FCN)| |set lcl_Bitmap(FCN) 2765 | | send local_Bitmap| |send local_Bitmap 2766 | | | +----------------------+ 2767 | |All-1 & w=expct | | 2768 | |& MIC wrong v +---+ w=expctd & | 2769 | |~~~~~~~~~~~~~~~~~~~~ +====+=====+ | MIC wrong | 2770 | |set local_Bitmap(FCN) | +<+ ~~~~~~~~~~~~~~ | 2771 | |send local_Bitmap | Wait End | set lcl_btmp(FCN)| 2772 | +--------------------->+ +--->* ABORT | 2773 | +===+====+=+-+ All-1&MIC wrong| 2774 | | ^ | ~~~~~~~~~~~~~~~| 2775 | w=expected & MIC right | +---+ send lcl_btmp | 2776 | ~~~~~~~~~~~~~~~~~~~~~~ | | 2777 | set local_Bitmap(FCN) | +-+ Not All-1 | 2778 | send local_Bitmap | | | ~~~~~~~~~ | 2779 | | | | discard | 2780 |All-1 & w=expctd & MIC right | | | | 2781 |~~~~~~~~~~~~~~~~~~~~~~~~~~~~ v | v +----+All-1 | 2782 |set local_Bitmap(FCN) +=+=+=+=+==+ |~~~~~~~~~ | 2783 |send local_Bitmap | +<+Send lcl_btmp | 2784 +-------------------------->+ END | | 2785 +==========+<---------------+ 2787 --->* ABORT 2788 ~~~~~~~ 2789 Inactivity_Timer = expires 2790 When DWN_Link 2791 IF Inactivity_Timer expires 2792 Send DWL Request 2793 Attemp++ 2795 Figure 42: Receiver State Machine for the ACK-Always Mode 2796 +=======+ 2797 | | 2798 | INIT | 2799 | | FCN!=0 & more frags 2800 +======++ +--+ ~~~~~~~~~~~~~~~~~~~~~~ 2801 W=0 | | | send Window + frag(FCN) 2802 ~~~~~~~~~~~~~~~~~~ | | | FCN- 2803 Clear local Bitmap | | v set local Bitmap 2804 FCN=max value | ++=============+ 2805 +> | | 2806 | SEND | 2807 +-------------------------> | | 2808 | ++=====+=======+ 2809 | FCN==0 & more frags| |last frag 2810 | ~~~~~~~~~~~~~~~~~~~~~~~| |~~~~~~~~~~~~~~~~~ 2811 | set local-Bitmap| |set local-Bitmap 2812 | send wnd + frag(all-0)| |send wnd+frag(all-1)+MIC 2813 | set Retrans_Timer| |set Retrans_Timer 2814 | | | 2815 |Retrans_Timer expires & | | lcl-Bitmap!=rcv-Bitmap 2816 |more fragments | | ~~~~~~~~~~~~~~~~~~~~~~ 2817 |~~~~~~~~~~~~~~~~~~~~ | | Attemp++ 2818 |stop Retrans_Timer | | +-----------------+ 2819 |clear local-Bitmap v v | v 2820 |window = next window +=====+=====+==+==+ +====+====+ 2821 +----------------------+ + | Resend | 2822 +--------------------->+ Wait Bitmap | | Missing | 2823 | +-- + | | Frag | 2824 | not expected wnd | ++=+===+===+===+==+ +======+==+ 2825 | ~~~~~~~~~~~~~~~~ | ^ | | | ^ | 2826 | discard frag +----+ | | | +-------------------+ 2827 | | | | all missing frag sent 2828 |Retrans_Timer expires & | | | ~~~~~~~~~~~~~~~~~~~~~ 2829 | No more Frag | | | Set Retrans_Timer 2830 | ~~~~~~~~~~~~~~~~~~~~~~~ | | | 2831 | Stop Retrans_Timer | | | 2832 | Send ALL-1-empty | | | 2833 +-------------------------+ | | 2834 | | 2835 Local_Bitmap==Recv_Bitmap| | 2836 ~~~~~~~~~~~~~~~~~~~~~~~~~| |Attemp > MAX_ACK_REQUESTS 2837 +=========+Stop Retrans_Timer | |~~~~~~~~~~~~~~~~~~~~~~~ 2838 | END +<------------------+ v Send Abort 2839 +=========+ +=+=========+ 2840 | ERROR | 2841 +===========+ 2843 Figure 43: Sender State Machine for the ACK-on-Error Mode 2845 Not All- & w=expected +---+ +---+w = Not expected 2846 ~~~~~~~~~~~~~~~~~~~~~ | | | |~~~~~~~~~~~~~~~~ 2847 Set local_Bitmap(FCN) | v v |discard 2848 ++===+===+===+=+ 2849 +-----------------------+ +--+ All-0 & full 2850 | ABORT *<---+ Rcv Window | | ~~~~~~~~~~~~ 2851 | +--------------------+ +<-+ w =next 2852 | | All-0 empty +->+=+=+===+======+ clear lcl_Bitmap 2853 | | ~~~~~~~~~~~ | | | ^ 2854 | | send bitmap +----+ | |w=expct & not-All & full 2855 | | | |~~~~~~~~~~~~~~~~~~~~~~~~ 2856 | | | |set lcl_Bitmap; w =nxt 2857 | | | | 2858 | | All-0 & w=expect | | w=next 2859 | | & no_full Bitmap | | ~~~~~~~~ +========+ 2860 | | ~~~~~~~~~~~~~~~~~ | | Send abort| Error/ | 2861 | | send local_Bitmap | | +---------->+ Abort | 2862 | | | | | +-------->+========+ 2863 | | v | | | all-1 ^ 2864 | | All-0 empty +====+===+==+=+=+ ~~~~~~~ | 2865 | | ~~~~~~~~~~~~~ +--+ Wait | Send abort | 2866 | | send lcl_btmp +->| Missing Fragm.| | 2867 | | +==============++ | 2868 | | +--------------+ 2869 | | Uplink Only & 2870 | | Inactivity_Timer = expires 2871 | | ~~~~~~~~~~~~~~~~~~~~~~~~~~ 2872 | | Send Abort 2873 | |All-1 & w=expect & MIC wrong 2874 | |~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +-+ All-1 2875 | |set local_Bitmap(FCN) | v ~~~~~~~~~~ 2876 | |send local_Bitmap +===========+==+ snd lcl_btmp 2877 | +--------------------->+ Wait End +-+ 2878 | +=====+=+====+=+ | w=expct & 2879 | w=expected & MIC right | | ^ | MIC wrong 2880 | ~~~~~~~~~~~~~~~~~~~~~~ | | +---+ ~~~~~~~~~ 2881 | set & send local_Bitmap(FCN) | | set lcl_Bitmap(FCN) 2882 | | | 2883 |All-1 & w=expected & MIC right | +-->* ABORT 2884 |~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ v 2885 |set & send local_Bitmap(FCN) +=+==========+ 2886 +---------------------------->+ END | 2887 +============+ 2888 --->* ABORT 2889 Only Uplink 2890 Inactivity_Timer = expires 2891 ~~~~~~~~~~~~~~~~~~~~~~~~~~ 2892 Send Abort 2894 Figure 44: Receiver State Machine for the ACK-on-Error Mode 2896 Appendix D. SCHC Parameters - Ticket #15 2898 This section gives the list of parameters that need to be defined in 2899 the technology-specific documents. 2901 o Define the most common uses case and how SCHC may be deployed. 2903 o LPWAN Architecture. Explain the SCHC entities (Compression and 2904 Fragmentation), how/where they are represented in the 2905 corresponding technology architecture. If applicable, explain the 2906 various potential channel conditions for the technology and the 2907 corresponding recommended use of C/D and F/R. 2909 o L2 fragmentation decision 2911 o Technology developers must evaluate that L2 has strong enough 2912 integrity checking to match SCHC's assumption. 2914 o Rule ID numbering system, number of Rules 2916 o Size of the Rule IDs 2918 o The way the Rule ID is sent (L2 or L3) and how (describe) 2920 o Fragmentation delivery reliability mode used in which cases (e.g. 2921 based on link channel condition) 2923 o Define the number of bits for FCN (N) and DTag (T) 2925 o in particular, is interleaved packet transmission supported and to 2926 what extent 2928 o The MIC algorithm to be used and the size, if different from the 2929 default CRC32 2931 o Retransmission Timer duration 2933 o Inactivity Timer duration 2935 o Define MAX_ACK_REQUEST (number of attempts) 2937 o Padding: size of the L2 Word (for most technologies, a byte; for 2938 some technologies, a bit). Value of the padding bits (1 or 0). 2939 The value of the padding bits needs to be specified because the 2940 padding bits are included in the MIC calculation. 2942 o Take into account that the length of Rule ID + N + T + W when 2943 possible is good to have a multiple of 8 bits to complete a byte 2944 and avoid padding 2946 o In the ACK format to have a length for Rule ID + T + W bit into a 2947 complete number of byte to do optimization more easily 2949 o The technology documents will describe if Rule ID is constrained 2950 by any alignment 2952 o When fragmenting in ACK-on-Error or ACK-Always mode, it is 2953 expected that the last window (called All-1 window) will not be 2954 fully utilised, i.e. there won't be fragments with all FCN values 2955 from MAX_WIND_FCN downto 1 and finally All-1. It is worth noting 2956 that this document does not mandate that other windows (called 2957 All-0 windows) are fully utilised either. This document purposely 2958 does not specify that All-1 windows use Bitmaps with the same 2959 number of bits as All-0 windows do. By default, Bitmaps for All-0 2960 and All-1 windows are of the same size MAX_WIND_FCN + 1. But a 2961 technology-specific document MAY revert that decision. The 2962 rationale for reverting the decision could be the following: Note 2963 that the SCHC ACK sent as a response to an All-1 fragment includes 2964 a C bit that SCHC ACK for other windows don't have. Therefore, 2965 the SCHC ACK for the All-1 window is one bit bigger. An L2 2966 technology with a severely constrained payload size might decide 2967 that this "bump" in the SCHC ACK for the last fragment is a bad 2968 resource usage. It could thus mandate that the All-1 window is 2969 not allowed to use the FCN value 1 and that the All-1 SCHC ACK 2970 Bitmap size is reduced by 1 bit. This provides room for the C bit 2971 without creating a bump in the SCHC ACK. 2973 And the following parameters need to be addressed in another document 2974 but not forcely in the technology-specific one: 2976 o The way the contexts are provisioning 2978 o The way the Rules as generated 2980 Appendix E. Note 2982 Carles Gomez has been funded in part by the Spanish Government 2983 (Ministerio de Educacion, Cultura y Deporte) through the Jose 2984 Castillejo grant CAS15/00336, and by the ERDF and the Spanish 2985 Government through project TEC2016-79988-P. Part of his contribution 2986 to this work has been carried out during his stay as a visiting 2987 scholar at the Computer Laboratory of the University of Cambridge. 2989 Authors' Addresses 2991 Ana Minaburo 2992 Acklio 2993 1137A avenue des Champs Blancs 2994 35510 Cesson-Sevigne Cedex 2995 France 2997 Email: ana@ackl.io 2999 Laurent Toutain 3000 IMT-Atlantique 3001 2 rue de la Chataigneraie 3002 CS 17607 3003 35576 Cesson-Sevigne Cedex 3004 France 3006 Email: Laurent.Toutain@imt-atlantique.fr 3008 Carles Gomez 3009 Universitat Politecnica de Catalunya 3010 C/Esteve Terradas, 7 3011 08860 Castelldefels 3012 Spain 3014 Email: carlesgo@entel.upc.edu 3016 Dominique Barthel 3017 Orange Labs 3018 28 chemin du Vieux Chene 3019 38243 Meylan 3020 France 3022 Email: dominique.barthel@orange.com