Re: [6tisch] [6lo] The "BEFORE" and "AFTER"

"Pascal Thubert (pthubert)" <pthubert@cisco.com> Thu, 21 January 2016 17:27 UTC

Return-Path: <pthubert@cisco.com>
X-Original-To: 6tisch@ietfa.amsl.com
Delivered-To: 6tisch@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 78A4C1B334F; Thu, 21 Jan 2016 09:27:16 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -14.501
X-Spam-Level:
X-Spam-Status: No, score=-14.501 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_HI=-5, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_DEF_DKIM_WL=-7.5] autolearn=ham
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2GDtFKxDblPC; Thu, 21 Jan 2016 09:27:11 -0800 (PST)
Received: from rcdn-iport-1.cisco.com (rcdn-iport-1.cisco.com [173.37.86.72]) (using TLSv1.2 with cipher DHE-RSA-SEED-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id D48A01B334E; Thu, 21 Jan 2016 09:27:10 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=97360; q=dns/txt; s=iport; t=1453397230; x=1454606830; h=from:to:subject:date:message-id:references:in-reply-to: mime-version; bh=zjwu9uPwgl0EM8+nnGAS2O7dobQIkNbbq0kW3bNH/F8=; b=Wk59ZqLfostRM9ujr6X0AX6urDqgESDH+KJeQeHYItDY6NxCe79Olnx+ q7pMbA4B7pKelGjre1lOU8MqFWKtweggi1DDBAEgw8hREPRTqA8BYhZwu 77X6nZKv8/+WESBb0oS2n+f6EsR0JZm024vbzPfc0/yhSGHM/Itzk10m2 A=;
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: A0AJAgDNE6FW/4oNJK1egm5MUm0GiFGwC4ITAQ2BYiSCFySDMAIcgSI4FAEBAQEBAQGBCoQ0AQEBAwEaCQo6FwcEAgEIEQQBASEBBgMCAgIwFAkIAgQBEgiICwgOriiPUAEBAQEBAQEBAQEBAQEBAQEBAQEBAREEhjiEdIRjF4JUgToFh1WLHYQDAYVFgnKFGIFlhESIV4ppg1IBHgEBQoF7G4FQaoYnfAEBAQ
X-IronPort-AV: E=Sophos; i="5.22,326,1449532800"; d="scan'208,217"; a="69480475"
Received: from alln-core-5.cisco.com ([173.36.13.138]) by rcdn-iport-1.cisco.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 21 Jan 2016 17:27:09 +0000
Received: from XCH-RCD-003.cisco.com (xch-rcd-003.cisco.com [173.37.102.13]) by alln-core-5.cisco.com (8.14.5/8.14.5) with ESMTP id u0LHR9X4029061 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=FAIL); Thu, 21 Jan 2016 17:27:09 GMT
Received: from xch-rcd-001.cisco.com (173.37.102.11) by XCH-RCD-003.cisco.com (173.37.102.13) with Microsoft SMTP Server (TLS) id 15.0.1104.5; Thu, 21 Jan 2016 11:27:08 -0600
Received: from xch-rcd-001.cisco.com ([173.37.102.11]) by XCH-RCD-001.cisco.com ([173.37.102.11]) with mapi id 15.00.1104.009; Thu, 21 Jan 2016 11:27:08 -0600
From: "Pascal Thubert (pthubert)" <pthubert@cisco.com>
To: Michael Richardson <mcr+ietf@sandelman.ca>, "6tisch@ietf.org" <6tisch@ietf.org>, "6lo@ietf.org" <6lo@ietf.org>
Thread-Topic: [6lo] [6tisch] The "BEFORE" and "AFTER"
Thread-Index: AQHRU1tqtnDmos6Mek2lEt0tEDasGp8EKL4QgACgQgD//7v5UIAB+rmA//+zLEA=
Date: Thu, 21 Jan 2016 17:26:41 +0000
Deferred-Delivery: Thu, 21 Jan 2016 17:26:15 +0000
Message-ID: <413af1673df94cf485a03a3529503979@XCH-RCD-001.cisco.com>
References: <CAAdgstTwS5bSuRfLwh_ntf1MNek+nMR2wDOPjkuCedvpuJ3VwA@mail.gmail.com> <f49c3ea76c394235a690a0dee54cda12@XCH-RCD-001.cisco.com> <CAAdgstTzq-d8X=Gxay3sTVXrE7eck=b3w92xsJh-ujxtVhdc7Q@mail.gmail.com> <f8d1f9064dcb4765b14d492038c1bb44@XCH-RCD-001.cisco.com> <896.1453390339@obiwan.sandelman.ca>
In-Reply-To: <896.1453390339@obiwan.sandelman.ca>
Accept-Language: fr-FR, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-ms-exchange-transport-fromentityheader: Hosted
x-originating-ip: [10.61.65.69]
Content-Type: multipart/alternative; boundary="_000_413af1673df94cf485a03a3529503979XCHRCD001ciscocom_"
MIME-Version: 1.0
Archived-At: <http://mailarchive.ietf.org/arch/msg/6tisch/RFHu7GcECH-mFiwZ-vwEw5HGdMY>
Subject: Re: [6tisch] [6lo] The "BEFORE" and "AFTER"
X-BeenThere: 6tisch@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: "Discuss link layer model for Deterministic IPv6 over the TSCH mode of IEEE 802.15.4e, and impacts on RPL and 6LoWPAN such as resource allocation" <6tisch.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/6tisch>, <mailto:6tisch-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/6tisch/>
List-Post: <mailto:6tisch@ietf.org>
List-Help: <mailto:6tisch-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/6tisch>, <mailto:6tisch-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 21 Jan 2016 17:27:16 -0000

