idnits 2.17.1 draft-ietf-6lo-ghc-05.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- No issues found here. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (September 19, 2014) is 3505 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) == Missing Reference: 'RFCthis' is mentioned on line 415, but not defined ** Obsolete normative reference: RFC 5226 (Obsoleted by RFC 8126) Summary: 1 error (**), 0 flaws (~~), 2 warnings (==), 1 comment (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 6Lo Working Group C. Bormann 3 Internet-Draft Universitaet Bremen TZI 4 Intended status: Standards Track September 19, 2014 5 Expires: March 23, 2015 7 6LoWPAN Generic Compression of Headers and Header-like Payloads (GHC) 8 draft-ietf-6lo-ghc-05 10 Abstract 12 This short specification provides a simple addition to 6LoWPAN Header 13 Compression that enables the compression of generic headers and 14 header-like payloads, without a need to define a new header 15 compression scheme for each new such header or header-like payload. 17 Status of This Memo 19 This Internet-Draft is submitted in full conformance with the 20 provisions of BCP 78 and BCP 79. 22 Internet-Drafts are working documents of the Internet Engineering 23 Task Force (IETF). Note that other groups may also distribute 24 working documents as Internet-Drafts. The list of current Internet- 25 Drafts is at http://datatracker.ietf.org/drafts/current/. 27 Internet-Drafts are draft documents valid for a maximum of six months 28 and may be updated, replaced, or obsoleted by other documents at any 29 time. It is inappropriate to use Internet-Drafts as reference 30 material or to cite them other than as "work in progress." 32 This Internet-Draft will expire on March 23, 2015. 34 Copyright Notice 36 Copyright (c) 2014 IETF Trust and the persons identified as the 37 document authors. All rights reserved. 39 This document is subject to BCP 78 and the IETF Trust's Legal 40 Provisions Relating to IETF Documents 41 (http://trustee.ietf.org/license-info) in effect on the date of 42 publication of this document. Please review these documents 43 carefully, as they describe your rights and restrictions with respect 44 to this document. Code Components extracted from this document must 45 include Simplified BSD License text as described in Section 4.e of 46 the Trust Legal Provisions and are provided without warranty as 47 described in the Simplified BSD License. 49 Table of Contents 51 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 52 1.1. The Header Compression Coupling Problem . . . . . . . . . 2 53 1.2. Compression Approach . . . . . . . . . . . . . . . . . . 3 54 1.3. Terminology . . . . . . . . . . . . . . . . . . . . . . . 3 55 1.4. Notation . . . . . . . . . . . . . . . . . . . . . . . . 4 56 2. 6LoWPAN-GHC . . . . . . . . . . . . . . . . . . . . . . . . . 5 57 3. Integrating 6LoWPAN-GHC into 6LoWPAN-HC . . . . . . . . . . . 6 58 3.1. Compressing payloads (UDP and ICMPv6) . . . . . . . . . . 6 59 3.2. Compressing extension headers . . . . . . . . . . . . . . 6 60 3.3. Indicating GHC capability . . . . . . . . . . . . . . . . 7 61 3.4. Using the 6CIO Option . . . . . . . . . . . . . . . . . . 8 62 4. IANA considerations . . . . . . . . . . . . . . . . . . . . . 9 63 5. Security considerations . . . . . . . . . . . . . . . . . . . 10 64 6. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 11 65 7. References . . . . . . . . . . . . . . . . . . . . . . . . . 13 66 7.1. Normative References . . . . . . . . . . . . . . . . . . 13 67 7.2. Informative References . . . . . . . . . . . . . . . . . 13 68 Appendix A. Examples . . . . . . . . . . . . . . . . . . . . . . 14 69 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 24 71 1. Introduction 73 1.1. The Header Compression Coupling Problem 75 6LoWPAN-HC [RFC6282] defines a scheme for header compression in 76 6LoWPAN [RFC4944] packets. As with most header compression schemes, 77 a new specification is needed for every new kind of header that needs 78 to be compressed. In addition, [RFC6282] does not define an 79 extensibility scheme like the ROHC profiles defined in ROHC [RFC3095] 80 [RFC5795]. This leads to the difficult situation that 6LoWPAN-HC 81 tended to be reopened and reexamined each time a new header receives 82 consideration (or an old header is changed and reconsidered) in the 83 6LoWPAN/roll/CoRE cluster of IETF working groups. While [RFC6282] 84 finally got completed, the underlying problem remains unsolved. 86 The purpose of the present contribution is to plug into [RFC6282] as 87 is, using its NHC (next header compression) concept. We add a 88 slightly less efficient, but vastly more general form of compression 89 for headers of any kind and even for header-like payloads such as 90 those exhibited by routing protocols, DHCP, etc.: Generic Header 91 Compression (GHC). The objective is an extremely simple 92 specification that can be defined on a single page and implemented in 93 a small number of lines of code, as opposed to a general data 94 compression scheme such as that defined in [RFC1951]. 96 1.2. Compression Approach 98 The basic approach of GHC's compression function is to define a 99 bytecode for LZ77-style compression [LZ77]. The bytecode is a series 100 of simple instructions for the decompressor to reconstitute the 101 uncompressed payload. These instructions include: 103 o appending bytes to the reconstituted payload that are literally 104 given with the instruction in the compressed data 106 o appending a given number of zero bytes to the reconstituted 107 payload 109 o appending bytes to the reconstituted payload by copying a 110 contiguous sequence from the payload being reconstituted 111 ("backreferencing") 113 o an ancillary instruction for setting up parameters for the 114 backreferencing instruction in "decompression variables" 116 o a stop code (optional, see Section 3.2) 118 The buffer for the reconstituted payload ("destination buffer") is 119 prefixed by a predefined dictionary that can be used in the 120 backreferencing as if it were a prefix of the payload. This 121 predefined dictionary is built from the IPv6 addresses of the packet 122 being reconstituted, followed by a static component, the "static 123 dictionary". 125 As usual, this specification defines the decompressor operation in 126 detail, but leaves the detailed operation of the compressor open to 127 implementation. The compressor can be implemented as with a 128 classical LZ77 compressor, or it can be a simple protocol encoder 129 that just makes use of known compression opportunities. 131 1.3. Terminology 133 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 134 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 135 "OPTIONAL" in this document are to be interpreted as described in RFC 136 2119 [RFC2119]. 138 The term "byte" is used in its now customary sense as a synonym for 139 "octet". 141 Terms from [RFC7228] are used in Section 5. 143 1.4. Notation 145 This specification uses a trivial notation for code bytes and the 146 bitfields in them, the meaning of which should be mostly obvious. 147 More formally, the meaning of the notation is: 149 Potential values for the code bytes themselves are expressed by 150 templates that represent 8-bit most-significant-bit-first binary 151 numbers (without any special prefix), where 0 stands for 0, 1 for 1, 152 and variable segments in these code byte templates are indicated by 153 sequences of the same letter such as kkkkkkk or ssss, the length of 154 which indicates the length of the variable segment in bits. 156 In the notation of values derived from the code bytes, 0b is used as 157 a prefix for expressing binary numbers in most-significant-bit first 158 notation (akin to the use of 0x for most-significant-digit-first 159 hexadecimal numbers in the C programming language). Where the above- 160 mentioned sequences of letters are then referenced in such a binary 161 number in the text, the intention is that the value from these 162 bitfields in the actual code byte be inserted. 164 Example: The code byte template 166 101nssss 168 stands for a byte that starts (most-significant-bit-first) with the 169 bits 1, 0, and 1, and continues with five variable bits, the first of 170 which is referenced as "n" and the next four are referenced as 171 "ssss". Based on this code byte template, a reference to 173 0b0ssss000 175 means a binary number composed from a zero bit, the four bits that 176 are in the "ssss" field (for 101nssss, the four least significant 177 bits) in the actual byte encountered, kept in the same order, and 178 three more zero bits. 180 2. 6LoWPAN-GHC 182 The format of a GHC-compressed header or payload is a simple 183 bytecode. A compressed header consists of a sequence of pieces, each 184 of which begins with a code byte, which may be followed by zero or 185 more bytes as its argument. Some code bytes cause bytes to be laid 186 out in the destination buffer, some simply modify some decompression 187 variables. 189 At the start of decompressing a header or payload within a L2 packet 190 (= fragment), the decompression variables "sa" and "na" are 191 initialized as zero. 193 The code bytes are defined as follows (Table 1): 195 +----------+---------------------------------------------+----------+ 196 | code | Action | Argument | 197 | byte | | | 198 +----------+---------------------------------------------+----------+ 199 | 0kkkkkkk | Append k = 0b0kkkkkkk bytes of data in the | k bytes | 200 | | bytecode argument (k < 96) | of data | 201 | | | | 202 | 1000nnnn | Append 0b0000nnnn+2 bytes of zeroes | | 203 | | | | 204 | 10010000 | STOP code (end of compressed data, see | | 205 | | Section 3.2) | | 206 | | | | 207 | 101nssss | Set up extended arguments for a | | 208 | | backreference: sa += 0b0ssss000, na += | | 209 | | 0b0000n000 | | 210 | | | | 211 | 11nnnkkk | Backreference: n = na+0b00000nnn+2; s = | | 212 | | 0b00000kkk+sa+n; append n bytes from | | 213 | | previously output bytes, starting s bytes | | 214 | | to the left of the current output pointer; | | 215 | | set sa = 0, na = 0 | | 216 +----------+---------------------------------------------+----------+ 218 Table 1: Bytecodes for generic header compression 220 Note that the following bit combinations are reserved at this time: 221 011xxxxx, and 1001nnnn (where 0b0000nnnn > 0). 223 For the purposes of the backreferences, the expansion buffer is 224 initialized with a predefined dictionary, at the end of which the 225 reconstituted payload begins. This dictionary is composed of the 226 source and destination IPv6 addresses of the packet being 227 reconstituted, followed by a 16-byte static dictionary (Figure 1). 229 These 48 dictionary bytes are therefore available for 230 backreferencing, but not copied into the final reconstituted payload. 232 16 fe fd 17 fe fd 00 01 00 00 00 00 00 01 00 00 234 Figure 1: The 16 bytes of static dictionary (in hex) 236 3. Integrating 6LoWPAN-GHC into 6LoWPAN-HC 238 6LoWPAN-GHC plugs in as an NHC format for 6LoWPAN-HC [RFC6282]. 240 3.1. Compressing payloads (UDP and ICMPv6) 242 GHC is by definition generic and can be applied to different kinds of 243 packets. Many of the examples given in Appendix A are for ICMPv6 244 packets; a single NHC value suffices to define an NHC format for 245 ICMPv6 based on GHC (see below). 247 In addition it is useful to include an NHC format for UDP, as many 248 headerlike payloads (e.g., DHCPv6, DTLS) are carried in UDP. 249 [RFC6282] already defines an NHC format for UDP (11110CPP). GHC uses 250 an analogous NHC byte formatted as shown in Figure 2. The difference 251 to the existing UDP NHC specification is that for 0b11010cpp NHC 252 bytes, the UDP payload is not supplied literally but compressed by 253 6LoWPAN-GHC. 255 0 1 2 3 4 5 6 7 256 +---+---+---+---+---+---+---+---+ 257 | 1 | 1 | 0 | 1 | 0 | C | P | 258 +---+---+---+---+---+---+---+---+ 260 Figure 2: NHC byte for UDP GHC (to be allocated by IANA) 262 To stay in the same general numbering space, we use 0b11011111 as the 263 NHC byte for ICMPv6 GHC (Figure 3). 265 0 1 2 3 4 5 6 7 266 +---+---+---+---+---+---+---+---+ 267 | 1 | 1 | 0 | 1 | 1 | 1 | 1 | 1 | 268 +---+---+---+---+---+---+---+---+ 270 Figure 3: NHC byte for ICMPv6 GHC (to be allocated by IANA) 272 3.2. Compressing extension headers 274 Compression of specific extension headers is added in a similar way 275 (Figure 4) (however, probably only EID 0 to 3 need to be assigned). 276 As there is no easy way to extract the length field from the GHC- 277 encoded header before decoding, this would make detecting the end of 278 the extension header somewhat complex. The easiest (and most 279 efficient) approach is to completely elide the length field (in the 280 same way NHC already elides the next header field in certain cases) 281 and reconstruct it only on decompression. To serve as a terminator 282 for the extension header, the reserved bytecode 0b10010000 has been 283 assigned as a stop marker. Note that the stop marker is only needed 284 for extension headers, not for the final payloads discussed in the 285 previous subsection, the decompression of which is automatically 286 stopped by the end of the packet. 288 0 1 2 3 4 5 6 7 289 +---+---+---+---+---+---+---+---+ 290 | 1 | 0 | 1 | 1 | EID |NH | 291 +---+---+---+---+---+---+---+---+ 293 Figure 4: NHC byte for extension header GHC 295 3.3. Indicating GHC capability 297 The 6LoWPAN baseline includes just [RFC4944], [RFC6282], [RFC6775] 298 (see [I-D.bormann-6lo-6lowpan-roadmap]). To enable the use of GHC 299 towards a neighbor, a 6LoWPAN node needs to know that the neighbor 300 implements it. While this can also simply be administratively 301 required, a transition strategy as well as a way to support mixed 302 networks is required. 304 One way to know a neighbor does implement GHC is receiving a packet 305 from that neighbor with GHC in it ("implicit capability detection"). 306 However, there needs to be a way to bootstrap this, as nobody ever 307 would start sending packets with GHC otherwise. 309 To minimize the impact on [RFC6775], we define an ND option 6LoWPAN 310 Capability Indication (6CIO), as illustrated in Figure 5. (For the 311 fields marked by an underscore in Figure 5, see Section 3.4.) 313 0 1 2 3 314 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 315 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 316 | Type | Length = 1 |_____________________________|G| 317 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 318 |_______________________________________________________________| 319 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 321 Figure 5: 6LoWPAN Capability Indication Option (6CIO) 323 The G bit indicates whether the node sending the option is GHC 324 capable. 326 Once a node receives either an explicit or an implicit indication of 327 GHC capability from another node, it may send GHC-compressed packets 328 to that node. Where that capability has not been recently confirmed, 329 similar to the way PLPMTUD [RFC4821] finds out about changes in the 330 network, a node SHOULD make use of NUD (neighbor unreachability 331 detection) failures to switch back to basic 6LoWPAN header 332 compression [RFC6282]. 334 3.4. Using the 6CIO Option 336 The 6CIO option will typically only be ever sent in 6LoWPAN-ND RS 337 packets (which cannot itself be GHC compressed unless the host 338 desires to limit itself to talking to GHC capable routers). The 339 resulting 6LoWPAN-ND RA can then already make use of GHC and thus 340 indicate GHC capability implicitly, which in turn allows both nodes 341 to use GHC in the 6LoWPAN-ND NS/NA exchange. 343 6CIO can also be used for future options that need to be negotiated 344 between 6LoWPAN peers; an IANA registry is used to assign the flags. 345 Bits marked by underscores in Figure 5 are unassigned and available 346 for future assignment. They MUST be sent as zero and MUST be ignored 347 on reception until assigned by IANA. Length values larger than 1 348 MUST be accepted by implementations in order to enable future 349 extensions; the additional bits in the option are then deemed 350 unassigned in the same way. For the purposes of the IANA registry, 351 the bits are numbered in most-significant-bit-first order from the 352 16th bit of the option onward: the 16th bit is flag number 0, the 353 31st bit (the G bit) is flag number 15, up to the 63rd bit for flag 354 number 47. (Additional bits may also be used by a follow-on version 355 of this document if some bit combinations that have been left 356 unassigned here are then used in an upward compatible manner.) 358 Flag numbers 0 to 7 are reserved for experiments. They MUST NOT be 359 used for actual deployments. 361 Where the use of this option by other specifications or by 362 experiments is envisioned, the following items have to be kept in 363 mind: 365 o The option can be used in any ND packet. 367 o Specific bits are set in the option to indicate that a capability 368 is present in the sender. (There may be other ways to infer this 369 information, as is the case in this specification.) Bit 370 combinations may be used as desired. The absence of the 371 capability _indication_ is signaled by setting these bits to zero; 372 this does not necessarily mean that the capability is absent. 374 o The intention is not to modify the semantics of the specific ND 375 packet carrying the option, but to provide the general capability 376 indication described above. 378 o Specifications have to be designed such that receivers that do not 379 receive or do not process such a capability indication can still 380 interoperate (presumably without exploiting the indicated 381 capability). 383 o The option is meant to be used sparsely, i.e. once a sender has 384 reason to believe the capability indication has been received, 385 there no longer is a need to continue sending it. 387 4. IANA considerations 389 [This section to be removed/replaced by the RFC Editor.] 391 In the IANA registry for the "LOWPAN_NHC Header Type" (in the "IPv6 392 Low Power Personal Area Network Parameters"), IANA is requested to 393 add the assignments in Figure 6. 395 10110IIN: Extension header GHC [RFCthis] 396 11010CPP: UDP GHC [RFCthis] 397 11011111: ICMPv6 GHC [RFCthis] 399 Figure 6: IANA assignments for the NHC byte 401 IANA is requested to allocate an ND option number for the "6LoWPAN 402 Capability Indication Option (6CIO)" ND option format in the Registry 403 "IPv6 Neighbor Discovery Option Formats" [RFC4861]. 405 IANA is requested to create a subregistry for "6LoWPAN capability 406 bits" within the "Internet Control Message Protocol version 6 407 (ICMPv6) Parameters". The bits are assigned by giving their numbers 408 as small non-negative integers as defined in section Section 3.4, 409 preferably in the range 0..47. The policy is "IETF Review" or "IESG 410 Approval" [RFC5226]. The initial content of the registry is as in 411 Figure 7: 413 0..7: reserved for experiments [RFCthis] 414 8..14: unassigned 415 15: GHC capable bit (G bit) [RFCthis] 416 16..47: unassigned 418 Figure 7: IANA assignments for the 6LoWPAN capability bits 420 5. Security considerations 422 The security considerations of [RFC4944] and [RFC6282] apply. As 423 usual in protocols with packet parsing/construction, care must be 424 taken in implementations to avoid buffer overflows and in particular 425 (with respect to the back-referencing) out-of-area references during 426 decompression. 428 One additional consideration is that an attacker may send a forged 429 packet that makes a second node believe a third victim node is GHC- 430 capable. If it is not, this may prevent packets sent by the second 431 node from reaching the third node (at least until robustness features 432 such as those discussed in Section 3.3 kick in). 434 No mitigation is proposed (or known) for this attack, except that a 435 victim node that does implement GHC is not vulnerable. However, with 436 unsecured ND, a number of attacks with similar outcomes are already 437 possible, so there is little incentive to make use of this additional 438 attack. With secured ND, 6CIO is also secured; nodes relying on 439 secured ND therefore should use 6CIO bidirectionally (and limit the 440 implicit capability detection to secured ND packets carrying GHC) 441 instead of basing their neighbor capability assumptions on receiving 442 any kind of unprotected packet. 444 As with any LZ77 scheme, decompression bombs (compressed packets 445 crafted to expand so much that the decompressor is overloaded) are a 446 problem. An attacker cannot send a GHC decompressor into a tight 447 loop for too long, because the MTU will be reached quickly. Some 448 amplification of an attack from inside the compressed link is 449 possible, though. Using a constrained node in a constrained network 450 as a DoS attack source is usually not very useful, though, except 451 maybe against other nodes in that constrained network. The worst 452 case for an attack to the outside is a not-so-constrained device 453 using a (typically not-so-constrained) edge router to attack by 454 forwarding out of its Ethernet interface. The worst-case 455 amplification of GHC is 17, so an MTU-size packet can be generated 456 from a 6LoWPAN packet of 76 bytes. The 6LoWPAN network is still 457 constrained, so the amplification at the edge router turns an entire 458 250 kbit/s 802.15.4 network (assuming a theoretical upper bound of 459 225 kbit/s throughput to a single-hop adjacent node) into a 3.8 Mbit/ 460 s attacker. 462 The amplification may be more important inside the 6LoWPAN, if there 463 is a way to obtain reflection (otherwise the packet is likely to 464 simply stay compressed on the way and do little damage), e.g., by 465 pinging a node using a decompression bomb, somehow keeping that node 466 from re-compressing the ping response (which would probably require 467 something more complex than simple runs of zeroes, so the worst-case 468 amplification is likely closer to 9). Or, if there are nodes that do 469 not support GHC, those can be attacked via a router that is then 470 forced to decompress. 472 All these attacks are mitigated by some form of network access 473 control. 475 In a 6LoWPAN stack, sensitive information will normally be protected 476 by transport or application (or even IP) layer security, which are 477 all above the adaptation layer, leaving no sensitive information to 478 compress at the GHC level. However, a 6LoWPAN deployment that 479 entirely depends on MAC layer security may be vulnerable to attacks 480 that exploit redundancy information disclosed by compression to 481 recover information about secret values. The attacker would need to 482 be in radio range to observe the compressed packets. Since 483 compression is stateless, the attacker would need to entice the party 484 sending the secret value to also send some value controlled (or at 485 least usefully varying and knowable) by the attacker in (what becomes 486 the first adaptation layer fragment of) the same packet. This attack 487 is fully mitigated by not exposing secret values to the adaptation 488 layer, or by not using GHC in deployments where this is done. 490 6. Acknowledgements 492 Colin O'Flynn has repeatedly insisted that some form of compression 493 for ICMPv6 and ND packets might be beneficial. He actually wrote his 494 own draft, [I-D.oflynn-6lowpan-icmphc], which compresses better, but 495 addresses basic ICMPv6/ND only and needs a much longer spec (around 496 17 pages of detailed spec, as compared to the single page of core 497 spec here). This motivated the author to try something simple, yet 498 general. Special thanks go to Colin for indicating that he indeed 499 considers his draft superseded by the present one. 501 The examples given are based on pcap files that Colin O'Flynn, Owen 502 Kirby, Olaf Bergmann and others provided. 504 Using these pcap files as a corpus, the static dictionary was 505 developed, and the bit allocations validated, based on research by 506 Sebastian Dominik. 508 Erik Nordmark provided input that helped shaping the 6CIO option. 509 Thomas Bjorklund proposed simplifying the predefined dictionary. 511 Yoshihiro Ohba insisted on clarifying the notation used for the 512 definition of the bytecodes and their bitfields. Ulrich Herberg 513 provided some additional review and suggested expanding the 514 introductory material, and with Hannes Tschofenig and Brian Haberman 515 he helped come up with the IANA policy for the "6LoWPAN capability 516 bits" assignments in the 6CIO option. 518 The IESG reviewers Richard Barnes and Stephen Farrell have 519 contributed issues to the security considerations section; they and 520 Barry Leiba, as well as GEN-ART reviewer Vijay K. Gurbani also have 521 provided editorial improvements. 523 7. References 525 7.1. Normative References 527 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 528 Requirement Levels", BCP 14, RFC 2119, March 1997. 530 [RFC4861] Narten, T., Nordmark, E., Simpson, W., and H. Soliman, 531 "Neighbor Discovery for IP version 6 (IPv6)", RFC 4861, 532 September 2007. 534 [RFC4944] Montenegro, G., Kushalnagar, N., Hui, J., and D. Culler, 535 "Transmission of IPv6 Packets over IEEE 802.15.4 536 Networks", RFC 4944, September 2007. 538 [RFC5226] Narten, T. and H. Alvestrand, "Guidelines for Writing an 539 IANA Considerations Section in RFCs", BCP 26, RFC 5226, 540 May 2008. 542 [RFC6282] Hui, J. and P. Thubert, "Compression Format for IPv6 543 Datagrams over IEEE 802.15.4-Based Networks", RFC 6282, 544 September 2011. 546 [RFC6775] Shelby, Z., Chakrabarti, S., Nordmark, E., and C. Bormann, 547 "Neighbor Discovery Optimization for IPv6 over Low-Power 548 Wireless Personal Area Networks (6LoWPANs)", RFC 6775, 549 November 2012. 551 7.2. Informative References 553 [I-D.bormann-6lo-6lowpan-roadmap] 554 Bormann, C., "6LoWPAN Roadmap and Implementation Guide", 555 draft-bormann-6lo-6lowpan-roadmap-00 (work in progress), 556 October 2013. 558 [I-D.oflynn-6lowpan-icmphc] 559 O'Flynn, C., "ICMPv6/ND Compression for 6LoWPAN Networks", 560 draft-oflynn-6lowpan-icmphc-00 (work in progress), July 561 2010. 563 [LZ77] Ziv, J. and A. Lempel, "A Universal Algorithm for 564 Sequential Data Compression", IEEE Transactions on 565 Information Theory, Vol. 23, No. 3, pp. 337-343, May 1977. 567 [RFC1951] Deutsch, P., "DEFLATE Compressed Data Format Specification 568 version 1.3", RFC 1951, May 1996. 570 [RFC3095] Bormann, C., Burmeister, C., Degermark, M., Fukushima, H., 571 Hannu, H., Jonsson, L-E., Hakenberg, R., Koren, T., Le, 572 K., Liu, Z., Martensson, A., Miyazaki, A., Svanbro, K., 573 Wiebke, T., Yoshimura, T., and H. Zheng, "RObust Header 574 Compression (ROHC): Framework and four profiles: RTP, UDP, 575 ESP, and uncompressed", RFC 3095, July 2001. 577 [RFC4821] Mathis, M. and J. Heffner, "Packetization Layer Path MTU 578 Discovery", RFC 4821, March 2007. 580 [RFC5795] Sandlund, K., Pelletier, G., and L-E. Jonsson, "The RObust 581 Header Compression (ROHC) Framework", RFC 5795, March 582 2010. 584 [RFC7228] Bormann, C., Ersue, M., and A. Keranen, "Terminology for 585 Constrained-Node Networks", RFC 7228, May 2014. 587 Appendix A. Examples 589 This section demonstrates some relatively realistic examples derived 590 from actual PCAP dumps taken at previous interops. 592 Figure 8 shows an RPL DODAG Information Solicitation, a quite short 593 RPL message that obviously cannot be improved much. 595 IP header: 596 60 00 00 00 00 08 3a ff fe 80 00 00 00 00 00 00 597 02 1c da ff fe 00 20 24 ff 02 00 00 00 00 00 00 598 00 00 00 00 00 00 00 1a 599 Payload: 600 9b 00 6b de 00 00 00 00 601 Dictionary: 602 fe 80 00 00 00 00 00 00 02 1c da ff fe 00 20 24 603 ff 02 00 00 00 00 00 00 00 00 00 00 00 00 00 1a 604 16 fe fd 17 fe fd 00 01 00 00 00 00 00 01 00 00 605 copy: 04 9b 00 6b de 606 4 nulls: 82 607 Compressed: 608 04 9b 00 6b de 82 609 Was 8 bytes; compressed to 6 bytes, compression factor 1.33 611 Figure 8: A simple RPL example 613 Figure 9 shows an RPL DODAG Information Object, a longer RPL control 614 message that is improved a bit more. Note that the compressed output 615 exposes an inefficiency in the simple-minded compressor used to 616 generate it; this does not devalue the example since constrained 617 nodes are quite likely to make use of simple-minded compressors. 619 IP header: 620 60 00 00 00 00 5c 3a ff fe 80 00 00 00 00 00 00 621 02 1c da ff fe 00 30 23 ff 02 00 00 00 00 00 00 622 00 00 00 00 00 00 00 1a 623 Payload: 624 9b 01 7a 5f 00 f0 01 00 88 00 00 00 20 02 0d b8 625 00 00 00 00 00 00 00 ff fe 00 fa ce 04 0e 00 14 626 09 ff 00 00 01 00 00 00 00 00 00 00 08 1e 80 20 627 ff ff ff ff ff ff ff ff 00 00 00 00 20 02 0d b8 628 00 00 00 00 00 00 00 ff fe 00 fa ce 03 0e 40 00 629 ff ff ff ff 20 02 0d b8 00 00 00 00 630 Dictionary: 631 fe 80 00 00 00 00 00 00 02 1c da ff fe 00 30 23 632 ff 02 00 00 00 00 00 00 00 00 00 00 00 00 00 1a 633 16 fe fd 17 fe fd 00 01 00 00 00 00 00 01 00 00 634 copy: 06 9b 01 7a 5f 00 f0 635 ref(9): 01 00 -> ref 11nnnkkk 0 7: c7 636 copy: 01 88 637 3 nulls: 81 638 copy: 04 20 02 0d b8 639 7 nulls: 85 640 ref(60): ff fe 00 -> ref 101nssss 0 7/11nnnkkk 1 1: a7 c9 641 copy: 08 fa ce 04 0e 00 14 09 ff 642 ref(39): 00 00 01 00 00 -> ref 101nssss 0 4/11nnnkkk 3 2: a4 da 643 5 nulls: 83 644 copy: 06 08 1e 80 20 ff ff 645 ref(2): ff ff -> ref 11nnnkkk 0 0: c0 646 ref(4): ff ff ff ff -> ref 11nnnkkk 2 0: d0 647 4 nulls: 82 648 ref(48): 20 02 0d b8 00 00 00 00 00 00 00 ff fe 00 fa ce 649 -> ref 101nssss 1 4/11nnnkkk 6 0: b4 f0 650 copy: 03 03 0e 40 651 ref(9): 00 ff -> ref 11nnnkkk 0 7: c7 652 ref(28): ff ff ff -> ref 101nssss 0 3/11nnnkkk 1 1: a3 c9 653 ref(24): 20 02 0d b8 00 00 00 00 654 -> ref 101nssss 0 2/11nnnkkk 6 0: a2 f0 655 Compressed: 656 06 9b 01 7a 5f 00 f0 c7 01 88 81 04 20 02 0d b8 657 85 a7 c9 08 fa ce 04 0e 00 14 09 ff a4 da 83 06 658 08 1e 80 20 ff ff c0 d0 82 b4 f0 03 03 0e 40 c7 659 a3 c9 a2 f0 660 Was 92 bytes; compressed to 52 bytes, compression factor 1.77 662 Figure 9: A longer RPL example 664 Similarly, Figure 10 shows an RPL DAO message. One of the embedded 665 addresses is copied right out of the pseudo-header, the other one is 666 effectively converted from global to local by providing the prefix 667 FE80 literally, inserting a number of nulls, and copying (some of) 668 the IID part again out of the pseudo-header. Note that a simple 669 implementation would probably emit fewer nulls and copy the entire 670 IID; there are multiple ways to encode this 50-byte payload into 27 671 bytes. 673 IP header: 674 60 00 00 00 00 32 3a ff 20 02 0d b8 00 00 00 00 675 00 00 00 ff fe 00 33 44 20 02 0d b8 00 00 00 00 676 00 00 00 ff fe 00 11 22 677 Payload: 678 9b 02 58 7d 01 80 00 f1 05 12 00 80 20 02 0d b8 679 00 00 00 00 00 00 00 ff fe 00 33 44 06 14 00 80 680 f1 00 fe 80 00 00 00 00 00 00 00 00 00 ff fe 00 681 11 22 682 Dictionary: 683 20 02 0d b8 00 00 00 00 00 00 00 ff fe 00 33 44 684 20 02 0d b8 00 00 00 00 00 00 00 ff fe 00 11 22 685 16 fe fd 17 fe fd 00 01 00 00 00 00 00 01 00 00 686 copy: 0c 9b 02 58 7d 01 80 00 f1 05 12 00 80 687 ref(60): 20 02 0d b8 00 00 00 00 00 00 00 ff fe 00 33 44 688 -> ref 101nssss 1 5/11nnnkkk 6 4: b5 f4 689 copy: 08 06 14 00 80 f1 00 fe 80 690 9 nulls: 87 691 ref(66): ff fe 00 11 22 -> ref 101nssss 0 7/11nnnkkk 3 5: a7 dd 692 Compressed: 693 0c 9b 02 58 7d 01 80 00 f1 05 12 00 80 b5 f4 08 694 06 14 00 80 f1 00 fe 80 87 a7 dd 695 Was 50 bytes; compressed to 27 bytes, compression factor 1.85 697 Figure 10: An RPL DAO message 699 Figure 11 shows the effect of compressing a simple ND neighbor 700 solicitation. 702 IP header: 703 60 00 00 00 00 30 3a ff 20 02 0d b8 00 00 00 00 704 00 00 00 ff fe 00 3b d3 fe 80 00 00 00 00 00 00 705 02 1c da ff fe 00 30 23 706 Payload: 707 87 00 a7 68 00 00 00 00 fe 80 00 00 00 00 00 00 708 02 1c da ff fe 00 30 23 01 01 3b d3 00 00 00 00 709 1f 02 00 00 00 00 00 06 00 1c da ff fe 00 20 24 710 Dictionary: 711 20 02 0d b8 00 00 00 00 00 00 00 ff fe 00 3b d3 712 fe 80 00 00 00 00 00 00 02 1c da ff fe 00 30 23 713 16 fe fd 17 fe fd 00 01 00 00 00 00 00 01 00 00 714 copy: 04 87 00 a7 68 715 4 nulls: 82 716 ref(40): fe 80 00 00 00 00 00 00 02 1c da ff fe 00 30 23 717 -> ref 101nssss 1 3/11nnnkkk 6 0: b3 f0 718 copy: 04 01 01 3b d3 719 4 nulls: 82 720 copy: 02 1f 02 721 5 nulls: 83 722 copy: 02 06 00 723 ref(24): 1c da ff fe 00 -> ref 101nssss 0 2/11nnnkkk 3 3: a2 db 724 copy: 02 20 24 725 Compressed: 726 04 87 00 a7 68 82 b3 f0 04 01 01 3b d3 82 02 1f 727 02 83 02 06 00 a2 db 02 20 24 728 Was 48 bytes; compressed to 26 bytes, compression factor 1.85 730 Figure 11: An ND neighbor solicitation 732 Figure 12 shows the compression of an ND neighbor advertisement. 734 IP header: 735 60 00 00 00 00 30 3a fe fe 80 00 00 00 00 00 00 736 02 1c da ff fe 00 30 23 20 02 0d b8 00 00 00 00 737 00 00 00 ff fe 00 3b d3 738 Payload: 739 88 00 26 6c c0 00 00 00 fe 80 00 00 00 00 00 00 740 02 1c da ff fe 00 30 23 02 01 fa ce 00 00 00 00 741 1f 02 00 00 00 00 00 06 00 1c da ff fe 00 20 24 742 Dictionary: 743 fe 80 00 00 00 00 00 00 02 1c da ff fe 00 30 23 744 20 02 0d b8 00 00 00 00 00 00 00 ff fe 00 3b d3 745 16 fe fd 17 fe fd 00 01 00 00 00 00 00 01 00 00 746 copy: 05 88 00 26 6c c0 747 3 nulls: 81 748 ref(56): fe 80 00 00 00 00 00 00 02 1c da ff fe 00 30 23 749 -> ref 101nssss 1 5/11nnnkkk 6 0: b5 f0 750 copy: 04 02 01 fa ce 751 4 nulls: 82 752 copy: 02 1f 02 753 5 nulls: 83 754 copy: 02 06 00 755 ref(24): 1c da ff fe 00 -> ref 101nssss 0 2/11nnnkkk 3 3: a2 db 756 copy: 02 20 24 757 Compressed: 758 05 88 00 26 6c c0 81 b5 f0 04 02 01 fa ce 82 02 759 1f 02 83 02 06 00 a2 db 02 20 24 760 Was 48 bytes; compressed to 27 bytes, compression factor 1.78 762 Figure 12: An ND neighbor advertisement 764 Figure 13 shows the compression of an ND router solicitation. Note 765 that the relatively good compression is not caused by the many zero 766 bytes in the link-layer address of this particular capture (which are 767 unlikely to occur in practice): 7 of these 8 bytes are copied from 768 the pseudo-header (the 8th byte cannot be copied as the universal/ 769 local bit needs to be inverted). 771 IP header: 772 60 00 00 00 00 18 3a ff fe 80 00 00 00 00 00 00 773 ae de 48 00 00 00 00 01 ff 02 00 00 00 00 00 00 774 00 00 00 00 00 00 00 02 775 Payload: 776 85 00 90 65 00 00 00 00 01 02 ac de 48 00 00 00 777 00 01 00 00 00 00 00 00 778 Dictionary: 779 fe 80 00 00 00 00 00 00 ae de 48 00 00 00 00 01 780 ff 02 00 00 00 00 00 00 00 00 00 00 00 00 00 02 781 16 fe fd 17 fe fd 00 01 00 00 00 00 00 01 00 00 782 copy: 04 85 00 90 65 783 ref(11): 00 00 00 00 01 -> ref 11nnnkkk 3 6: de 784 copy: 02 02 ac 785 ref(50): de 48 00 00 00 00 01 786 -> ref 101nssss 0 5/11nnnkkk 5 3: a5 eb 787 6 nulls: 84 788 Compressed: 789 04 85 00 90 65 de 02 02 ac a5 eb 84 790 Was 24 bytes; compressed to 12 bytes, compression factor 2.00 792 Figure 13: An ND router solicitation 794 Figure 14 shows the compression of an ND router advertisement. The 795 indefinite lifetime is compressed to four bytes by backreferencing; 796 this could be improved (at the cost of minor additional decompressor 797 complexity) by including some simple runlength mechanism. 799 IP header: 800 60 00 00 00 00 60 3a ff fe 80 00 00 00 00 00 00 801 10 34 00 ff fe 00 11 22 fe 80 00 00 00 00 00 00 802 ae de 48 00 00 00 00 01 803 Payload: 804 86 00 55 c9 40 00 0f a0 1c 5a 38 17 00 00 07 d0 805 01 01 11 22 00 00 00 00 03 04 40 40 ff ff ff ff 806 ff ff ff ff 00 00 00 00 20 02 0d b8 00 00 00 00 807 00 00 00 00 00 00 00 00 20 02 40 10 00 00 03 e8 808 20 02 0d b8 00 00 00 00 21 03 00 01 00 00 00 00 809 20 02 0d b8 00 00 00 00 00 00 00 ff fe 00 11 22 810 Dictionary: 811 fe 80 00 00 00 00 00 00 10 34 00 ff fe 00 11 22 812 fe 80 00 00 00 00 00 00 ae de 48 00 00 00 00 01 813 16 fe fd 17 fe fd 00 01 00 00 00 00 00 01 00 00 814 copy: 0c 86 00 55 c9 40 00 0f a0 1c 5a 38 17 815 2 nulls: 80 816 copy: 06 07 d0 01 01 11 22 817 4 nulls: 82 818 copy: 06 03 04 40 40 ff ff 819 ref(2): ff ff -> ref 11nnnkkk 0 0: c0 820 ref(4): ff ff ff ff -> ref 11nnnkkk 2 0: d0 821 4 nulls: 82 822 copy: 04 20 02 0d b8 823 12 nulls: 8a 824 copy: 04 20 02 40 10 825 ref(38): 00 00 03 -> ref 101nssss 0 4/11nnnkkk 1 3: a4 cb 826 copy: 01 e8 827 ref(24): 20 02 0d b8 00 00 00 00 828 -> ref 101nssss 0 2/11nnnkkk 6 0: a2 f0 829 copy: 02 21 03 830 ref(84): 00 01 00 00 00 00 831 -> ref 101nssss 0 9/11nnnkkk 4 6: a9 e6 832 ref(40): 20 02 0d b8 00 00 00 00 00 00 00 833 -> ref 101nssss 1 3/11nnnkkk 1 5: b3 cd 834 ref(128): ff fe 00 11 22 835 -> ref 101nssss 0 15/11nnnkkk 3 3: af db 836 Compressed: 837 0c 86 00 55 c9 40 00 0f a0 1c 5a 38 17 80 06 07 838 d0 01 01 11 22 82 06 03 04 40 40 ff ff c0 d0 82 839 04 20 02 0d b8 8a 04 20 02 40 10 a4 cb 01 e8 a2 840 f0 02 21 03 a9 e6 b3 cd af db 841 Was 96 bytes; compressed to 58 bytes, compression factor 1.66 843 Figure 14: An ND router advertisement 845 Figure 15 shows the compression of a DTLS application data packet 846 with a net payload of 13 bytes of cleartext, and 8 bytes of 847 authenticator (note that the IP header is not relevant for this 848 example and has been set to 0). This makes good use of the static 849 dictionary, and is quite effective crunching out the redundancy in 850 the TLS_PSK_WITH_AES_128_CCM_8 header, leading to a net reduction by 851 15 bytes. 853 IP header: 854 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 855 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 856 00 00 00 00 00 00 00 00 857 Payload: 858 17 fe fd 00 01 00 00 00 00 00 01 00 1d 00 01 00 859 00 00 00 00 01 09 b2 0e 82 c1 6e b6 96 c5 1f 36 860 8d 17 61 e2 b5 d4 22 d4 ed 2b 861 Dictionary: 862 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 863 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 864 16 fe fd 17 fe fd 00 01 00 00 00 00 00 01 00 00 865 ref(13): 17 fe fd 00 01 00 00 00 00 00 01 00 866 -> ref 101nssss 1 0/11nnnkkk 2 1: b0 d1 867 copy: 01 1d 868 ref(10): 00 01 00 00 00 00 00 01 -> ref 11nnnkkk 6 2: f2 869 copy: 15 09 b2 0e 82 c1 6e b6 96 c5 1f 36 8d 17 61 e2 870 copy: b5 d4 22 d4 ed 2b 871 Compressed: 872 b0 d1 01 1d f2 15 09 b2 0e 82 c1 6e b6 96 c5 1f 873 36 8d 17 61 e2 b5 d4 22 d4 ed 2b 874 Was 42 bytes; compressed to 27 bytes, compression factor 1.56 876 Figure 15: A DTLS application data packet 878 Figure 16 shows that the compression is slightly worse in a 879 subsequent packet (containing 6 bytes of cleartext and 8 bytes of 880 authenticator, yielding a net compression of 13 bytes). The total 881 overhead does stay at a quite acceptable 8 bytes. 883 IP header: 884 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 885 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 886 00 00 00 00 00 00 00 00 887 Payload: 888 17 fe fd 00 01 00 00 00 00 00 05 00 16 00 01 00 889 00 00 00 00 05 ae a0 15 56 67 92 4d ff 8a 24 e4 890 cb 35 b9 891 Dictionary: 892 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 893 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 894 16 fe fd 17 fe fd 00 01 00 00 00 00 00 01 00 00 895 ref(13): 17 fe fd 00 01 00 00 00 00 00 896 -> ref 101nssss 1 0/11nnnkkk 0 3: b0 c3 897 copy: 03 05 00 16 898 ref(10): 00 01 00 00 00 00 00 05 -> ref 11nnnkkk 6 2: f2 899 copy: 0e ae a0 15 56 67 92 4d ff 8a 24 e4 cb 35 b9 900 Compressed: 901 b0 c3 03 05 00 16 f2 0e ae a0 15 56 67 92 4d ff 902 8a 24 e4 cb 35 b9 903 Was 35 bytes; compressed to 22 bytes, compression factor 1.59 905 Figure 16: Another DTLS application data packet 907 Figure 17 shows the compression of a DTLS handshake message, here a 908 client hello. There is little that can be compressed about the 32 909 bytes of randomness. Still, the net reduction is by 14 bytes. 911 IP header: 912 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 913 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 914 00 00 00 00 00 00 00 00 915 Payload: 916 16 fe fd 00 00 00 00 00 00 00 00 00 36 01 00 00 917 2a 00 00 00 00 00 00 00 2a fe fd 51 52 ed 79 a4 918 20 c9 62 56 11 47 c9 39 ee 6c c0 a4 fe c6 89 2f 919 32 26 9a 16 4e 31 7e 9f 20 92 92 00 00 00 02 c0 920 a8 01 00 921 Dictionary: 922 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 923 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 924 16 fe fd 17 fe fd 00 01 00 00 00 00 00 01 00 00 925 ref(16): 16 fe fd -> ref 101nssss 0 1/11nnnkkk 1 5: a1 cd 926 9 nulls: 87 927 copy: 01 36 928 ref(16): 01 00 00 -> ref 101nssss 0 1/11nnnkkk 1 5: a1 cd 929 copy: 01 2a 930 7 nulls: 85 931 copy: 23 2a fe fd 51 52 ed 79 a4 20 c9 62 56 11 47 c9 932 copy: 39 ee 6c c0 a4 fe c6 89 2f 32 26 9a 16 4e 31 7e 933 copy: 9f 20 92 92 934 3 nulls: 81 935 copy: 05 02 c0 a8 01 00 936 Compressed: 937 a1 cd 87 01 36 a1 cd 01 2a 85 23 2a fe fd 51 52 938 ed 79 a4 20 c9 62 56 11 47 c9 39 ee 6c c0 a4 fe 939 c6 89 2f 32 26 9a 16 4e 31 7e 9f 20 92 92 81 05 940 02 c0 a8 01 00 941 Was 67 bytes; compressed to 53 bytes, compression factor 1.26 943 Figure 17: A DTLS handshake packet (client hello) 945 Author's Address 947 Carsten Bormann 948 Universitaet Bremen TZI 949 Postfach 330440 950 D-28359 Bremen 951 Germany 953 Phone: +49-421-218-63921 954 Email: cabo@tzi.org