idnits 2.17.1 draft-ietf-roll-routing-dispatch-01.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: ---------------------------------------------------------------------------- == It seems as if not all pages are separated by form feeds - found 33 form feeds but 37 pages 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 16, 2016) is 2779 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 1170, but not defined == Outdated reference: A later version (-05) exists of draft-ietf-6lo-paging-dispatch-04 -- Possible downref: Non-RFC (?) normative reference: ref. 'IEEE802154' ** Obsolete normative reference: RFC 2460 (Obsoleted by RFC 8200) ** Obsolete normative reference: RFC 5226 (Obsoleted by RFC 8126) == Outdated reference: A later version (-30) exists of draft-ietf-6tisch-architecture-10 == Outdated reference: A later version (-44) exists of draft-ietf-roll-useofrplinfo-08 == Outdated reference: A later version (-08) exists of draft-thubert-6lo-forwarding-fragments-02 Summary: 2 errors (**), 0 flaws (~~), 7 warnings (==), 2 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 roll P. Thubert, Ed. 3 Internet-Draft Cisco 4 Intended status: Standards Track C. Bormann 5 Expires: March 20, 2017 Uni Bremen TZI 6 L. Toutain 7 IMT-TELECOM Bretagne 8 R. Cragie 9 ARM 10 September 16, 2016 12 6LoWPAN Routing Header 13 draft-ietf-roll-routing-dispatch-01 15 Abstract 17 This specification introduces a new 6LoWPAN dispatch type for use in 18 6LoWPAN Route-Over topologies, that initially covers the needs of RPL 19 (RFC6550) data packets compression. Using this dispatch type, this 20 specification defines a method to compress RPL Option (RFC6553) 21 information and Routing Header type 3 (RFC6554), an efficient IP-in- 22 IP technique and is extensible for more applications. 24 Status of This Memo 26 This Internet-Draft is submitted in full conformance with the 27 provisions of BCP 78 and BCP 79. 29 Internet-Drafts are working documents of the Internet Engineering 30 Task Force (IETF). Note that other groups may also distribute 31 working documents as Internet-Drafts. The list of current Internet- 32 Drafts is at http://datatracker.ietf.org/drafts/current/. 34 Internet-Drafts are draft documents valid for a maximum of six months 35 and may be updated, replaced, or obsoleted by other documents at any 36 time. It is inappropriate to use Internet-Drafts as reference 37 material or to cite them other than as "work in progress." 39 This Internet-Draft will expire on March 20, 2017. 41 Copyright Notice 43 Copyright (c) 2016 IETF Trust and the persons identified as the 44 document authors. All rights reserved. 46 This document is subject to BCP 78 and the IETF Trust's Legal 47 Provisions Relating to IETF Documents 48 (http://trustee.ietf.org/license-info) in effect on the date of 49 publication of this document. Please review these documents 50 carefully, as they describe your rights and restrictions with respect 51 to this document. Code Components extracted from this document must 52 include Simplified BSD License text as described in Section 4.e of 53 the Trust Legal Provisions and are provided without warranty as 54 described in the Simplified BSD License. 56 Table of Contents 58 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 59 2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 6 60 3. Using the Page Dispatch . . . . . . . . . . . . . . . . . . . 6 61 3.1. New Routing Header Dispatch (6LoRH) . . . . . . . . . . . 6 62 3.2. Placement Of 6LoRH headers . . . . . . . . . . . . . . . 7 63 3.2.1. Relative To Non-6LoRH Headers . . . . . . . . . . . . 7 64 3.2.2. Relative To Other 6LoRH Headers . . . . . . . . . . . 7 65 4. 6LoWPAN Routing Header General Format . . . . . . . . . . . . 8 66 4.1. Elective Format . . . . . . . . . . . . . . . . . . . . . 8 67 4.2. Critical Format . . . . . . . . . . . . . . . . . . . . . 9 68 4.3. Compressing Addresses . . . . . . . . . . . . . . . . . . 9 69 4.3.1. Coalescence . . . . . . . . . . . . . . . . . . . . . 10 70 4.3.2. DODAG Root Address Determination . . . . . . . . . . 10 71 5. The SRH 6LoRH Header . . . . . . . . . . . . . . . . . . . . 11 72 5.1. Encoding . . . . . . . . . . . . . . . . . . . . . . . . 11 73 5.2. SRH-6LoRH General Operation . . . . . . . . . . . . . . . 13 74 5.2.1. Uncompressed SRH Operation . . . . . . . . . . . . . 13 75 5.2.2. 6LoRH-Compressed SRH Operation . . . . . . . . . . . 13 76 5.2.3. Inner LOWPAN_IPHC Compression . . . . . . . . . . . . 14 77 5.3. The Design Point of Popping Entries . . . . . . . . . . . 14 78 5.4. Compression Reference for SRH-6LoRH header entries . . . 15 79 5.5. Popping Headers . . . . . . . . . . . . . . . . . . . . . 16 80 5.6. Forwarding . . . . . . . . . . . . . . . . . . . . . . . 17 81 6. The RPL Packet Information 6LoRH . . . . . . . . . . . . . . 17 82 6.1. Compressing the RPLInstanceID . . . . . . . . . . . . . . 19 83 6.2. Compressing the SenderRank . . . . . . . . . . . . . . . 19 84 6.3. The Overall RPI-6LoRH encoding . . . . . . . . . . . . . 20 85 7. The IP-in-IP 6LoRH Header . . . . . . . . . . . . . . . . . . 22 86 8. Management Considerations . . . . . . . . . . . . . . . . . . 23 87 9. Security Considerations . . . . . . . . . . . . . . . . . . . 24 88 10. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 24 89 10.1. Reserving Space in 6LoWPAN Dispatch Page 1 . . . . . . . 25 90 10.2. New Critical 6LoWPAN Routing Header Type Registry . . . 25 91 11. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 25 92 12. References . . . . . . . . . . . . . . . . . . . . . . . . . 26 93 12.1. Normative References . . . . . . . . . . . . . . . . . . 26 94 12.2. Informative References . . . . . . . . . . . . . . . . . 27 95 Appendix A. Examples . . . . . . . . . . . . . . . . . . . . . . 28 96 A.1. Examples Compressing The RPI . . . . . . . . . . . . . . 28 97 A.2. Example Of Downward Packet In Non-Storing Mode . . . . . 30 98 A.3. Example of SRH-6LoRH life-cycle . . . . . . . . . . . . . 31 99 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 33 101 1. Introduction 103 The design of Low Power and Lossy Networks (LLNs) is generally 104 focused on saving energy, a very constrained resource in most cases. 105 The other constraints, such as the memory capacity and the duty 106 cycling of the LLN devices, derive from that primary concern. Energy 107 is often available from primary batteries that are expected to last 108 for years, or is scavenged from the environment in very limited 109 quantities. Any protocol that is intended for use in LLNs must be 110 designed with the primary concern of saving energy as a strict 111 requirement. 113 Controlling the amount of data transmission is one possible venue to 114 save energy. In a number of LLN standards, the frame size is limited 115 to much smaller values than the IPv6 maximum transmission unit (MTU) 116 of 1280 bytes. In particular, an LLN that relies on the classical 117 Physical Layer (PHY) of IEEE 802.15.4 [IEEE802154] is limited to 127 118 bytes per frame. The need to compress IPv6 packets over IEEE 119 802.15.4 led to the 6LoWPAN Header Compression [RFC6282] work 120 (6LoWPAN-HC). 122 Innovative Route-over techniques have been and are still being 123 developed for routing inside a LLN. In a general fashion, such 124 techniques require additional information in the packet to provide 125 loop prevention and to indicate information such as flow 126 identification, source routing information, etc. 128 For reasons such as security and the capability to send ICMP errors 129 back to the source, an original packet must not be tampered with, and 130 any information that must be inserted in or removed from an IPv6 131 packet must be placed in an extra IP-in-IP encapsulation. This is 132 the case when the additional routing information is inserted by a 133 router on the path of a packet, for instance a mesh root, as opposed 134 to the source node. This is also the case when some routing 135 information must be removed from a packet that flows outside the LLN. 136 When to use RFC 6553, RFC 6554 and IPv6-in-IPv6 137 [I-D.ietf-roll-useofrplinfo] details different cases where RFC 6553, 138 RFC 6554 and IPv6-in-IPv6 encapsulation is required to set the bases 139 to help defining the compression of RPL routing information in LLN 140 environments. 142 When using [RFC6282] the outer IP header of an IP-in-IP encapsulation 143 may be compressed down to 2 octets in stateless compression and down 144 to 3 octets in stateful compression when context information must be 145 added. 147 0 1 148 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 149 +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 150 | 0 | 1 | 1 | TF |NH | HLIM |CID|SAC| SAM | M |DAC| DAM | 151 +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 153 Figure 1: LOWPAN_IPHC base Encoding (RFC6282). 155 The Stateless Compression of an IPv6 addresses can only happen if the 156 IPv6 address can de deduced from the MAC addresses, meaning that the 157 IP end point is also the MAC-layer endpoint. This is generally not 158 the case in a RPL network which is generally a multi-hop route-over 159 (i.e., operated at Layer-3) network. A better compression, which 160 does not involve variable compressions depending on the hop in the 161 mesh, can be achieved based on the fact that the outer encapsulation 162 is usually between the source (or destination) of the inner packet 163 and the root. Also, the inner IP header can only be compressed by 164 [RFC6282] if all the fields preceding it are also compressed. This 165 specification makes the inner IP header the first header to be 166 compressed by [RFC6282], and keeps the inner packet encoded the same 167 way whether it is encapsulated or not, thus preserving existing 168 implementations. 170 As an example, the Routing Protocol for Low Power and Lossy Networks 171 [RFC6550] (RPL) is designed to optimize the routing operations in 172 constrained LLNs. As part of this optimization, RPL requires the 173 addition of RPL Packet Information (RPI) in every packet, as defined 174 in Section 11.2 of [RFC6550]. 176 The RPL Option for Carrying RPL Information in Data-Plane Datagrams 177 [RFC6553] specification indicates how the RPI can be placed in a RPL 178 Option (RPL-OPT) that is placed in an IPv6 Hop-by-Hop header. 180 This representation demands a total of 8 bytes, while in most cases 181 the actual RPI payload requires only 19 bits. Since the Hop-by-Hop 182 header must not flow outside of the RPL domain, it must be inserted 183 in packets entering the domain and be removed from packets that leave 184 the domain. In both cases, this operation implies an IP-in-IP 185 encapsulation. 187 Additionally, in the case of the Non-Storing Mode of Operation (MOP), 188 RPL requires a Source Routing Header (SRH) in all packets that are 189 routed down a RPL graph. for that purpose, the [IPv6 Routing Header 190 for Source Routes with RPL] (#RFC6554) specification defines the type 191 3 Routing Header for IPv6 (RH3). 193 ------+--------- ^ 194 | Internet | 195 | | Native IPv6 196 +-----+ | 197 | | Border Router (RPL Root) ^ | ^ 198 | | | | | 199 +-----+ | | | IPv6 in 200 | | | | IPv6 201 o o o o | | | plus 202 o o o o o o o o o | | | 203 o o o o o o o o o o | | | RPL SRH 204 o o o o o o o o o | | | 205 o o o o o o o o v v v 206 o o o o 207 LLN 209 Figure 2: IP-in-IP Encapsulation within the LLN. 211 With Non-Storing RPL, even if the source is a node in the same LLN, 212 the packet must first reach up the graph to the root so that the root 213 can insert the SRH to go down the graph. In any fashion, whether the 214 packet was originated in a node in the LLN or outside the LLN, and 215 regardless of whether the packet stays within the LLN or not, as long 216 as the source of the packet is not the root itself, the source- 217 routing operation also implies an IP-in-IP encapsulation at the root 218 in order to insert the SRH. 220 6TiSCH [I-D.ietf-6tisch-architecture] specifies the operation of IPv6 221 over the TimeSlotted Channel Hopping [RFC7554] (TSCH) mode of 222 operation of IEEE 802.15.4. The architecture requires the use of 223 both RPL and the 6lo adaptation layer over IEEE 802.15.4. Because it 224 inherits the constraints on frame size from the MAC layer, 6TiSCH 225 cannot afford to allocate 8 bytes per packet on the RPI. Hence the 226 requirement for 6LoWPAN header compression of the RPI. 228 An extensible compression technique is required that simplifies IP- 229 in-IP encapsulation when it is needed, and optimally compresses 230 existing routing artifacts found in RPL LLNs. 232 This specification extends the 6lo adaptation layer framework 233 ([RFC4944],[RFC6282]) so as to carry routing information for route- 234 over networks based on RPL. The specification includes the formats 235 necessary for RPL and is extensible for additional formats. 237 2. Terminology 239 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 240 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 241 "OPTIONAL" in this document are to be interpreted as described in 242 [RFC2119]. 244 The Terminology used in this document is consistent with and 245 incorporates that described in `Terminology in Low power And Lossy 246 Networks' [RFC7102] and [RFC6550]. 248 The terms Route-over and Mesh-under are defined in [RFC6775]. 250 Other terms in use in LLNs are found in [RFC7228]. 252 The term "byte" is used in its now customary sense as a synonym for 253 "octet". 255 3. Using the Page Dispatch 257 The 6LoWPAN Paging Dispatch [I-D.ietf-6lo-paging-dispatch] 258 specification extends the 6lo adaptation layer framework ([RFC4944], 259 [RFC6282]) by introducing a concept of "context" in the 6LoWPAN 260 parser, a context being identified by a Page number. The 261 specification defines 16 Pages. 263 This draft operates within Page 1, which is indicated by a Dispatch 264 Value of binary 11110001. 266 3.1. New Routing Header Dispatch (6LoRH) 268 This specification introduces a new 6LoWPAN Routing Header (6LoRH) to 269 carry IPv6 routing information. The 6LoRH may contain source routing 270 information such as a compressed form of SRH, as well as other sorts 271 of routing information such as the RPI and IP-in-IP encapsulation. 273 The 6LoRH is expressed in a 6loWPAN packet as a Type-Length-Value 274 (TLV) field, which is extensible for future use. 276 It is expected that a router that does not recognize the 6LoRH 277 general format detailed in Section 4 will drop the packet when a 278 6LoRH is present. 280 This specification uses the bit pattern 10xxxxxx in Page 1 for the 281 new 6LoRH Dispatch. Section 4 describes how RPL artifacts in data 282 packets can be compressed as 6LoRH headers. 284 3.2. Placement Of 6LoRH headers 286 3.2.1. Relative To Non-6LoRH Headers 288 Paging Dispatch is parsed and no subsequent Paging Dispatch has been 289 parsed, the parsing of the packet MUST follow this specification if 290 the 6LoRH Bit Pattern Section 3.1 is found. 292 With this specification, the 6LoRH Dispatch is only defined in Page 293 context is active. 295 Because a 6LoRH header requires a Page 1 context, it MUST always be 296 placed after any Fragmentation Header and/or Mesh Header [RFC4944]. 298 A 6LoRH header MUST always be placed before the LOWPAN_IPHC as 299 defined in 6LoWPAN Header Compression [RFC6282]. It is designed in 300 such a fashion that placing or removing a header that is encoded with 301 6LoRH does not modify the part of the packet that is encoded with 302 LoWPAN_IPHC, whether there is an IP-in-IP encapsulation or not. For 303 instance, the final destination of the packet is always the one in 304 the LOWPAN_IPHC whether there is a Routing Header or not. 306 3.2.2. Relative To Other 6LoRH Headers 308 IPv6 [RFC2460] defines chains of headers that are introduced by an 309 IPv6 header and terminated by either another IPv6 header (IP-in-IP) 310 or an Upper Layer Protocol ULP) header. When an outer header is 311 stripped from the packet, the whole chain goes with it. When one or 312 more header(s) are inserted by an intermediate router, that router 313 normally chains the headers and encapsulates the result in IP-in-IP. 315 With this specification, the chains of headers MUST be compressed in 316 the same order as they appear in the uncompressed form of the packet. 317 This means that if there is more than one nested IP-in-IP 318 encapsulations, the first IP-in-IP encapsulation, with all its chain 319 of headers, is encoded first in the compressed form. 321 In the compressed form of a packet that has SRH or HbH headers after 322 the inner IPv6 header (e.g. if there is no IP-in-IP encapsulation), 323 these headers are placed in the 6LoRH form before the 6LOWPAN-IPHC 324 that represents the IPv6 header Section 3.2.1. If this packet gets 325 encapsulated and some other SRH or HbH headers are added as part of 326 the encapsulation, placing the 6LoRH headers next to one another may 327 present an ambiguity on which header belong to which chain in the 328 uncompressed form. 330 In order to disambiguate the headers that follow the inner IPv6 331 header in the uncompressed form from the headers that follow the 332 outer IP-in-IP header, it is REQUIRED that the compressed IP-in-IP 333 header is placed last in the encoded chain. This means that the 334 6LoRH headers that are found after the last compressed IP-in-IP 335 header are to be inserted after the IPv6 header that is encoded with 336 the 6LOWPAN-IPHC when decompressing the packet. 338 With regards to the relative placement of the SRH and the RPI in the 339 compressed form, it is a design point for this specification that the 340 SRH entries are consumed as the packet progresses down the LLN 341 Section 5.3. In order to make this operation simpler in the 342 compressed form, it is REQUIRED that the in the compressed form, the 343 addresses along the source route path are encoded in the order of the 344 path, and that the compressed SRH are placed before the compressed 345 RPI. 347 4. 6LoWPAN Routing Header General Format 349 The 6LoRH uses the Dispatch Value Bit Pattern of 10xxxxxx in Page 1. 351 The Dispatch Value Bit Pattern is split in two forms of 6LoRH: 353 Elective (6LoRHE) that may skipped if not understood 355 Critical (6LoRHC) that may not be ignored 357 for each form, a Type field is used to encode the type of 6LoRH. 358 Note that there is a different registry for the Type field of each 359 form of 6LoRH, This means that that a value for the Type that is 360 defined for one form of 6LoRH may be redefined in the future for the 361 other form. 363 4.1. Elective Format 365 The 6LoRHE uses the Dispatch Value Bit Pattern of 101xxxxx. A 6LoRHE 366 may be ignored and skipped in parsing. If it is ignored, the 6LoRHE 367 is forwarded with no change inside the LLN. 369 0 1 370 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 371 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- ... -+ 372 |1|0|1| Length | Type | | 373 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- ... -+ 374 <-- Length --> 376 Figure 3: Elective 6LoWPAN Routing Header. 378 Length: Length of the 6LoRHE expressed in bytes, excluding the first 379 2 bytes. This enables a node to skip a 6LoRHE header that it 380 does not support and/or cannot parse, for instance if the Type 381 is not recognized. 383 Type: Type of the 6LoRHE 385 4.2. Critical Format 387 The 6LoRHC uses the Dispatch Value Bit Pattern of 100xxxxx. 389 A node which does not support the 6LoRHC Type MUST silently discard 390 the packet. 392 Note: the situation where a node receives a message with a Critical 393 6LoWPAN Routing Header that it does not understand should not occur 394 and is an administrative error, see Section 8. 396 0 1 397 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 398 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- ... -+ 399 |1|0|0| TSE | Type | | 400 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- ... -+ 401 <-- Length implied by Type/TSE --> 403 Figure 4: Critical 6LoWPAN Routing Header. 405 TSE: Type Specific Extension. The meaning depends on the Type, 406 which must be known in all of the nodes. The interpretation of 407 the TSE depends on the Type field that follows. For instance, 408 it may be used to transport control bits, the number of 409 elements in an array, or the length of the remainder of the 410 6LoRHC expressed in a unit other than bytes. 412 Type: Type of the 6LoRHC 414 4.3. Compressing Addresses 416 The general technique used in this draft to compress an address is 417 first to determine a reference that as a long prefix match with this 418 address, and then elide that matching piece. In order to reconstruct 419 the compress address, the receiving node will perform the process of 420 coalescence described in section Section 4.3.1. 422 One possible reference is the root of the RPL DODAG that is being 423 traversed. It is used by 6LoRH as the reference to compress an outer 424 IP header, in case of an IP-in-IP encapsulation. If the root is the 425 source of the packet, this technique allows to fully elide the source 426 address in the compressed form of the IP header. If the root is not 427 the encapsulator, then the encapsulator address may still be 428 compressed using the root as reference. How the address of the root 429 is determined is discussed in Section 4.3.2. 431 Once the address of the source of the packet is determined, it 432 becomes the reference for the compression of the addresses that are 433 located in compressed SRH headers that are present inside the IP-in- 434 IP encapsulation in the uncompressed form. 436 4.3.1. Coalescence 438 An IPv6 compressed address is coalesced with a reference address by 439 overriding the N rightmost bytes of the reference address with the 440 compressed address, where N is the length of the compressed address, 441 as indicated by the Type of the SRH-6LoRH header in Figure 7. 443 The reference address MAY be a compressed address as well, in which 444 case it MUST be compressed in a form that is of an equal or greater 445 length than the address that is being coalesced. 447 A compressed address is expanded by coalescing it with a reference 448 address. In the particular case of a Type 4 SRH-6LoRH, the address 449 is expressed in full and the coalescence is a complete override as 450 illustrated in Figure 5. 452 RRRRRRRRRRRRRRRRRRRR reference address, may be compressed or not 454 CCCCCCC compressed address, shorter or same as reference 456 RRRRRRRRRRRRRCCCCCCC Coalesced address, same compression as reference 458 Figure 5: Coalescing addresses. 460 4.3.2. DODAG Root Address Determination 462 Stateful Address compression requires that some state is installed in 463 the devices to store the compression information that is elided from 464 the packet. That state is stored in an abstract context table and 465 some form of index is found in the packet to obtain the compression 466 information from the context table. 468 With [RFC6282], the state is provided to the stack by the 6LoWPAN 469 Neighbor Discovery Protocol (NDP) [RFC6775]. NDP exchanges the 470 context through 6LoWPAN Context Option in Router Advertisement (RA) 471 messages. In the compressed form of the packet, the context can be 472 signaled in a Context Identifier Extension. 474 With this specification, the compression information is provided to 475 the stack by RPL, and RPL exchanges it through the DODAGID field in 476 the DAG Information Object (DIO) messages, as described in more 477 details below. In the compressed form of the packet, the context can 478 be signaled in by the RPLInstanceID in the RPI. 480 With RPL [RFC6550], the address of the DODAG root is known from the 481 DODAGID field of the DIO messages. For a Global Instance, the 482 RPLInstanceID that is present in the RPI is enough information to 483 identify the DODAG that this node participates to and its associated 484 root. But for a Local Instance, the address of the root MUST be 485 explicit, either in some device configuration or signaled in the 486 packet, as the source or the destination address, respectively. 488 When implicit, the address of the DODAG root MUST be determined as 489 follows: 491 If the whole network is a single DODAG then the root can be well- 492 known and does not need to be signaled in the packets. But since RPL 493 does not expose that property, it can only be known by a 494 configuration applied to all nodes. 496 Else, the router that encapsulates the packet and compresses it with 497 this specification MUST also place an RPI in the packet as prescribed 498 by [RFC6550] to enable the identification of the DODAG. The RPI must 499 be present even in the case when the router also places an SRH header 500 in the packet. 502 It is expected that the RPL implementation maintains an abstract 503 context table, indexed by Global RPLInstanceID, that provides the 504 address of the root of the DODAG that this nodes participates to for 505 that particular RPL Instance. 507 5. The SRH 6LoRH Header 509 5.1. Encoding 511 A Source Routing Header 6LoRH (SRH-6LoRH) header provides a 512 compressed form for the SRH, as defined in [RFC6554] for use by RPL 513 routers. 515 One or more SRH-6LoRH header(s) MAY be placed in a 6LoWPAN packet. 517 If a non-RPL router receives a packet with a SRH-6LoRH header, there 518 was a routing or a configuration error (see Section 8). 520 The desired reaction for the non-RPL router is to drop the packet as 521 opposed to skip the header and forward the packet. 523 The Dispatch Value Bit Pattern for the SRH-6LoRH header indicates 524 Critical. Routers that understand the 6LoRH general format detailed 525 in Section 4 cannot ignore a 6LoRH header of this type, and will drop 526 the packet if it is unknown to them. 528 0 1 529 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 530 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- -+- -+ ... +- -+ 531 |1|0|0| Size |6LoRH Type 0..4| Hop1 | Hop2 | | HopN | 532 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- -+- -+ ... +- -+ 534 Where N = Size + 1 536 Figure 6: The SRH-6LoRH. 538 The 6LoRH Type of a SRH-6LoRH header indicates the compression level 539 used for that header. 541 It results that all addresses in a given SRH-6LoRH header MUST be 542 compressed in an identical fashion, down to using the identical 543 number of bytes per address. In order to get different degrees of 544 compression, multiple consecutive SRH-6LoRH headers MUST be used. 546 Type 0 means that the address is compressed down to one byte, whereas 547 Type 4 means that the address is provided in full in the SRH-6LoRH 548 with no compression. The complete list of Types of SRH-6LoRH and the 549 corresponding compression level are provided in Figure 7: 551 +-----------+----------------------+ 552 | 6LoRH | Length of compressed | 553 | Type | IPv6 address (bytes) | 554 +-----------+----------------------+ 555 | 0 | 1 | 556 | 1 | 2 | 557 | 2 | 4 | 558 | 3 | 8 | 559 | 4 | 16 | 560 +-----------+----------------------+ 562 Figure 7: The SRH-6LoRH Types. 564 In the case of a SRH-6LoRH header, the TSE field is used as a Size, 565 which encodes the number of hops minus 1; so a Size of 0 means one 566 hop, and the maximum that can be encoded is 32 hops. (If more than 567 32 hops need to be expressed, a sequence of SRH-6LoRH elements can be 568 employed.) It results that the Length in bytes of a SRH-6LoRH header 569 is: 571 2 + Length_of_compressed_IPv6_address * (Size + 1) 573 5.2. SRH-6LoRH General Operation 575 5.2.1. Uncompressed SRH Operation 577 In the non-compressed form, when the root generates or forwards a 578 packet in non-Storing Mode, it needs to include a Source Routing 579 Header [RFC6554] to signal a strict source-route path to a final 580 destination down the DODAG. 582 All the hops along the path, but the first one, are encoded in order 583 in the SRH. The last entry in the SRH is the final destination and 584 the destination in the IPv6 header is the first hop along the source- 585 route path. The intermediate hops perform a swap and the Segment- 586 Left field indicates the active entry in the Routing Header 587 [RFC2460]. 589 The current destination of the packet, which is the termination of 590 the current segment, is indicated at all times by the destination 591 address of the IPv6 header. 593 5.2.2. 6LoRH-Compressed SRH Operation 595 The handling of the SRH-6LoRH is different: there is no swap, and a 596 forwarding router that corresponds to the first entry in the first 597 SRH-6LoRH upon reception of a packet effectively consumes that entry 598 when forwarding. This means that the size of a compressed source- 599 routed packet decreases as the packet progresses along its path and 600 that the routing information is lost along the way. This also means 601 that an SRH encoded with 6LoRH is not recoverable and cannot be 602 protected. 604 When compressed with this specification, all the remaining hops MUST 605 be encoded in order in one or more consecutive SRH-6LoRH headers. 606 Whether or not there is a SRH-6LoRH header present, the address of 607 the final destination is indicated in the LoWPAN_IPHC at all times 608 along the path. Examples of this are provided in Appendix A. 610 The current destination (termination of the current segment) for a 611 compressed source-routed packet is indicated in the first entry of 612 the first SRH-6LoRH. In strict source-routing, that entry MUST match 613 an address of the router that receives the packet. 615 The last entry in the last SRH-6LoRH is the last router on the way to 616 the final destination in the LLN. This router can be the final 617 destination if it is found desirable to carry a whole IP-in-IP 618 encapsulation all the way. Else, it is the RPL parent of the final 619 destination, or a router acting at 6LR [RFC6775] for the destination 620 host, and advertising the host as an external route to RPL. 622 If the SRH-6LoRH header is contained in an IP-in-IP encapsulation, 623 the last router removes the whole chain of headers. Otherwise, it 624 removes the SRH-6LoRH header only. 626 5.2.3. Inner LOWPAN_IPHC Compression 628 6LoWPAN ND [RFC6282] is designed to support more than one IPv6 629 address per node and per Interface Identifier (IID), an IID being 630 typically derived from a MAC address to optimize the LOWPAN-IPHC 631 compression. 633 Link local addresses are compressed with stateless address 634 compression (S/DAC=0). The other addresses are derived from 635 different prefixes and they can be compressed with stateful address 636 compression based on a context (S/DAC=1). 638 But stateless compression is only defined for the specific link-local 639 prefix as opposed to the prefix in an encapsulating header. And with 640 stateful compression, the compression reference is found in a 641 context, as opposed to an encapsulating header. 643 It results that in the case of an IP-in-IP encapsulation, it is 644 possible to compress an inner source (respectively destination) IP 645 address in a LOWPAN_IPHC based on the encapsulating IP header only if 646 stateful (context-based) compression is used. The compression will 647 operate only if the IID in the source (respectively the destination) 648 IP address in the outer and inner headers match, which usually means 649 that they refer to the same node . This is encoded as S/DAC = 1 and 650 S/AM=11. It must be noted that the outer destination address that is 651 used to compress the inner destination address is the last entry in 652 the last SRH-6LoRH header. 654 5.3. The Design Point of Popping Entries 656 In order to save energy and to optimize the chances of transmission 657 success on lossy media, it is a design point for this specification 658 that the entries in the SRH that have been used are removed from the 659 packet. This creates a discrepancy from the art of IPv6 where 660 Routing Header are mutable but recoverable. 662 With this specification, the packet can be expanded at any hop into a 663 valid IPv6 packet, including a SRH, and compressed back. But the 664 packet as decompressed along the way will not carry all the consumed 665 addresses that packet would have if it had been forwarded in the 666 uncompressed form. 668 It is noted that: 670 The value of keeping the whole RH in an IPv6 header is for the 671 receiver to reverse it to use the symmetrical path on the way 672 back. 674 It is generally not a good idea to reverse a routing header. The 675 RH may have been used to stay away from the shortest path for some 676 reason that is only valid on the way in (segment routing). 678 There is no use of reversing a RH in the present RPL 679 specifications. 681 P2P RPL reverses a path that was learned reactively, as a part of 682 the protocol operation, which is probably a cleaner way than a 683 reversed echo on the data path. 685 Reversing a header is discouraged by [RFC2460] for RH0 unless it 686 is authenticated, which requires an Authentication Header (AH). 687 There is no definition of an AH operation for SRH, and there is no 688 indication that the need exists in LLNs. 690 It is noted that AH does not protect the RH on the way. AH is a 691 validation at the receiver with the sole value of enabling the 692 receiver to reversing it. 694 A RPL domain is usually protected by L2 security and that secures 695 both RPL itself and the RH in the packets, at every hop. This is 696 a better security than that provided by AH. 698 In summary, the benefit of saving energy and lowering the chances of 699 loss by sending smaller frames over the LLN are seen as overwhelming 700 compared to the value of possibly reversing the header. 702 5.4. Compression Reference for SRH-6LoRH header entries 704 In order to optimize the compression of IP addresses present in the 705 SRH headers, this specification requires that the 6LoWPAN layer 706 identifies an address that is used as reference for the compression. 708 With this specification, the Compression Reference for the first 709 address found in an SRH header is the source of the IPv6 packet, and 710 then the reference for each subsequent entry is the address of its 711 predecessor once it is uncompressed. 713 With RPL [RFC6550], an SRH header may only be present in Non-Storing 714 mode, and it may only be placed in the packet by the root of the 715 DODAG, which must be the source of the resulting IPv6 packet 717 [RFC2460]. In this case, the address used as Compression Reference 718 is that the address of the root, and it can be implicit when the 719 address of the root is. 721 The Compression Reference MUST be determined as follows: 723 The reference address may be obtained by configuration. The 724 configuration may indicate either the address in full, or the 725 identifier of a 6LoWPAN Context that carries the address [RFC6775], 726 for instance one of the 16 Context Identifiers used in LOWPAN-IPHC 727 [RFC6282]. 729 Else, and if there is no IP-in-IP encapsulation, the source address 730 in the IPv6 header that is compressed with LOWPAN-IPHC is the 731 reference for the compression. 733 Else, and if the IP-in-IP compression specified in this document is 734 used and the Encapsulator Address is provided, then the Encapsulator 735 Address is the reference. 737 5.5. Popping Headers 739 Upon reception, the router checks whether the address in the first 740 entry of the first SRH-6LoRH one of its own addresses. In that case, 741 router MUST consume that entry before forwarding, which is an action 742 of popping from a stack, where the stack is effectively the sequence 743 of entries in consecutive SRH-6LoRH headers. 745 Popping an entry of an SRH-6LoRH header is a recursive action 746 performed as follows: 748 If the Size of the SRH-6LoRH header is 1 or more, indicating that 749 there are at least 2 entries in the header, the router removes the 750 first entry and decrements the Size (by 1). 752 Else (meaning that this is the last entry in the SRH-6LoRH header), 753 and if there is no next SRH-6LoRH header after this then the SRH- 754 6LoRH is removed. 756 Else, if there is a next SRH-6LoRH of a Type with a larger or equal 757 value, meaning a same or lesser compression yielding same or larger 758 compressed forms, then the SRH-6LoRH is removed. 760 Else, the first entry of the next SRH-6LoRH is popped from the next 761 SRH-6LoRH and coalesced with the first entry of this SRH-6LoRH. 763 At the end of the process, if there is no more SRH-6LoRH in the 764 packet, then the processing node is the last router along the source 765 route path. 767 5.6. Forwarding 769 When receiving a packet with a SRH-6LoRH, a router determines the 770 IPv6 address of the current segment endpoint. 772 If strict source routing is enforced and this router is not the 773 segment endpoint for the packet then this router MUST drop the 774 packet. 776 If this router is the current segment endpoint, then the router pops 777 its address as described in Section 5.5 and continues processing the 778 packet. 780 If there is still a SRH-6LoRH, then the router determines the new 781 segment endpoint and routes the packet towards that endpoint. 783 Otherwise the router uses the destination in the inner IP header to 784 forward or accept the packet. 786 The segment endpoint of a packet MUST be determined as follows: 788 The router first determines the Compression Reference as discussed in 789 Section 4.3.1. 791 The router then coalesces the Compression Reference with the first 792 entry of the first SRH-6LoRH header as discussed in Section 5.4. If 793 the type of the SRH-6LoRH header is type 4 then the coalescence is a 794 full override. 796 Since the Compression Reference is an uncompressed address, the 797 coalesced IPv6 address is also expressed in the full 128bits. 799 An example of this operation is provided in Appendix A.3. 801 6. The RPL Packet Information 6LoRH 803 [RFC6550], Section 11.2, specifies the RPL Packet Information (RPI) 804 as a set of fields that are placed by RPL routers in IP packets to 805 identify the RPL Instance, detect anomalies and trigger corrective 806 actions. 808 In particular, the SenderRank, which is the scalar metric computed by 809 a specialized Objective Function such as [RFC6552], indicates the 810 Rank of the sender and is modified at each hop. The SenderRank field 811 is used to validate that the packet progresses in the expected 812 direction, either upwards or downwards, along the DODAG. 814 RPL defines the RPL Option for Carrying RPL Information in Data-Plane 815 Datagrams [RFC6553] to transport the RPI, which is carried in an IPv6 816 Hop-by-Hop Options Header [RFC2460], typically consuming eight bytes 817 per packet. 819 With [RFC6553], the RPL option is encoded as six octets, which must 820 be placed in a Hop-by-Hop header that consumes two additional octets 821 for a total of eight octets. To limit the header's range to just the 822 RPL domain, the Hop-by-Hop header must be added to (or removed from) 823 packets that cross the border of the RPL domain. 825 The 8-byte overhead is detrimental to LLN operation, in particular 826 with regards to bandwidth and battery constraints. These bytes may 827 cause a containing frame to grow above maximum frame size, leading to 828 Layer 2 or 6LoWPAN [RFC4944] fragmentation, which in turn leads to 829 even more energy expenditure and issues discussed in LLN Fragment 830 Forwarding and Recovery [I-D.thubert-6lo-forwarding-fragments]. 832 An additional overhead comes from the need, in certain cases, to add 833 an IP-in-IP encapsulation to carry the Hop-by-Hop header. This is 834 needed when the router that inserts the Hop-by-Hop header is not the 835 source of the packet, so that an error can be returned to the router. 836 This is also the case when a packet originated by a RPL node must be 837 stripped from the Hop-by-Hop header to be routed outside the RPL 838 domain. 840 For that reason, this specification defines an IP-in-IP-6LoRH header 841 in Section 7, but it must be noted that removal of a 6LoRH header 842 does not require manipulation of the packet in the LOWPAN_IPHC, and 843 thus, if the source address in the LOWPAN_IPHC is the node that 844 inserted the IP-in-IP-6LoRH header then this situation alone does not 845 mandate an IP-in-IP-6LoRH header. 847 Note: A typical packet in RPL non-storing mode going down the RPL 848 graph requires an IP-in-IP encapsulation of the SRH, whereas the RPI 849 is usually (and quite illegally) omitted. With this specification, 850 the RPI is important to indicate the RPLInstanceID so the RPI should 851 not be omitted. To impact of placing an IP-in-IP encapsulation and 852 an RPI in the packet, an optimized IP-in-IP 6LoRH header is defined 853 in Section 7. 855 As a result, a RPL packet may bear only an RPI-6LoRH header and no 856 IP-in-IP-6LoRH header. In that case, the source and destination of 857 the packet are specified by the LOWPAN_IPHC. 859 As with [RFC6553], the fields in the RPI include an 'O', an 'R', and 860 an 'F' bit, an 8-bit RPLInstanceID (with some internal structure), 861 and a 16-bit SenderRank. 863 The remainder of this section defines the RPI-6LoRH header, which is 864 a Critical 6LoWPAN Routing Header that is designed to transport the 865 RPI in 6LoWPAN LLNs. 867 6.1. Compressing the RPLInstanceID 869 RPL Instances are discussed in [RFC6550], Section 5. A number of 870 simple use cases do not require more than one RPL Instance, and in 871 such cases, the RPL Instance is expected to be the Global Instance 0. 872 A global RPLInstanceID is encoded in a RPLInstanceID field as 873 follows: 875 0 1 2 3 4 5 6 7 876 +-+-+-+-+-+-+-+-+ 877 |0| ID | Global RPLInstanceID in 0..127 878 +-+-+-+-+-+-+-+-+ 880 Figure 8: RPLInstanceID Field Format for Global Instances. 882 For the particular case of the Global Instance 0, the RPLInstanceID 883 field is all zeros. This specification allows to elide a 884 RPLInstanceID field that is all zeros, and defines a I flag that, 885 when set, signals that the field is elided. 887 6.2. Compressing the SenderRank 889 The SenderRank is the result of the DAGRank operation on the rank of 890 the sender; here the DAGRank operation is defined in [RFC6550], 891 Section 3.5.1, as: 893 DAGRank(rank) = floor(rank/MinHopRankIncrease) 895 If MinHopRankIncrease is set to a multiple of 256, the least 896 significant 8 bits of the SenderRank will be all zeroes; by eliding 897 those, the SenderRank can be compressed into a single byte. This 898 idea is used in [RFC6550] by defining DEFAULT_MIN_HOP_RANK_INCREASE 899 as 256 and in [RFC6552] that defaults MinHopRankIncrease to 900 DEFAULT_MIN_HOP_RANK_INCREASE. 902 This specification allows to encode the SenderRank as either one or 903 two bytes, and defines a K flag that, when set, signals that a single 904 byte is used. 906 6.3. The Overall RPI-6LoRH encoding 908 The RPI-6LoRH header provides a compressed form for the RPL RPI. 909 Routers that need to forward a packet with a RPI-6LoRH header are 910 expected to be RPL routers that support this specification. 912 If a non-RPL router receives a packet with a RPI-6LoRH header, there 913 was a routing or a configuration error (see Section 8). 915 The desired reaction for the non-RPL router is to drop the packet as 916 opposed to skip the header and forward the packet, which could end up 917 forming loops by reinjecting the packet in the wrong RPL Instance. 919 The Dispatch Value Bit Pattern for the SRH-6LoRH header indicates 920 Critical. Routers that understand the 6LoRH general format detailed 921 in Section 4 cannot ignore a 6LoRH header of this type, and will drop 922 the packet if it is unknown to them. 924 Since the RPI-6LoRH header is a critical header, the TSE field does 925 not need to be a length expressed in bytes. In that case the field 926 is fully reused for control bits that encode the O, R and F flags 927 from the RPI, as well as the I and K flags that indicate the 928 compression format. 930 The Type for the RPI-6LoRH is 5. 932 The RPI-6LoRH header is immediately followed by the RPLInstanceID 933 field, unless that field is fully elided, and then the SenderRank, 934 which is either compressed into one byte or fully in-lined as two 935 bytes. The I and K flags in the RPI-6LoRH header indicate whether 936 the RPLInstanceID is elided and/or the SenderRank is compressed. 937 Depending on these bits, the Length of the RPI-6LoRH may vary as 938 described hereafter. 940 0 1 2 941 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 942 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ... -+-+-+ 943 |1|0|0|O|R|F|I|K| 6LoRH Type=5 | Compressed fields | 944 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ... -+-+-+ 946 Figure 9: The Generic RPI-6LoRH Format. 948 O, R, and F bits: The O, R, and F bits are defined in [RFC6550], 949 section 11.2. 951 I flag: If it is set, the RPLInstanceID is elided and the 952 RPLInstanceID is the Global RPLInstanceID 0. If it is not set, 953 the octet immediately following the type field contains the 954 RPLInstanceID as specified in [RFC6550], section 5.1. 956 K flag: If it is set, the SenderRank is compressed into one octet, 957 with the least significant octet elided. If it is not set, the 958 SenderRank, is fully inlined as two octets. 960 In Figure 10, the RPLInstanceID is the Global RPLInstanceID 0, and 961 the MinHopRankIncrease is a multiple of 256 so the least significant 962 byte is all zeros and can be elided: 964 0 1 2 965 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 966 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 967 |1|0|0|O|R|F|1|1| 6LoRH Type=5 | SenderRank | 968 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 969 I=1, K=1 971 Figure 10: The most compressed RPI-6LoRH. 973 In Figure 11, the RPLInstanceID is the Global RPLInstanceID 0, but 974 both bytes of the SenderRank are significant so it can not be 975 compressed: 977 0 1 2 3 978 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 979 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 980 |1|0|0|O|R|F|1|0| 6LoRH Type=5 | SenderRank | 981 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 982 I=1, K=0 984 Figure 11: Eliding the RPLInstanceID. 986 In Figure 12, the RPLInstanceID is not the Global RPLInstanceID 0, 987 and the MinHopRankIncrease is a multiple of 256: 989 0 1 2 3 990 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 991 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 992 |1|0|0|O|R|F|0|1| 6LoRH Type=5 | RPLInstanceID | SenderRank | 993 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 994 I=0, K=1 996 Figure 12: Compressing SenderRank. 998 In Figure 13, the RPLInstanceID is not the Global RPLInstanceID 0, 999 and both bytes of the SenderRank are significant: 1001 0 1 2 3 1002 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 1003 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1004 |1|0|0|O|R|F|0|0| 6LoRH Type=5 | RPLInstanceID | Sender-... 1005 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1006 ...-Rank | 1007 +-+-+-+-+-+-+-+-+ 1008 I=0, K=0 1010 Figure 13: Least compressed form of RPI-6LoRH. 1012 7. The IP-in-IP 6LoRH Header 1014 The IP-in-IP 6LoRH (IP-in-IP-6LoRH) header is an Elective 6LoWPAN 1015 Routing Header that provides a compressed form for the encapsulating 1016 IPv6 Header in the case of an IP-in-IP encapsulation. 1018 An IP-in-IP encapsulation is used to insert a field such as a Routing 1019 Header or an RPI at a router that is not the source of the packet. 1020 In order to send an error back regarding the inserted field, the 1021 address of the router that performs the insertion must be provided. 1023 The encapsulation can also enable the last router prior to 1024 Destination to remove a field such as the RPI, but this can be done 1025 in the compressed form by removing the RPI-6LoRH, so an IP-in-IP- 1026 6LoRH encapsulation is not required for that sole purpose. 1028 The Dispatch Value Bit Pattern for the SRH-6LoRH header indicates 1029 Elective. This field is not critical for routing since it does not 1030 indicate the destination of the packet, which is either encoded in a 1031 SRH-6LoRH header or in the inner IP header. A 6LoRH header of this 1032 type can be skipped if not understood (per Section 4), and the 6LoRH 1033 header indicates the Length in bytes. 1035 0 1 2 1036 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 1037 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- ... -+ 1038 |1|0|1| Length | 6LoRH Type 6 | Hop Limit | Encaps. Address | 1039 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- ... -+ 1041 Figure 14: The IP-in-IP-6LoRH. 1043 The Length of an IP-in-IP-6LoRH header is expressed in bytes and MUST 1044 be at least 1, to indicate a Hop Limit (HL), that is decremented at 1045 each hop. When the HL reaches 0, the packet is dropped per 1046 [RFC2460]. 1048 If the Length of an IP-in-IP-6LoRH header is exactly 1, then the 1049 Encapsulator Address is elided, which means that the Encapsulator is 1050 a well-known router, for instance the root in a RPL graph. 1052 The most efficient compression of an IP-in-IP encapsulation that can 1053 be achieved with this specification is obtained when an endpoint of 1054 the packet is the root of the RPL DODAG associated to the RPL 1055 Instance that is used to forward the packet, and the root address is 1056 known implicitly as opposed to signaled explicitly in the data 1057 packets. 1059 If the Length of an IP-in-IP-6LoRH header is greater than 1, then an 1060 Encapsulator Address is placed in a compressed form after the Hop 1061 Limit field. The value of the Length indicates which compression is 1062 performed on the Encapsulator Address. For instance, a Length of 3 1063 indicates that the Encapsulator Address is compressed to 2 bytes. 1064 The reference for the compression is the address of the root of the 1065 DODAG. The way the address of the root is determined is discussed in 1066 Section 4.3.2. 1068 With RPL, the destination address in the IP-in-IP header is 1069 implicitly the root in the RPL graph for packets going upwards, and, 1070 in storing mode, it is the destination address in the IPHC for 1071 packets going downwards. In non-storing mode, there is no implicit 1072 value for packets going downwards. 1074 If the implicit value is correct, the destination IP address of the 1075 IP-in-IP encapsulation can be elided. Else, the destination IP 1076 address of the IP-in-IP header is transported in a SRH-6LoRH header 1077 as the first entry of the first of these headers. 1079 If the final destination of the packet is a leaf that does not 1080 support this specification, then the chain of 6LoRH headers must be 1081 stripped by the RPL/6LR router to which the leaf is attached. In 1082 that example, the destination IP address of the IP-in-IP header 1083 cannot be elided. 1085 In the special case where a 6LoRH header is used to route 6LoWPAN 1086 fragments, the destination address is not accessible in the IPHC on 1087 all fragments and can be elided only for the first fragment and for 1088 packets going upwards. 1090 8. Management Considerations 1092 Though it is possible to decompress a packet at any hop, this 1093 specification is optimized to enable that a packet is forwarded in 1094 its compressed form all the way, and it makes sense to deploy 1095 homogeneous networks, where all nodes, or no node at all, use the 1096 compression technique detailed therein. 1098 This specification does not provide a method to discover the 1099 capability by a next-hop device to support the compression technique, 1100 or the incremental addition of 6LoWPAN Routing Header as new 1101 specifications are published, considering that such extraneous code 1102 would overburden many constrained devices. This specification does 1103 not require extraneous code to exchange and handle error messages for 1104 mismatch situations, either. 1106 It is thus critical to keep the network homogeneous, or at least 1107 provide in forwarding nodes the knowledge of the support by the next 1108 hops. This is either a deployment issue, by deploying only devices 1109 with a same capability, or a management issue, by configuring all 1110 devices to either use, or not use, a certain level of this 1111 compression technique and its future additions. 1113 In particular, the situation where a node receives a message with a 1114 Critical 6LoWPAN Routing Header that it does not understand is an 1115 administrative error whereby the wrong device is placed in a network, 1116 or the device is mis-configured. 1118 When a mismatch situation is detected, it is expected that the device 1119 raises some management alert, indicating the issue, e.g. that it has 1120 to drop a packet with a Critical 6LoRH. 1122 9. Security Considerations 1124 The security considerations of [RFC4944], [RFC6282], and [RFC6553] 1125 apply. 1127 Using a compressed format as opposed to the full in-line format is 1128 logically equivalent and is believed to not create an opening for a 1129 new threat when compared to [RFC6550], [RFC6553] and [RFC6554], 1130 noting that, even though intermediate hops are removed from the SRH 1131 header as they are consumed, a node may still identify that the rest 1132 of the source routed path includes a loop or not (see Security 1133 section of [RFC6554]. It must be noted that if the attacker is not 1134 part of the loop, then there is always a node at the beginning of the 1135 loop that can detect it and remove it. 1137 10. IANA Considerations 1138 This specification reserves Dispatch Value Bit Patterns within the 1139 6LoWPAN Dispatch Page 1 as follows: 1141 101xxxxx: for Elective 6LoWPAN Routing Headers 1143 100xxxxx: for Critical 6LoWPAN Routing Headers. 1145 Additionally this document creates two IANA registries, one for the 1146 Critical 6LoWPAN Routing Header Type and one for the Elective 6LoWPAN 1147 Routing Header Type, each with 32 possible values from 0 to 31, as 1148 described below. 1150 Future assignments in these registries are to be coordinated via IANA 1151 under the policy of "RFC Required" [RFC5226] to enable any type of 1152 RFC to obtain a value in the registry. 1154 10.2. New Critical 6LoWPAN Routing Header Type Registry 1156 This document creates an IANA registry for the Critical 6LoWPAN 1157 Routing Header Type, and assigns the following values: 1159 0..4: SRH-6LoRH [RFCthis] 1161 5: RPI-6LoRH [RFCthis] 1163 <- under the policy of "IETF Review" [RFC5226] to ensure adequate 1164 community review. -> ## New Elective 6LoWPAN Routing Header Type 1165 Registry 1167 This document creates an IANA registry for the Elective 6LoWPAN 1168 Routing Header Type, and assigns the following value: 1170 6: IP-in-IP-6LoRH [RFCthis] 1172 <- under the policy of "IETF Review" [RFC5226] to ensure adequate 1173 community review. -> 1175 11. Acknowledgments 1177 The authors wish to thank Tom Phinney, Thomas Watteyne, Tengfei 1178 Chang, Martin Turon, James Woodyatt, Samita Chakrabarti, Jonathan 1179 Hui, Gabriel Montenegro and Ralph Droms for constructive reviews to 1180 the design in the 6lo Working Group. The overall discussion involved 1181 participants to the 6MAN, 6TiSCH and ROLL WGs, thank you all. 1182 Special thanks to the chairs of the ROLL WG, Michael Richardson and 1183 Ines Robles, Brian Haberman, Internet Area A-D, and Alvaro Retana and 1184 Adrian Farrel, Routing Area A-Ds, for driving this complex effort 1185 across Working Groups and Areas. 1187 12. References 1189 12.1. Normative References 1191 [I-D.ietf-6lo-paging-dispatch] 1192 Thubert, P. and R. Cragie, "6LoWPAN Paging Dispatch", 1193 draft-ietf-6lo-paging-dispatch-04 (work in progress), 1194 September 2016. 1196 [IEEE802154] 1197 IEEE standard for Information Technology, "IEEE std. 1198 802.15.4, Part. 15.4: Wireless Medium Access Control (MAC) 1199 and Physical Layer (PHY) Specifications for Low-Rate 1200 Wireless Personal Area Networks", 2015. 1202 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 1203 Requirement Levels", BCP 14, RFC 2119, 1204 DOI 10.17487/RFC2119, March 1997, 1205 . 1207 [RFC2460] Deering, S. and R. Hinden, "Internet Protocol, Version 6 1208 (IPv6) Specification", RFC 2460, DOI 10.17487/RFC2460, 1209 December 1998, . 1211 [RFC4944] Montenegro, G., Kushalnagar, N., Hui, J., and D. Culler, 1212 "Transmission of IPv6 Packets over IEEE 802.15.4 1213 Networks", RFC 4944, DOI 10.17487/RFC4944, September 2007, 1214 . 1216 [RFC5226] Narten, T. and H. Alvestrand, "Guidelines for Writing an 1217 IANA Considerations Section in RFCs", BCP 26, RFC 5226, 1218 DOI 10.17487/RFC5226, May 2008, 1219 . 1221 [RFC6282] Hui, J., Ed. and P. Thubert, "Compression Format for IPv6 1222 Datagrams over IEEE 802.15.4-Based Networks", RFC 6282, 1223 DOI 10.17487/RFC6282, September 2011, 1224 . 1226 [RFC6550] Winter, T., Ed., Thubert, P., Ed., Brandt, A., Hui, J., 1227 Kelsey, R., Levis, P., Pister, K., Struik, R., Vasseur, 1228 JP., and R. Alexander, "RPL: IPv6 Routing Protocol for 1229 Low-Power and Lossy Networks", RFC 6550, 1230 DOI 10.17487/RFC6550, March 2012, 1231 . 1233 [RFC6552] Thubert, P., Ed., "Objective Function Zero for the Routing 1234 Protocol for Low-Power and Lossy Networks (RPL)", 1235 RFC 6552, DOI 10.17487/RFC6552, March 2012, 1236 . 1238 [RFC6553] Hui, J. and JP. Vasseur, "The Routing Protocol for Low- 1239 Power and Lossy Networks (RPL) Option for Carrying RPL 1240 Information in Data-Plane Datagrams", RFC 6553, 1241 DOI 10.17487/RFC6553, March 2012, 1242 . 1244 [RFC6554] Hui, J., Vasseur, JP., Culler, D., and V. Manral, "An IPv6 1245 Routing Header for Source Routes with the Routing Protocol 1246 for Low-Power and Lossy Networks (RPL)", RFC 6554, 1247 DOI 10.17487/RFC6554, March 2012, 1248 . 1250 12.2. Informative References 1252 [I-D.ietf-6tisch-architecture] 1253 Thubert, P., "An Architecture for IPv6 over the TSCH mode 1254 of IEEE 802.15.4", draft-ietf-6tisch-architecture-10 (work 1255 in progress), June 2016. 1257 [I-D.ietf-roll-useofrplinfo] 1258 Robles, I., Richardson, M., and P. Thubert, "When to use 1259 RFC 6553, 6554 and IPv6-in-IPv6", draft-ietf-roll- 1260 useofrplinfo-08 (work in progress), September 2016. 1262 [I-D.thubert-6lo-forwarding-fragments] 1263 Thubert, P. and J. Hui, "LLN Fragment Forwarding and 1264 Recovery", draft-thubert-6lo-forwarding-fragments-02 (work 1265 in progress), November 2014. 1267 [RFC6775] Shelby, Z., Ed., Chakrabarti, S., Nordmark, E., and C. 1268 Bormann, "Neighbor Discovery Optimization for IPv6 over 1269 Low-Power Wireless Personal Area Networks (6LoWPANs)", 1270 RFC 6775, DOI 10.17487/RFC6775, November 2012, 1271 . 1273 [RFC7102] Vasseur, JP., "Terms Used in Routing for Low-Power and 1274 Lossy Networks", RFC 7102, DOI 10.17487/RFC7102, January 1275 2014, . 1277 [RFC7228] Bormann, C., Ersue, M., and A. Keranen, "Terminology for 1278 Constrained-Node Networks", RFC 7228, 1279 DOI 10.17487/RFC7228, May 2014, 1280 . 1282 [RFC7554] Watteyne, T., Ed., Palattella, M., and L. Grieco, "Using 1283 IEEE 802.15.4e Time-Slotted Channel Hopping (TSCH) in the 1284 Internet of Things (IoT): Problem Statement", RFC 7554, 1285 DOI 10.17487/RFC7554, May 2015, 1286 . 1288 Appendix A. Examples 1290 A.1. Examples Compressing The RPI 1292 The example in Figure 15 illustrates the 6LoRH compression of a 1293 classical packet in Storing Mode in all directions, as well as in 1294 non-Storing mode for a packet going up the DODAG following the 1295 default route to the root. In this particular example, a 1296 fragmentation process takes place per [RFC4944], and the fragment 1297 headers must be placed in Page 0 before switching to Page 1: 1299 +- ... -+- ... -+-+ ... -+- ... +-+-+ ... -+-+-+-+-+-+-+-+-+-+... 1300 |Frag type|Frag hdr |11110001| RPI- |IP-in-IP| LOWPAN-IPHC | ... 1301 |RFC 4944 |RFC 4944 | Page 1 | 6LoRH | 6LoRH | | 1302 +- ... -+- ... -+-+ ... -+- ... +-+-+ ... -+-+-+-+-+-+-+-+-+-+... 1303 <- RFC 6282 -> 1304 No RPL artifact 1306 +- ... -+- ... -+-+ ... -+-+ ... -+- ... +-+-+-+-+-+-+-+-+-+-+... 1307 |Frag type|Frag hdr | 1308 |RFC 4944 |RFC 4944 | Payload (cont) 1309 +- ... -+- ... -+-+ ... -+-+ ... -+- ... +-+-+-+-+-+-+-+-+-+-+... 1311 +- ... -+- ... -+-+ ... -+-+ ... -+- ... +-+-+-+-+-+-+-+-+-+-+... 1312 |Frag type|Frag hdr | 1313 |RFC 4944 |RFC 4944 | Payload (cont) 1314 +- ... -+- ... -+-+ ... -+-+ ... -+- ... +-+-+-+-+-+-+-+-+-+-+... 1316 Figure 15: Example Compressed Packet with RPI. 1318 In Storing Mode, if the packet stays within the RPL domain, then it 1319 is possible to save the IP-in-IP encapsulation, in which case only 1320 the RPI is compressed with a 6LoRH, as illustrated in Figure 16 in 1321 the case of a non-fragmented ICMP packet: 1323 +- ... -+-+- ... -+-+-+-+ ... -+-+-+-+ ... -+-+-+-+-+-+-+-+-+-+-+... 1324 |11110001| RPI-6LoRH | NH = 0 | NH = 58 | ICMP message ... 1325 |Page 1 | type 5 | 6LOWPAN-IPHC | (ICMP) | (no compression) 1326 +- ... -+-+- ... -+-+-+-+ ... -+-+-+-+ ... -+-+-+-+-+-+-+-+-+-+-+... 1327 <- RFC 6282 -> 1328 No RPL artifact 1330 Figure 16: Example ICMP Packet with RPI in Storing Mode. 1332 The format in Figure 16 is logically equivalent to the non-compressed 1333 format illustrated in Figure 17: 1335 +-+-+-+- ... -+-+-+-+ ... -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+... 1336 | IPv6 Header | Hop-by-Hop | RPI in | ICMP message ... 1337 | NH = 58 | Header | RPL Option | 1338 +-+-+-+- ... -+-+-+-+ ... -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+... 1340 Figure 17: Uncompressed ICMP Packet with RPI. 1342 For a UDP packet, the transport header can be compressed with 6LoWPAN 1343 HC [RFC6282] as illustrated in Figure 18: 1345 +- ... -+- ... -+-+-+-+- ... +-+-+-+-+-+-+-+-+-+- ... +-+-+-+-+-+... 1346 |11110001| RPI-6LoRH | NH = 1 |11110|C| P | Compressed |UDP ... 1347 |Page 1 | type 5 | 6LOWPAN-IPHC | UDP | | | UDP header |Payload 1348 +- ... -+- ... -+-+-+-+- ... +-+-+-+-+-+-+-+-+-+- ... +-+-+-+-+-+... 1349 <- RFC 6282 -> 1350 No RPL artifact 1352 Figure 18: Uncompressed ICMP Packet with RPI. 1354 If the packet is received from the Internet in Storing Mode, then the 1355 root is supposed to encapsulate the packet to insert the RPI. The 1356 resulting format would be as represented in Figure 19: 1358 +-+-+-+-+-+-+- ... -+-+-- ... -+-+- ... -+-+-+-+-+-+-+ ... -+-+-+-+... 1359 |11110001 | RPI-6LoRH | IP-in-IP | NH=1 |11110CPP| Compressed | UDP 1360 |Page 1 | | 6LoRH | IPHC | UDP | UDP header | Payload 1361 +-+-+-+-+-+-+- ... -+-+-- ... -+-+- ... -+-+-+-+-+-+-+ ... -+-+-+-+... 1362 <- RFC 6282 -> 1363 No RPL artifact 1365 Figure 19: RPI inserted by the root in Storing Mode. 1367 A.2. Example Of Downward Packet In Non-Storing Mode 1369 The example illustrated in Figure 20 is a classical packet in non- 1370 Storing mode for a packet going down the DODAG following a source 1371 routed path from the root. Say that we have 4 forwarding hops to 1372 reach a destination. In the non-compressed form, when the root 1373 generates the packet, the last 3 hops are encoded in a Routing Header 1374 type 3 (SRH) and the first hop is the destination of the packet. The 1375 intermediate hops perform a swap and the hop count indicates the 1376 current active hop [RFC2460], [RFC6554]. 1378 When compressed with this specification, the 4 hops are encoded in 1379 SRH-6LoRH when the root generates the packet, and the final 1380 destination is left in the LOWPAN-IPHC. There is no swap, and the 1381 forwarding node that corresponds to the first entry effectively 1382 consumes it when forwarding, which means that the size of the encoded 1383 packet decreases and that the hop information is lost. 1385 If the last hop in a SRH-6LoRH is not the final destination then it 1386 removes the SRH-6LoRH before forwarding. 1388 In the particular example illustrated in Figure 20, all addresses in 1389 the DODAG are assigned from a same /112 prefix and the last 2 octets 1390 encoding an identifier such as a IEEE 802.15.4 short address. In 1391 that case, all addresses can be compressed to 2 octets, using the 1392 root address as reference. There will be one SRH_6LoRH header, with, 1393 in this example, 3 compressed addresses: 1395 +-+-+-+-+-+-+- ... +-+-+- ... -+-+-- ... -+-+- ... -+-+-+-+-+ ... +-... 1396 |11110001 |SRH-6LoRH | RPI-6LoRH | IP-in-IP | NH=1 |11110CPP| UDP | UDP 1397 |Page 1 |Type1 S=2 | | 6LoRH | IPHC | UDP | hdr |load 1398 +-+-+-+-+-+-+- ... +-+-+- ... -+-+-- ... -+-+- ... -+-+-+-+-+ ... +-... 1399 <-8bytes-> <- RFC 6282 -> 1400 No RPL artifact 1402 Figure 20: Example Compressed Packet with SRH. 1404 One may note that the RPI is provided. This is because the address 1405 of the root that is the source of the IP-in-IP header is elided and 1406 inferred from the RPLInstanceID in the RPI. Once found from a local 1407 context, that address is used as Compression Reference to expand 1408 addresses in the SRH-6LoRH. 1410 With the RPL specifications available at the time of writing this 1411 draft, the root is the only node that may incorporate a SRH in an IP 1412 packet. When the root forwards a packet that it did not generate, it 1413 has to encapsulate the packet with IP-in-IP. 1415 But if the root generates the packet towards a node in its DODAG, 1416 then it should avoid the extra IP-in-IP as illustrated in Figure 21: 1418 +- ... -+-+-+ ... +-+-+-+ ... -+-+-+-+-+-+-+-++-+- ... -+-+-+-+-+... 1419 |11110001| SRH-6LoRH | NH=1 | 11110CPP | Compressed | UDP 1420 |Page 1 | Type1 S=3 | LOWPAN-IPHC| LOWPAN-NHC| UDP header | Payload 1421 +- ... -+-+-+ ... +-+-+-+ ... -+-+-+-+-+-+-+-++-+- ... -+-+-+-+-+... 1422 <- RFC 6282 -> 1424 Figure 21: compressed SRH 4*2bytes entries sourced by root. 1426 Note: the RPI is not represented though RPL [RFC6550] generally 1427 expects it. In this particular case, since the Compression Reference 1428 for the SRH-6LoRH is the source address in the LOWPAN-IPHC, and the 1429 routing is strict along the source route path, the RPI does not 1430 appear to be absolutely necessary. 1432 In Figure 21, all the nodes along the source route path share a same 1433 /112 prefix. This is typical of IPv6 addresses derived from an 1434 IEEE802.15.4 short address, as long as all the nodes share a same 1435 PAN-ID. In that case, a type-1 SRH-6LoRH header can be used for 1436 encoding. The IPv6 address of the root is taken as reference, and 1437 only the last 2 octets of the address of the intermediate hops is 1438 encoded. The Size of 3 indicates 4 hops, resulting in a SRH-6LoRH of 1439 10 bytes. 1441 A.3. Example of SRH-6LoRH life-cycle 1443 This section illustrates the operation specified in Section 5.6 of 1444 forwarding a packet with a compressed SRH along an A->B->C->D source 1445 route path. The operation of popping addresses is exemplified at 1446 each hop. 1448 Packet as received by node A 1449 ---------------------------- 1450 Type 3 SRH-6LoRH Size = 0 AAAA AAAA AAAA AAAA 1451 Type 1 SRH-6LoRH Size = 0 BBBB 1452 Type 2 SRH-6LoRH Size = 1 CCCC CCCC 1453 DDDD DDDD 1455 Step 1 popping BBBB the first entry of the next SRH-6LoRH 1456 Step 2 next is if larger value (2 vs. 1) the SRH-6LoRH is removed 1458 Type 3 SRH-6LoRH Size = 0 AAAA AAAA AAAA AAAA 1459 Type 2 SRH-6LoRH Size = 1 CCCC CCCC 1460 DDDD DDDD 1462 Step 3: recursion ended, coalescing BBBB with the first entry 1463 Type 3 SRH-6LoRH Size = 0 AAAA AAAA AAAA BBBB 1465 Step 4: routing based on next segment endpoint to B 1467 Figure 22: Processing at Node A. 1469 Packet as received by node B 1470 ---------------------------- 1471 Type 3 SRH-6LoRH Size = 0 AAAA AAAA AAAA BBBB 1472 Type 2 SRH-6LoRH Size = 1 CCCC CCCC 1473 DDDD DDDD 1475 Step 1 popping CCCC CCCC, the first entry of the next SRH-6LoRH 1476 Step 2 removing the first entry and decrementing the Size (by 1) 1478 Type 3 SRH-6LoRH Size = 0 AAAA AAAA AAAA BBBB 1479 Type 2 SRH-6LoRH Size = 0 DDDD DDDD 1481 Step 3: recursion ended, coalescing CCCC CCCC with the first entry 1482 Type 3 SRH-6LoRH Size = 0 AAAA AAAA CCCC CCCC 1484 Step 4: routing based on next segment endpoint to C 1486 Figure 23: Processing at Node B. 1488 Packet as received by node C 1489 ---------------------------- 1491 Type 3 SRH-6LoRH Size = 0 AAAA AAAA CCCC CCCC 1492 Type 2 SRH-6LoRH Size = 0 DDDD DDDD 1494 Step 1 popping DDDD DDDD, the first entry of the next SRH-6LoRH 1495 Step 2 the SRH-6LoRH is removed 1497 Type 3 SRH-6LoRH Size = 0 AAAA AAAA CCCC CCCC 1499 Step 3: recursion ended, coalescing DDDD DDDDD with the first entry 1500 Type 3 SRH-6LoRH Size = 0 AAAA AAAA DDDD DDDD 1502 Step 4: routing based on next segment endpoint to D 1504 Figure 24: Processing at Node C. 1506 Packet as received by node D 1507 ---------------------------- 1508 Type 3 SRH-6LoRH Size = 0 AAAA AAAA DDDD DDDD 1510 Step 1 the SRH-6LoRH is removed. 1511 Step 2 no more header, routing based on inner IP header. 1513 Figure 25: Processing at Node D. 1515 Authors' Addresses 1517 Pascal Thubert (editor) 1518 Cisco Systems 1519 Building D - Regus 1520 45 Allee des Ormes 1521 BP1200 1522 MOUGINS - Sophia Antipolis 06254 1523 FRANCE 1525 Phone: +33 4 97 23 26 34 1526 Email: pthubert@cisco.com 1527 Carsten Bormann 1528 Universitaet Bremen TZI 1529 Postfach 330440 1530 Bremen D-28359 1531 Germany 1533 Phone: +49-421-218-63921 1534 Email: cabo@tzi.org 1536 Laurent Toutain 1537 Institut MINES TELECOM; TELECOM Bretagne 1538 2 rue de la Chataigneraie 1539 CS 17607 1540 Cesson-Sevigne Cedex 35576 1541 France 1543 Email: Laurent.Toutain@telecom-bretagne.eu 1545 Robert Cragie 1546 ARM Ltd. 1547 110 Fulbourn Road 1548 Cambridge CB1 9NJ 1549 UK 1551 Email: robert.cragie@gridmerge.com