<?xml version="1.0" encoding="UTF-8"?>
  <?xml-stylesheet type="text/xsl" href="rfc2629.xslt" ?>
  <!-- generated by https://github.com/cabo/kramdown-rfc2629 version 1.0.36 -->

<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
]>

<?rfc sortrefs="yes"?>
<?rfc iprnotified="no"?>
<?rfc authorship="yes"?>
<?rfc tocappendix="yes"?>
<?rfc strict="yes"?>
<?rfc toc="yes"?>
<?rfc tocdepth="4"?>
<?rfc symrefs="yes"?>
<?rfc compact="no"?>

<rfc ipr="trust200902" docName="draft-ietf-roll-routing-dispatch-01" category="std">

  <front>
    <title>6LoWPAN Routing Header</title>

    <author initials="P." surname="Thubert" fullname="Pascal Thubert" role="editor">
      <organization abbrev="Cisco">Cisco Systems</organization>
      <address>
        <postal>
          <street>Building D - Regus</street> <street>45 Allee des Ormes</street> <street>BP1200</street>
          <city>MOUGINS - Sophia Antipolis</city>
          <code>06254</code>
          <country>FRANCE</country>
        </postal>
        <phone>+33 4 97 23 26 34</phone>
        <email>pthubert@cisco.com</email>
      </address>
    </author>
    <author initials="C." surname="Bormann" fullname="Carsten Bormann">
      <organization abbrev="Uni Bremen TZI">Universitaet Bremen TZI</organization>
      <address>
        <postal>
          <street>Postfach 330440</street>
          <city>Bremen</city>
          <code>D-28359</code>
          <country>Germany</country>
        </postal>
        <phone>+49-421-218-63921</phone>
        <email>cabo@tzi.org</email>
      </address>
    </author>
    <author initials="L." surname="Toutain" fullname="Laurent Toutain">
      <organization abbrev="IMT-TELECOM Bretagne">Institut MINES TELECOM; TELECOM Bretagne</organization>
      <address>
        <postal>
          <street>2 rue de la Chataigneraie</street> <street>CS 17607</street>
          <city>Cesson-Sevigne Cedex</city>
          <code>35576</code>
          <country>France</country>
        </postal>
        <email>Laurent.Toutain@telecom-bretagne.eu</email>
      </address>
    </author>
    <author initials="R." surname="Cragie" fullname="Robert Cragie">
      <organization abbrev="ARM">ARM Ltd.</organization>
      <address>
        <postal>
          <street>110 Fulbourn Road</street>
          <city>Cambridge</city>
          <code>CB1 9NJ</code>
          <country>UK</country>
        </postal>
        <email>robert.cragie@gridmerge.com</email>
      </address>
    </author>

    <date year="2016" month="September" day="16"/>

    <area>Internet</area>
    <workgroup>roll</workgroup>
    

    <abstract>


<t>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.</t>



    </abstract>


  </front>

  <middle>


<section anchor="introduction" title="Introduction">

<t>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.</t>

<t>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 <xref target="IEEE802154"/> is limited to 127 bytes
per frame. The need to compress IPv6 packets over IEEE 802.15.4 led to
the <xref target="RFC6282">6LoWPAN Header Compression</xref> work (6LoWPAN-HC).</t>

<t>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.</t>

<t>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.
<xref target="I-D.ietf-roll-useofrplinfo">When to use RFC 6553, RFC 6554 and IPv6-in-IPv6</xref>
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.</t>

<t>When using <xref target="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.</t>

<figure title="LOWPAN_IPHC base Encoding (RFC6282)." anchor="encaps6282"><artwork><![CDATA[
   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  |
 +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
]]></artwork></figure>

<t>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 <xref target="RFC6282"/> if all the fields
preceding it are also compressed.  This specification makes the inner IP header
the first header to be compressed by <xref target="RFC6282"/>, and keeps the inner packet
encoded the same way whether it is encapsulated or not, thus preserving existing
implementations.</t>

