idnits 2.17.1 draft-bormann-6lowpan-ghc-06.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 (March 29, 2013) is 4018 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 363, but not defined ** Obsolete normative reference: RFC 2460 (Obsoleted by RFC 8200) ** Obsolete normative reference: RFC 5226 (Obsoleted by RFC 8126) == Outdated reference: A later version (-04) exists of draft-bormann-6lowpan-roadmap-03 Summary: 2 errors (**), 0 flaws (~~), 3 warnings (==), 1 comment (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 6LoWPAN Working Group C. Bormann 3 Internet-Draft Universitaet Bremen TZI 4 Intended status: Standards Track March 29, 2013 5 Expires: September 30, 2013 7 6LoWPAN Generic Compression of Headers and Header-like Payloads 8 draft-bormann-6lowpan-ghc-06 10 Abstract 12 This short I-D 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 September 30, 2013. 34 Copyright Notice 36 Copyright (c) 2013 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. Terminology . . . . . . . . . . . . . . . . . . . . . . . 2 54 1.3. Notation . . . . . . . . . . . . . . . . . . . . . . . . 3 55 2. 6LoWPAN-GHC . . . . . . . . . . . . . . . . . . . . . . . . . 4 56 3. Integrating 6LoWPAN-GHC into 6LoWPAN-HC . . . . . . . . . . . 5 57 3.1. Compressing payloads (UDP and ICMPv6) . . . . . . . . . . 5 58 3.2. Compressing extension headers . . . . . . . . . . . . . . 5 59 3.3. Indicating GHC capability . . . . . . . . . . . . . . . . 6 60 3.4. Using the 6CIO Option . . . . . . . . . . . . . . . . . . 7 61 4. IANA considerations . . . . . . . . . . . . . . . . . . . . . 8 62 5. Security considerations . . . . . . . . . . . . . . . . . . . 9 63 6. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 9 64 7. References . . . . . . . . . . . . . . . . . . . . . . . . . 10 65 7.1. Normative References . . . . . . . . . . . . . . . . . . 10 66 7.2. Informative References . . . . . . . . . . . . . . . . . 10 67 Appendix A. Examples . . . . . . . . . . . . . . . . . . . . . . 11 68 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 19 70 1. Introduction 72 1.1. The Header Compression Coupling Problem 74 6LoWPAN-HC [RFC6282] defines a scheme for header compression in 75 6LoWPAN [RFC4944] packets. As with most header compression schemes, 76 a new specification is needed for every new kind of header that needs 77 to be compressed. In addition, [RFC6282] does not define an 78 extensibility scheme like the ROHC profiles defined in ROHC [RFC3095] 79 [RFC5795]. This leads to the difficult situation that 6LoWPAN-HC 80 tended to be reopened and reexamined each time a new header receives 81 consideration (or an old header is changed and reconsidered) in the 82 6LoWPAN/roll/CoRE cluster of IETF working groups. While [RFC6282] 83 finally got completed, the underlying problem remains unsolved. 85 The purpose of the present contribution is to plug into [RFC6282] as 86 is, using its NHC (next header compression) concept. We add a 87 slightly less efficient, but vastly more general form of compression 88 for headers of any kind and even for header-like payloads such as 89 those exhibited by routing protocols, DHCP, etc. The objective is an 90 extremely simple specification that can be defined on a single page 91 and implemented in a small number of lines of code, as opposed to a 92 general data compression scheme such as that defined in [RFC1951]. 94 1.2. Terminology 95 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 96 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 97 document are to be interpreted as described in RFC 2119 [RFC2119]. 99 The term "byte" is used in its now customary sense as a synonym for 100 "octet". 102 1.3. Notation 104 This specification uses a trivial notation for code bytes and the 105 bitfields in them the meaning of which should be mostly obvious. 106 More formally speaking, the meaning of the notation is: 108 Potential values for the code bytes themselves are expressed by 109 templates that represent 8-bit most-significant-bit-first binary 110 numbers (without any special prefix), where 0 stands for 0, 1 for 1, 111 and variable segments in these code byte templates are indicated by 112 sequences of the same letter such as kkkkkkk or ssss, the length of 113 which indicates the length of the variable segment in bits. 115 In the notation of values derived from the code bytes, 0b is used as 116 a prefix for expressing binary numbers in most-significant-bit first 117 notation (akin to the use of 0x for most-significant-digit-first 118 hexadecimal numbers in the C programming language). Where the 119 abovementioned sequences of letters are then referenced in such a 120 binary number in the text, the intention is that the value from these 121 bitfields in the actual code byte be inserted. 123 Example: The code byte template 125 101nssss 127 stands for a byte that starts (most-significant-bit-first) with the 128 bits 1, 0, and 1, and continues with five variable bits, the first of 129 which is referenced as "n" and the next four are referenced as 130 "ssss". Based on this code byte template, a reference to 132 0b0ssss000 134 means a binary number composed from a zero bit, the four bits that 135 are in the "ssss" field (for 101nssss, the four least significant 136 bits) in the actual byte encountered, kept in the same order, and 137 three more zero bits. 139 2. 6LoWPAN-GHC 141 The format of a GHC-compressed header or payload is a simple 142 bytecode. A compressed header consists of a sequence of pieces, each 143 of which begins with a code byte, which may be followed by zero or 144 more bytes as its argument. Some code bytes cause bytes to be laid 145 out in the destination buffer, some simply modify some decompression 146 variables. 148 At the start of decompressing a header or payload within a L2 packet 149 (= fragment), variables "sa" and "na" are initialized as zero. 151 The code bytes are defined as follows: 153 +------------+------------------------------------------+-----------+ 154 | code byte | Action | Argument | 155 +------------+------------------------------------------+-----------+ 156 | 0kkkkkkk | Append k = 0b0kkkkkkk bytes of data in | k bytes | 157 | | the bytecode argument (k < 96) | of data | 158 | | | | 159 | 1000nnnn | Append 0b0000nnnn+2 bytes of zeroes | | 160 | | | | 161 | 10010000 | STOP code (end of compressed data, see | | 162 | | Section 3.2) | | 163 | | | | 164 | 101nssss | Set up extended arguments for a | | 165 | | backreference: sa += 0b0ssss000, na += | | 166 | | 0b0000n000 | | 167 | | | | 168 | 11nnnkkk | Backreference: n = na+0b00000nnn+2; s = | | 169 | | 0b00000kkk+sa+n; append n bytes from | | 170 | | previously output bytes, starting s | | 171 | | bytes to the left of the current output | | 172 | | pointer; set sa = 0, na = 0 | | 173 +------------+------------------------------------------+-----------+ 175 Note that the following bit combinations are reserved at this time: 176 011xxxxx, and 1001nnnn (where 0b0000nnnn > 0). 178 For the purposes of the backreferences, the expansion buffer is 179 initialized with a predefined dictionary, at the end of which the 180 target buffer begins. This dictionary is composed of the pseudo- 181 header for the current packet as defined in [RFC2460], followed by a 182 16-byte static dictionary (Figure 1). These dictionary bytes are 183 therefore available for backreferencing, but not copied into the 184 final result. 186 16 fe fd 17 fe fd 00 01 00 00 00 00 00 01 00 00 188 Figure 1: The 16 bytes of static dictionary (in hex) 190 3. Integrating 6LoWPAN-GHC into 6LoWPAN-HC 192 6LoWPAN-GHC is intended to plug in as an NHC format for 6LoWPAN-HC 193 [RFC6282]. This section shows how this can be done (without 194 supplying the detailed normative text yet, although it could be 195 implemented from this page). 197 3.1. Compressing payloads (UDP and ICMPv6) 199 GHC is by definition generic and can be applied to different kinds of 200 packets. All the examples given in Appendix A are for ICMPv6 201 packets; a single NHC value suffices to define an NHC format for 202 ICMPv6 based on GHC (see below). 204 In addition it may be useful to include an NHC format for UDP, as 205 many headerlike payloads (e.g., DHCPv6) are carried in UDP. 206 [RFC6282] already defines an NHC format for UDP (11110CPP). What 207 remains to be done is to define an analogous NHC byte formatted, e.g. 208 as shown in Figure 2, and simply reference the existing 209 specification, indicating that for 0b11010cpp NHC bytes, the UDP 210 payload is not supplied literally but compressed by 6LoWPAN-GHC. 212 0 1 2 3 4 5 6 7 213 +---+---+---+---+---+---+---+---+ 214 | 1 | 1 | 0 | 1 | 0 | C | P | 215 +---+---+---+---+---+---+---+---+ 217 Figure 2: Proposed NHC byte for UDP GHC (actual value to be allocated 218 by IANA) 220 To stay in the same general numbering space, we propose 0b11011111 as 221 the NHC byte for ICMPv6 GHC (Figure 3). 223 0 1 2 3 4 5 6 7 224 +---+---+---+---+---+---+---+---+ 225 | 1 | 1 | 0 | 1 | 1 | 1 | 1 | 1 | 226 +---+---+---+---+---+---+---+---+ 228 Figure 3: Proposed NHC byte for ICMPv6 GHC (actual value to be 229 allocated by IANA) 231 3.2. Compressing extension headers 232 If the compression of specific extension headers is considered 233 desirable, this can be added in a similar way, e.g. as in Figure 4 234 (however, probably only EID 0 to 3 need to be assigned). As there is 235 no easy way to extract the length field from the GHC-encoded header 236 before decoding, this would make detecting the end of the extension 237 header somewhat complex. The easiest (and most efficient) approach 238 is to completely elide the length field (in the same way NHC already 239 elides the next header field in certain cases) and reconstruct it 240 only on decompression. To serve as a terminator for the extension 241 header, the reserved bytecode 0b10010000 has been assigned as a stop 242 marker. Note that the stop marker is only needed for extension 243 headers, not for final payloads, the decompression of which is 244 automatically stopped by the end of the packet. 246 0 1 2 3 4 5 6 7 247 +---+---+---+---+---+---+---+---+ 248 | 1 | 0 | 1 | 1 | EID |NH | 249 +---+---+---+---+---+---+---+---+ 251 Figure 4: Proposed NHC byte for extension header GHC 253 3.3. Indicating GHC capability 255 The 6LoWPAN baseline includes just [RFC4944], [RFC6282], [RFC6775] 256 (see [I-D.bormann-6lowpan-roadmap]). To enable the use of GHC, 257 6LoWPAN nodes need to know that their neighbors implement it. While 258 this can also simply be administratively required, a transition 259 strategy as well as a way to support mixed networks is required. 261 One way to know a neighbor does implement GHC is receiving a packet 262 from that neighbor with GHC in it ("implicit capability detection"). 263 However, there needs to be a way to bootstrap this, as nobody ever 264 would start sending packets with GHC otherwise. 266 To minimize the impact on [RFC6775], we propose adding an ND option 267 6LoWPAN Capability Indication (6CIO), as illustrated in Figure 5. 269 0 1 2 3 270 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 271 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 272 | Type | Length = 1 |_____________________________|G| 273 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 274 |_______________________________________________________________| 275 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 277 Figure 5: 6LoWPAN Capability Indication Option (6CIO) 279 The G bit indicates whether the node sending the option is GHC 280 capable. 282 Once a node receives either an explicit or an implicit indication of 283 GHC capability from another node, it may send GHC-compressed packets 284 to that node. Where that capability has not been recently confirmed, 285 similar to the way PLPMTUD [RFC4821] finds out about changes in the 286 network, a node SHOULD make use of NUD (neighbor unreachability 287 detection) failures to switch back to basic 6LoWPAN header 288 compression [RFC6282]. 290 3.4. Using the 6CIO Option 292 The 6CIO option will typically only be ever sent in 6LoWPAN-ND RS 293 packets (it then cannot itself be GHC compressed unless the host 294 desires to limit itself to talking to GHC capable routers); the 295 resulting 6LoWPAN-ND RA can already make use of GHC and thus indicate 296 GHC capability implicitly, which in turn allows the nodes to use GHC 297 in the 6LoWPAN-ND NS/NA exchange. 299 6CIO can also be used for future options that need to be negotiated 300 between 6LoWPAN peers; an IANA registry will administrate the flags. 301 (Bits marked by underscores in Figure 5 are reserved for future 302 allocation, i.e., they MUST be sent as zero and MUST be ignored on 303 reception until allocated. Length values larger than 1 MUST be 304 accepted by implementations in order to enable future extensions; the 305 additional bits in the option are then reserved in the same way. For 306 the purposes of the IANA registry, the bits are numbered in msb-first 307 order from the 16th bit of the option onward, i.e., the G bit is flag 308 number 15.) (Additional bits may also be used by a follow-on version 309 of this document if some bit combinations that have been left 310 reserved here are then used in an upward compatible manner.) 312 Where the use of this option by other specifications is envisioned, 313 the following items have to be kept in mind: 315 o The option can be used in any ND packet. 317 o Specific bits are set in the option to indicate that a capability 318 is present in the sender. (There may be other ways to infer this 319 information, as is the case in this specification.) Bit 320 combinations may be used as desired. The absence of the 321 capability _indication_ is signaled by setting these bits to zero; 322 this does not necessarily mean that the capability is absent. 324 o The intention is not to modify the semantics of the specific ND 325 packet carrying the option, but to provide the general capability 326 indication described above. 328 o Specifications have to be designed such that receivers that do not 329 receive or do not process such a capability indication can still 330 interoperate (presumably without exploiting the indicated 331 capability). 333 o The option is meant to be used sparsely, i.e. once a sender has 334 reason to believe the capability indication has been received, 335 there no longer is a need to continue sending it. 337 4. IANA considerations 339 [This section to be removed/replaced by the RFC Editor.] 341 In the IANA registry for the "LOWPAN_NHC Header Type" (in the "IPv6 342 Low Power Personal Area Network Parameters"), IANA needs to add the 343 assignments in Figure 6. 345 10110IIN: Extension header GHC [RFCthis] 346 11010CPP: UDP GHC [RFCthis] 347 11011111: ICMPv6 GHC [RFCthis] 349 Figure 6: IANA assignments for the NHC byte 351 IANA needs to allocate an ND option number for the 6CIO ND option 352 format in the Registry "IPv6 Neighbor Discovery Option Formats" 353 [RFC4861]. 355 IANA needs to create a registry for "6LoWPAN capability bits" within 356 the "Internet Control Message Protocol version 6 (ICMPv6) 357 Parameters". The bits are allocated by giving their numbers as small 358 non-negative integers as defined in section Section 3.4, preferably 359 in the range 0..47. The policy is "RFC Required" [RFC5226]. The 360 initial content of the registry is as in Figure 7: 362 0..14: unassigned 363 15: GHC capable bit (G bit) [RFCthis] 364 16..47: unassigned 366 Figure 7 368 5. Security considerations 370 The security considerations of [RFC4944] and [RFC6282] apply. As 371 usual in protocols with packet parsing/construction, care must be 372 taken in implementations to avoid buffer overflows and in particular 373 (with respect to the back-referencing) out-of-area references during 374 decompression. 376 One additional consideration is that an attacker may send a forged 377 packet that makes a second node believe a third victim node is GHC- 378 capable. If it is not, this may prevent packets sent by the second 379 node from reaching the third node (at least until robustness features 380 such as those discussed in Section 3.3 kick in). 382 No mitigation is proposed (or known) for this attack, except that a 383 victim node that does implement GHC is not vulnerable. However, with 384 unsecured ND, a number of attacks with similar outcomes are already 385 possible, so there is little incentive to make use of this additional 386 attack. With secured ND, 6CIO is also secured; nodes relying on 387 secured ND therefore should use 6CIO bidirectionally (and limit the 388 implicit capability detection to secured ND packets carrying GHC) 389 instead of basing their neighbor capability assumptions on receiving 390 any kind of unprotected packet. 392 6. Acknowledgements 394 Colin O'Flynn has repeatedly insisted that some form of compression 395 for ICMPv6 and ND packets might be beneficial. He actually wrote his 396 own draft, [I-D.oflynn-6lowpan-icmphc], which compresses better, but 397 addresses basic ICMPv6/ND only and needs a much longer spec (around 398 17 pages of detailed spec, as compared to the single page of core 399 spec here). This motivated the author to try something simple, yet 400 general. Special thanks go to Colin for indicating that he indeed 401 considers his draft superseded by the present one. 403 The examples given are based on pcap files that Colin O'Flynn, Owen 404 Kirby, Olaf Bergmann and others provided. 406 The static dictionary was developed, and the bit allocations 407 validated, based on research by Sebastian Dominik. 409 Erik Nordmark provided input that helped shaping the 6CIO option. 411 Yoshihiro Ohba insisted on clarifying the notation used for the 412 definition of the bytecodes and their bitfields. 414 7. References 416 7.1. Normative References 418 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 419 Requirement Levels", BCP 14, RFC 2119, March 1997. 421 [RFC2460] Deering, S.E. and R.M. Hinden, "Internet Protocol, Version 422 6 (IPv6) Specification", RFC 2460, December 1998. 424 [RFC4861] Narten, T., Nordmark, E., Simpson, W., and H. Soliman, 425 "Neighbor Discovery for IP version 6 (IPv6)", RFC 4861, 426 September 2007. 428 [RFC4944] Montenegro, G., Kushalnagar, N., Hui, J., and D. Culler, 429 "Transmission of IPv6 Packets over IEEE 802.15.4 430 Networks", RFC 4944, September 2007. 432 [RFC5226] Narten, T. and H. Alvestrand, "Guidelines for Writing an 433 IANA Considerations Section in RFCs", BCP 26, RFC 5226, 434 May 2008. 436 [RFC6282] Hui, J. and P. Thubert, "Compression Format for IPv6 437 Datagrams over IEEE 802.15.4-Based Networks", RFC 6282, 438 September 2011. 440 [RFC6775] Shelby, Z., Chakrabarti, S., Nordmark, E., and C. Bormann, 441 "Neighbor Discovery Optimization for IPv6 over Low-Power 442 Wireless Personal Area Networks (6LoWPANs)", RFC 6775, 443 November 2012. 445 7.2. Informative References 447 [I-D.bormann-6lowpan-roadmap] 448 Bormann, C., "6LoWPAN Roadmap and Implementation Guide", 449 draft-bormann-6lowpan-roadmap-03 (work in progress), 450 October 2012. 452 [I-D.oflynn-6lowpan-icmphc] 453 O'Flynn, C., "ICMPv6/ND Compression for 6LoWPAN Networks", 454 draft-oflynn-6lowpan-icmphc-00 (work in progress), July 455 2010. 457 [RFC1951] Deutsch, P., "DEFLATE Compressed Data Format Specification 458 version 1.3", RFC 1951, May 1996. 460 [RFC3095] Bormann, C., Burmeister, C., Degermark, M., Fukushima, H., 461 Hannu, H., Jonsson, L-E., Hakenberg, R., Koren, T., Le, 462 K., Liu, Z., Martensson, A., Miyazaki, A., Svanbro, K., 463 Wiebke, T., Yoshimura, T., and H. Zheng, "RObust Header 464 Compression (ROHC): Framework and four profiles: RTP, UDP, 465 ESP, and uncompressed", RFC 3095, July 2001. 467 [RFC4821] Mathis, M. and J. Heffner, "Packetization Layer Path MTU 468 Discovery", RFC 4821, March 2007. 470 [RFC5795] Sandlund, K., Pelletier, G., and L-E. Jonsson, "The RObust 471 Header Compression (ROHC) Framework", RFC 5795, March 472 2010. 474 Appendix A. Examples 476 This section demonstrates some relatively realistic examples derived 477 from actual PCAP dumps taken at previous interops. (TBD: Add a 478 couple DHCP examples.) 480 Figure 8 shows an RPL DODAG Information Solicitation, a quite short 481 RPL message that obviously cannot be improved much. 483 IP header: 484 60 00 00 00 00 08 3a ff fe 80 00 00 00 00 00 00 485 02 1c da ff fe 00 20 24 ff 02 00 00 00 00 00 00 486 00 00 00 00 00 00 00 1a 487 Payload: 488 9b 00 6b de 00 00 00 00 489 Dictionary: 490 fe 80 00 00 00 00 00 00 02 1c da ff fe 00 20 24 491 ff 02 00 00 00 00 00 00 00 00 00 00 00 00 00 1a 492 00 00 00 08 00 00 00 3a 16 fe fd 17 fe fd 00 01 493 00 00 00 00 00 01 00 00 494 copy: 04 9b 00 6b de 495 4 nulls: 82 496 Compressed: 497 04 9b 00 6b de 82 498 Was 8 bytes; compressed to 6 bytes, compression factor 1.33 500 Figure 8: A simple RPL example 502 Figure 9 shows an RPL DODAG Information Object, a longer RPL control 503 message that is improved a bit more. Note that the compressed output 504 exposes an inefficiency in the simple-minded compressor used to 505 generate it; this does not devalue the example since constrained 506 nodes are quite likely to make use of simple-minded compressors. 508 IP header: 509 60 00 00 00 00 5c 3a ff fe 80 00 00 00 00 00 00 510 02 1c da ff fe 00 30 23 ff 02 00 00 00 00 00 00 511 00 00 00 00 00 00 00 1a 512 Payload: 513 9b 01 7a 5f 00 f0 01 00 88 00 00 00 20 02 0d b8 514 00 00 00 00 00 00 00 ff fe 00 fa ce 04 0e 00 14 515 09 ff 00 00 01 00 00 00 00 00 00 00 08 1e 80 20 516 ff ff ff ff ff ff ff ff 00 00 00 00 20 02 0d b8 517 00 00 00 00 00 00 00 ff fe 00 fa ce 03 0e 40 00 518 ff ff ff ff 20 02 0d b8 00 00 00 00 519 Dictionary: 520 fe 80 00 00 00 00 00 00 02 1c da ff fe 00 30 23 521 ff 02 00 00 00 00 00 00 00 00 00 00 00 00 00 1a 522 00 00 00 5c 00 00 00 3a 16 fe fd 17 fe fd 00 01 523 00 00 00 00 00 01 00 00 524 copy: 06 9b 01 7a 5f 00 f0 525 ref(9): 01 00 -> ref 11nnnkkk 0 7: c7 526 copy: 01 88 527 3 nulls: 81 528 copy: 04 20 02 0d b8 529 7 nulls: 85 530 ref(68): ff fe 00 -> ref 101nssss 0 8/11nnnkkk 1 1: a8 c9 531 copy: 08 fa ce 04 0e 00 14 09 ff 532 ref(39): 00 00 01 00 00 -> ref 101nssss 0 4/11nnnkkk 3 2: a4 da 533 5 nulls: 83 534 copy: 06 08 1e 80 20 ff ff 535 ref(2): ff ff -> ref 11nnnkkk 0 0: c0 536 ref(4): ff ff ff ff -> ref 11nnnkkk 2 0: d0 537 4 nulls: 82 538 ref(48): 20 02 0d b8 00 00 00 00 00 00 00 ff fe 00 fa ce 539 -> ref 101nssss 1 4/11nnnkkk 6 0: b4 f0 540 copy: 03 03 0e 40 541 ref(9): 00 ff -> ref 11nnnkkk 0 7: c7 542 ref(28): ff ff ff -> ref 101nssss 0 3/11nnnkkk 1 1: a3 c9 543 ref(24): 20 02 0d b8 00 00 00 00 544 -> ref 101nssss 0 2/11nnnkkk 6 0: a2 f0 545 Compressed: 546 06 9b 01 7a 5f 00 f0 c7 01 88 81 04 20 02 0d b8 547 85 a8 c9 08 fa ce 04 0e 00 14 09 ff a4 da 83 06 548 08 1e 80 20 ff ff c0 d0 82 b4 f0 03 03 0e 40 c7 549 a3 c9 a2 f0 550 Was 92 bytes; compressed to 52 bytes, compression factor 1.77 552 Figure 9: A longer RPL example 554 Similarly, Figure 10 shows an RPL DAO message. One of the embedded 555 addresses is copied right out of the pseudo-header, the other one is 556 effectively converted from global to local by providing the prefix 557 FE80 literally, inserting a number of nulls, and copying (some of) 558 the IID part again out of the pseudo-header. Note that a simple 559 implementation would probably emit fewer nulls and copy the entire 560 IID; there are multiple ways to encode this 50-byte payload into 27 561 bytes. 563 IP header: 564 60 00 00 00 00 32 3a ff 20 02 0d b8 00 00 00 00 565 00 00 00 ff fe 00 33 44 20 02 0d b8 00 00 00 00 566 00 00 00 ff fe 00 11 22 567 Payload: 568 9b 02 58 7d 01 80 00 f1 05 12 00 80 20 02 0d b8 569 00 00 00 00 00 00 00 ff fe 00 33 44 06 14 00 80 570 f1 00 fe 80 00 00 00 00 00 00 00 00 00 ff fe 00 571 11 22 572 Dictionary: 573 20 02 0d b8 00 00 00 00 00 00 00 ff fe 00 33 44 574 20 02 0d b8 00 00 00 00 00 00 00 ff fe 00 11 22 575 00 00 00 32 00 00 00 3a 16 fe fd 17 fe fd 00 01 576 00 00 00 00 00 01 00 00 577 copy: 0c 9b 02 58 7d 01 80 00 f1 05 12 00 80 578 ref(68): 20 02 0d b8 00 00 00 00 00 00 00 ff fe 00 33 44 579 -> ref 101nssss 1 6/11nnnkkk 6 4: b6 f4 580 copy: 08 06 14 00 80 f1 00 fe 80 581 9 nulls: 87 582 ref(74): ff fe 00 11 22 -> ref 101nssss 0 8/11nnnkkk 3 5: a8 dd 583 Compressed: 584 0c 9b 02 58 7d 01 80 00 f1 05 12 00 80 b6 f4 08 585 06 14 00 80 f1 00 fe 80 87 a8 dd 586 Was 50 bytes; compressed to 27 bytes, compression factor 1.85 588 Figure 10: An RPL DAO message 590 Figure 11 shows the effect of compressing a simple ND neighbor 591 solicitation. 593 IP header: 594 60 00 00 00 00 30 3a ff 20 02 0d b8 00 00 00 00 595 00 00 00 ff fe 00 3b d3 fe 80 00 00 00 00 00 00 596 02 1c da ff fe 00 30 23 597 Payload: 598 87 00 a7 68 00 00 00 00 fe 80 00 00 00 00 00 00 599 02 1c da ff fe 00 30 23 01 01 3b d3 00 00 00 00 600 1f 02 00 00 00 00 00 06 00 1c da ff fe 00 20 24 601 Dictionary: 602 20 02 0d b8 00 00 00 00 00 00 00 ff fe 00 3b d3 603 fe 80 00 00 00 00 00 00 02 1c da ff fe 00 30 23 604 00 00 00 30 00 00 00 3a 16 fe fd 17 fe fd 00 01 605 00 00 00 00 00 01 00 00 607 copy: 04 87 00 a7 68 608 4 nulls: 82 609 ref(48): fe 80 00 00 00 00 00 00 02 1c da ff fe 00 30 23 610 -> ref 101nssss 1 4/11nnnkkk 6 0: b4 f0 611 copy: 04 01 01 3b d3 612 4 nulls: 82 613 copy: 02 1f 02 614 5 nulls: 83 615 copy: 02 06 00 616 ref(24): 1c da ff fe 00 -> ref 101nssss 0 2/11nnnkkk 3 3: a2 db 617 copy: 02 20 24 618 Compressed: 619 04 87 00 a7 68 82 b4 f0 04 01 01 3b d3 82 02 1f 620 02 83 02 06 00 a2 db 02 20 24 621 Was 48 bytes; compressed to 26 bytes, compression factor 1.85 623 Figure 11: An ND neighbor solicitation 625 Figure 12 shows the compression of an ND neighbor advertisement. 627 IP header: 628 60 00 00 00 00 30 3a fe fe 80 00 00 00 00 00 00 629 02 1c da ff fe 00 30 23 20 02 0d b8 00 00 00 00 630 00 00 00 ff fe 00 3b d3 631 Payload: 632 88 00 26 6c c0 00 00 00 fe 80 00 00 00 00 00 00 633 02 1c da ff fe 00 30 23 02 01 fa ce 00 00 00 00 634 1f 02 00 00 00 00 00 06 00 1c da ff fe 00 20 24 635 Dictionary: 636 fe 80 00 00 00 00 00 00 02 1c da ff fe 00 30 23 637 20 02 0d b8 00 00 00 00 00 00 00 ff fe 00 3b d3 638 00 00 00 30 00 00 00 3a 16 fe fd 17 fe fd 00 01 639 00 00 00 00 00 01 00 00 640 copy: 05 88 00 26 6c c0 641 3 nulls: 81 642 ref(64): fe 80 00 00 00 00 00 00 02 1c da ff fe 00 30 23 643 -> ref 101nssss 1 6/11nnnkkk 6 0: b6 f0 644 copy: 04 02 01 fa ce 645 4 nulls: 82 646 copy: 02 1f 02 647 5 nulls: 83 648 copy: 02 06 00 649 ref(24): 1c da ff fe 00 -> ref 101nssss 0 2/11nnnkkk 3 3: a2 db 650 copy: 02 20 24 651 Compressed: 652 05 88 00 26 6c c0 81 b6 f0 04 02 01 fa ce 82 02 653 1f 02 83 02 06 00 a2 db 02 20 24 654 Was 48 bytes; compressed to 27 bytes, compression factor 1.78 655 Figure 12: An ND neighbor advertisement 657 Figure 13 shows the compression of an ND router solicitation. Note 658 that the relatively good compression is not caused by the many zero 659 bytes in the link-layer address of this particular capture (which are 660 unlikely to occur in practice): 7 of these 8 bytes are copied from 661 the pseudo-header (the 8th byte cannot be copied as the universal/ 662 local bit needs to be inverted). 664 IP header: 665 60 00 00 00 00 18 3a ff fe 80 00 00 00 00 00 00 666 ae de 48 00 00 00 00 01 ff 02 00 00 00 00 00 00 667 00 00 00 00 00 00 00 02 668 Payload: 669 85 00 90 65 00 00 00 00 01 02 ac de 48 00 00 00 670 00 01 00 00 00 00 00 00 671 Dictionary: 672 fe 80 00 00 00 00 00 00 ae de 48 00 00 00 00 01 673 ff 02 00 00 00 00 00 00 00 00 00 00 00 00 00 02 674 00 00 00 18 00 00 00 3a 16 fe fd 17 fe fd 00 01 675 00 00 00 00 00 01 00 00 676 copy: 04 85 00 90 65 677 ref(11): 00 00 00 00 01 -> ref 11nnnkkk 3 6: de 678 copy: 02 02 ac 679 ref(58): de 48 00 00 00 00 01 680 -> ref 101nssss 0 6/11nnnkkk 5 3: a6 eb 681 6 nulls: 84 682 Compressed: 683 04 85 00 90 65 de 02 02 ac a6 eb 84 684 Was 24 bytes; compressed to 12 bytes, compression factor 2.00 686 Figure 13: An ND router solicitation 688 Figure 14 shows the compression of an ND router advertisement. The 689 indefinite lifetime is compressed to four bytes by backreferencing; 690 this could be improved (at the cost of minor additional decompressor 691 complexity) by including some simple runlength mechanism. 693 IP header: 694 60 00 00 00 00 60 3a ff fe 80 00 00 00 00 00 00 695 10 34 00 ff fe 00 11 22 fe 80 00 00 00 00 00 00 696 ae de 48 00 00 00 00 01 697 Payload: 698 86 00 55 c9 40 00 0f a0 1c 5a 38 17 00 00 07 d0 699 01 01 11 22 00 00 00 00 03 04 40 40 ff ff ff ff 700 ff ff ff ff 00 00 00 00 20 02 0d b8 00 00 00 00 701 00 00 00 00 00 00 00 00 20 02 40 10 00 00 03 e8 702 20 02 0d b8 00 00 00 00 21 03 00 01 00 00 00 00 703 20 02 0d b8 00 00 00 00 00 00 00 ff fe 00 11 22 704 Dictionary: 705 fe 80 00 00 00 00 00 00 10 34 00 ff fe 00 11 22 706 fe 80 00 00 00 00 00 00 ae de 48 00 00 00 00 01 707 00 00 00 60 00 00 00 3a 16 fe fd 17 fe fd 00 01 708 00 00 00 00 00 01 00 00 709 copy: 0c 86 00 55 c9 40 00 0f a0 1c 5a 38 17 710 2 nulls: 80 711 copy: 06 07 d0 01 01 11 22 712 4 nulls: 82 713 copy: 06 03 04 40 40 ff ff 714 ref(2): ff ff -> ref 11nnnkkk 0 0: c0 715 ref(4): ff ff ff ff -> ref 11nnnkkk 2 0: d0 716 4 nulls: 82 717 copy: 04 20 02 0d b8 718 12 nulls: 8a 719 copy: 04 20 02 40 10 720 ref(38): 00 00 03 -> ref 101nssss 0 4/11nnnkkk 1 3: a4 cb 721 copy: 01 e8 722 ref(24): 20 02 0d b8 00 00 00 00 723 -> ref 101nssss 0 2/11nnnkkk 6 0: a2 f0 724 copy: 02 21 03 725 ref(84): 00 01 00 00 00 00 726 -> ref 101nssss 0 9/11nnnkkk 4 6: a9 e6 727 ref(40): 20 02 0d b8 00 00 00 00 00 00 00 728 -> ref 101nssss 1 3/11nnnkkk 1 5: b3 cd 729 ref(136): ff fe 00 11 22 730 -> ref 101nssss 0 15/101nssss 0 1/11nnnkkk 3 3: af a1 db 731 Compressed: 732 0c 86 00 55 c9 40 00 0f a0 1c 5a 38 17 80 06 07 733 d0 01 01 11 22 82 06 03 04 40 40 ff ff c0 d0 82 734 04 20 02 0d b8 8a 04 20 02 40 10 a4 cb 01 e8 a2 735 f0 02 21 03 a9 e6 b3 cd af a1 db 736 Was 96 bytes; compressed to 59 bytes, compression factor 1.63 738 Figure 14: An ND router advertisement 740 Figure 15 shows the compression of a DTLS application data packet 741 with a net payload of 13 bytes of cleartext, and 8 bytes of 742 authenticator (note that the IP header is not relevant for this 743 example and has been set to 0). This makes good use of the static 744 dictionary, and is quite effective crunching out the redundancy in 745 the TLS_PSK_WITH_AES_128_CCM_8 header, leading to a net reduction by 746 15 bytes. 748 IP header: 749 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 750 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 751 00 00 00 00 00 00 00 00 752 Payload: 753 17 fe fd 00 01 00 00 00 00 00 01 00 1d 00 01 00 754 00 00 00 00 01 09 b2 0e 82 c1 6e b6 96 c5 1f 36 755 8d 17 61 e2 b5 d4 22 d4 ed 2b 756 Dictionary: 757 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 758 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 759 00 00 00 2a 00 00 00 00 16 fe fd 17 fe fd 00 01 760 00 00 00 00 00 01 00 00 761 ref(13): 17 fe fd 00 01 00 00 00 00 00 01 00 762 -> ref 101nssss 1 0/11nnnkkk 2 1: b0 d1 763 copy: 01 1d 764 ref(10): 00 01 00 00 00 00 00 01 -> ref 11nnnkkk 6 2: f2 765 copy: 15 09 b2 0e 82 c1 6e b6 96 c5 1f 36 8d 17 61 e2 766 copy: b5 d4 22 d4 ed 2b 767 Compressed: 768 b0 d1 01 1d f2 15 09 b2 0e 82 c1 6e b6 96 c5 1f 769 36 8d 17 61 e2 b5 d4 22 d4 ed 2b 770 Was 42 bytes; compressed to 27 bytes, compression factor 1.56 772 Figure 15: A DTLS application data packet 774 Figure 16 shows that the compression is slightly worse in a 775 subsequent packet (containing 6 bytes of cleartext and 8 bytes of 776 authenticator, yielding a net compression of 13 bytes). The total 777 overhead does stay at a quite acceptable 8 bytes. 779 IP header: 780 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 781 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 782 00 00 00 00 00 00 00 00 783 Payload: 784 17 fe fd 00 01 00 00 00 00 00 05 00 16 00 01 00 785 00 00 00 00 05 ae a0 15 56 67 92 4d ff 8a 24 e4 786 cb 35 b9 787 Dictionary: 788 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 789 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 790 00 00 00 23 00 00 00 00 16 fe fd 17 fe fd 00 01 791 00 00 00 00 00 01 00 00 792 ref(13): 17 fe fd 00 01 00 00 00 00 00 793 -> ref 101nssss 1 0/11nnnkkk 0 3: b0 c3 794 copy: 03 05 00 16 795 ref(10): 00 01 00 00 00 00 00 05 -> ref 11nnnkkk 6 2: f2 796 copy: 0e ae a0 15 56 67 92 4d ff 8a 24 e4 cb 35 b9 797 Compressed: 798 b0 c3 03 05 00 16 f2 0e ae a0 15 56 67 92 4d ff 799 8a 24 e4 cb 35 b9 800 Was 35 bytes; compressed to 22 bytes, compression factor 1.59 802 Figure 16: Another DTLS application data packet 804 Figure 17 shows the compression of a DTLS handshake message, here a 805 client hello. There is little that can be compressed about the 32 806 bytes of randomness. Still, the net reduction is by 14 bytes. 808 IP header: 809 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 810 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 811 00 00 00 00 00 00 00 00 812 Payload: 813 16 fe fd 00 00 00 00 00 00 00 00 00 36 01 00 00 814 2a 00 00 00 00 00 00 00 2a fe fd 51 52 ed 79 a4 815 20 c9 62 56 11 47 c9 39 ee 6c c0 a4 fe c6 89 2f 816 32 26 9a 16 4e 31 7e 9f 20 92 92 00 00 00 02 c0 817 a8 01 00 818 Dictionary: 819 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 820 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 821 00 00 00 43 00 00 00 00 16 fe fd 17 fe fd 00 01 822 00 00 00 00 00 01 00 00 823 ref(16): 16 fe fd -> ref 101nssss 0 1/11nnnkkk 1 5: a1 cd 824 9 nulls: 87 825 copy: 01 36 826 ref(16): 01 00 00 -> ref 101nssss 0 1/11nnnkkk 1 5: a1 cd 827 copy: 01 2a 828 7 nulls: 85 829 copy: 23 2a fe fd 51 52 ed 79 a4 20 c9 62 56 11 47 c9 830 copy: 39 ee 6c c0 a4 fe c6 89 2f 32 26 9a 16 4e 31 7e 831 copy: 9f 20 92 92 832 3 nulls: 81 833 copy: 05 02 c0 a8 01 00 834 Compressed: 835 a1 cd 87 01 36 a1 cd 01 2a 85 23 2a fe fd 51 52 836 ed 79 a4 20 c9 62 56 11 47 c9 39 ee 6c c0 a4 fe 837 c6 89 2f 32 26 9a 16 4e 31 7e 9f 20 92 92 81 05 838 02 c0 a8 01 00 839 Was 67 bytes; compressed to 53 bytes, compression factor 1.26 841 Figure 17: A DTLS handshake packet (client hello) 843 Author's Address 845 Carsten Bormann 846 Universitaet Bremen TZI 847 Postfach 330440 848 D-28359 Bremen 849 Germany 851 Phone: +49-421-218-63921 852 Email: cabo@tzi.org