Hello Michael:



The non RPL source leaf sends a packet IPHC source = self dest = other leaf.

The 6LR adds the RPI but the IPHC and whatever comes after it stay untouched and the packet flies to the root.

The root adds IP in IP 6LoRH, the updated RPI and the RH3 6LoRH(s) but still  the IPHC and whatever comes after it stay untouched.

Packet goes down, RPI is updated, RH3-LoRH get popped out.

The last router is the one that removes the last RH3-6LoRH and ideally all of the 6LoRH is the leaf is not a RPL node.

So the leaves would not need to know the root. But as you know the support of non RPL leaves has to be fully defined.



I maintain the txt based on our discussion here: https://bitbucket.org/6lo/rpi/src/master/draft-ietf-6lo-routing-dispatch-04.txt



It has grown considerably though the meaning is hopefully unchanged from 03 apart from taking the source (that’s the root, normally) as reference for RH3 compression by default and indicating more clearly that the RPI is useful even if there is a RH3.



Early review would be appreciated and if you think that your question above is insufficiently answered please let me know ( and provide text suggestions if possible ☺)



Thanks in advance!





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



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



   The Routing Header type 3 (RH3) 6LoRH (RH3-6LoRH) header is a

   Critical 6LoWPAN Routing Header that provides a compressed form for

   the RH3, as defined in [RFC6554] for use by RPL routers.  Routers

   that need to forward a packet with a RH3-6LoRH are expected to be RPL

   routers and are expected to support this specification.  If a non-RPL

   router receives a packet with a RH3-6LoRH, this means that there was

   a routing error and the packet should be dropped so the Type cannot

   be ignored.



      0                   1

       0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5

      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-    -+-    -+ ... +-    -+

      |1|0|0|  Size   |6LoRH Type 0..4| Hop1 | Hop2 |     | HopN |

      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-    -+-    -+ ... +-    -+



            Size indicates the number of compressed addresses



                         Figure 5: The RH3-6LoRH.



   The 6LoRH Type indicates the compression level used in a given

   RH3-6LoRH header.



   One or more 6LoRH header(s) MAY be placed in a 6LoWPAN packet.



   It results that all addresses in a given RH3-6LoRH header MUST be

   compressed in an identical fashion, down to using the identical

   number of bytes per address.  In order to get different degrees of

   compression, multiple consecutive RH3-6LoRH headers MUST be used.



   Type 0 means that the address is compressed down to one byte, whereas

   Type 4 means that the address is provided in full in the RH3-6LoRH

   with no compression.  The complete list of Types of RH3-6LoRH and the

   corresponding compression level are provided in Figure 6:



     +-----------+----------------------+

     |   6LoRH   | Length of compressed |

     |   Type    | IPv6 address (bytes) |

     +-----------+----------------------+

     |    0      |       1              |

     |    1      |       2              |

     |    2      |       4              |

     |    3      |       8              |

     |    4      |      16              |

     +-----------+----------------------+



                      Figure 6: The RH3-6LoRH Types.



   In the case of a RH3-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 RH3-6LoRH elements can be

   employed.)  It results that the Length in bytes of a RH3-6LoRH header

   is:



   2 + Length_of_compressed_IPv6_address * (Size + 1)







