6lo                                                      P. Thubert, Ed.
Internet-Draft                                                     Cisco
Intended status: Standards Track                              C. Bormann
Expires: July 18, 26, 2016                                    Uni Bremen TZI
                                                              L. Toutain
                                                    IMT-TELECOM Bretagne
                                                               R. Cragie
                                                                     ARM
                                                        January 15, 23, 2016

                         6LoWPAN Routing Header And Paging Dispatches
                   draft-ietf-6lo-routing-dispatch-03
                   draft-ietf-6lo-routing-dispatch-04

Abstract

   This specification introduces a new 6LoWPAN dispatch type for use in
   6LoWPAN Route-Over topologies, that initially covers the needs of RPL
   (RFC6550) data packets compression.  Using this dispatch type, this
   specification defines a method to compress RPL Option (RFC6553)
   information and Routing Header type 3 (RFC6554), an efficient IP-in-
   IP technique and is extensible for more applications.

Status of This Memo

   This Internet-Draft is submitted in full conformance with the
   provisions of BCP 78 and BCP 79.

   Internet-Drafts are working documents of the Internet Engineering
   Task Force (IETF).  Note that other groups may also distribute
   working documents as Internet-Drafts.  The list of current Internet-
   Drafts is at http://datatracker.ietf.org/drafts/current/.

   Internet-Drafts are draft documents valid for a maximum of six months
   and may be updated, replaced, or obsoleted by other documents at any
   time.  It is inappropriate to use Internet-Drafts as reference
   material or to cite them other than as "work in progress."

   This Internet-Draft will expire on July 18, 26, 2016.