<t>As an example, the <xref target="RFC6550">Routing Protocol for Low Power and Lossy Networks</xref>
(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 <xref target="RFC6550"/>.</t>

<t>The <xref target="RFC6553">RPL Option for Carrying RPL Information in Data-Plane Datagrams</xref>
specification indicates how the RPI can be placed in a RPL Option (RPL-OPT) that 
is placed in an IPv6 Hop-by-Hop header.</t>

<t>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.</t>

<t>Additionally, in the case of the Non-Storing Mode of Operation (MOP), RPL
requires a Source Routing Header (SRH) in all packets that are routed down a RPL
graph. for that purpose, the [IPv6 Routing Header for Source Routes with RPL]
(#RFC6554) specification defines the type 3 Routing Header for IPv6 (RH3).</t>

<figure title="IP-in-IP Encapsulation within the LLN." anchor="encaps"><artwork><![CDATA[
        ------+---------                            ^
              |          Internet                   |
              |                                     | Native IPv6
           +-----+                                  |
           |     | Border Router (RPL Root)    ^    |    ^
           |     |                             |    |    |
           +-----+                             |    |    | IPv6 in
              |                                |    |    | IPv6  
        o    o   o    o                        |    |    | plus
    o o   o  o   o  o  o o   o                 |    |    | 
   o  o o  o o    o   o   o  o  o              |    |    | RPL SRH
   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

]]></artwork></figure>

<t>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 SRH 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 SRH.</t>

<t><xref target="I-D.ietf-6tisch-architecture">6TiSCH</xref> specifies the
operation of IPv6 over the <xref target="RFC7554">TimeSlotted Channel Hopping</xref>
(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.</t>

<t>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.</t>

<t>This specification extends the 6lo adaptation layer framework
(<xref target="RFC4944"/>,<xref target="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.</t>

</section>
<section anchor="terminology" title="Terminology">

<t>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 <xref target="RFC2119"/>.</t>

<t>The Terminology used in this document is consistent with and incorporates that 
described in `Terminology in Low power And Lossy Networks’ <xref target="RFC7102"/> and 
<xref target="RFC6550"/>.</t>

<t>The terms Route-over and Mesh-under are defined in <xref target="RFC6775"/>.</t>

<t>Other terms in use in LLNs are found in <xref target="RFC7228"/>.</t>

<t>The term “byte” is used in its now customary sense as a synonym for
“octet”.</t>

</section>
<section anchor="updating-rfc-4944" title="Using the Page Dispatch">

<t>The <xref target="I-D.ietf-6lo-paging-dispatch">6LoWPAN Paging Dispatch</xref> specification extends 
the 6lo adaptation layer framework (<xref target="RFC4944"/>, <xref target="RFC6282"/>)
by introducing a concept of “context” in the 6LoWPAN parser,
a context being identified by a Page number. The specification defines 16 Pages.</t>

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

<section anchor="NewLoRH" title="New Routing Header Dispatch (6LoRH)">

<t>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 SRH, as well as other sorts of
routing information such as the RPI and IP-in-IP encapsulation.</t>

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

<t>It is expected that a router that does not recognize the 6LoRH general format
detailed in <xref target="rhf"/> will drop the packet when a 6LoRH is present.</t>

<!--
The proposed BIER bitmap encoding in {{BIER-6LoRH-encoding}} is an example
of extension.


Section 5.1 of RFC4944 {{RFC4944}} defines various Dispatch Types and Headers
for Page 0. 

-->
<t>This specification uses the bit pattern 10xxxxxx 
in Page 1 for <!-- the canonical form of --> the new 6LoRH Dispatch.
<xref target="rhf"/> describes how RPL artifacts in data packets can be compressed
as 6LoRH headers.</t>

<!--
The 6LoRH uses on a 1/4th of the Dispatch space in Page 1, and this
specification only uses a limited portion of the TLV space in
the 6LoRH to encode RPL artifacts as detailed in {{rhf}}.


It is expected that in the
future, other specification with extend the 6LoRH for other features
related to packet routing and forwarding in 6LoWPAN networks.

-->

<!--
## Sur-Compression Mechanisms {#reuse-mesh}

It is expected that virtual-link-specific sur-compression mechanisms may
be applied in the future that merge Dispatch values from multiple Pages into 
a single octet, attempting to keep the dispatch bits settings in their
canonical form as much as possible. 

The new 6LoRH Dispatch introduced in this specification uses in Page 1 the 
bit pattern that is used in Page 0 by the Mesh Header {{RFC4944}}.
Considering that the Mesh-Under and the Route-Over modes are
generally mutually exclusive, it is expected that  in most cases the
6LoRH Dispatch can be left in its canonical form through sur-compression technique.

A dispatch space of equivalent size was reserved in
{{RFC4944}} for external specifications, Not A LoWPAN (NALP), hoping that such
specification could coexist harmlessly on a same network as a early 6LoWPAN.

A sur-compression technique may alternatively use the NALP space for 6LoRH, 
in which case bit patterns represented as 10xxxxxx in this specification will 
be mapped directly to 00xxxxxx.

-->

</section>
<section anchor="placement_6LoRHC" title="Placement Of 6LoRH headers">

<section anchor="placement_out_6LoRHC" title="Relative To Non-6LoRH Headers">

<t>In a zone of a packet where Page 1 is active (i.e., once a Page 1 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
<xref target="NewLoRH"/> is found.</t>

<t>With this specification, the 6LoRH Dispatch is only defined in Page 1, so it MUST be
placed in the packet in a zone where the Page 1 context is active.</t>

<t>Because a 6LoRH header requires a Page 1 context, it MUST always be placed
after any Fragmentation Header and/or Mesh Header <xref target="RFC4944"/>.</t>

<t>A 6LoRH header MUST always be placed before the LOWPAN_IPHC as defined in
6LoWPAN Header Compression <xref target="RFC6282"/>. It is designed in such a fashion that
placing or removing a header that is encoded with 6LoRH does not modify the part
of the packet that is encoded with LoWPAN_IPHC, whether there is an IP-in-IP
encapsulation or not. For instance, the final destination of the packet is
always the one in the LOWPAN_IPHC whether there is a Routing Header or not.</t>

</section>
<section anchor="placement_in_6LoRHC" title="Relative To Other 6LoRH Headers">

<t>IPv6 <xref target="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 router normally chains the headers and encapsulates the result in IP-in-IP.</t>

<t>With this specification, the chains of headers MUST be compressed in the same
order as they appear in the uncompressed form of the packet. This means that if
there is more than one nested IP-in-IP encapsulations, the first IP-in-IP
encapsulation, with all its chain of headers, is encoded first in the compressed
form.</t>

<t>In the compressed form of a packet that has SRH or HbH headers after the inner
IPv6 header (e.g. if there is no IP-in-IP encapsulation), these headers are
placed in the 6LoRH form before the 6LOWPAN-IPHC that represents the IPv6 header
<xref target="placement_out_6LoRHC"/>. If this packet gets encapsulated and some other SRH or
HbH headers are added as part of the encapsulation, placing the 6LoRH headers
next to one another may present an ambiguity on which header belong to which
chain in the uncompressed form.</t>

<t>In order to disambiguate the headers that follow the inner IPv6 header in the
uncompressed form from the headers that follow the outer IP-in-IP header, it is
REQUIRED that the compressed IP-in-IP header is placed last in the encoded chain.
This means that the 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.</t>

<t>With regards to the relative placement of the SRH and the RPI in the compressed
form, it is a design point for this specification that the SRH entries are
consumed as the packet progresses down the LLN <xref target="SRH-design-pop"/>.
In order to make this operation simpler in the compressed form, it is REQUIRED
that the in the compressed form, the addresses along the source route path are
encoded in the order of the path, and that the compressed SRH are placed before
the compressed RPI.</t>

</section>
</section>
</section>
<section anchor="rhf" title="6LoWPAN Routing Header General Format">

<!-- In its canonical form, t-->
<t>The 6LoRH uses the Dispatch Value Bit Pattern of 10xxxxxx in Page 1.</t>

<t>The Dispatch Value Bit Pattern is split in two forms of 6LoRH:</t>

<t><list style='empty'>
  <t>Elective (6LoRHE) that may skipped if not understood</t>
</list></t>

<t><list style='empty'>
  <t>Critical (6LoRHC) that may not be ignored</t>
</list></t>

<t>for each form, a Type field is used to encode the type of 6LoRH.
Note that there is a different registry for the Type field of each form of 6LoRH,
This means that that a value for the Type that is defined for one form of 6LoRH
may be redefined in the future for the other form.</t>

<section anchor="LoRHE" title="Elective Format">

<!-- In its canonical form, t-->
<t>The 6LoRHE uses the Dispatch Value Bit Pattern of 101xxxxx.
A 6LoRHE may be ignored and skipped in parsing.
If it is ignored, the 6LoRHE is forwarded with no change inside the LLN.</t>

<figure title="Elective 6LoWPAN Routing Header." anchor="rtghe"><artwork><![CDATA[
    0                   1
    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-       ...        -+
   |1|0|1| Length  |      Type     |                    |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-       ...        -+
                                    <--    Length    -->
]]></artwork></figure>

<t><list style="hanging" hangIndent="6">
  <t hangText='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 Type is not recognized.</t>
  <t hangText='Type:'>
  Type of the 6LoRHE</t>
</list></t>

</section>
<section anchor="LoRHC" title="Critical Format">

<!-- In its canonical form, t -->
<t>The 6LoRHC uses the Dispatch Value Bit Pattern of 100xxxxx.</t>

<t>A node which does not support the 6LoRHC Type MUST silently discard the packet.</t>

<t>Note: the situation where a node receives a message with a Critical 6LoWPAN Routing Header
that it does not understand should not occur and is an administrative error,
see <xref target="management-considerations"/>.</t>

<figure title="Critical 6LoWPAN Routing Header." anchor="rtghc"><artwork><![CDATA[
  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 -->
]]></artwork></figure>

<t><list style="hanging" hangIndent="6">
  <t hangText='TSE:'>
  Type Specific Extension.  The meaning depends on the Type, which must be known in all of the nodes.  The interpretation of the TSE depends on the Type field that follows. For instance, it may be used to transport control bits, the number of elements in an array, or the length of the remainder of the 6LoRHC expressed in a unit other than bytes.</t>
  <t hangText='Type:'>
  Type of the 6LoRHC</t>
</list></t>

</section>
<section anchor="SRH-6LoRH-addrcomp" title="Compressing Addresses">

<t>The general technique used in this draft to compress an address is first to determine
a reference that as a long prefix match with this address, and then elide that matching
piece. In order to reconstruct the compress address, the receiving node will perform
the process of coalescence described in section <xref target="SRH-6LoRH-coalescence"/>.</t>

<t>One possible reference is the root of the RPL DODAG that is being traversed. It
is used by 6LoRH as the reference to compress an outer IP header, in case of an
IP-in-IP encapsulation. If the root is the source of the packet, this
technique allows to fully elide the source address in the compressed form of the IP
header. If the root is not the encapsulator, then the encapsulator address may still be
compressed using the root as reference. How the address of the root is determined is
discussed in <xref target="find-root"/>.</t>

<t>Once the address of the source of the packet is determined, it becomes the reference
for the compression of the addresses that are located in compressed SRH headers that
are present inside the IP-in-IP encapsulation in the uncompressed form.</t>

<section anchor="SRH-6LoRH-coalescence" title="Coalescence">

<t>An IPv6 compressed address is coalesced with a reference address by overriding
the N rightmost bytes of the reference address with the compressed address,
where N is the length of the compressed address, as indicated by the Type of the
SRH-6LoRH header in <xref target="SRHLoRHtype"/>.</t>

<t>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 address that is being coalesced.</t>

<t>A compressed address is expanded by coalescing it with a reference address. In
the particular case of a Type 4 SRH-6LoRH, the address is expressed in full and
the coalescence is a complete override as illustrated in <xref target="SRHCoalesce"/>.</t>

<figure title="Coalescing addresses." anchor="SRHCoalesce"><artwork><![CDATA[
RRRRRRRRRRRRRRRRRRRR reference address, may be compressed or not

             CCCCCCC compressed address, shorter or same as reference
             
RRRRRRRRRRRRRCCCCCCC Coalesced address, same compression as reference
]]></artwork></figure>

</section>
<section anchor="find-root" title="DODAG Root Address Determination">

<t>Stateful Address compression requires that some state is installed in the devices
to store the compression information that is elided from the packet.
That state is stored in an abstract context table and some form of index is found
in the packet to obtain the compression information from the context table.</t>

<t>With <xref target="RFC6282"/>, the state is provided to the stack by the 6LoWPAN Neighbor
Discovery Protocol (NDP) <xref target="RFC6775"/>. NDP exchanges the context through 6LoWPAN
Context Option in Router Advertisement (RA) messages. In the compressed form of
the packet, the context can be signaled in a Context Identifier Extension.</t>

<t>With this specification, the compression information is provided to the stack by
RPL, and RPL exchanges it through the DODAGID field in the DAG Information Object
(DIO) messages, as described in more details below. In the compressed form of
the packet, the context can be signaled in by the RPLInstanceID in the RPI.</t>

<t>With RPL <xref target="RFC6550"/>, the address of the DODAG root is known from the DODAGID 
field 
of the DIO messages. For a Global Instance, the RPLInstanceID that is present in
the RPI is enough information to identify the DODAG that this node participates
to and its associated root. But for a Local Instance, the address of the root
MUST be explicit, either in some device configuration or signaled in the packet,
as the source or the destination address, respectively.</t>

<t>When implicit, the address of the DODAG root MUST be determined as follows:</t>

<t>If the whole network is a single DODAG then the root can be well-known and does
not need to be signaled in the packets. But since RPL does not expose that
property, it can only be known by a configuration applied to all nodes.</t>

<t>Else, the router that encapsulates the packet and compresses it with this
specification MUST also place an RPI in the packet as prescribed by <xref target="RFC6550"/>
to enable the identification of the DODAG. The RPI must be present even in the
case when the router also places an SRH header in the packet.</t>

<t>It is expected that the RPL implementation maintains an abstract context table,
indexed by Global RPLInstanceID, that provides the address of the root of the
DODAG that this nodes participates to for that particular RPL Instance.</t>

</section>
</section>
</section>
<section anchor="SRH-6LoRH" title="The SRH 6LoRH Header">

<section anchor="SRH-6LoRH-encoding" title="Encoding">

<t>A Source Routing Header 6LoRH (SRH-6LoRH) header
provides a compressed form for the SRH, as defined
in <xref target="RFC6554"/> for use by RPL routers.</t>

<t>One or more SRH-6LoRH header(s) MAY be placed in a 6LoWPAN packet.</t>

<t>If a non-RPL router receives a packet with a SRH-6LoRH header, 
there was a routing or a configuration error (see <xref target="management-considerations"/>).</t>

<t>The desired reaction for the non-RPL router is to drop the packet as opposed to
skip the header and forward the packet.</t>

<t>The Dispatch Value Bit Pattern for the SRH-6LoRH header indicates Critical.
Routers that understand the 6LoRH general format detailed in <xref target="rhf"/> cannot
ignore a 6LoRH header of this type, and will drop the packet if it is unknown to them.</t>

<figure title="The SRH-6LoRH." anchor="SRHLoRH"><artwork><![CDATA[
    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 |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-    -+-    -+ ... +-    -+
   
             Where N = Size + 1
]]></artwork></figure>

<t>The 6LoRH Type of a SRH-6LoRH header indicates the compression level used for that header.</t>

<t>It results that all addresses in a given SRH-6LoRH header MUST be compressed in
an identical fashion, down to using the identical number of bytes per address.
In order to get different degrees of compression, multiple consecutive SRH-6LoRH
headers MUST be used.</t>

<t>Type 0 means that the address is compressed down to one byte, whereas Type 4
means that the address is provided in full in the SRH-6LoRH with no compression.
The complete list of Types of SRH-6LoRH and the corresponding compression level 
are provided in <xref target="SRHLoRHtype"/>:</t>

<figure title="The SRH-6LoRH Types." anchor="SRHLoRHtype"><artwork><![CDATA[
  +-----------+----------------------+
  |   6LoRH   | Length of compressed |
  |   Type    | IPv6 address (bytes) |
  +-----------+----------------------+
  |    0      |       1              |
  |    1      |       2              |
  |    2      |       4              |
  |    3      |       8              |
  |    4      |      16              |
  +-----------+----------------------+
]]></artwork></figure>

<t>In the case of a SRH-6LoRH header, the TSE field is used as a Size,
which encodes the number of hops minus 1; so a Size 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 SRH-6LoRH elements can be
employed.) It results that the Length in bytes of a SRH-6LoRH header is:</t>

<t>2 + Length_of_compressed_IPv6_address * (Size + 1)</t>

</section>
<section anchor="SRH-6LoRH-operation" title="SRH-6LoRH General Operation">

<section anchor="SRH-6LoRH-operation-uncomp" title="Uncompressed SRH Operation">

<t>In the non-compressed form, when the root generates or forwards a packet in
non-Storing Mode, it needs to include a Source Routing Header <xref target="RFC6554"/>
to signal a strict source-route path to a final destination down the DODAG.</t>

<t>All the hops along the path, but the first one, are encoded in order in the SRH.
The last entry in the SRH is the final destination and the destination in the
IPv6 header is the first hop along the source-route path. The intermediate hops
perform a swap and the Segment-Left field indicates the active entry in the
Routing Header <xref target="RFC2460"/>.</t>

<t>The current destination of the packet, which is the
termination of the current segment, is indicated at all times by the destination
address of the IPv6 header.</t>

</section>
<section anchor="SRH-6LoRH-operation-comp" title="6LoRH-Compressed SRH Operation">

<t>The handling of the SRH-6LoRH is different: there is no swap, and a forwarding
router that corresponds to the first entry in the first SRH-6LoRH upon reception
of a packet effectively consumes that entry when forwarding. This means that the
size of a compressed source-routed packet decreases as the packet progresses
along its path and that the routing information is lost along the way. This also
means that an SRH encoded with 6LoRH is not recoverable and cannot be protected.</t>

<t>When compressed with this specification, all the remaining hops MUST be encoded
in order in one or more consecutive SRH-6LoRH headers. Whether or not there
is a SRH-6LoRH header present, the address of the final destination is indicated
in the LoWPAN_IPHC at all times along the path. Examples of this are provided in
<xref target="examples"/>.</t>

<t>The current destination (termination of the current segment) for a compressed
source-routed packet is indicated in the first entry of the first SRH-6LoRH.
In strict source-routing, that entry MUST match an address of the router that
receives the packet.</t>

<t>The last entry in the last SRH-6LoRH is the last router on the way to the final
destination in the LLN. This router can be the final destination if it is found
desirable to carry a whole IP-in-IP encapsulation all the way. Else, it is the
RPL parent of the final destination, or a router acting at 6LR <xref target="RFC6775"/> for
the destination host, and advertising the host as an external route to RPL.</t>

<t>If the SRH-6LoRH header is contained in an IP-in-IP encapsulation, the last router
removes the whole chain of headers. Otherwise, it removes the SRH-6LoRH header
only.</t>

</section>
<section anchor="SRH-6LoRH-operation-iphc" title="Inner LOWPAN_IPHC Compression">

<t>6LoWPAN ND <xref target="RFC6282"/> is designed to support more than one IPv6 address
per node and per Interface Identifier (IID), an IID being typically derived
from a MAC address to optimize the LOWPAN-IPHC compression.</t>

<t>Link local addresses are compressed with stateless address compression (S/DAC=0).
The other addresses are derived from different prefixes and they can be compressed
with stateful address compression based on a context (S/DAC=1).</t>

<t>But stateless compression is only defined for the specific link-local prefix as
opposed to the prefix in an encapsulating header. And with stateful compression,
the compression reference is found in a context, as opposed to an encapsulating
header.</t>

<t>It results that in the case of an IP-in-IP encapsulation, it is possible to
compress an inner source (respectively destination) IP address in a LOWPAN_IPHC
based on the encapsulating IP header only if stateful (context-based) compression
is used. The compression will operate only if the IID in the source (respectively
the destination) IP address in the outer and inner headers match, which usually
means that they refer to the same node . This is encoded as S/DAC = 1 and S/AM=11.
It must be noted that the outer destination address that is used to compress the
inner destination address is the last entry in the last SRH-6LoRH header.</t>

</section>
</section>
<section anchor="SRH-design-pop" title="The Design Point of Popping Entries">

<t>In order to save energy and to optimize the chances of transmission success on
lossy media, it is a design point for this specification that the entries in the
SRH that have been used are removed from the packet. This creates a discrepancy
from the art of IPv6 where Routing Header are mutable but recoverable.</t>

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

<t>It is noted that:</t>

<t><list style='empty'>
  <t>The value of keeping the whole RH in an IPv6 header is for the receiver to
  reverse it to use the symmetrical path on the way back.</t>
</list></t>

<t><list style='empty'>
  <t>It is generally not a good idea to reverse a routing header. The RH may have
  been used to stay away from the shortest path for some reason that is only
  valid on the way in (segment routing).</t>
</list></t>

<t><list style='empty'>
  <t>There is no use of reversing a RH in the present RPL specifications.</t>
</list></t>

<t><list style='empty'>
  <t>P2P RPL reverses a path that was learned reactively, as a part of the protocol
  operation, which is probably a cleaner way than a reversed echo on the data
  path.</t>
</list></t>

<t><list style='empty'>
  <t>Reversing a header is discouraged by <xref target="RFC2460"/> for RH0 unless it is
  authenticated, which requires an Authentication Header (AH). There is no
  definition of an AH operation for SRH, and there is no indication that the
  need exists in LLNs.</t>
</list></t>

<t><list style='empty'>
  <t>It is noted that AH does not protect the RH on the way. AH is a validation at
  the receiver with the sole value of enabling the receiver to reversing it.</t>
</list></t>

<t><list style='empty'>
  <t>A RPL domain is usually protected by L2 security and that secures both RPL
  itself and the RH in the packets, at every hop. This is a better security than
  that provided by AH.</t>
</list></t>

<t>In summary, the benefit of saving energy and lowering the chances of loss by
sending smaller frames over the LLN are seen as overwhelming compared to the
value of possibly reversing the header.</t>

</section>
<section anchor="sig-comp-ref" title="Compression Reference for SRH-6LoRH header entries">

<t>In order to optimize the compression of IP addresses present in the SRH headers,
this specification requires that the 6LoWPAN layer identifies an address that is
used as reference for the compression.</t>

<t>With this specification, the Compression Reference for the first address found
in an SRH header is the source of the IPv6 packet, and then the reference for
each subsequent entry is the address of its predecessor once it is uncompressed.</t>

<t>With RPL <xref target="RFC6550"/>, an SRH header may only be present in Non-Storing mode, and 
it may only be placed in the packet by the root of the DODAG, which must be the
source of the resulting IPv6 packet <xref target="RFC2460"/>. In this case, the address used
as Compression Reference is that the address of the root, and it can be implicit
when the address of the root is.</t>

<t>The Compression Reference MUST be determined as follows:</t>

<t>The reference address may be obtained by configuration. The configuration may
indicate either the address in full, or the identifier of a 6LoWPAN Context that
carries the address <xref target="RFC6775"/>, for instance one of the 16 Context Identifiers
used in LOWPAN-IPHC <xref target="RFC6282"/>.</t>

<t>Else, and if there is no IP-in-IP encapsulation, the source address in the IPv6
header that is compressed with LOWPAN-IPHC is the reference for the compression.</t>

<t>Else, and if the IP-in-IP compression specified in this document is used and the
Encapsulator Address is provided, then the Encapsulator Address is the reference.</t>

</section>
<section anchor="SRH-6LoRH-popping" title="Popping Headers">

<t>Upon reception, the router checks whether the address in the first entry of the
first SRH-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
stack is effectively the sequence of entries in consecutive SRH-6LoRH headers.</t>

<t>Popping an entry of an SRH-6LoRH header is a recursive action performed as
follows:</t>

<t>If the Size of the SRH-6LoRH header is 1 or more, indicating that there
are at least 2 entries in the header, the router removes the first entry and
decrements the Size (by 1).</t>

<t>Else (meaning that this is the last entry in the SRH-6LoRH header), and
if there is no next SRH-6LoRH header after this then the SRH-6LoRH is removed.</t>

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

<t>Else, the first entry of the next SRH-6LoRH is popped from the next SRH-6LoRH 
and coalesced with the first entry of this SRH-6LoRH.</t>

<t>At the end of the process, if there is no more SRH-6LoRH in the packet, then
the processing node is the last router along the source route path.</t>

</section>
<section anchor="SRH-6LoRH-forwarding" title="Forwarding">

<t>When receiving a packet with a SRH-6LoRH, a router determines the IPv6 address
of the current segment endpoint.</t>

<t>If strict source routing is enforced and this router is not the segment endpoint
for the packet then this router MUST drop the packet.</t>

<t>If this router is the current segment endpoint, then the router pops its address
as described in <xref target="SRH-6LoRH-popping"/> and continues processing the packet.</t>

<t>If there is still a SRH-6LoRH, then the router determines the new segment
endpoint and routes the packet towards that endpoint.</t>

<t>Otherwise the router uses the destination in the inner IP header to forward or
accept the packet.</t>

<t>The segment endpoint of a packet MUST be determined as follows:</t>

<t>The router first determines the Compression Reference as discussed in
<xref target="SRH-6LoRH-coalescence"/>.</t>

<t>The router then coalesces the Compression Reference with the first entry of the
first SRH-6LoRH header as discussed in <xref target="sig-comp-ref"/>. If the type of the
SRH-6LoRH header is type 4 then the coalescence is a full override.</t>

<t>Since the Compression Reference is an uncompressed address, the coalesced IPv6
address is also expressed in the full 128bits.</t>

<t>An example of this operation is provided in <xref target="examplesSRHfwd"/>.</t>

</section>
</section>
<section anchor="rpl6LoRHenc" title="The RPL Packet Information 6LoRH">

<t><xref target="RFC6550"/>, Section 11.2, specifies the RPL Packet Information (RPI) as
a set of fields that are placed by RPL routers in IP packets to identify the
RPL Instance, detect anomalies and trigger corrective actions.</t>

<t>In particular, the SenderRank, which is the scalar
metric computed by a specialized Objective Function such as <xref target="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.</t>

<t>RPL defines the <xref target="RFC6553">RPL Option for Carrying RPL Information in Data-Plane Datagrams</xref>
to transport the RPI, which is carried in an
<xref target="RFC2460">IPv6 Hop-by-Hop Options Header</xref>,
typically consuming eight bytes per packet.</t>

<t>With <xref target="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.</t>

<t>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 <xref target="RFC4944"/> fragmentation, which in turn
leads to even more energy expenditure and issues discussed in
<xref target="I-D.thubert-6lo-forwarding-fragments">LLN Fragment Forwarding and Recovery</xref>.</t>

<t>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.</t>

<t>For that reason, this specification defines an IP-in-IP-6LoRH header
in <xref target="IP-in-IPencoding"/>, 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.</t>

<t>Note: A typical packet in RPL non-storing mode going down the RPL
graph requires an IP-in-IP encapsulation of the SRH, whereas the RPI
is usually (and quite illegally) omitted. With this specification,
the RPI is important to indicate the RPLInstanceID so the RPI should
not be omitted. To impact of placing an IP-in-IP encapsulation and an 
RPI in the packet, an optimized IP-in-IP 6LoRH header is defined in
<xref target="IP-in-IPencoding"/>.</t>

<t>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.</t>

<t>As with <xref target="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.</t>

<t>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.</t>

<section anchor="ints6LoRH" title="Compressing the RPLInstanceID">

<t>RPL Instances are discussed in <xref target="RFC6550"/>, Section 5.
A number of simple use cases do not require more than one RPL Instance, and in
such cases, the RPL Instance is expected to be the Global Instance 0.
A global RPLInstanceID is encoded in a RPLInstanceID field as follows:</t>

<figure title="RPLInstanceID Field Format for Global Instances." anchor="rplgid"><artwork><![CDATA[
    0 1 2 3 4 5 6 7
   +-+-+-+-+-+-+-+-+
   |0|     ID      |  Global RPLInstanceID in 0..127
   +-+-+-+-+-+-+-+-+
]]></artwork></figure>

<t>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.</t>

</section>
<section anchor="rank6LoRH" title="Compressing the SenderRank">

<t>The SenderRank is the result of the DAGRank operation on the rank of the
sender; here the DAGRank operation is defined in <xref target="RFC6550"/>, Section 3.5.1, as:</t>

<t><list style='empty'>
  <t>DAGRank(rank) = floor(rank/MinHopRankIncrease)</t>
</list></t>

<t>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 <xref target="RFC6550"/> by defining
DEFAULT_MIN_HOP_RANK_INCREASE as 256 and in <xref target="RFC6552"/> that defaults
MinHopRankIncrease to DEFAULT_MIN_HOP_RANK_INCREASE.</t>

<t>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.</t>

</section>
<section anchor="rpi-6LoRH-encoding" title="The Overall RPI-6LoRH encoding">

<t>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.</t>

<t>If a non-RPL router receives a packet with a RPI-6LoRH header, 
there was a routing or a configuration error (see <xref target="management-considerations"/>).</t>

<t>The desired reaction for the non-RPL router is to drop the packet as opposed to
skip the header and forward the packet, which could end up forming loops by 
reinjecting the packet in the wrong RPL Instance.</t>

<t>The Dispatch Value Bit Pattern for the SRH-6LoRH header indicates Critical.
Routers that understand the 6LoRH general format detailed in <xref target="rhf"/> cannot
ignore a 6LoRH header of this type, and will drop the packet if it is unknown to them.</t>

<t>Since the RPI-6LoRH header is a critical header, 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.</t>

<t>The Type for the RPI-6LoRH is 5.</t>

<t>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.</t>

<figure title="The Generic RPI-6LoRH Format." anchor="rpl6LoRH"><artwork><![CDATA[
    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  |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+  ...  -+-+-+
]]></artwork></figure>

<t><list style="hanging" hangIndent="6">
  <t hangText='O, R, and F bits:'>
  The O, R, and F bits are defined in <xref target="RFC6550"/>, section 11.2.</t>
  <t hangText='I flag:'>
  If it is set, the RPLInstanceID 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 <xref target="RFC6550"/>, section 5.1.</t>
  <t hangText='K flag:'>
  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.</t>
</list></t>

<t>In <xref target="rpl6LoRH1"/>, 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:</t>

<figure title="The most compressed RPI-6LoRH." anchor="rpl6LoRH1"><artwork><![CDATA[
    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
]]></artwork></figure>

<t>In <xref target="rpl6LoRH2"/>, the RPLInstanceID is the Global RPLInstanceID 0, but
both bytes of the SenderRank are significant so it can not be compressed:</t>

<figure title="Eliding the RPLInstanceID." anchor="rpl6LoRH2"><artwork><![CDATA[
    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
]]></artwork></figure>

<t>In <xref target="rpl6LoRH4"/>, the RPLInstanceID is not the Global RPLInstanceID
0, and the MinHopRankIncrease is a multiple of 256:</t>

<figure title="Compressing SenderRank." anchor="rpl6LoRH4"><artwork><![CDATA[
    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
]]></artwork></figure>

<t>In <xref target="rpl6LoSRH"/>, the RPLInstanceID is not the Global RPLInstanceID
0, and both bytes of the SenderRank are significant:</t>

<figure title="Least compressed form of RPI-6LoRH." anchor="rpl6LoSRH"><artwork><![CDATA[
    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
]]></artwork></figure>

</section>
</section>
<section anchor="IP-in-IPencoding" title="The IP-in-IP 6LoRH Header">

<t>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.</t>

<t>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.</t>

<t>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.</t>

<t>The Dispatch Value Bit Pattern for the SRH-6LoRH header indicates Elective.
This field is not critical for routing since it does not indicate the destination
of the packet, which is either encoded in a SRH-6LoRH header or in the inner IP header.
A 6LoRH header of this type can be skipped if not understood (per <xref target="rhf"/>),
and the 6LoRH header indicates the Length in bytes.</t>

<figure title="The IP-in-IP-6LoRH." anchor="IP-in-IPLoRH"><artwork><![CDATA[
  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  |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-       ...      -+

]]></artwork></figure>

<t>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 <xref target="RFC2460"/>.</t>

<t>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.</t>

<t>The most efficient compression of an IP-in-IP encapsulation that can be
achieved with this specification is obtained when an endpoint of the packet is
the root of the RPL DODAG associated to the RPL Instance that is used to
forward the packet, and the root address is known implicitly as opposed to
signaled explicitly in the data packets.</t>

<t>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 Length 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 <xref target="find-root"/>.</t>

<t>With RPL, the destination address in the IP-in-IP header is implicitly the
root in the RPL graph for packets going upwards, and, in storing mode,
it is the destination address in the IPHC for packets going downwards.
In non-storing mode, there is no implicit value for packets going downwards.</t>

<t>If the implicit value is correct, the destination IP address of the IP-in-IP
encapsulation can be elided. Else, the destination IP address of the IP-in-IP 
header is transported in a SRH-6LoRH header as the first entry of the first of
these headers.</t>

<t>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.</t>

<t>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.</t>

<!--


# The BIER 6LoRH {#BIER-6LoRH-encoding}

(Note that the current contents of this section is a proof of concept
only; the details for this encoding need to be developed in parallel
with defining the semantics of a constrained version of BIER.)

The Bit Index Explicit Replication (BIER) 6LoRH (BIER-6LoRH)
is an Elective 6LoWPAN Routing Header that provides
a variable-size container for a BIER Bitmap.
BIER can be used to route downwards a RPL graph towards
one or more LLN node, as discussed in the
[BIER Architecture](#I-D.wijnands-bier-architecture) specification. 
The
capability to parse the BIER Bitmap is necessary to forward the packet
so the Type cannot be ignored.

~~~~

    0                   1
    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ... -+-+-+-    ...      -+
   |1|0|0|  Size   |6LoRHType 15-19| Control Fields |    bitmap     |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ... -+-+-+-    ...      -+

~~~~
{: #BIERLoRH title='The BIER-6LoRH'}

The Type for a BIER-6LoRH indicates the size of words used to build the bitmap
and whether the bitmap is operated as an uncompressed bit-by-bit mapping,
or as a Bloom filter.

In the bit-by-bit case, each bit is mapped in an unequivocal fashion with a
single addressable resource in the network. This may rapidly lead to large
bitmaps, and BIER allows to divide a network into groups that partition the
network so that a given bitmap is locally significant to one group only.
This specification allows to encode a 1-byte Group ID in the BIER-6LoRH
Control Fields.

A Bloom Filter can be seen as a compression technique for the bitmap.
A Bloom Filter may generate false positives, which, in the case of BIER, result
in undue forwarding of a packet down a path where no listener exists.

As an example, the [Constrained-Cast](#I-D.bergmann-bier-ccast) specification
employs Bloom Filters as a compact representation of a match or non-match for
elements in a large set.

In the case of a Bloom Filter, a number of Hash functions must be run to obtain
a multi-bit signature of an encoded element. This specification allows to signal
an Identifier of the Hash functions being used to generate a certain bitmap, so
as to enable a migration scenario where Hash functions are renewed. A Hash ID is
signaled as a 1-byte value, and, depending on the Type, there may be up to 2 or
up to 8 Hash IDs passed  in the BIER-6LoRH Control Fields associated with a
Bloom Filter bitmap, as follows:

~~~~

  +____________+______________+__________________+____________+
  |   Type     |   encoding   |  Control Fields  | Word Size  |
  +____________+______________+__________________+____________+
  |    15      | bit-by-bit   |      none        |  32 bits   |
  |    16      | Bloom filter | 2* 1-byte HashID |  32 bits   |
  |    17      | bit-by-bit   |      none        |  128 bits  |
  |    18      | Bloom filter | 8* 1-byte HashID |  128 bits  |
  |    19      | bit-by-bit   |  1-byte GroupID  |  128 bits  |
  +____________+______________+__________________+____________+

~~~~
{: #BIERLoRHtype title='The BIER-6LoRH Types'}

In order to address a potentially large number of devices, the bitmap may
grow very large. Yet, the maximum frame size for a given MAC layer may limit
the number of bits that can be dedicated to routing. The Size indicates the
number of words in the bitmap minus one, so a size of 0 means one word,
a Size of 1 means 64 2 words, up to a size of 31 which means 32 words.

-->

</section>
<section anchor="management-considerations" title="Management Considerations">

<t>Though it is possible to decompress a packet at any hop, this specification is optimized to
enable that a packet is forwarded in its compressed form all the way, and it makes sense
to deploy homogeneous networks, where all nodes, or no node at all, use the compression
technique detailed therein.</t>

<t>This specification does not provide a method to discover the capability by a next-hop
device to support the compression technique, or the incremental addition of 6LoWPAN 
Routing Header as new specifications are published, 
considering that such extraneous code would overburden many constrained devices.
This specification does not require extraneous code to exchange and handle error messages
for mismatch situations, either.</t>

<t>It is thus critical to keep the network homogeneous, or at least provide in forwarding nodes
the knowledge of the support by the next hops. This is either a deployment issue, by deploying
only devices with a same capability, or a management issue, by configuring all devices to either
use, or not use, a certain level of this compression technique and its future additions.</t>

<t>In particular, the situation where a node receives a message with a Critical
6LoWPAN Routing Header that it does not understand is an administrative error 
whereby the wrong device is placed in a network, or the device is mis-configured.</t>

<t>When a mismatch situation is detected, it is expected that the device raises some management
alert, indicating the issue, e.g. that it has to drop a packet with a Critical 6LoRH.</t>

</section>
<section anchor="security-considerations" title="Security Considerations">

<t>The security considerations of <xref target="RFC4944"/>, <xref target="RFC6282"/>, and <xref target="RFC6553"/> apply.</t>

<t>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 <xref target="RFC6550"/>, <xref target="RFC6553"/> and <xref target="RFC6554"/>, noting that, even though
intermediate hops are removed from the SRH header as they are consumed, a node may still
identify that the rest of the source routed path includes a loop or not
(see Security section of <xref target="RFC6554"/>. 
It must be noted that if the attacker is not part of the loop, then there is always a node
at the beginning of the loop that can detect it and remove it.</t>

</section>
<section anchor="iana-considerations" title="IANA Considerations">

<section anchor="reserving-space-in-6lowpan-dispatch-page-1" title="Reserving Space in 6LoWPAN Dispatch Page 1">

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

<t><list style='empty'>
  <t>101xxxxx: for Elective 6LoWPAN Routing Headers</t>
</list></t>

<t><list style='empty'>
  <t>100xxxxx: for Critical 6LoWPAN Routing Headers.</t>
</list></t>

<t>Additionally this document creates two IANA registries, one for the Critical 6LoWPAN
Routing Header Type and one for the Elective 6LoWPAN Routing Header Type, 
each with 32 possible values from 0 to 31, as described below.</t>

<t>Future assignments in these registries are to be coordinated via IANA
under the policy of “RFC Required” <xref target="RFC5226"/> to enable any type of RFC
to obtain a value in the registry.</t>

</section>
<section anchor="new-critical-6lowpan-routing-header-type-registry" title="New Critical 6LoWPAN Routing Header Type Registry">

<t>This document creates an IANA registry for the Critical 6LoWPAN Routing Header Type,
and assigns the following values:</t>

<t><list style='empty'>
  <t>0..4: SRH-6LoRH [RFCthis]</t>
</list></t>

<t><list style='empty'>
  <t>5: RPI-6LoRH [RFCthis]</t>
</list></t>

<t>&lt;–
under the policy of “IETF Review” <xref target="RFC5226"/> to ensure adequate community review.
–&gt;
##  New Elective 6LoWPAN Routing Header Type Registry</t>

<t>This document creates an IANA registry for the Elective 6LoWPAN Routing Header Type,
and assigns the following value:</t>

<t><list style='empty'>
  <t>6: IP-in-IP-6LoRH [RFCthis]</t>
</list></t>

<!--
> 15..19 : BIER-6LoRH[RFCthis]
-->

<t>&lt;–
under the policy of “IETF Review” <xref target="RFC5226"/> to ensure adequate community review.
–&gt;</t>

</section>
</section>
<section anchor="acknowledgments" title="Acknowledgments">

<t>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, 
Brian Haberman, Internet Area A-D, and Alvaro Retana and Adrian Farrel, Routing Area A-Ds,
for driving this complex effort across Working Groups and Areas.</t>

</section>


  </middle>

  <back>

    <references title='Normative References'>





<reference  anchor='RFC2119' target='http://www.rfc-editor.org/info/rfc2119'>
<front>
<title>Key words for use in RFCs to Indicate Requirement Levels</title>
<author initials='S.' surname='Bradner' fullname='S. Bradner'><organization /></author>
<date year='1997' month='March' />
<abstract><t>In many standards track documents several words are used to signify the requirements in the specification.  These words are often capitalized. This document defines these words as they should be interpreted in IETF documents.  This document specifies an Internet Best Current Practices for the Internet Community, and requests discussion and suggestions for improvements.</t></abstract>
</front>
<seriesInfo name='BCP' value='14'/>
<seriesInfo name='RFC' value='2119'/>
<seriesInfo name='DOI' value='10.17487/RFC2119'/>
</reference>



<reference  anchor='RFC2460' target='http://www.rfc-editor.org/info/rfc2460'>
<front>
<title>Internet Protocol, Version 6 (IPv6) Specification</title>
<author initials='S.' surname='Deering' fullname='S. Deering'><organization /></author>
<author initials='R.' surname='Hinden' fullname='R. Hinden'><organization /></author>
<date year='1998' month='December' />
<abstract><t>This document specifies version 6 of the Internet Protocol (IPv6), also sometimes referred to as IP Next Generation or IPng.  [STANDARDS-TRACK]</t></abstract>
</front>
<seriesInfo name='RFC' value='2460'/>
<seriesInfo name='DOI' value='10.17487/RFC2460'/>
</reference>



<reference  anchor='RFC4944' target='http://www.rfc-editor.org/info/rfc4944'>
<front>
<title>Transmission of IPv6 Packets over IEEE 802.15.4 Networks</title>
<author initials='G.' surname='Montenegro' fullname='G. Montenegro'><organization /></author>
<author initials='N.' surname='Kushalnagar' fullname='N. Kushalnagar'><organization /></author>
<author initials='J.' surname='Hui' fullname='J. Hui'><organization /></author>
<author initials='D.' surname='Culler' fullname='D. Culler'><organization /></author>
<date year='2007' month='September' />
<abstract><t>This document describes the frame format for transmission of IPv6 packets and the method of forming IPv6 link-local addresses and statelessly autoconfigured addresses on IEEE 802.15.4 networks. Additional specifications include a simple header compression scheme using shared context and provisions for packet delivery in IEEE 802.15.4 meshes.  [STANDARDS-TRACK]</t></abstract>
</front>
<seriesInfo name='RFC' value='4944'/>
<seriesInfo name='DOI' value='10.17487/RFC4944'/>
</reference>



<reference  anchor='RFC6282' target='http://www.rfc-editor.org/info/rfc6282'>
<front>
<title>Compression Format for IPv6 Datagrams over IEEE 802.15.4-Based Networks</title>
<author initials='J.' surname='Hui' fullname='J. Hui' role='editor'><organization /></author>
<author initials='P.' surname='Thubert' fullname='P. Thubert'><organization /></author>
<date year='2011' month='September' />
<abstract><t>This document updates RFC 4944, &quot;Transmission of IPv6 Packets over IEEE 802.15.4 Networks&quot;.  This document specifies an IPv6 header compression format for IPv6 packet delivery in Low Power Wireless Personal Area Networks (6LoWPANs).  The compression format relies on shared context to allow compression of arbitrary prefixes.  How the information is maintained in that shared context is out of scope. This document specifies compression of multicast addresses and a framework for compressing next headers.  UDP header compression is specified within this framework.  [STANDARDS-TRACK]</t></abstract>
</front>
<seriesInfo name='RFC' value='6282'/>
<seriesInfo name='DOI' value='10.17487/RFC6282'/>
</reference>



<reference  anchor='RFC6550' target='http://www.rfc-editor.org/info/rfc6550'>
<front>
<title>RPL: IPv6 Routing Protocol for Low-Power and Lossy Networks</title>
<author initials='T.' surname='Winter' fullname='T. Winter' role='editor'><organization /></author>
<author initials='P.' surname='Thubert' fullname='P. Thubert' role='editor'><organization /></author>
<author initials='A.' surname='Brandt' fullname='A. Brandt'><organization /></author>
<author initials='J.' surname='Hui' fullname='J. Hui'><organization /></author>
<author initials='R.' surname='Kelsey' fullname='R. Kelsey'><organization /></author>
<author initials='P.' surname='Levis' fullname='P. Levis'><organization /></author>
<author initials='K.' surname='Pister' fullname='K. Pister'><organization /></author>
<author initials='R.' surname='Struik' fullname='R. Struik'><organization /></author>
<author initials='JP.' surname='Vasseur' fullname='JP. Vasseur'><organization /></author>
<author initials='R.' surname='Alexander' fullname='R. Alexander'><organization /></author>
<date year='2012' month='March' />
<abstract><t>Low-Power and Lossy Networks (LLNs) are a class of network in which both the routers and their interconnect are constrained.  LLN routers typically operate with constraints on processing power, memory, and energy (battery power).  Their interconnects are characterized by high loss rates, low data rates, and instability.  LLNs are comprised of anything from a few dozen to thousands of routers.  Supported traffic flows include point-to-point (between devices inside the LLN), point-to-multipoint (from a central control point to a subset of devices inside the LLN), and multipoint-to-point (from devices inside the LLN towards a central control point).  This document specifies the IPv6 Routing Protocol for Low-Power and Lossy Networks (RPL), which provides a mechanism whereby multipoint-to-point traffic from devices inside the LLN towards a central control point as well as point-to-multipoint traffic from the central control point to the devices inside the LLN are supported.  Support for point-to-point traffic is also available.  [STANDARDS-TRACK]</t></abstract>
</front>
<seriesInfo name='RFC' value='6550'/>
<seriesInfo name='DOI' value='10.17487/RFC6550'/>
</reference>



<reference  anchor='RFC6552' target='http://www.rfc-editor.org/info/rfc6552'>
<front>
<title>Objective Function Zero for the Routing Protocol for Low-Power and Lossy Networks (RPL)</title>
<author initials='P.' surname='Thubert' fullname='P. Thubert' role='editor'><organization /></author>
<date year='2012' month='March' />
<abstract><t>The Routing Protocol for Low-Power and Lossy Networks (RPL) specification defines a generic Distance Vector protocol that is adapted to a variety of network types by the application of specific Objective Functions (OFs).  An OF states the outcome of the process used by a RPL node to select and optimize routes within a RPL Instance based on the Information Objects available; an OF is not an algorithm.</t><t>This document specifies a basic Objective Function that relies only on the objects that are defined in the RPL and does not use any protocol extensions.  [STANDARDS-TRACK]</t></abstract>
</front>
<seriesInfo name='RFC' value='6552'/>
<seriesInfo name='DOI' value='10.17487/RFC6552'/>
</reference>



<reference  anchor='RFC6553' target='http://www.rfc-editor.org/info/rfc6553'>
<front>
<title>The Routing Protocol for Low-Power and Lossy Networks (RPL) Option for Carrying RPL Information in Data-Plane Datagrams</title>
<author initials='J.' surname='Hui' fullname='J. Hui'><organization /></author>
<author initials='JP.' surname='Vasseur' fullname='JP. Vasseur'><organization /></author>
<date year='2012' month='March' />
<abstract><t>The Routing Protocol for Low-Power and Lossy Networks (RPL) includes routing information in data-plane datagrams to quickly identify inconsistencies in the routing topology.  This document describes the RPL Option for use among RPL routers to include such routing information.  [STANDARDS-TRACK]</t></abstract>
</front>
<seriesInfo name='RFC' value='6553'/>
<seriesInfo name='DOI' value='10.17487/RFC6553'/>
</reference>



<reference  anchor='RFC6554' target='http://www.rfc-editor.org/info/rfc6554'>
<front>
<title>An IPv6 Routing Header for Source Routes with the Routing Protocol for Low-Power and Lossy Networks (RPL)</title>
<author initials='J.' surname='Hui' fullname='J. Hui'><organization /></author>
<author initials='JP.' surname='Vasseur' fullname='JP. Vasseur'><organization /></author>
<author initials='D.' surname='Culler' fullname='D. Culler'><organization /></author>
<author initials='V.' surname='Manral' fullname='V. Manral'><organization /></author>
<date year='2012' month='March' />
<abstract><t>In Low-Power and Lossy Networks (LLNs), memory constraints on routers may limit them to maintaining, at most, a few routes.  In some configurations, it is necessary to use these memory-constrained routers to deliver datagrams to nodes within the LLN.  The Routing Protocol for Low-Power and Lossy Networks (RPL) can be used in some deployments to store most, if not all, routes on one (e.g., the Directed Acyclic Graph (DAG) root) or a few routers and forward the IPv6 datagram using a source routing technique to avoid large routing tables on memory-constrained routers.  This document specifies a new IPv6 Routing header type for delivering datagrams within a RPL routing domain.  [STANDARDS-TRACK]</t></abstract>
</front>
<seriesInfo name='RFC' value='6554'/>
<seriesInfo name='DOI' value='10.17487/RFC6554'/>
</reference>



<reference  anchor='RFC5226' target='http://www.rfc-editor.org/info/rfc5226'>
<front>
<title>Guidelines for Writing an IANA Considerations Section in RFCs</title>
<author initials='T.' surname='Narten' fullname='T. Narten'><organization /></author>
<author initials='H.' surname='Alvestrand' fullname='H. Alvestrand'><organization /></author>
<date year='2008' month='May' />
<abstract><t>Many protocols make use of identifiers consisting of constants and other well-known values.  Even after a protocol has been defined and deployment has begun, new values may need to be assigned (e.g., for a new option type in DHCP, or a new encryption or authentication transform for IPsec).  To ensure that such quantities have consistent values and interpretations across all implementations, their assignment must be administered by a central authority.  For IETF protocols, that role is provided by the Internet Assigned Numbers Authority (IANA).</t><t>In order for IANA to manage a given namespace prudently, it needs guidelines describing the conditions under which new values can be assigned or when modifications to existing values can be made.  If IANA is expected to play a role in the management of a namespace, IANA must be given clear and concise instructions describing that role.  This document discusses issues that should be considered in formulating a policy for assigning values to a namespace and provides guidelines for authors on the specific text that must be included in documents that place demands on IANA.</t><t>This document obsoletes RFC 2434.  This document specifies an Internet Best  Current Practices for the Internet Community, and requests discussion and  suggestions for improvements.</t></abstract>
</front>
<seriesInfo name='BCP' value='26'/>
<seriesInfo name='RFC' value='5226'/>
<seriesInfo name='DOI' value='10.17487/RFC5226'/>
</reference>



<reference anchor='I-D.ietf-6lo-paging-dispatch'>
<front>
<title>6LoWPAN Paging Dispatch</title>

<author initials='P' surname='Thubert' fullname='Pascal Thubert'>
    <organization />
</author>

<author initials='R' surname='Cragie' fullname='Robert Cragie'>
    <organization />
</author>

<date month='September' day='9' year='2016' />

<abstract><t>This specification updates RFC 4944 to introduce a new context switch mechanism for 6LoWPAN compression, expressed in terms of Pages and signaled by a new Paging Dispatch.</t></abstract>

</front>

<seriesInfo name='Internet-Draft' value='draft-ietf-6lo-paging-dispatch-04' />
<format type='TXT'
        target='http://www.ietf.org/internet-drafts/draft-ietf-6lo-paging-dispatch-04.txt' />
</reference>


<reference anchor="IEEE802154" >
  <front>
    <title>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</title>
    <author >
      <organization>IEEE standard for Information Technology</organization>
    </author>
    <date year="2015"/>
  </front>
</reference>


    </references>

    <references title='Informative References'>





<reference  anchor='RFC7102' target='http://www.rfc-editor.org/info/rfc7102'>
<front>
<title>Terms Used in Routing for Low-Power and Lossy Networks</title>
<author initials='JP.' surname='Vasseur' fullname='JP. Vasseur'><organization /></author>
<date year='2014' month='January' />
<abstract><t>This document provides a glossary of terminology used in routing requirements and solutions for networks referred to as Low-Power and Lossy Networks (LLNs).  An LLN is typically composed of many embedded devices with limited power, memory, and processing resources interconnected by a variety of links.  There is a wide scope of application areas for LLNs, including industrial monitoring, building automation (e.g., heating, ventilation, air conditioning, lighting, access control, fire), connected home, health care, environmental monitoring, urban sensor networks, energy management, assets tracking, and refrigeration.</t></abstract>
</front>
<seriesInfo name='RFC' value='7102'/>
<seriesInfo name='DOI' value='10.17487/RFC7102'/>
</reference>



<reference  anchor='RFC7228' target='http://www.rfc-editor.org/info/rfc7228'>
<front>
<title>Terminology for Constrained-Node Networks</title>
<author initials='C.' surname='Bormann' fullname='C. Bormann'><organization /></author>
<author initials='M.' surname='Ersue' fullname='M. Ersue'><organization /></author>
<author initials='A.' surname='Keranen' fullname='A. Keranen'><organization /></author>
<date year='2014' month='May' />
<abstract><t>The Internet Protocol Suite is increasingly used on small devices with severe constraints on power, memory, and processing resources, creating constrained-node networks.  This document provides a number of basic terms that have been useful in the standardization work for constrained-node networks.</t></abstract>
</front>
<seriesInfo name='RFC' value='7228'/>
<seriesInfo name='DOI' value='10.17487/RFC7228'/>
</reference>



<reference  anchor='RFC6775' target='http://www.rfc-editor.org/info/rfc6775'>
<front>
<title>Neighbor Discovery Optimization for IPv6 over Low-Power Wireless Personal Area Networks (6LoWPANs)</title>
<author initials='Z.' surname='Shelby' fullname='Z. Shelby' role='editor'><organization /></author>
<author initials='S.' surname='Chakrabarti' fullname='S. Chakrabarti'><organization /></author>
<author initials='E.' surname='Nordmark' fullname='E. Nordmark'><organization /></author>
<author initials='C.' surname='Bormann' fullname='C. Bormann'><organization /></author>
<date year='2012' month='November' />
<abstract><t>The IETF work in IPv6 over Low-power Wireless Personal Area Network (6LoWPAN) defines 6LoWPANs such as IEEE 802.15.4.  This and other similar link technologies have limited or no usage of multicast signaling due to energy conservation.  In addition, the wireless network may not strictly follow the traditional concept of IP subnets and IP links.  IPv6 Neighbor Discovery was not designed for non- transitive wireless links, as its reliance on the traditional IPv6 link concept and its heavy use of multicast make it inefficient and sometimes impractical in a low-power and lossy network.  This document describes simple optimizations to IPv6 Neighbor Discovery, its addressing mechanisms, and duplicate address detection for Low- power Wireless Personal Area Networks and similar networks.  The document thus updates RFC 4944 to specify the use of the optimizations defined here.  [STANDARDS-TRACK]</t></abstract>
</front>
<seriesInfo name='RFC' value='6775'/>
<seriesInfo name='DOI' value='10.17487/RFC6775'/>
</reference>



<reference  anchor='RFC7554' target='http://www.rfc-editor.org/info/rfc7554'>
<front>
<title>Using IEEE 802.15.4e Time-Slotted Channel Hopping (TSCH) in the Internet of Things (IoT): Problem Statement</title>
<author initials='T.' surname='Watteyne' fullname='T. Watteyne' role='editor'><organization /></author>
<author initials='M.' surname='Palattella' fullname='M. Palattella'><organization /></author>
<author initials='L.' surname='Grieco' fullname='L. Grieco'><organization /></author>
<date year='2015' month='May' />
<abstract><t>This document describes the environment, problem statement, and goals for using the Time-Slotted Channel Hopping (TSCH) Medium Access Control (MAC) protocol of IEEE 802.14.4e in the context of Low-Power and Lossy Networks (LLNs).  The set of goals enumerated in this document form an initial set only.</t></abstract>
</front>
<seriesInfo name='RFC' value='7554'/>
<seriesInfo name='DOI' value='10.17487/RFC7554'/>
</reference>



<reference anchor='I-D.thubert-6lo-forwarding-fragments'>
<front>
<title>LLN Fragment Forwarding and Recovery</title>

<author initials='P' surname='Thubert' fullname='Pascal Thubert'>
    <organization />
</author>

<author initials='J' surname='Hui' fullname='Jonathan Hui'>
    <organization />
</author>

<date month='November' day='25' year='2014' />

<abstract><t>In order to be routed, a fragmented packet must be reassembled at every hop of a multihop link where lower layer fragmentation occurs. Considering that the IPv6 minimum MTU is 1280 bytes and that an an 802.15.4 frame can have a payload limited to 74 bytes in the worst case, a packet might end up fragmented into as many as 18 fragments at the 6LoWPAN shim layer.  If a single one of those fragments is lost in transmission, all fragments must be resent, further contributing to the congestion that might have caused the initial packet loss.  This draft introduces a simple protocol to forward and recover individual fragments that might be lost over multiple hops between 6LoWPAN endpoints.</t></abstract>

</front>

<seriesInfo name='Internet-Draft' value='draft-thubert-6lo-forwarding-fragments-02' />
<format type='TXT'
        target='http://www.ietf.org/internet-drafts/draft-thubert-6lo-forwarding-fragments-02.txt' />
</reference>



<reference anchor='I-D.ietf-6tisch-architecture'>
<front>
<title>An Architecture for IPv6 over the TSCH mode of IEEE 802.15.4</title>

<author initials='P' surname='Thubert' fullname='Pascal Thubert'>
    <organization />
</author>

<date month='June' day='10' year='2016' />

<abstract><t>This document describes a network architecture that provides low- latency, low-jitter and high-reliability packet delivery.  It combines a high speed powered backbone and subnetworks using IEEE 802.15.4 time-slotted channel hopping (TSCH) to meet the requirements of LowPower wireless deterministic applications.</t></abstract>

</front>

<seriesInfo name='Internet-Draft' value='draft-ietf-6tisch-architecture-10' />
<format type='TXT'
        target='http://www.ietf.org/internet-drafts/draft-ietf-6tisch-architecture-10.txt' />
</reference>



<reference anchor='I-D.ietf-roll-useofrplinfo'>
<front>
<title>When to use RFC 6553, 6554 and IPv6-in-IPv6</title>

<author initials='I' surname='Robles' fullname='Ines Robles'>
    <organization />
</author>

<author initials='M' surname='Richardson' fullname='Michael Richardson'>
    <organization />
</author>

<author initials='P' surname='Thubert' fullname='Pascal Thubert'>
    <organization />
</author>

<date month='September' day='14' year='2016' />

<abstract><t>This document looks at different data flows through LLN (Low-Power and Lossy Networks) where RPL (IPv6 Routing Protocol for Low-Power and Lossy Networks) is used to establish routing.  The document enumerates the cases where RFC 6553, RFC 6554 and IPv6-in-IPv6 encapsulation is required.  This analysis provides the basis on which to design efficient compression of these headers.</t></abstract>

</front>

<seriesInfo name='Internet-Draft' value='draft-ietf-roll-useofrplinfo-08' />
<format type='TXT'
        target='http://www.ietf.org/internet-drafts/draft-ietf-roll-useofrplinfo-08.txt' />
</reference>




    </references>


<section anchor="examples" title="Examples">

<section anchor="examplesRPI" title="Examples Compressing The RPI">

<t>The example in <xref target="XMPrpi"/> 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 <xref target="RFC4944"/>, and the fragment headers must be placed in
Page 0 before switching to Page 1:</t>

<figure title="Example Compressed Packet with RPI." anchor="XMPrpi"><artwork><![CDATA[
+-  ...  -+-  ...  -+-+ ... -+- ... +-+-+ ... -+-+-+-+-+-+-+-+-+-+... 
|Frag type|Frag hdr |11110001|  RPI-  |IP-in-IP| LOWPAN-IPHC | ...
|RFC 4944 |RFC 4944 | Page 1 | 6LoRH  | 6LoRH  |             |
+-  ...  -+-  ...  -+-+ ... -+- ... +-+-+ ... -+-+-+-+-+-+-+-+-+-+...
                                                <-  RFC 6282  ->
                                                 No RPL artifact
                                                 
+-  ...  -+-  ...  -+-+ ... -+-+ ... -+- ... +-+-+-+-+-+-+-+-+-+-+...
|Frag type|Frag hdr | 
|RFC 4944 |RFC 4944 |  Payload (cont)
+-  ...  -+-  ...  -+-+ ... -+-+ ... -+- ... +-+-+-+-+-+-+-+-+-+-+...

+-  ...  -+-  ...  -+-+ ... -+-+ ... -+- ... +-+-+-+-+-+-+-+-+-+-+...
|Frag type|Frag hdr | 
|RFC 4944 |RFC 4944 |  Payload (cont)
+-  ...  -+-  ...  -+-+ ... -+-+ ... -+- ... +-+-+-+-+-+-+-+-+-+-+...



]]></artwork></figure>

<t>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 <xref target="XMPrpi2"/> in the 
case of a non-fragmented ICMP packet:</t>

<figure title="Example ICMP Packet with RPI in Storing Mode." anchor="XMPrpi2"><artwork><![CDATA[
+- ...  -+-+- ... -+-+-+-+ ... -+-+-+-+ ... -+-+-+-+-+-+-+-+-+-+-+...
|11110001| RPI-6LoRH |  NH = 0      | NH = 58  |  ICMP message ...
|Page 1  |  type 5   | 6LOWPAN-IPHC | (ICMP)   |  (no compression) 
+- ...  -+-+- ... -+-+-+-+ ... -+-+-+-+ ... -+-+-+-+-+-+-+-+-+-+-+...
                      <-      RFC 6282       ->
                          No RPL artifact
]]></artwork></figure>

<t>The format in <xref target="XMPrpi2"/> is logically equivalent to the
non-compressed format illustrated in <xref target="XMPrpi3"/>:</t>

<figure title="Uncompressed ICMP Packet with RPI." anchor="XMPrpi3"><artwork><![CDATA[
+-+-+-+- ... -+-+-+-+ ... -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+...
|  IPv6 Header  | Hop-by-Hop |  RPI in       |  ICMP message ...
|  NH = 58      | Header     |  RPL Option   | 
+-+-+-+- ... -+-+-+-+ ... -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+...
]]></artwork></figure>

<t>For a UDP packet, the transport header can be compressed with 6LoWPAN
HC <xref target="RFC6282"/> as illustrated in <xref target="XMPrpi4"/>:</t>

<figure title="Uncompressed ICMP Packet with RPI." anchor="XMPrpi4"><artwork><![CDATA[
+- ...  -+- ... -+-+-+-+- ... +-+-+-+-+-+-+-+-+-+- ... +-+-+-+-+-+...
|11110001| RPI-6LoRH |  NH = 1      |11110|C| P | Compressed |UDP ... 
|Page 1  |  type 5   | 6LOWPAN-IPHC | UDP | |   | UDP header |Payload
+- ...  -+- ... -+-+-+-+- ... +-+-+-+-+-+-+-+-+-+- ... +-+-+-+-+-+...
                      <-              RFC 6282             ->
                                 No RPL artifact
]]></artwork></figure>

<t>If the packet is received from the Internet in Storing Mode, then the root is
supposed to encapsulate the packet to insert the RPI. The resulting format 
would be as represented in  <xref target="XMPrpi3b"/>:</t>

<figure title="RPI inserted by the root in Storing Mode." anchor="XMPrpi3b"><artwork><![CDATA[
+-+-+-+-+-+-+- ... -+-+-- ... -+-+- ... -+-+-+-+-+-+-+ ... -+-+-+-+... 
|11110001 | RPI-6LoRH | IP-in-IP | NH=1 |11110CPP| Compressed | UDP
|Page 1   |           |  6LoRH   | IPHC | UDP    | UDP header | Payload
+-+-+-+-+-+-+- ... -+-+-- ... -+-+- ... -+-+-+-+-+-+-+ ... -+-+-+-+... 
                                  <-         RFC 6282       ->
                                        No RPL artifact

]]></artwork></figure>

</section>
<section anchor="examplesRH4" title="Example Of Downward Packet In Non-Storing Mode">

<t>The example illustrated in <xref target="XMPSRH"/> is a classical packet in non-Storing mode
for a packet going down the 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 Header type 3 (SRH) and the first hop is the destination of the packet.
The intermediate hops perform a swap and the hop count indicates the current 
active hop <xref target="RFC2460"/>, <xref target="RFC6554"/>.</t>

<t>When compressed with this specification, the 4 hops are encoded in SRH-6LoRH
when the root generates the packet, and the final destination is left in the
LOWPAN-IPHC. There is no swap, and the forwarding node that corresponds to the
first entry effectively consumes it when forwarding, which means that the size
of the encoded packet decreases and that the hop information is lost.</t>

<t>If the last hop in a SRH-6LoRH is not the final destination then it removes
the SRH-6LoRH before forwarding.</t>

<t>In the particular example illustrated in <xref target="XMPSRH"/>, all addresses in the DODAG
are assigned from a same /112 prefix and the 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 address as reference. There will be
one SRH_6LoRH header, with, in this example, 3 compressed addresses:</t>

<figure title="Example Compressed Packet with SRH." anchor="XMPSRH"><artwork><![CDATA[
+-+-+-+-+-+-+- ... +-+-+- ... -+-+-- ... -+-+- ... -+-+-+-+-+ ... +-... 
|11110001 |SRH-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
]]></artwork></figure>

<t>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
RPLInstanceID in the RPI. Once found from a local context, that address is
used as Compression Reference to expand addresses in the SRH-6LoRH.</t>

<t>With the RPL specifications available at the time of writing this draft, the root
is the only node that may incorporate a SRH 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.</t>

<t>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 <xref target="XMPSRH1"/>:</t>

<figure title="compressed SRH 4*2bytes entries sourced by root." anchor="XMPSRH1"><artwork><![CDATA[
+- ...  -+-+-+ ... +-+-+-+ ... -+-+-+-+-+-+-+-++-+- ... -+-+-+-+-+...
|11110001| SRH-6LoRH | NH=1       | 11110CPP  | Compressed | UDP
|Page 1  | Type1 S=3 | LOWPAN-IPHC| LOWPAN-NHC| UDP header | Payload
+- ...  -+-+-+ ... +-+-+-+ ... -+-+-+-+-+-+-+-++-+- ... -+-+-+-+-+...
                                       <-        RFC 6282        ->
]]></artwork></figure>

<t>Note: the RPI is not represented though RPL <xref target="RFC6550"/> generally expects it.
In this particular case, since the Compression Reference for the SRH-6LoRH is the source
address in the LOWPAN-IPHC, and the routing is strict along the source route path,
the RPI does not appear to be absolutely necessary.</t>

<t>In <xref target="XMPSRH1"/>, all the nodes along the source route path share a same /112
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
SRH-6LoRH header can be used for encoding. The IPv6 address of the root is taken
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 SRH-6LoRH of 10 bytes.</t>

</section>
<section anchor="examplesSRHfwd" title="Example of SRH-6LoRH life-cycle">

<t>This section illustrates the operation specified in <xref target="SRH-6LoRH-forwarding"/>
of forwarding a packet with a compressed SRH along an A-&gt;B-&gt;C-&gt;D source route
path. The operation of popping addresses is exemplified at each hop.</t>

<figure title="Processing at Node A." anchor="SRHfwdA"><artwork><![CDATA[
Packet as received by node A
----------------------------
  Type 3 SRH-6LoRH Size = 0   AAAA AAAA AAAA AAAA
  Type 1 SRH-6LoRH Size = 0                  BBBB
  Type 2 SRH-6LoRH Size = 1             CCCC CCCC
                                        DDDD DDDD
                                      
 Step 1 popping BBBB the first entry of the next SRH-6LoRH
 Step 2 next is if larger value (2 vs. 1) the SRH-6LoRH is removed 
 
  Type 3 SRH-6LoRH Size = 0   AAAA AAAA AAAA AAAA
  Type 2 SRH-6LoRH Size = 1             CCCC CCCC
                                        DDDD DDDD   
                                      
 Step 3: recursion ended, coalescing BBBB with the first entry
  Type 3 SRH-6LoRH Size = 0   AAAA AAAA AAAA BBBB

 Step 4: routing based on next segment endpoint to B

]]></artwork></figure>

<figure title="Processing at Node B." anchor="SRHfwdB"><artwork><![CDATA[
 
Packet as received by node B
---------------------------- 
  Type 3 SRH-6LoRH Size = 0   AAAA AAAA AAAA BBBB
  Type 2 SRH-6LoRH Size = 1             CCCC CCCC
                                        DDDD DDDD   
                                      
 Step 1 popping CCCC CCCC, the first entry of the next SRH-6LoRH
 Step 2 removing the first entry and decrementing the Size (by 1)
  
  Type 3 SRH-6LoRH Size = 0   AAAA AAAA AAAA BBBB
  Type 2 SRH-6LoRH Size = 0             DDDD DDDD 

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

 Step 4: routing based on next segment endpoint to C
 
]]></artwork></figure>

<figure title="Processing at Node C." anchor="SRHfwdC"><artwork><![CDATA[
 
Packet as received by node C
----------------------------
                   
  Type 3 SRH-6LoRH Size = 0   AAAA AAAA CCCC CCCC 
  Type 2 SRH-6LoRH Size = 0             DDDD DDDD

 Step 1 popping DDDD DDDD, the first entry of the next SRH-6LoRH
 Step 2 the SRH-6LoRH is removed
  
  Type 3 SRH-6LoRH Size = 0   AAAA AAAA CCCC CCCC

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

 Step 4: routing based on next segment endpoint to D

]]></artwork></figure>

<figure title="Processing at Node D." anchor="SRHfwdD"><artwork><![CDATA[
 
 
Packet as received by node D
----------------------------
  Type 3 SRH-6LoRH Size = 0   AAAA AAAA DDDD DDDD

 Step 1 the SRH-6LoRH is removed. 
 Step 2 no more header, routing based on inner IP header.

]]></artwork></figure>

<!--  LocalWords:  LoWPAN topologies RPL IP IPv Lossy LLNs LLN MTU
 -->
<!--  LocalWords:  PHY IEEE ICMP RPI Datagrams TiSCH TSCH TLV DODAG
 -->
<!--  LocalWords:  SenderRank RPLInstanceID DAGRank inlined LoRH IPHC
 -->
<!--  LocalWords:  MinHopRankIncrease IP-in-IP Encapsulator IANA
 -->
<!--  LocalWords:  RFCthis acknowledgments
 -->

</section>
</section>


  </back>
</rfc>