5.1.  RH3-6LoRH General Operation



   In the non-compressed form, when the root generates or forwards a

   packet in non-Storing Mode, it needs to include a Routing Header type

   3 (RH3) [RFC6554] to signal a strict source-route path to a final

   destination down the DODAG.  All the hops along the path, but the

   first one, are encoded in order in the RH3.  The last entry in the

   RH3 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 [RFC2460].  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.



   The handling of the RH3-6LoRH is different: there is no swap, and a

   forwarding router that corresponds to the first entry in the first

   RH3-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 RH3 encoded with 6LoRH is not recoverable and cannot be

   protected.



   When compressed with this specification, all the remaining hops MUST

   be encoded in order in one or more consecutive RH3-6LoRH headers.

   Whether or not there is a RH3-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 Appendix A.



   The current destination (termination of the current segment) for a

   compressed source-routed packet is indicated in the first entry of

   the first RH3-6LoRH.  In strict source-routing, that entry MUST match

   an address of the router that receives the packet.



   The last entry in the last RH3-6LoRH is the last router on the way to

   the final destination in the LLN.  It is typically a RPL parent of

   the final destination, but it can also be a router acting at 6LR

   [RFC6775] for the destination host.



5.2.  Compression Reference



   In order to optimize the compression of IP addresses present in the

   RH3 headers, this specification requires that the 6LoWPAN layer

   identifies an address that is used as reference for the compression.

   With this specification, the Compression Reference for addresses

   found in an RH3 header is the source of the IPv6 packet.



   With RPL [RFC6550], an RH3 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

   [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.



   The Compression Reference MUST be determined as follows:



   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 [RFC6775],

   for instance one of the 16 Context Identifiers used in LOWPAN-IPHC

   [RFC6282].



   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.



   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.



5.3.  Coalescence



   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 RH3-6LoRH header in Figure 6.



   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.



   A compressed address is expanded by coalescing it with a reference

   address.  In the particular case of a Type 4 RH3-6LoRH, the address

   is expressed in full and the coalescence is a complete override as

   illustrated in Figure 7.





   RRRRRRRRRRRRRRRRRRRR reference address, may be compressed or not



                CCCCCCC compressed address, shorter or same as reference



   RRRRRRRRRRRRRCCCCCCC Coalesced address, same compression as reference



                      Figure 7: Coalescing addresses.



5.4.  Popping Headers



   Upon reception, the router checks whether the address in the first

   entry of the first RH3-6LoRH one of its own addresses.  In that case,

   router MUST consume that entry before forwarding, which is an action

   of popping from a stack, where the stack is effectively the sequence

   of entries in consecutive RH3-6LoRH headers.



   Popping an entry of an RH3-6LoRH header is a recursive action

   performed as follows:



   If the Size of the RH3-6LoRH header is 1 or more, indicating that

   there are at least 2 entries in the header, the router removes the

   first entry and decrements the Size (by 1).



   Else (meaning that this is the last entry in the RH3-6LoRH header),

   and if there is no next RH3-6LoRH header after this then the

   RH3-6LoRH is removed.



   Else, if there is a next RH3-6LoRH of a Type with a larger or equal

   value, meaning a same or lesser compression yielding same or larger

   compressed forms, then the RH3-6LoRH is removed.



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

   RH3-6LoRH and coalesced with the first entry of this RH3-6LoRH.



   At the end of the process, if there is no more RH3-6LoRH in the

   packet, then the processing node is the last router along the source

   route path.



5.5.  Forwarding



   When receiving a packet with a RH3-6LoRH, a router determines the

   IPv6 address of the current segment endpoint.



   If strict source routing is enforced and thus router is not the

   segment endpoint for the packet then this router MUST drop the

   packet.



   If this router is the current segment endpoint, then the router pops

   its address as described in Section 5.4 and continues processing the

   packet.



   If there is still a RH3-6LoRH, then the router determines the new

   segment endpoint and routes the packet towards that endpoint.



   Otherwise the router uses the destination in the inner IP header to

   forward or accept the packet.



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



   The router first determines the Compression Reference as discussed in

   Section 5.3.



   The router then coalesces the Compression Reference with the first

   entry of the first RH3-6LoRH header as discussed in Section 5.2.  If

   the type of the RH3-6LoRH header is type 4 then the coalescence is a

   full override.



   Since the Compression Reference is an uncompressed address, the

   coalesced IPv6 address is also expressed in the full 128bits.



   Packet as received by node A

   ----------------------------

     Type 3 RH3-6LoRH Size = 0   AAAA AAAA AAAA AAAA

     Type 1 RH3-6LoRH Size = 0                  BBBB

     Type 2 RH3-6LoRH Size = 1             CCCC CCCC

                                           DDDD DDDD



    Step 1 popping BBBB the first entry of the next RH3-6LoRH

    Step 2 next is if larger value (2 vs. 1) the RH3-6LoRH is removed



     Type 3 RH3-6LoRH Size = 0   AAAA AAAA AAAA AAAA

     Type 2 RH3-6LoRH Size = 1             CCCC CCCC

                                           DDDD DDDD



    Step 3: recursion ended, coalescing BBBB with the first entry

    Step 4: routing based on next segment endpoint to B



   Packet as received by node B

   ----------------------------

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

     Type 2 RH3-6LoRH Size = 1             CCCC CCCC

                                           DDDD DDDD



    Step 1 popping CCCC CCCC, the first entry of the next RH3-6LoRH

    Step 2 removing the first entry and decrementing the Size (by 1)



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

     Type 2 RH3-6LoRH Size = 0             DDDD DDDD



    Step 3: recursion ended, coalescing CCCC CCCC with the first entry

    Step 4: routing based on next segment endpoint to C



   Packet as received by node C

   ----------------------------



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

     Type 2 RH3-6LoRH Size = 0             DDDD DDDD



    Step 1 popping DDDD DDDD, the first entry of the next RH3-6LoRH

    Step 2 the RH3-6LoRH is removed



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



    Step 3: recursion ended, coalescing DDDD DDDDD with the first entry

    Step 4: routing based on next segment endpoint to D



   Packet as received by node D

   ----------------------------

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



    Step 1 the RH3-6LoRH is removed.

    Step 2 no more header, routing based on inner IP header.





               Figure 8: Forwarding packets with RH3-6LoRH.











Cheers,



Pascal



> -----Original Message-----

> From: 6lo [mailto:6lo-bounces@ietf.org] On Behalf Of Michael Richardson

> Sent: jeudi 21 janvier 2016 16:32

> To: 6tisch@ietf.org; 6lo@ietf.org

> Subject: Re: [6lo] [6tisch] The "BEFORE" and "AFTER"

>

>

> Pascal Thubert (pthubert) <pthubert@cisco.com> wrote:

>     > OK, let us see.

>

>     > With the new text I just proposed, the source (normally that’s the root)

>     > address of the packet with a RH3 is the reference for compression. So

> Ideally

>     > we’d parse that before we parse the RH3 so we can decompress the first

>     > address in the RH3. This is a change from the original text where I

> expected

>     > the first address in the RH3 to be mostly in the full. So in 6LoRH form, IP

>     > in IP would come before the RH3.

>

> So, in the case of traffic that flows from one leaf to another leaf, would

> either end actually know the IP of the root?  I think that the RPL daemon

> would have to program them.

>

> --

> Michael Richardson <mcr+IETF@sandelman.ca>, Sandelman Software Works

> -= IPv6 IoT consulting =-

>

>