Copyright Notice

   Copyright (c) 2016 IETF Trust and the persons identified as the
   document authors.  All rights reserved.

   This document is subject to BCP 78 and the IETF Trust's Legal
   Provisions Relating to IETF Documents
   (http://trustee.ietf.org/license-info) in effect on the date of
   publication of this document.  Please review these documents
   carefully, as they describe your rights and restrictions with respect
   to this document.  Code Components extracted from this document must
   include Simplified BSD License text as described in Section 4.e of
   the Trust Legal Provisions and are provided without warranty as
   described in the Simplified BSD License.

Table of Contents

   1.  Introduction  . . . . . . . . . . . . . . . . . . . . . . . .   2   3
   2.  Terminology . . . . . . . . . . . . . . . . . . . . . . . . .   5   6
   3.  Using the Page Dispatch . . . . . . . . . . . . . . . . . . .   5   6
     3.1.  New Routing Header Dispatch (6LoRH) . . . . . . . . . . .   6
     3.2.  Placement Of The 6LoRH headers  . . . . . . . . . . . . . . .   6
       3.2.1.  Relative To Non-6LoRH Headers . . . .   6 . . . . . . . .   7
       3.2.2.  Relative To Other 6LoRH Headers . . . . . . . . . . .   7
   4.  6LoWPAN Routing Header General Format . . . . . . . . . . . .   6   8
     4.1.  Elective Format . . . . . . . . . . . . . . . . . . . . .   7   8
     4.2.  Critical Format . . . . . . . . . . . . . . . . . . . . .   7   9
     4.3.  Compressing Addresses . . . . . . . . . . . . . . . . . .   9
       4.3.1.  Coalescence . . . . . . . . . . . . . . . . . . . . .  10
       4.3.2.  DODAG Root Address Determination  . . . . . . . . . .  10
   5.  The Routing Header Type 3 (RH3) 6LoRH Header  . . . . . . . .   8  11
     5.1.  RH3-6LoRH General Operation . . . . . . . . . . . . . . .  13
     5.2.  The Design Point of Popping Entries . . . . . . . . . . .  13
     5.3.  Compression Reference . . . . . . . . . . . . . . . . . .  14
     5.4.  Popping Headers . . . . . . . . . . . . . . . . . . . . .  15
     5.5.  Forwarding  . . . . . . . . . . . . . . . . . . . . . . .  16
   6.  The RPL Packet Information 6LoRH  . . . . . . . . . . . . . .  10  16
     6.1.  Compressing the RPLInstanceID . . . . . . . . . . . . . .  11  18
     6.2.  Compressing the SenderRank  . . . . . . . . . . . . . . .  11  18
     6.3.  The Overall RPI-6LoRH encoding  . . . . . . . . . . . . .  12  19
   7.  The IP-in-IP 6LoRH Header . . . . . . . . . . . . . . . . . .  14  21
   8.  Security Considerations . . . . . . . . . . . . . . . . . . .  15  22
   9.  IANA Considerations . . . . . . . . . . . . . . . . . . . . .  15  22
     9.1.  Reserving Space in 6LoWPAN Dispatch Page 1  . . . . . . .  15  22
     9.2.  Nex  New 6LoWPAN Routing Header Type Registry  . . . . . . . .  16  23
   10. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . .  16  23
   11. References  . . . . . . . . . . . . . . . . . . . . . . . . .  16  23
     11.1.  Normative References . . . . . . . . . . . . . . . . . .  16  23
     11.2.  Informative References . . . . . . . . . . . . . . . . .  17  24
   Appendix A.  Examples . . . . . . . . . . . . . . . . . . . . . .  18
   Authors' Addresses  25
     A.1.  Examples Compressing The RPI  . . . . . . . . . . . . . .  25
     A.2.  Example Of Downward Packet In Non-Storing Mode  . . . . .  27
     A.3.  Example of RH3-6LoRH life-cycle . . . .  19

1.  Introduction

   The design of Low Power and Lossy Networks (LLNs) is generally
   focused on saving energy, a . . . . . . . . .  28
   Authors' Addresses  . . . . . . . . . . . . . . . . . . . . . . .  30

1.  Introduction

   The design of Low Power and Lossy Networks (LLNs) is generally
   focused on saving energy, a very constrained resource in most cases.
   The other constraints, such as the memory capacity and the duty
   cycling of the LLN devices, derive from that primary concern.  Energy
   is often available from primary batteries that are expected to last
   for years, or is scavenged from the environment in very limited
   quantities.  Any protocol that is intended for use in LLNs must be
   designed with the primary concern of saving energy as a strict
   requirement.

   Controlling the amount of data transmission is one possible venue to
   save energy.  In a number of LLN standards, the frame size is limited
   to much smaller values than the IPv6 maximum transmission unit (MTU)
   of 1280 bytes.  In particular, an LLN that relies on the classical
   Physical Layer (PHY) of IEEE 802.15.4 [IEEE802154] is limited to 127
   bytes per frame.  The need to compress IPv6 packets over IEEE
   802.15.4 led to the 6LoWPAN Header Compression [RFC6282] work
   (6LoWPAN-HC).

   Innovative Route-over techniques have been and are still being
   developed for routing inside a LLN.  In a general fashion, such
   techniques require additional information in the packet to provide
   loop prevention and to indicate information such as flow
   identification, source routing information, etc.

   For reasons such as security and the capability to send ICMP errors
   back to the source, an original packet must not be tampered with, and
   any information that must be inserted in or removed from an IPv6
   packet must be placed in an extra IP-in-IP encapsulation.  This is
   the case when the additional routing information is inserted by a
   router on the path of a packet, for instance a mesh root, as opposed
   to the source node.  This is also the case when some routing
   information must be removed from a packet that flows outside the LLN.
   When to use RFC 6553, 6554 and IPv6-in-IPv6
   [I-D.robles-roll-useofrplinfo] details different cases where RFC
   6553, RFC 6554 and IPv6-in-IPv6 encapsulation is required to set the
   bases to help defining the compression of RPL routing information in
   LLN environments.

   When using [RFC6282] the outer IP header of an IP-in-IP encapsulation
   may be compressed down to 2 octets in stateless compression and down
   to 3 octets in stateful compression when context information must be
   added.

      0                                       1
      0   1   2   3   4   5   6   7   8   9   0   1   2   3   4   5
    +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
    | 0 | 1 | 1 |  TF   |NH | HLIM  |CID|SAC|  SAM  | M |DAC|  DAM  |
    +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+

              Figure 1: LOWPAN_IPHC base Encoding (RFC6282).

   The Stateless Compression of an IPv6 addresses can only happen if the
   IPv6 address can de deduced from the MAC addresses, meaning that the
   IP end point is also the MAC-layer endpoint.  This is generally not
   the case in a RPL network which is generally a multi-hop route-over
   (i.e., operated at Layer-3) network.  A better compression, which
   does not involve variable compressions depending on the hop in the
   mesh, can be achieved based on the fact that the outer encapsulation
   is usually between the source (or destination) of the inner packet
   and the root.  Also, the inner IP header can only be compressed by
   [RFC6282] if all the fields preceding it are also compressed.  This
   specification makes the inner IP header the first header to be
   compressed by [RFC6282], and keeps the inner packet encoded the same
   way whether it is encapsulated or not, thus preserving existing
   implementations.

   As an example, the Routing Protocol for Low Power and Lossy Networks
   [RFC6550] (RPL) is designed to optimize the routing operations in
   constrained LLNs.  As part of this optimization, RPL requires the
   addition of RPL Packet Information (RPI) in every packet, as defined
   in Section 11.2 of [RFC6550].

   The RPL Option for Carrying RPL Information in Data-Plane Datagrams
   [RFC6553] specification indicates how the RPI can be placed in a RPL
   Option for use in an IPv6 Hop-by-Hop header.

   This representation demands a total of 8 bytes, while in most cases
   the actual RPI payload requires only 19 bits.  Since the Hop-by-Hop
   header must not flow outside of the RPL domain, it must be inserted
   in packets entering the domain and be removed from packets that leave
   the domain.  In both cases, this operation implies an IP-in-IP
   encapsulation.

           ------+---------                            ^
                 |          Internet                   |
                 |                                     | Native IPv6
              +-----+                                  |
              |     | Border Router (RPL Root)    ^    |    ^
              |     |                             |    |    |
              +-----+                             |    |    | IPv6 in
                 |                                |    |    | IPv6
           o    o   o    o                        |    |    | + RPI
       o o   o  o   o  o  o o   o                 |    |    |  or RH3
      o  o o  o o    o   o   o  o  o              |    |    |
      o   o    o  o     o  o    o  o  o           |    |    |
     o  o   o  o   o         o   o o              v    v    v
     o          o             o     o
                       LLN

             Figure 2: IP-in-IP Encapsulation within the LLN.

   Additionally, in the case of the Non-Storing Mode of Operation (MOP),
   RPL requires a Routing Header type 3 (RH3) as defined in the IPv6
   Routing Header for Source Routes with RPL [RFC6554] specification,
   for all packets that are routed down a RPL graph.  With Non-Storing
   RPL, even if the source is a node in the same LLN, the packet must
   first reach up the graph to the root so that the root can insert the
   RH3 to go down the graph.  In any fashion, whether the packet was
   originated in a node in the LLN or outside the LLN, and regardless of
   whether the packet stays within the LLN or not, as long as the source
   of the packet is not the root itself, the source-routing operation
   also implies an IP-in-IP encapsulation at the root in order to insert
   the RH3.

   6TiSCH [I-D.ietf-6tisch-architecture] specifies the operation of IPv6
   over the TimeSlotted Channel Hopping [RFC7554] (TSCH) mode of
   operation of IEEE 802.15.4.  The architecture requires the use of
   both RPL and the 6lo adaptation layer over IEEE 802.15.4.  Because it
   inherits the constraints on frame size from the MAC layer, 6TiSCH
   cannot afford to allocate 8 bytes per packet on the RPI.  Hence the
   requirement for 6LoWPAN header compression of the RPI.

   An extensible compression technique is required that simplifies IP-
   in-IP encapsulation when it is needed, and optimally compresses
   existing routing artifacts found in RPL LLNs.

   This specification extends the 6lo adaptation layer framework
   ([RFC4944],[RFC6282]) so as to carry routing information for route-
   over networks based on RPL.  The specification includes the formats
   necessary for RPL and is extensible for additional formats.

2.  Terminology

   The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
   "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and
   "OPTIONAL" in this document are to be interpreted as described in
   [RFC2119].

   The Terminology used in this document is consistent with and
   incorporates that described in `Terminology in Low power And Lossy
   Networks' [RFC7102] and [RFC6550].

   The terms Route-over and Mesh-under are defined in [RFC6775].

   Other terms in use in LLNs are found in [RFC7228].

   The term "byte" is used in its now customary sense as a synonym for
   "octet".

3.  Using the Page Dispatch

   The6LoWPAN

   The 6LoWPAN Paging Dispatch [I-D.ietf-6lo-paging-dispatch]
   specification extends the 6lo adaptation layer framework ([RFC4944],
   [RFC6282]) by introducing a concept of "context" in the 6LoWPAN
   parser, a context being identified by a Page number.  The
   specification defines 16 Pages.

   This draft operates within Page 1, which is indicated by a Dispatch
   Value of binary 11110001.

3.1.  New Routing Header Dispatch (6LoRH)

   This specification introduces a new 6LoWPAN Routing Header (6LoRH) to
   carry IPv6 routing information.  The 6LoRH may contain source routing
   information such as a compressed form of RH3, as well as other sorts
   of routing information such as the RPI and IP-in-IP encapsulation.

   The 6LoRH is expressed in a 6loWPAN packet as a Type-Length-Value
   (TLV) field, which is extensible for future use.

   This specification uses the bit pattern 10xxxxxx in Page 1 for the
   new 6LoRH Dispatch.  Section 4 describes how RPL artifacts in data
   packets can be compressed as 6LoRH headers.

3.2.  Placement Of The 6LoRH headers
3.2.1.  Relative To Non-6LoRH Headers

   Paging Dispatch is parsed and no subsequent Paging Dispatch has been
   parsed, the parsing of the packet MUST follow this specification if
   the 6LoRH Bit Pattern Section 3.1 is found.

   With this specification, the 6LoRH Dispatch is only defined in Page
   context is active.

   One or more 6LoRH header(s) MAY be placed in a 6LoWPAN packet.  A
   6LoRH header MUST always be placed before the LOWPAN_IPHC as defined
   in 6LoWPAN Header Compression [RFC6282].

   Because a 6LoRH header requires a Page 1 context, it MUST always be
   placed after any Fragmentation Header and/or Mesh Header [RFC4944].

4.  6LoWPAN Routing Header General Format

   The

   A 6LoRH reuses in Page 1 header MUST always be placed before the Dispatch Value Bit Pattern of
   10xxxxxx.

   The Dispatch Value Bit Pattern LOWPAN_IPHC as
   defined in 6LoWPAN Header Compression [RFC6282].  It is split designed in two forms of 6LoRH:

      Elective (6LoRHE)
   such a fashion that may skipped if not understood

      Critical (6LoRHC) placing or removing a header that may is encoded with
   6LoRH does not be ignored

4.1.  Elective Format

   The 6LoRHE uses modify the Dispatch Value Bit Pattern part of 101xxxxx.  A 6LoRHE
   may be ignored and skipped in parsing.  If it is ignored, the 6LoRHE packet that is forwarded encoded with no change inside
   LoWPAN_IPHC, whether there is an IP-in-IP encapsulation or not.  For
   instance, the LLN.

       0                   1
       0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-       ...        -+
      |1|0|1| Length  |      Type     |                    |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-       ...        -+
                                       <--    Length    -->

                Figure 3: Elective 6LoWPAN Routing Header.

   Length:
      Length final destination of the 6LoRHE expressed packet is always the one in bytes, excluding
   the first 2
      bytes.  This enables a node to skip LOWPAN_IPHC whether there is a 6LoRHE Routing Header or not.

3.2.2.  Relative To Other 6LoRH Headers

   IPv6 [RFC2460] defines chains of headers that are introduced by an
   IPv6 header and terminated by either another IPv6 header (IP-in-IP)
   or an Upper Layer Protocol ULP) header.  When an outer header is
   stripped from the packet, the whole chain goes with it.  When one or
   more header(s) are inserted by an intermediate router, that it does
      not support and/or cannot parse, for instance if router
   normally chains the Type is not
      recognized.

   Type:
      Type of headers and encapsulates the 6LoRHE

4.2.  Critical Format

   The 6LoRHC uses result in IP-in-IP.

   With this specification, the Dispatch Value Bit Pattern chains of 100xxxxx.

   A node which does not support the 6LoRHC Type headers MUST silently discard be compressed in
   the same order as they appear in the uncompressed form of the packet.

   Note: The situation where a node receives a message with a Critical
   6LoWPAN Routing Header
   This means that it does not understand if there is a critical
   administrative error whereby more than one nested IP-in-IP
   encapsulations, the wrong device first IP-in-IP encapsulation, with all its chain
   of headers, is placed encoded first in a network.
   It makes no sense to overburden the constrained device with code that
   would send an ICMP error to compressed form.

   In the source.  Rather, it is expected compressed form of a packet that has RH3 or HbH headers after
   the device will raise some management alert indicating that it cannot
   operate in this network for that reason.  As a result, inner IPv6 header (e.g. if there is no
   provision for IP-in-IP encapsulation),
   these headers are placed in the exchange of error messages for 6LoRH form before the 6LOWPAN-IPHC
   that represents the IPv6 header Section 3.2.1.  If this situation, so
   it should be avoided by judicious use of administrative control and/ packet gets
   encapsulated and some other RH3 or capability indications by HbH headers are added as part of
   the device manufacturer.

     0                   1
     0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-              ...               -+
    |1|0|0|   TSE   |      Type     |                                  |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-              ...               -+
                                     <-- Length implied by Type/TSE -->

                Figure 4: Critical 6LoWPAN Routing Header.

   TSE:
      Type Specific Extension.  The meaning depends on encapsulation, placing the Type, 6LoRH headers next to one another may
   present an ambiguity on which
      must be known header belong to which chain in all of the nodes.  The interpretation of
   uncompressed form.

   In order to disambiguate the TSE
      depends on headers that follow the Type field inner IPv6
   header in the uncompressed form from the headers that follows.  For instance, follow the
   outer IP-in-IP header, it may be
      used to transport control bits, is REQUIRED that the number of elements compressed IP-in-IP
   header is placed last in an
      array, or the length of encoded chain.  This means that the remainder
   6LoRH headers that are found after the last compressed IP-in-IP
   header are to be inserted after the IPv6 header that is encoded with
   the 6LOWPAN-IPHC when decompressing the packet.

   With regards to the relative placement of the 6LoRHC expressed RH3 and the RPI in a
      unit other than bytes.

   Type:
      Type of the 6LoRHC

5.  The Routing Header Type 3 (RH3) 6LoRH Header

   The Routing Header type 3 (RH3) 6LoRH (RH3-6LoRH) header
   compressed form, it is a
   Critical 6LoWPAN Routing Header that provides a compressed form design point for this specification that the RH3,
   RH3 entries are consumed as defined the packet progresses down the LLN
   Section 5.2.  In order to make this operation simpler in [RFC6554] for use by RPL routers.  Routers the
   compressed form, it is REQUIRED that need to forward a packet with a RH3-6LoRH the in the compressed form, the
   addresses along the source route path are expected to be RPL
   routers encoded in the order of the
   path, and are expected to support this specification.  If a non-RPL
   router receives a packet with a RH3-6LoRH, this means that there was
   a routing error and the packet should compressed RH3 are placed before the compressed
   RPI.

4.  6LoWPAN Routing Header General Format

   The 6LoRH usesthe Dispatch Value Bit Pattern of 10xxxxxx in Page 1.

   The Dispatch Value Bit Pattern is split in two forms of 6LoRH:

      Elective (6LoRHE) that may skipped if not understood

      Critical (6LoRHC) that may not be dropped so ignored

4.1.  Elective Format

   The 6LoRHE uses the Type cannot Dispatch Value Bit Pattern of 101xxxxx.  A 6LoRHE
   may be ignored. ignored and skipped in parsing.  If it is ignored, the 6LoRHE
   is forwarded with no change inside the LLN.

       0                   1
       0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-    -+-    -+       ... +-        -+
      |1|0|0|  Size   |6LoRH Type 0..4| Hop1 | Hop2
      |1|0|1| Length  |      Type     | HopN                    |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-    -+-    -+       ... +-        -+

            Size indicates the number of compressed addresses
                                       <--    Length    -->

                Figure 5: The RH3-6LoRH.

   The values 3: Elective 6LoWPAN Routing Header.

   Length:
      Length of the 6LoRHE expressed in bytes, excluding the first 2
      bytes.  This enables a node to skip a 6LoRHE header that it does
      not support and/or cannot parse, for instance if the RH3-6LoRH Type are an enumeration, 0 to 4.  The
   form of compression is indicated by not
      recognized.

   Type:
      Type of the Type. 6LoRHE

4.2.  Critical Format

   The unit (as a number 6LoRHC uses the Dispatch Value Bit Pattern of bytes) in 100xxxxx.

   A node which does not support the Size 6LoRHC Type MUST silently discard
   the packet.

   Note: The situation where a node receives a message with a Critical
   6LoWPAN Routing Header that it does not understand is expressed depends on a critical
   administrative error whereby the Type as
   described wrong device is placed in Figure 6:

     +-----------+-----------+
     |   Type    | Size Unit |
     +-----------+-----------+
     | a network.
   It makes no sense to overburden the constrained device with code that
   would send an ICMP error to the source.  Rather, it is expected that
   the device will raise some management alert indicating that it cannot
   operate in this network for that reason.  As a result, there is no
   provision for the exchange of error messages for this situation, so
   it should be avoided by judicious use of administrative control and/
   or capability indications by the device manufacturer.

     0      |                   1    |
     |
     0 1      |      2    |
     | 2      |      4    |
     | 3      | 4 5 6 7 8    |
     | 9 0 1 2 3 4 5
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-              ...               -+
    |1|0|0|   TSE   |     16      Type     |
     +-----------+-----------+                                  |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-              ...               -+
                                     <-- Length implied by Type/TSE -->

                Figure 6: 4: Critical 6LoWPAN Routing Header.

   TSE:
      Type Specific Extension.  The RH3-6LoRH Types.

   In meaning depends on the case Type, which
      must be known in all of the nodes.  The interpretation of a RH3-6LoRH header, the TSE
      depends on the Type field is that follows.  For instance, it may be
      used as a Size,
   which encodes to transport control bits, the number of hops minus 1; so elements in an
      array, or the length of the remainder of the 6LoRHC expressed in a Size
      unit other than bytes.

   Type:
      Type of 0 means one
   hop, and the maximum that can be encoded is 32 hops.  (If more than
   32 hops need to be expressed, a sequence of RH3-6LoRH elements can be
   employed.) 6LoRHC

4.3.  Compressing Addresses

   The Next Hop is indicated general technique used in the this draft to compress an address is
   first entry of to determine a reference that as a long prefix match with this
   address, and then elide that matching piece.  In order to reconstruct
   the first RH3-6LoRH
   header.  Upon reception, compress address, the router checks whether receiving node will perform the address
   indicated as Next Hop process of
   coalescence described in section Section 4.3.1.

   One possible reference is one the root of its own addresses, which MUST be the
   case in a strict source-routing environment.  In RPL DODAG that case, the entry is removed from the RH3-6LoRH header being
   traversed.  It is used to compress an outer IP-in-IP header, and if
   the Size root is decremented.  If
   that makes the Size zero, source of the whole RH3-6LoRH header is removed.  If
   there are no more RH3-6LoRH headers, packet, the processing node is technique allows to fully
   elide the last
   router on source address in the path, which may or may not be collocated with compressed form of the final
   destination.

   The last hop in IP header.  If
   the last RH3-6LoRH root is not the last router on encapsulator, then the way to encapsulator address may
   still be compressed using the destination in root as reference.  How the LLN.  In a classical RPL network, all nodes
   are routers so address of
   the last hop root is effectively the destination as well,
   but in the general case, even when there determined is a RH3-6LoRH header
   present, discussed in Section 4.3.2.

   Once the address of the final destination source of the packet is always indicated in determined, it
   becomes the LoWPAN_IPHC [RFC6282].

   If some bits reference for the compression of the first address addresses that are
   located in compressed RH3 headers that are present inside the RH3-6LoRH header can be
   derived from the final destination IP-in-
   IP encapsulation in the LoWPAN_IPHC, then that uncompressed form.

4.3.1.  Coalescence

   An IPv6 compressed address may be compressed; otherwise it is expressed as coalesced with a full IPv6 reference address by
   overriding the N rightmost bytes of 128 bits.  Next addresses only need to express the delta
   from reference address with the previous address.

   All addresses in a given RH3-6LoRH header are
   compressed in an
   identical fashion, down to using address, where N is the identical number of bytes per
   address.  In order to get different degrees length of compression, multiple
   consecutive RH3-6LoRH headers MUST be used

6.  The RPL Packet Information 6LoRH

   [RFC6550], Section 11.2, specifies the RPL Packet Information (RPI) compressed address,
   as a set of fields that are placed indicated by RPL routers in IP packets for the purpose Type of Instance Identification, as well as Loop Avoidance and
   Detection.

   In particular, the SenderRank, RH3-6LoRH header in Figure 7.

   The reference address MAY be a compressed address as well, in which
   case it MUST be compressed in a form that is of an equal or greater
   length than the scalar metric computed address that is being coalesced.

   A compressed address is expanded by coalescing it with a specialized Objective Function such as [RFC6552], indicates reference
   address.  In the
   Rank particular case of a Type 4 RH3-6LoRH, the sender address
   is expressed in full and the coalescence is modified at each hop.  The SenderRank field a complete override as
   illustrated in Figure 5.

   RRRRRRRRRRRRRRRRRRRR reference address, may be compressed or not

                CCCCCCC compressed address, shorter or same as reference

   RRRRRRRRRRRRRCCCCCCC Coalesced address, same compression as reference

                      Figure 5: Coalescing addresses.

4.3.2.  DODAG Root Address Determination

   Stateful Address compression requires that some state is used installed in
   the devices to validate store the compression information that is elided from
   the packet progresses packet.  That state is stored in an abstract context table and
   some form of index is found in the expected
   direction, either upwards or downwards, along packet to obtain the DODAG.

   RPL defines compression
   information from the RPL context table.

   With [RFC6282], the state is provided to the stack by the 6LoWPAN
   Neighbor Discovery Protocol (NDP) [RFC6775].  NDP exchanges the
   context through 6LoWPAN Context Option for Carrying RPL Information in Data-Plane
   Datagrams [RFC6553] to transport Router Advertisement (RA)
   messages.  In the RPI, which is carried compressed form of the packet, the context can be
   signaled in an IPv6
   Hop-by-Hop Options Header [RFC2460], typically consuming eight bytes
   per packet. a Context Identifier Extension.

   With [RFC6553], this specification, the RPL option compression information is encoded provided to
   the stack by RPL, and RPL exchanges it through the DODAGID field in
   the DAG Information Object (DIO) messages, as six octets, which must described in more
   details below.  In the compressed form of the packet, the context can
   be placed signaled in by the InstanceID in the RPI.

   With RPL [RFC6550], the address of DODAG root is known from the
   DODAGID field of the DIO messages.  For a Hop-by-Hop header Global Instance, the
   RPLInstanceID that consumes two additional octets is present in the RPI is enough information to
   identify the DODAG that this node participates to and its associated
   root.  But for a total Local Instance, the address of eight octets.  To limit the header's range to just root MUST be
   explicit, either in some device configuration or signaled in the
   RPL domain,
   packet, as the Hop-by-Hop header must be added to (or removed from)
   packets that cross source or the border destination address, respectively.

   When implicit, the address of the RPL domain.

   The 8-byte overhead DODAG root MUST be determined as
   follows:

   If the whole network is detrimental a single DODAG then the root can be well-
   known and does not need to LLN operation, be signaled in particular
   with regards to bandwidth the packets.  But RPL does
   not expose that property and battery constraints.  These bytes may
   cause it can only be known by a containing frame configuration
   applied to grow above maximum frame size, leading to
   Layer 2 or 6LoWPAN [RFC4944] fragmentation, which all nodes.

   Else, the router that encapsulates the packet and compresses it with
   this specification MUST also place an RPI in turn leads the packet as prescribed
   by [RFC6550] to enable the identification of the DODAG.  The RPI must
   be present even more energy expenditure and issues discussed in LLN Fragment
   Forwarding and Recovery [I-D.thubert-6lo-forwarding-fragments].

   An additional overhead comes from the need, in certain cases, to add case when the router also places an IP-in-IP encapsulation to carry RH3 header
   in the Hop-by-Hop header.  This packet.

   It is
   needed when expected that the router RPL implementation provides an abstract
   context table, indexed by Global RPLInstanceID, that inserts provides the Hop-by-Hop header is not
   address of the
   source root of the packet, so DODAG that an error can be returned this nodes participates to the router.
   This for
   that particular Instance.

5.  The Routing Header Type 3 (RH3) 6LoRH Header

   ## Encoding {#RH3-6LoRH-encoding}

   The Routing Header type 3 (RH3) 6LoRH (RH3-6LoRH) header is also a
   Critical 6LoWPAN Routing Header that provides a compressed form for
   the case when RH3, as defined in [RFC6554] for use by RPL routers.  Routers
   that need to forward a packet originated by with a RPL node must be
   stripped from the Hop-by-Hop header RH3-6LoRH are expected to be routed outside the RPL
   domain.

   For that reason,
   routers and are expected to support this specification defines an IP-in-IP-6LoRH header
   in Section 7, but it must be noted that removal of specification.  If a non-RPL
   router receives a 6LoRH header
   does not require manipulation of the packet in the LOWPAN_IPHC, with a RH3-6LoRH, this means that there was
   a routing error and
   thus, if the source address in packet should be dropped so the LOWPAN_IPHC is Type cannot
   be ignored.

       0                   1
       0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-    -+-    -+ ... +-    -+
      |1|0|0|  Size   |6LoRH Type 0..4| Hop1 | Hop2 |     | HopN |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-    -+-    -+ ... +-    -+

            Size indicates the node that
   inserted number of compressed addresses

                         Figure 6: The RH3-6LoRH.

   The 6LoRH Type indicates the IP-in-IP-6LoRH header then this situation alone does not
   mandate an IP-in-IP-6LoRH compression level used in a given
   RH3-6LoRH header.

   Note: A typical packet

   One or more 6LoRH header(s) MAY be placed in RPL non-storing mode going a 6LoWPAN packet.

   It results that all addresses in a given RH3-6LoRH header MUST be
   compressed in an identical fashion, down to using the RPL
   graph requires an IP-in-IP encapsulation identical
   number of bytes per address.  In order to get different degrees of
   compression, multiple consecutive RH3-6LoRH headers MUST be used.

   Type 0 means that the RH3, whereas the RPI
   is usually (and quite illegally) omitted, unless it address is important compressed down to
   indicate one byte, whereas
   Type 4 means that the RPLInstanceID.  To match this structure, an optimized
   IP-in-IP 6LoRH header address is defined provided in full in Section 7.

   As a result, a RPL packet may bear only an RPI-6LoRH header and no
   IP-in-IP-6LoRH header.  In that case, the source and destination RH3-6LoRH
   with no compression.  The complete list of Types of RH3-6LoRH and the packet
   corresponding compression level are specified by the LOWPAN_IPHC.

   As with [RFC6553], the fields provided in the RPI include an 'O', an 'R', and
   an 'F' bit, an 8-bit RPLInstanceID (with some internal structure),
   and a 16-bit SenderRank.

   The remainder of this section defines the RPI-6LoRH header, which is
   a Critical 6LoWPAN Routing Header that is designed to transport the
   RPI in 6LoWPAN LLNs.

6.1.  Compressing the RPLInstanceID

   RPL Instances are discussed in [RFC6550], Section 5.  A number Figure 7:

     +-----------+----------------------+
     |   6LoRH   | Length of
   simple use cases do not require more than one instance, and in such
   cases, the instance is expected to be the global Instance 0.  A
   global RPLInstanceID is encoded in a RPLInstanceID field as follows: compressed |
     |   Type    | IPv6 address (bytes) |
     +-----------+----------------------+
     |    0      |       1              |
     |    1      |       2              |
     |    2      |       4              |
     |    3      |       8              |
     |    4 5 6 7
      +-+-+-+-+-+-+-+-+
      |0|     ID      |  Global RPLInstanceID in 0..127
      +-+-+-+-+-+-+-+-+      16              |
     +-----------+----------------------+

                      Figure 7: RPLInstanceID Field Format for Global Instances.

   For The RH3-6LoRH Types.

   In the particular case of the global Instance 0, the RPLInstanceID
   field is all zeros.  This specification allows to elide a
   RPLInstanceID field that is all zeros, and defines a I flag that,
   when set, signals that RH3-6LoRH header, the TSE field is elided.

6.2.  Compressing the SenderRank

   The SenderRank is used as a Size,
   which encodes the result number of the DAGRank operation on the rank hops minus 1; so a Size of 0 means one
   hop, and the sender; here the DAGRank operation is defined in [RFC6550],
   Section 3.5.1, as:

      DAGRank(rank) = floor(rank/MinHopRankIncrease)

   If MinHopRankIncrease maximum that can be encoded is set 32 hops.  (If more than
   32 hops need to be expressed, a multiple of 256, the least
   significant 8 bits sequence of the SenderRank will be all zeroes; by eliding
   those, the SenderRank RH3-6LoRH elements can be compressed into a single byte.  This
   idea is used in [RFC6550] by defining DEFAULT_MIN_HOP_RANK_INCREASE
   as 256 and in [RFC6552]
   employed.)  It results that defaults MinHopRankIncrease to
   DEFAULT_MIN_HOP_RANK_INCREASE.

   This specification allows to encode the SenderRank as either one or
   two bytes, and defines a K flag that, when set, signals that Length in bytes of a single
   byte is used.

6.3.  The Overall RPI-6LoRH encoding

   The RPI-6LoRH RH3-6LoRH header provides a compressed form for
   is:

   2 + Length_of_compressed_IPv6_address * (Size + 1)

5.1.  RH3-6LoRH General Operation

   In the RPL RPI.
   Routers that need to forward non-compressed form, when the root generates or forwards a
   packet with a RPI-6LoRH header are
   expected in non-Storing Mode, it needs to be RPL routers that support this specification.  If a
   non-RPL router receives include a packet with Routing Header type
   3 (RH3) [RFC6554] to signal a RPI-6LoRH header, there was strict source-route path to a
   routing error and final
   destination down the packet should be dropped.  Thus DODAG.  All the Type field
   MUST NOT be ignored.

   Since hops along the I flag is not set, path, but the TSE field does not need to be a
   length expressed
   first one, are encoded in order in bytes.  In that case the field is fully reused
   for control bits that encode the O, R and F flags from RH3.  The last entry in the RPI, as
   well as
   RH3 is the I final destination and K flags that indicate the compression format.

   The Type for destination in the RPI-6LoRH is 5.

   The RPI-6LoRH IPv6 header
   is immediately followed by the RPLInstanceID
   field, unless that field is fully elided, and then first hop along the SenderRank,
   which is either compressed into one byte or fully in-lined as two
   bytes. source-route path.  The I intermediate hops
   perform a swap and K flags the Segment-Left field indicates the active entry
   in the RPI-6LoRH header indicate whether Routing Header [RFC2460].  The current destination of the RPLInstanceID
   packet, which is elided and/or the SenderRank termination of the current segment, is compressed.
   Depending on these bits, indicated
   at all times by the Length destination address of the RPI-6LoRH may vary as
   described hereafter.

       0                   1                   2
       0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+  ...  -+-+-+
      |1|0|0|O|R|F|I|K| 6LoRH Type=5  |   Compressed fields  |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+  ...  -+-+-+

                  Figure 8: The Generic RPI-6LoRH Format.

   O, R, and F bits: IPv6 header.

   The O, R, and F bits are defined in [RFC6550],
         section 11.2.

   I bit:  If it is set, handling of the Instance ID RH3-6LoRH is elided different: there is no swap, and a
   forwarding router that corresponds to the RPLInstanceID
         is first entry in the Global RPLInstanceID 0.  If it is not set, first
   RH3-6LoRH upon reception of a packet effectively consumes that entry
   when forwarding.  This means that the octet
         immediately following size of a compressed source-
   routed packet decreases as the type field contains packet progresses along its path and
   that the RPLInstanceID
         as specified in [RFC6550], section 5.1.

   K bit:  If it routing information is set, lost along the SenderRank way.  This also means
   that an RH3 encoded with 6LoRH is not recoverable and cannot be
   protected.

   When compressed into one octet, with this specification, all the least significant octet elided.  If it is remaining hops MUST
   be encoded in order in one or more consecutive RH3-6LoRH headers.
   Whether or not set, the
         SenderRank, there is fully inlined as two octets.

   In Figure 9, a RH3-6LoRH header present, the RPLInstanceID address of
   the final destination is indicated in the Global RPLInstanceID 0, and LoWPAN_IPHC at all times
   along the
   MinHopRankIncrease is a multiple path.  Examples of 256 so the least significant byte
   is all zeros and can be elided:

       0                   1                   2
       0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |1|0|0|O|R|F|1|1| 6LoRH Type=5  | SenderRank    |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
                I=1, K=1

                 Figure 9: this are provided in Appendix A.

   The most current destination (termination of the current segment) for a
   compressed RPI-6LoRH. source-routed packet is indicated in the first entry of
   the first RH3-6LoRH.  In Figure 10, strict source-routing, that entry MUST match
   an address of the RPLInstanceID router that receives the packet.

   The last entry in the last RH3-6LoRH is the Global RPLInstanceID 0, but
   both bytes last router on the way to
   the final destination in the LLN.  It is typically a RPL parent of
   the SenderRank are significant so final destination, but it can not also be
   compressed:

       0                   1                   2                   3
       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
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |1|0|0|O|R|F|1|0| 6LoRH Type=5  |        SenderRank             |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
                I=1, K=0

                   Figure 10: Eliding a router acting at 6LR
   [RFC6775] for the RPLInstanceID. destination host.

5.2.  The Design Point of Popping Entries

   In Figure 11, order to save energy and to optimize the RPLInstanceID chances of transmission
   success on lossy media, it is not a design point for this specification
   that the Global RPLInstanceID 0,
   and entries in the MinHopRankIncrease is RH3 that have been used are removed from the
   packet.  This creates a multiple discrepancy from the art of 256:

       0                   1                   2                   3
       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
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |1|0|0|O|R|F|0|1| 6LoRH Type=5  | RPLInstanceID |  SenderRank   |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
                I=0, K=1

                    Figure 11: Compressing SenderRank.

   In Figure 12, the RPLInstanceID is not the Global RPLInstanceID 0,
   and both bytes of the SenderRank are significant:

       0                   1                   2                   3
       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
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |1|0|0|O|R|F|0|0| 6LoRH Type=5  | RPLInstanceID |    Sender-...
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
        ...-Rank      |
      +-+-+-+-+-+-+-+-+
                I=0, K=0

              Figure 12: Least compressed form of RPI-6LoRH.

7.  The IP-in-IP 6LoRH Header

   The IP-in-IP 6LoRH (IP-in-IP-6LoRH) header is an Elective 6LoWPAN IPv6 where
   Routing Header that provides are mutable but recoverable.

   With this specification, the packet can be expanded at any hop into a
   valid IPv6 packet, including a RH3, and compressed form for back.  But the encapsulating
   IPv6 Header
   packet as decompressed along the way will not carry all the consumed
   addresses that packet would have if it had been forwarded in the case
   uncompressed form.

   It is noted that:

      The value of keeping the whole RH in an IP-in-IP encapsulation.

   An IP-in-IP encapsulation IPv6 header is used for the
      receiver to insert a field such as a Routing
   Header or an RPI at a router that is not reverse it to use the source of symmetrical path on the packet.
   In order way
      back.

      It is generally not a good idea to send an error back regarding reverse a routing header.  The
      RH may have been used to stay away from the inserted field, shortest path for some
      reason that is only valid on the
   address way in (segment routing).

      There is no use of reversing a RH in the router that performs the insertion must be provided.

   The encapsulation can also enable the last router prior to
   Destination to remove present RPL
      specifications.

      P2P RPL reverses a field such path that was learned reactively, as a part of
      the RPI, but this can be done
   in protocol operation, which is probably a cleaner way than a
      reversed echo on the compressed form data path.

      Reversing a header is discouraged by removing the RPI-6LoRH, so [RFC2460] for RH0 unless it
      is authenticated, which requires an IP-in-IP-
   6LoRH encapsulation Authentication Header (AH).
      There is not required no definition of an AH operation for RH3, and there is no
      indication that sole purpose.

   This field the need exists in LLNs.

      It is noted that AH does not critical for routing so the Type can be ignored,
   and protect the TSE field contains RH on the Length in bytes.

     0                   1                   2
     0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-       ...      -+
    |1|0|1| Length  | 6LoRH Type 6  |  Hop Limit    | Encaps. Address  |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-       ...      -+

                      Figure 13: The IP-in-IP-6LoRH.

   The Length of an IP-in-IP-6LoRH header way.  AH is expressed in bytes and MUST
   be at least 1, to indicate a Hop Limit (HL), that is decremented
      validation at
   each hop.  When the HL reaches 0, the packet is dropped per [RFC2460]

   If receiver with the Length sole value of an IP-in-IP-6LoRH header is exactly 1, then enabling the
   Encapsulator Address
      receiver to reversing it.

      A RPL domain is elided, which means usually protected by L2 security and that secures
      both RPL itself and the Encapsulator RH in the packets, at every hop.  This is
      a well-known router, for instance better security than that provided by AH.

   In summary, the root in a RPL graph.

   If benefit of saving energy and lowering the Length chances of an IP-in-IP-6LoRH header is greater than 1, then an
   Encapsulator Address is placed in a compressed form after
   loss by sending smaller frames over the LLN are seen as overwhelming
   compared to the Hop
   Limit field.  The value of possibly reversing the Length indicates which compression is
   performed on header.

5.3.  Compression Reference

   In order to optimize the Encapsulator Address.  For instance, a Size compression of 3
   indicates that IP addresses present in the Encapsulator Address is compressed to 2 bytes.

   When it cannot be elided,
   RH3 headers, this specification requires that the destination IP 6LoWPAN layer
   identifies an address of the IP-in-IP
   header that is transported in a RH3-6LoRH header used as reference for the first address of
   the list. compression.
   With RPL, this specification, the destination address Compression Reference for addresses
   found in the IP-in-IP an RH3 header is
   implicitly the root in source of the IPv6 packet.

   With RPL graph for packets going upwards, [RFC6550], an RH3 header may only be present in Non-Storing
   mode, and
   the destination address it may only be placed in the IPHC for packets going downwards.  If
   the implicit value is correct, packet by the destination IP address root of the IP-
   in-IP encapsulation can
   DODAG, which must be elided.

   If the final destination source of the resulting IPv6 packet
   [RFC2460].  In this case, the address used as Compression Reference
   is a leaf that does not
   support this specification, then the chain address of 6LoRH headers must be
   stripped by the RPL/6LR router to which the leaf is attached.  In
   that example, root, and it can be implicit when the destination IP
   address of the IP-in-IP header
   cannot root is.

   The Compression Reference MUST be elided.

   In determined as follows:

   The reference address may be obtained by configuration.  The
   configuration may indicate either the special case where address in full, or the
   identifier of a 6LoRH header is used to route 6LoWPAN
   fragments, Context that carries the destination address is not accessible in [RFC6775],
   for instance one of the IPHC on
   all fragments 16 Context Identifiers used in LOWPAN-IPHC
   [RFC6282].

   Else, and can be elided only for if there is no IP-in-IP encapsulation, the first fragment and for
   packets going upwards.

8.  Security Considerations

   The security considerations of [RFC4944], [RFC6282], and [RFC6553]
   apply.

   Using a compressed format as opposed to source address
   in the full in-line format IPv6 header that is
   logically equivalent and compressed with LOWPAN-IPHC is believed to not create an opening for a
   new threat when compared to [RFC6550], [RFC6553] and [RFC6554].

9.  IANA Considerations

   This specification reserves Dispatch Value Bit Patterns within the
   6LoWPAN Dispatch Page 1 as follows:

      101xxxxx: for Elective 6LoWPAN Routing Headers

      100xxxxx: for Critical 6LoWPAN Routing Headers.

9.2.  Nex 6LoWPAN Routing Header Type Registry

   This document creates an IANA registry
   reference for the 6LoWPAN Routing Header
   Type, compression.

   Else, and assigns if the following values:

      0..4: RH3-6LoRH [RFCthis]

      5: RPI-6LoRH [RFCthis]

      6: IP-in-IP-6LoRH [RFCthis]

10.  Acknowledgments

   The authors wish to thank Tom Phinney, Thomas Watteyne, Tengfei
   Chang, Martin Turon, James Woodyatt, Samita Chakrabarti, Jonathan
   Hui, Gabriel Montenegro IP-in-IP compression specified in this document is
   used and Ralph Droms for constructive reviews to the design Encapsulator Address is provided, then the Encapsulator
   Address is the reference.

5.4.  Popping Headers

   Upon reception, the router checks whether the address in the 6lo Working Group.  The overall discussion involved
   participants to first
   entry of the 6MAN, 6TiSCH and ROLL WGs, thank you all.
   Special thanks to first RH3-6LoRH one of its own addresses.  In that case,
   router MUST consume that entry before forwarding, which is an action
   of popping from a stack, where the chairs stack is effectively the sequence
   of entries in consecutive RH3-6LoRH headers.

   Popping an entry of an RH3-6LoRH header is a recursive action
   performed as follows:

   If the ROLL WG, Michael Richardson and
   Ines Robles, Size of the RH3-6LoRH header is 1 or more, indicating that
   there are at least 2 entries in the header, the router removes the
   first entry and Brian Haberman, Internet Area A-D, decrements the Size (by 1).

   Else (meaning that this is the last entry in the RH3-6LoRH header),
   and Adrian
   Farrel, Routing Area A-D, for driving if there is no next RH3-6LoRH header after this complex effort across
   Working Groups then the
   RH3-6LoRH is removed.

   Else, if there is a next RH3-6LoRH of a Type with a larger or equal
   value, meaning a same or lesser compression yielding same or larger
   compressed forms, then the RH3-6LoRH is removed.

   Else, the first entry of the next RH3-6LoRH is popped from the next
   RH3-6LoRH and Areas.

11.  References

11.1.  Normative References

   [I-D.ietf-6lo-paging-dispatch]
              Thubert, P., "6LoWPAN Paging Dispatch", draft-ietf-6lo-
              paging-dispatch-01 (work coalesced with the first entry of this RH3-6LoRH.

   At the end of the process, if there is no more RH3-6LoRH in progress), January 2016.

   [IEEE802154]
              IEEE standard for Information Technology, "IEEE std.
              802.15.4, Part. 15.4: Wireless Medium Access Control (MAC) the
   packet, then the processing node is the last router along the source
   route path.

5.5.  Forwarding

   When receiving a packet with a RH3-6LoRH, a router determines the
   IPv6 address of the current segment endpoint.

   If strict source routing is enforced and Physical Layer (PHY) Specifications for Low-Rate
              Wireless Personal Area Networks", 2015.

   [RFC2119]  Bradner, S., "Key words thus router is not the
   segment endpoint for use the packet then this router MUST drop the
   packet.

   If this router is the current segment endpoint, then the router pops
   its address as described in RFCs to Indicate
              Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/
              RFC2119, March 1997,
              <http://www.rfc-editor.org/info/rfc2119>.

   [RFC2460]  Deering, S. Section 5.4 and R. Hinden, "Internet Protocol, Version 6
              (IPv6) Specification", RFC 2460, DOI 10.17487/RFC2460,
              December 1998, <http://www.rfc-editor.org/info/rfc2460>.

   [RFC4944]  Montenegro, G., Kushalnagar, N., Hui, J., continues processing the
   packet.

   If there is still a RH3-6LoRH, then the router determines the new
   segment endpoint and D. Culler,
              "Transmission routes the packet towards that endpoint.

   Otherwise the router uses the destination in the inner IP header to
   forward or accept the packet.

   The segment endpoint of a packet MUST be determined as follows:

   The router first determines the Compression Reference as discussed in
   Section 4.3.1.

   The router then coalesces the Compression Reference with the first
   entry of the first RH3-6LoRH header as discussed in Section 5.3.  If
   the type of the RH3-6LoRH header is type 4 then the coalescence is a
   full override.

   Since the Compression Reference is an uncompressed address, the
   coalesced IPv6 Packets over IEEE 802.15.4
              Networks", RFC 4944, DOI 10.17487/RFC4944, September 2007,
              <http://www.rfc-editor.org/info/rfc4944>.

   [RFC6282]  Hui, J., Ed. address is also expressed in the full 128bits.

   An example of this operation is provided in Appendix A.3.

6.  The RPL Packet Information 6LoRH

   [RFC6550], Section 11.2, specifies the RPL Packet Information (RPI)
   as a set of fields that are placed by RPL routers in IP packets for
   the purpose of Instance Identification, as well as Loop Avoidance and P. Thubert, "Compression Format
   Detection.

   In particular, the SenderRank, which is the scalar metric computed by
   a specialized Objective Function such as [RFC6552], indicates the
   Rank of the sender and is modified at each hop.  The SenderRank field
   is used to validate that the packet progresses in the expected
   direction, either upwards or downwards, along the DODAG.

   RPL defines the RPL Option for IPv6 Carrying RPL Information in Data-Plane
   Datagrams over IEEE 802.15.4-Based Networks", RFC 6282,
              DOI 10.17487/RFC6282, September 2011, [RFC6553] to transport the RPI, which is carried in an IPv6
   Hop-by-Hop Options Header [RFC2460], typically consuming eight bytes
   per packet.

   With [RFC6553], the RPL option is encoded as six octets, which must
   be placed in a Hop-by-Hop header that consumes two additional octets
   for a total of eight octets.  To limit the header's range to just the
   RPL domain, the Hop-by-Hop header must be added to (or removed from)
   packets that cross the border of the RPL domain.

   The 8-byte overhead is detrimental to LLN operation, in particular
   with regards to bandwidth and battery constraints.  These bytes may
   cause a containing frame to grow above maximum frame size, leading to
   Layer 2 or 6LoWPAN [RFC4944] fragmentation, which in turn leads to
   even more energy expenditure and issues discussed in LLN Fragment
   Forwarding and Recovery [I-D.thubert-6lo-forwarding-fragments].

   An additional overhead comes from the need, in certain cases, to add
   an IP-in-IP encapsulation to carry the Hop-by-Hop header.  This is
   needed when the router that inserts the Hop-by-Hop header is not the
   source of the packet, so that an error can be returned to the router.
   This is also the case when a packet originated by a RPL node must be
   stripped from the Hop-by-Hop header to be routed outside the RPL
   domain.

   For that reason, this specification defines an IP-in-IP-6LoRH header
   in Section 7, but it must be noted that removal of a 6LoRH header
   does not require manipulation of the packet in the LOWPAN_IPHC, and
   thus, if the source address in the LOWPAN_IPHC is the node that
   inserted the IP-in-IP-6LoRH header then this situation alone does not
   mandate an IP-in-IP-6LoRH header.

   Note: A typical packet in RPL non-storing mode going down the RPL
   graph requires an IP-in-IP encapsulation of the RH3, whereas the RPI
   is usually (and quite illegally) omitted, unless it is important to
   indicate the RPLInstanceID.  To match this structure, an optimized
   IP-in-IP 6LoRH header is defined in Section 7.

   As a result, a RPL packet may bear only an RPI-6LoRH header and no
   IP-in-IP-6LoRH header.  In that case, the source and destination of
   the packet are specified by the LOWPAN_IPHC.

   As with [RFC6553], the fields in the RPI include an 'O', an 'R', and
   an 'F' bit, an 8-bit RPLInstanceID (with some internal structure),
   and a 16-bit SenderRank.

   The remainder of this section defines the RPI-6LoRH header, which is
   a Critical 6LoWPAN Routing Header that is designed to transport the
   RPI in 6LoWPAN LLNs.

6.1.  Compressing the RPLInstanceID

   RPL Instances are discussed in [RFC6550], Section 5.  A number of
   simple use cases do not require more than one instance, and in such
   cases, the instance is expected to be the global Instance 0.  A
   global RPLInstanceID is encoded in a RPLInstanceID field as follows:

       0 1 2 3 4 5 6 7
      +-+-+-+-+-+-+-+-+
      |0|     ID      |  Global RPLInstanceID in 0..127
      +-+-+-+-+-+-+-+-+

        Figure 8: RPLInstanceID Field Format for Global Instances.

   For the particular case of the global Instance 0, the RPLInstanceID
   field is all zeros.  This specification allows to elide a
   RPLInstanceID field that is all zeros, and defines a I flag that,
   when set, signals that the field is elided.

6.2.  Compressing the SenderRank

   The SenderRank is the result of the DAGRank operation on the rank of
   the sender; here the DAGRank operation is defined in [RFC6550],
   Section 3.5.1, as:

      DAGRank(rank) = floor(rank/MinHopRankIncrease)

   If MinHopRankIncrease is set to a multiple of 256, the least
   significant 8 bits of the SenderRank will be all zeroes; by eliding
   those, the SenderRank can be compressed into a single byte.  This
   idea is used in [RFC6550] by defining DEFAULT_MIN_HOP_RANK_INCREASE
   as 256 and in [RFC6552] that defaults MinHopRankIncrease to
   DEFAULT_MIN_HOP_RANK_INCREASE.

   This specification allows to encode the SenderRank as either one or
   two bytes, and defines a K flag that, when set, signals that a single
   byte is used.

6.3.  The Overall RPI-6LoRH encoding

   The RPI-6LoRH header provides a compressed form for the RPL RPI.
   Routers that need to forward a packet with a RPI-6LoRH header are
   expected to be RPL routers that support this specification.  If a
   non-RPL router receives a packet with a RPI-6LoRH header, there was a
   routing error and the packet should be dropped.  Thus the Type field
   MUST NOT be ignored.

   Since the I flag is not set, the TSE field does not need to be a
   length expressed in bytes.  In that case the field is fully reused
   for control bits that encode the O, R and F flags from the RPI, as
   well as the I and K flags that indicate the compression format.

   The Type for the RPI-6LoRH is 5.

   The RPI-6LoRH header is immediately followed by the RPLInstanceID
   field, unless that field is fully elided, and then the SenderRank,
   which is either compressed into one byte or fully in-lined as two
   bytes.  The I and K flags in the RPI-6LoRH header indicate whether
   the RPLInstanceID is elided and/or the SenderRank is compressed.
   Depending on these bits, the Length of the RPI-6LoRH may vary as
   described hereafter.

       0                   1                   2
       0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+  ...  -+-+-+
      |1|0|0|O|R|F|I|K| 6LoRH Type=5  |   Compressed fields  |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+  ...  -+-+-+

                  Figure 9: The Generic RPI-6LoRH Format.

   O, R, and F bits:  The O, R, and F bits are defined in [RFC6550],
         section 11.2.

   I bit:  If it is set, the Instance ID is elided and the RPLInstanceID
         is the Global RPLInstanceID 0.  If it is not set, the octet
         immediately following the type field contains the RPLInstanceID
         as specified in [RFC6550], section 5.1.

   K bit:  If it is set, the SenderRank is compressed into one octet,
         with the least significant octet elided.  If it is not set, the
         SenderRank, is fully inlined as two octets.

   In Figure 10, the RPLInstanceID is the Global RPLInstanceID 0, and
   the MinHopRankIncrease is a multiple of 256 so the least significant
   byte is all zeros and can be elided:

       0                   1                   2
       0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |1|0|0|O|R|F|1|1| 6LoRH Type=5  | SenderRank    |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
                I=1, K=1

                 Figure 10: The most compressed RPI-6LoRH.

   In Figure 11, the RPLInstanceID is the Global RPLInstanceID 0, but
   both bytes of the SenderRank are significant so it can not be
   compressed:

       0                   1                   2                   3
       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
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |1|0|0|O|R|F|1|0| 6LoRH Type=5  |        SenderRank             |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
                I=1, K=0

                   Figure 11: Eliding the RPLInstanceID.

   In Figure 12, the RPLInstanceID is not the Global RPLInstanceID 0,
   and the MinHopRankIncrease is a multiple of 256:

       0                   1                   2                   3
       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
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |1|0|0|O|R|F|0|1| 6LoRH Type=5  | RPLInstanceID |  SenderRank   |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
                I=0, K=1

                    Figure 12: Compressing SenderRank.

   In Figure 13, the RPLInstanceID is not the Global RPLInstanceID 0,
   and both bytes of the SenderRank are significant:

       0                   1                   2                   3
       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
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |1|0|0|O|R|F|0|0| 6LoRH Type=5  | RPLInstanceID |    Sender-...
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
        ...-Rank      |
      +-+-+-+-+-+-+-+-+
                I=0, K=0

              Figure 13: Least compressed form of RPI-6LoRH.

7.  The IP-in-IP 6LoRH Header

   The IP-in-IP 6LoRH (IP-in-IP-6LoRH) header is an Elective 6LoWPAN
   Routing Header that provides a compressed form for the encapsulating
   IPv6 Header in the case of an IP-in-IP encapsulation.

   An IP-in-IP encapsulation is used to insert a field such as a Routing
   Header or an RPI at a router that is not the source of the packet.
   In order to send an error back regarding the inserted field, the
   address of the router that performs the insertion must be provided.

   The encapsulation can also enable the last router prior to
   Destination to remove a field such as the RPI, but this can be done
   in the compressed form by removing the RPI-6LoRH, so an IP-in-IP-
   6LoRH encapsulation is not required for that sole purpose.

   This field is not critical for routing so the Type can be ignored,
   and the TSE field contains the Length in bytes.

     0                   1                   2
     0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-       ...      -+
    |1|0|1| Length  | 6LoRH Type 6  |  Hop Limit    | Encaps. Address  |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-       ...      -+

                      Figure 14: The IP-in-IP-6LoRH.

   The Length of an IP-in-IP-6LoRH header is expressed in bytes and MUST
   be at least 1, to indicate a Hop Limit (HL), that is decremented at
   each hop.  When the HL reaches 0, the packet is dropped per
   [RFC2460].

   If the Length of an IP-in-IP-6LoRH header is exactly 1, then the
   Encapsulator Address is elided, which means that the Encapsulator is
   a well-known router, for instance the root in a RPL graph.

   With this specification, an optimal compression of IP-in-IP
   encapsulation can be achieved if an endpoint of the packet is the
   root of the RPL DODAG associated to the Instance that is used to
   forward the packet, and the root address is known implicitly as
   opposed to signaled explicitly in the data packets.

   If the Length of an IP-in-IP-6LoRH header is greater than 1, then an
   Encapsulator Address is placed in a compressed form after the Hop
   Limit field.  The value of the Length indicates which compression is
   performed on the Encapsulator Address.  For instance, a Size of 3
   indicates that the Encapsulator Address is compressed to 2 bytes.

   The reference for the compression is the address of the root of the
   DODAG.  The way the address of the root is determined is discussed in
   Section 4.3.2.

   When it cannot be elided, the destination IP address of the IP-in-IP
   header is transported in a RH3-6LoRH header as the first address of
   the list.

   With RPL, the destination address in the IP-in-IP header is
   implicitly the root in the RPL graph for packets going upwards, and
   the destination address in the IPHC for packets going downwards.  If
   the implicit value is correct, the destination IP address of the IP-
   in-IP encapsulation can be elided.

   If the final destination of the packet is a leaf that does not
   support this specification, then the chain of 6LoRH headers must be
   stripped by the RPL/6LR router to which the leaf is attached.  In
   that example, the destination IP address of the IP-in-IP header
   cannot be elided.

   In the special case where a 6LoRH header is used to route 6LoWPAN
   fragments, the destination address is not accessible in the IPHC on
   all fragments and can be elided only for the first fragment and for
   packets going upwards.

8.  Security Considerations

   The security considerations of [RFC4944], [RFC6282], and [RFC6553]
   apply.

   Using a compressed format as opposed to the full in-line format is
   logically equivalent and is believed to not create an opening for a
   new threat when compared to [RFC6550], [RFC6553] and [RFC6554].

9.  IANA Considerations

   This specification reserves Dispatch Value Bit Patterns within the
   6LoWPAN Dispatch Page 1 as follows:

      101xxxxx: for Elective 6LoWPAN Routing Headers

      100xxxxx: for Critical 6LoWPAN Routing Headers.

9.2.  New 6LoWPAN Routing Header Type Registry

   This document creates an IANA registry for the 6LoWPAN Routing Header
   Type, and assigns the following values:

      0..4: RH3-6LoRH [RFCthis]

      5: RPI-6LoRH [RFCthis]

      6: IP-in-IP-6LoRH [RFCthis]

10.  Acknowledgments

   The authors wish to thank Tom Phinney, Thomas Watteyne, Tengfei
   Chang, Martin Turon, James Woodyatt, Samita Chakrabarti, Jonathan
   Hui, Gabriel Montenegro and Ralph Droms for constructive reviews to
   the design in the 6lo Working Group.  The overall discussion involved
   participants to the 6MAN, 6TiSCH and ROLL WGs, thank you all.
   Special thanks to the chairs of the ROLL WG, Michael Richardson and
   Ines Robles, and Brian Haberman, Internet Area A-D, and Adrian
   Farrel, Routing Area A-D, for driving this complex effort across
   Working Groups and Areas.

11.  References

11.1.  Normative References

   [I-D.ietf-6lo-paging-dispatch]
              Thubert, P., "6LoWPAN Paging Dispatch", draft-ietf-6lo-
              paging-dispatch-01 (work in progress), January 2016.

   [IEEE802154]
              IEEE standard for Information Technology, "IEEE std.
              802.15.4, Part. 15.4: Wireless Medium Access Control (MAC)
              and Physical Layer (PHY) Specifications for Low-Rate
              Wireless Personal Area Networks", 2015.

   [RFC2119]  Bradner, S., "Key words for use in RFCs to Indicate
              Requirement Levels", BCP 14, RFC 2119,
              DOI 10.17487/RFC2119, March 1997,
              <http://www.rfc-editor.org/info/rfc2119>.

   [RFC2460]  Deering, S. and R. Hinden, "Internet Protocol, Version 6
              (IPv6) Specification", RFC 2460, DOI 10.17487/RFC2460,
              December 1998, <http://www.rfc-editor.org/info/rfc2460>.

   [RFC4944]  Montenegro, G., Kushalnagar, N., Hui, J., and D. Culler,
              "Transmission of IPv6 Packets over IEEE 802.15.4
              Networks", RFC 4944, DOI 10.17487/RFC4944, September 2007,
              <http://www.rfc-editor.org/info/rfc4944>.

   [RFC6282]  Hui, J., Ed. and P. Thubert, "Compression Format for IPv6
              Datagrams over IEEE 802.15.4-Based Networks", RFC 6282,
              DOI 10.17487/RFC6282, September 2011,
              <http://www.rfc-editor.org/info/rfc6282>.

   [RFC6550]  Winter, T., Ed., Thubert, P., Ed., Brandt, A., Hui, J.,
              Kelsey, R., Levis, P., Pister, K., Struik, R., Vasseur,
              JP., and R. Alexander, "RPL: R. Alexander, "RPL: IPv6 Routing Protocol for
              Low-Power and Lossy Networks", RFC 6550,
              DOI 10.17487/RFC6550, March 2012,
              <http://www.rfc-editor.org/info/rfc6550>.

   [RFC6552]  Thubert, P., Ed., "Objective Function Zero for the Routing
              Protocol for Low-Power and Lossy Networks (RPL)",
              RFC 6552, DOI 10.17487/RFC6552, March 2012,
              <http://www.rfc-editor.org/info/rfc6552>.

   [RFC6553]  Hui, J. and JP. Vasseur, "The Routing Protocol for Low-
              Power and Lossy Networks (RPL) Option for Carrying RPL
              Information in Data-Plane Datagrams", RFC 6553,
              DOI 10.17487/RFC6553, March 2012,
              <http://www.rfc-editor.org/info/rfc6553>.

   [RFC6554]  Hui, J., Vasseur, JP., Culler, D., and V. Manral, "An IPv6
              Routing Header for Source Routes with the Routing Protocol
              for Low-Power and Lossy Networks (RPL)", RFC 6554,
              DOI 10.17487/RFC6554, March 2012,
              <http://www.rfc-editor.org/info/rfc6554>.

   [RFC7102]  Vasseur, JP., "Terms Used in Routing for Low-Power and
              Lossy Networks", RFC 7102, DOI 10.17487/RFC7102, January
              2014, <http://www.rfc-editor.org/info/rfc7102>.

   [RFC7228]  Bormann, C., Ersue, M., and A. Keranen, "Terminology for
              Constrained-Node Networks", RFC 7228,
              DOI 10.17487/RFC7228, May 2014,
              <http://www.rfc-editor.org/info/rfc7228>.

11.2.  Informative References

   [I-D.ietf-6tisch-architecture]
              Thubert, P., "An Architecture for IPv6 over the TSCH mode
              of IEEE 802.15.4", draft-ietf-6tisch-architecture-09 (work
              in progress), November 2015.

   [I-D.robles-roll-useofrplinfo]
              Robles, I., Richardson, M., and P. Thubert, "When to use
              RFC 6553, 6554 and IPv6-in-IPv6", draft-robles-roll-
              useofrplinfo-02 (work in progress), October 2015.

   [I-D.thubert-6lo-forwarding-fragments]
              Thubert, P. and J. Hui, "LLN Fragment Forwarding and
              Recovery", draft-thubert-6lo-forwarding-fragments-02 (work
              in progress), November 2014.

   [RFC6775]  Shelby, Z., Ed., Chakrabarti, S., Nordmark, E., and C.
              Bormann, "Neighbor Discovery Optimization for IPv6 over
              Low-Power Wireless Personal Area Networks (6LoWPANs)",
              RFC 6775, DOI 10.17487/RFC6775, November 2012,
              <http://www.rfc-editor.org/info/rfc6775>.

   [RFC7554]  Watteyne, T., Ed., Palattella, M., and L. Grieco, "Using
              IEEE 802.15.4e Time-Slotted Channel Hopping (TSCH) in the
              Internet of Things (IoT): Problem Statement", RFC 7554,
              DOI 10.17487/RFC7554, May 2015,
              <http://www.rfc-editor.org/info/rfc7554>.

Appendix A.  Examples

A.1.  Examples Compressing The RPI

   The example in Figure 15 illustrates the 6LoRH compression of a
   classical packet in Storing Mode in all directions, as well as in
   non-Storing mode for a packet going up the DODAG following the
   default route to the root.  In this particular example, a
   fragmentation process takes place per [RFC4944], and the fragment
   headers must be placed in Page 0 before switching to Page 1:

   +-  ...  -+-  ...  -+-+ ... -+- ... +-+-+ ... -+-+-+-+-+-+-+-+-+-+...
   |Frag type|Frag hdr |11110001|  RPI-  |IP-in-IP| LOWPAN-IPHC | ...
   |RFC 4944 |RFC 4944 | Page 1 | 6LoRH  | 6LoRH  |             |
   +-  ...  -+-  ...  -+-+ ... -+- ... +-+-+ ... -+-+-+-+-+-+-+-+-+-+...
                                                   <-  RFC 6282  ->
                                                    No RPL artifact

              Figure 15: Example Compressed Packet with RPI.

   In Storing Mode, if the packet stays within the RPL domain, then it
   is possible to save the IP-in-IP encapsulation, in which case only
   the RPI is compressed with a 6LoRH, as illustrated in Figure 16 in
   the case of a non-fragmented ICMP packet:

   +- ...  -+-+- ... -+-+-+-+ ... -+-+-+-+ ... -+-+-+-+-+-+-+-+-+-+-+...
   |11110001| RPI-6LoRH |  NH = 0      | NH = 58  |  ICMP message ...
   |Page 1  |  type 5   | 6LOWPAN-IPHC | (ICMP)   |  (no compression)
   +- ...  -+-+- ... -+-+-+-+ ... -+-+-+-+ ... -+-+-+-+-+-+-+-+-+-+-+...
                         <-      RFC 6282       ->
                             No RPL artifact

         Figure 16: Example ICMP Packet with RPI in Storing Mode.

   The format in Figure 16 is logically equivalent to the non-compressed
   format illustrated in Figure 17:

   +-+-+-+- ... -+-+-+-+ ... -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+...
   |  IPv6 Routing Protocol for
              Low-Power and Lossy Networks", RFC 6550, DOI 10.17487/
              RFC6550, March 2012,
              <http://www.rfc-editor.org/info/rfc6550>.

   [RFC6552]  Thubert, P., Ed., "Objective Function Zero for Header  | Hop-by-Hop |  RPI in       |  ICMP message ...
   |  NH = 58      | Header     |  RPL Option   |
   +-+-+-+- ... -+-+-+-+ ... -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+...

               Figure 17: Uncompressed ICMP Packet with RPI.

   For a UDP packet, the Routing
              Protocol for Low-Power and Lossy Networks (RPL)", transport header can be compressed with 6LoWPAN
   HC [RFC6282] as illustrated in Figure 18:

   +- ...  -+- ... -+-+-+-+- ... +-+-+-+-+-+-+-+-+-+- ... +-+-+-+-+-+...
   |11110001| RPI-6LoRH |  NH = 1      |11110|C| P | Compressed |UDP ...
   |Page 1  |  type 5   | 6LOWPAN-IPHC | UDP | |   | UDP header |Payload
   +- ...  -+- ... -+-+-+-+- ... +-+-+-+-+-+-+-+-+-+- ... +-+-+-+-+-+...
                         <-              RFC
              6552, DOI 10.17487/RFC6552, March 2012,
              <http://www.rfc-editor.org/info/rfc6552>.

   [RFC6553]  Hui, J. and JP. Vasseur, "The Routing Protocol for Low-
              Power and Lossy Networks (RPL) Option for Carrying 6282             ->
                                    No RPL
              Information artifact

               Figure 18: Uncompressed ICMP Packet with RPI.

   If the packet is received from the Internet in Data-Plane Datagrams", Storing Mode, then the
   root is supposed to encapsulate the packet to insert the RPI.  The
   resulting format would be as represented in Figure 19:

 +-+-+-+-+-+-+- ... -+-+-- ... -+-+- ... -+-+-+-+-+-+-+ ... -+-+-+-+...
 |11110001 | RPI-6LoRH | IP-in-IP | NH=1 |11110CPP| Compressed | UDP
 |Page 1   |           |  6LoRH   | IPHC | UDP    | UDP header | Payload
 +-+-+-+-+-+-+- ... -+-+-- ... -+-+- ... -+-+-+-+-+-+-+ ... -+-+-+-+...
                                   <-         RFC 6553, DOI
              10.17487/RFC6553, March 2012,
              <http://www.rfc-editor.org/info/rfc6553>.

   [RFC6554]  Hui, J., Vasseur, JP., Culler, D., and V. Manral, "An IPv6
              Routing Header 6282       ->
                                         No RPL artifact

           Figure 19: RPI inserted by the root in Storing Mode.

A.2.  Example Of Downward Packet In Non-Storing Mode

   The example illustrated in Figure 20 is a classical packet in non-
   Storing mode for Source Routes with a packet going down the Routing Protocol
              for Low-Power and Lossy Networks (RPL)", RFC 6554, DOI
              10.17487/RFC6554, March 2012,
              <http://www.rfc-editor.org/info/rfc6554>.

   [RFC7102]  Vasseur, JP., "Terms Used DODAG following a source
   routed path from the root.  Say that we have 4 forwarding hops to
   reach a destination.  In the non-compressed form, when the root
   generates the packet, the last 3 hops are encoded in a Routing for Low-Power and
              Lossy Networks", RFC 7102, DOI 10.17487/RFC7102, January
              2014, <http://www.rfc-editor.org/info/rfc7102>.

   [RFC7228]  Bormann, C., Ersue, M., Header
   type 3 (RH3) and A. Keranen, "Terminology for
              Constrained-Node Networks", RFC 7228, DOI 10.17487/
              RFC7228, May 2014,
              <http://www.rfc-editor.org/info/rfc7228>.

11.2.  Informative References

   [I-D.ietf-6tisch-architecture]
              Thubert, P., "An Architecture for IPv6 over the TSCH mode first hop is the destination of IEEE 802.15.4", draft-ietf-6tisch-architecture-09 (work
              in progress), November 2015.

   [I-D.robles-roll-useofrplinfo]
              Robles, I., Richardson, M., and P. Thubert, "When to use
              RFC 6553, 6554 the packet.  The
   intermediate hops perform a swap and IPv6-in-IPv6", draft-robles-roll-
              useofrplinfo-02 (work the hop count indicates the
   current active hop [RFC2460], [RFC6554].

   When compressed with this specification, the 4 hops are encoded in progress), October 2015.

   [I-D.thubert-6lo-forwarding-fragments]
              Thubert, P. and J. Hui, "LLN Fragment Forwarding
   RH3-6LoRH when the root generates the packet, and
              Recovery", draft-thubert-6lo-forwarding-fragments-02 (work the final
   destination is left in progress), November 2014.

   [RFC6775]  Shelby, Z., Ed., Chakrabarti, S., Nordmark, E., and C.
              Bormann, "Neighbor Discovery Optimization for IPv6 over
              Low-Power Wireless Personal Area Networks (6LoWPANs)", RFC
              6775, DOI 10.17487/RFC6775, November 2012,
              <http://www.rfc-editor.org/info/rfc6775>.

   [RFC7554]  Watteyne, T., Ed., Palattella, M., the LOWPAN-IPHC.  There is no swap, and L. Grieco, "Using
              IEEE 802.15.4e Time-Slotted Channel Hopping (TSCH) in the
              Internet of Things (IoT): Problem Statement", RFC 7554,
              DOI 10.17487/RFC7554, May 2015,
              <http://www.rfc-editor.org/info/rfc7554>.

Appendix A.  Examples

   The example in Figure 14 illustrates
   forwarding node that corresponds to the first entry effectively
   consumes it when forwarding, which means that the 6LoRH compression size of a
   classical the encoded
   packet decreases and that the hop information is lost.

   If the last hop in Storing Mode a RH3-6LoRH is not the final destination then it
   removes the RH3-6LoRH before forwarding.

   In the particular example illustrated in Figure 20, all directions, as well as addresses in
   non-Storing mode for a packet going up
   the DODAG following are assigned from a same /112 prefix and the
   default route last 2 octets
   encoding an identifier such as a IEEE 802.15.4 short address.  In
   that case, all addresses can be compressed to 2 octets, using the root.  In
   root address as reference.  There will be one RH3_6LoRH header, with,
   in this particular example, a
   fragmentation process takes place per [RFC4944], 3 compressed addresses:

 +-+-+-+-+-+-+- ... +-+-+- ... -+-+-- ... -+-+- ... -+-+-+-+-+ ... +-...
 |11110001 |RH3-6LoRH | RPI-6LoRH | IP-in-IP | NH=1 |11110CPP| UDP | UDP
 |Page 1   |Type1 S=2 |           |  6LoRH   | IPHC | UDP    | hdr |load
 +-+-+-+-+-+-+- ... +-+-+- ... -+-+-- ... -+-+- ... -+-+-+-+-+ ... +-...
            <-8bytes->                         <-  RFC 6282      ->
                                                No RPL artifact

              Figure 20: Example Compressed Packet with RH3.

   One may note that the RPI is provided.  This is because the address
   of the root that is the source of the IP-in-IP header is elided and
   inferred from the fragment
   headers must be placed InstanceID in Page 0 before switching the RPI.  Once found from a local
   context, that address is used as Compression Reference to Page 1: expand
   addresses in the RH3-6LoRH.

   With the RPL specifications available at the time of writing this
   draft, the root is the only node that may incorporate a RH3 in an IP
   packet.  When the root forwards a packet that it did not generate, it
   has to encapsulate the packet with IP-in-IP.

   But if the root generates the packet towards a node in its DODAG,
   then it should avoid the extra IP-in-IP as illustrated in Figure 21:

   +- ...  -+-  ...  -+-+  -+-+-+ ... -+-+ +-+-+-+ ... -+- -+-+-+-+-+-+-+-++-+- ... +-+-+-+-+-+-+-+-+-+-+...
   |Frag type|Frag hdr |11110001|IP-in-IP|  RPI -+-+-+-+-+...
   |11110001| RH3-6LoRH | RFC 6282 Dispatch
   |RFC 4944 |RFC 4944 NH=1       | Page 11110CPP  | Compressed | UDP
   |Page 1  | 6LoRH Type1 S=3 | 6LoRH LOWPAN-IPHC| LOWPAN-NHC| UDP header |   + LOWPAN_IPHC Payload
   +- ...  -+-  ...  -+-+  -+-+-+ ... -+-+ +-+-+-+ ... -+- -+-+-+-+-+-+-+-++-+- ... +-+-+-+-+-+-+-+-+-+-+... -+-+-+-+-+...
                                          <-        RFC 6282        ->
                                                      No RPL artifact

              Figure 14: Example Compressed Packet with RPI.

   The example illustrated in

        Figure 15 21: compressed RH3 4*2bytes entries sourced by root.

   Note: the RPI is a classical packet in non-
   Storing mode not represented though RPL [RFC6550] generally
   expects it.  In this particular case, since the Compression Reference
   for a packet going down the DODAG following a source
   routed path from RH3-6LoRH is the root; in this particular example, addresses source address in the DODAG are assigned LOWPAN-IPHC, and the
   routing is strict along the source route path, the RPI does not
   appear to be absolutely necessary.

   In Figure 21, all the nodes along the source route path share a same
   /112 prefix, prefix.  This is typical of IPv6 addresses derived from an
   IEEE802.15.4 short address, as long as all the nodes share a same
   PAN-ID.  In that case, a type-1 RH3-6LoRH header can be used for instance
   encoding.  The IPv6 address of the root is taken from as reference, and
   only the last 2 octets of the address of the intermediate hops is
   encoded.  The Size of 3 indicates 4 hops, resulting in a RH3-6LoRH of
   10 bytes.

A.3.  Example of RH3-6LoRH life-cycle

   This section illustrates the operation specified in Section 5.5 of
   forwarding a packet with a /64 subnet compressed RH3 along an A->B->C->D source
   route path.  The operation of popping addresses is exemplified at
   each hop.

   Packet as received by node A
   ----------------------------
     Type 3 RH3-6LoRH Size = 0   AAAA AAAA AAAA AAAA
     Type 1 RH3-6LoRH Size = 0                  BBBB
     Type 2 RH3-6LoRH Size = 1             CCCC CCCC
                                           DDDD DDDD

    Step 1 popping BBBB the first entry of the next RH3-6LoRH
    Step 2 next is if larger value (2 vs. 1) the RH3-6LoRH is removed

     Type 3 RH3-6LoRH Size = 0   AAAA AAAA AAAA AAAA
     Type 2 RH3-6LoRH Size = 1             CCCC CCCC
                                           DDDD DDDD

    Step 3: recursion ended, coalescing BBBB with the first 6 octets of the suffix set entry
     Type 3 RH3-6LoRH Size = 0   AAAA AAAA AAAA BBBB

    Step 4: routing based on next segment endpoint to
   a constant such B

                     Figure 22: Processing at Node A.

   Packet as all zeroes.  In that case, all addresses but received by node B
   ----------------------------
     Type 3 RH3-6LoRH Size = 0   AAAA AAAA AAAA BBBB
     Type 2 RH3-6LoRH Size = 1             CCCC CCCC
                                           DDDD DDDD

    Step 1 popping CCCC CCCC, the first can be compressed to 2 octets, which means that there will be entry of the next RH3-6LoRH
    Step 2
   RH3_6LoRH headers, one to store removing the first complete address entry and decrementing the
   one Size (by 1)

     Type 3 RH3-6LoRH Size = 0   AAAA AAAA AAAA BBBB
     Type 2 RH3-6LoRH Size = 0             DDDD DDDD

    Step 3: recursion ended, coalescing CCCC CCCC with the first entry
     Type 3 RH3-6LoRH Size = 0   AAAA AAAA CCCC CCCC

    Step 4: routing based on next segment endpoint to store C

                     Figure 23: Processing at Node B.

   Packet as received by node C
   ----------------------------

     Type 3 RH3-6LoRH Size = 0   AAAA AAAA CCCC CCCC
     Type 2 RH3-6LoRH Size = 0             DDDD DDDD

    Step 1 popping DDDD DDDD, the sequence first entry of addresses compressed to the next RH3-6LoRH
    Step 2 octets (in
   this example, the RH3-6LoRH is removed

     Type 3 of them):

   +- ...  -+- ...  -+-+-+- ... -+-+-+-+-+ ... -+-+-+-+-+-+-+-+-+-+-+...
   |11110001|IP-in-IP| RH3(128bits)| RH3(3*16bits)| RFC 6282 Dispatch
   |Page 1  | 6LoRH  | 6LoRH       | 6LoRH        |   + LOWPAN_IPHC
   +- ...  -+- ... +-+-+-+- ... -+-+-+-+-+ ... -+-+-+-+-+-+-+-+-+-+-+...
                                                   <-    RFC 6282     ->
                                                      No RPL artifact RH3-6LoRH Size = 0   AAAA AAAA CCCC CCCC

    Step 3: recursion ended, coalescing DDDD DDDDD with the first entry
     Type 3 RH3-6LoRH Size = 0   AAAA AAAA DDDD DDDD

    Step 4: routing based on next segment endpoint to D

                     Figure 15: Example Compressed 24: Processing at Node C.

   Packet with RH3.

   Note: as received by node D
   ----------------------------
     Type 3 RH3-6LoRH Size = 0   AAAA AAAA DDDD DDDD

    Step 1 the RPI RH3-6LoRH is not represented since most implementations actually
   refrain from placing it in a source routed packet though [RFC6550]
   generally expects it. removed.
    Step 2 no more header, routing based on inner IP header.

                     Figure 25: Processing at Node D.

Authors' Addresses

   Pascal Thubert (editor)
   Cisco Systems
   Building D - Regus
   45 Allee des Ormes
   BP1200
   MOUGINS - Sophia Antipolis  06254
   FRANCE

   Phone: +33 4 97 23 26 34
   Email: pthubert@cisco.com
   Carsten Bormann
   Universitaet Bremen TZI
   Postfach 330440
   Bremen  D-28359
   Germany

   Phone: +49-421-218-63921
   Email: cabo@tzi.org

   Laurent Toutain
   Institut MINES TELECOM; TELECOM Bretagne
   2 rue de la Chataigneraie
   CS 17607
   Cesson-Sevigne Cedex  35576
   France

   Email: Laurent.Toutain@telecom-bretagne.eu

   Robert Cragie
   ARM Ltd.
   110 Fulbourn Road
   Cambridge  CB1 9NJ
   UK

   Email: robert.cragie@gridmerge.com