<?xml version="1.0" encoding="US-ASCII"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
<?rfc toc="yes"?>
<?rfc tocompact="yes"?>
<?rfc tocdepth="3"?>
<?rfc tocindent="yes"?>
<?rfc symrefs="yes"?>
<?rfc sortrefs="yes"?>
<?rfc comments="yes"?>
<?rfc inline="yes"?>
<?rfc compact="yes"?>
<?rfc subcompact="no"?>
<rfc category="std" docName="draft-xu-msr6-rbs-01" ipr="trust200902">
  <front>
    <title abbrev="draft-xu-msr6-rbs-00">RBS(Recursive BitString Structure)
    for Multicast Source Routing over IPv6</title>

    <author fullname="Bing Xu" initials="B." surname="Xu">
      <organization>Huawei</organization>

      <address>
        <postal>
          <street/>

          <city/>

          <region/>

          <code/>

          <country/>
        </postal>

        <phone/>

        <facsimile/>

        <email>bing.xu@huawei.com</email>

        <uri/>
      </address>
    </author>

    <author fullname="Xuesong Geng" initials="X." surname="Geng">
      <organization>Huawei</organization>

      <address>
        <postal>
          <street/>

          <city/>

          <region/>

          <code/>

          <country/>
        </postal>

        <phone/>

        <facsimile/>

        <email>gengxuesong@huawei.com</email>

        <uri/>
      </address>
    </author>

    <author fullname="Toerless Eckert" initials="T." surname="Eckert">
      <organization>Futurewei Technologies</organization>

      <address>
        <postal>
          <street/>

          <city/>

          <region/>

          <code/>

          <country/>
        </postal>

        <phone/>

        <facsimile/>

        <email>tte@cs.fau.de</email>

        <uri/>
      </address>
    </author>

    <date day="30" month="March" year="2022"/>

    <abstract>
      <t>This document defines a new type of segment: End.RBS, and the
      corresponding packet processing procedures over the IPv6 data plane for
      the MSR6(Multicast Source Routing over IPv6) TE solutions.</t>
    </abstract>

    <note title="Requirements Language">
      <t>The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
      "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
      document are to be interpreted as described in <xref
      target="RFC2119">RFC 2119</xref>.</t>
    </note>
  </front>

  <middle>
    <section title="Introduction">
      <t>MSR6(Multicast Source Routing over IPv6) is an IPv6 based multicast
      source routing (MSR6) solution, defined in <xref
      target="I-D.cheng-spring-ipv6-msr-design-consideration"/>, which
      leverages the benefits of source routing over IPv6 data plane to provide
      simplified multicast TE and BE service in an IPv6 network without
      unnecessary multicast tree status and complex control plane protocols.
      MSR6 needs to reuse the advantages of SRv6 and BIER to implement source
      routing.</t>

      <t>MSR6 has two basic modes of forwarding: one is based on Shortest Path
      First(SPF), which is called MSR6 BE mode; the other is based on traffic
      engineered, which is called MSR6 TE mode. <xref
      target="I-D.geng-msr6-traffic-engineering"/>, <xref
      target="I-D.chen-pim-srv6-p2mp-path"/> and <xref
      target="I-D.geng-msr6-rlb-segment"/> have introduced structured segment
      list by defining arguments in each segment.</t>

      <t>This document defines IPv6 based RBS <xref
      target="I-D.eckert-bier-cgm2-rbs"/> which provides an optional solution
      for MSR6 TE. A new type of segment End.RBS and the corresponding RBS
      type sub-TLV in MRH defined in <xref
      target="I-D.geng-msr6-traffic-engineering"/>, which could indicate
      multicast tree in the a recuisive bitstring and save the header
      overhead.</t>
    </section>

    <section title="Terminologies">
      <t>MSR6: Multicast Source Routing over IPv6, defined in .</t>

      <t>MRH: Multicast Routing Header, a new type of Routing Header which is
      used for MSR6 <xref
      target="I-D.cheng-spring-ipv6-msr-design-consideration"/>.</t>

      <t>Replication Endpoint: the intermediate node of a multicast tree,
      which replicates packet and forwards the packet to the downstream nodes.
      For MSR6, the Replication Node is called Replication Endpoint which can
      be indicated by the MSR6 Segment and replicate packets according to the
      multicast source routing information encapsulation in the MSR6 header of
      the packet.</t>

      <t>BFR: Bit-Forwarding Router, a router support RBS.</t>

      <t>BIFT: Bit Index Forwarding Table, locally to BFR.</t>

      <t>RU: RecursiveUnit, a Bit String is to be parsed by BFR along the
      multicast tree of the packet, defined in <xref
      target="I-D.eckert-bier-cgm2-rbs"/></t>
    </section>

    <section title="Explicit Multicast Path with RBS">
      <t>This section describes the encoding of explictit multicast path with
      RecursiveUnit BitString Structure (RBS) .</t>

      <section title="RBS Architecture">
        <t>An explicit muliticast path is encapsulated with RBS as shown in
        Figure 1.<figure>
            <artwork><![CDATA[   +----------+---------------------+---------+
   | TotalLen |     RecursiveUnit   | Padding |
   +----------+---------------------+---------+
              .                     .
              ...... TotalLen .......
      Figure 1: Architecture of RBS Address
]]></artwork>
          </figure>For the reference encoding, TotalLen is an 16-bit field
        that counts the size of the RecursiveUnit in bits, permitting for up
        to 65535 Bit long RBS addresses.</t>

        <t>The Rsv filed,which is defined in <xref
        target="I-D.eckert-bier-cgm2-rbs"/> , is omitted in this scenario.</t>

        <t>Padding is used to align the RBS address as required by the IPv6
        encapsulation.</t>
      </section>

      <section title="Recursive encoding in packet">
        <t>This section uses a hierarchical multicast tree as an example to
        describe the RecursiveUnit coding format.</t>

        <t><figure>
            <artwork><![CDATA[                                +---+
                                | R |
                                +-+-+
                                  |
                  +----------+----+-----+-----------+
                  |          |          |           |
                +-v-+      +-v-+      +-v-+      +-v-+
                | A1|      | A2|      | A3|  ... | AM|
                +-+-+      +---+      +---+      +---+
                  |
  +----------+----+-----+----------+
  |          |          |          |
+-v-+      +-v-+      +-v-+      +-v-+
| B1|      | B2|      | B3|  ... | BN|
+---+      +---+      +---+      +---+
              Figure 2: Hierarchical multicast tree
]]></artwork>
          </figure>As Shown in Figure 2, the whole explicit multicast path
        should be encapsulated (See Section 3.1) in-packet, which will be
        parsed by each Router along the delivery tree.</t>

        <t>The RecursiveUnit filed is structured as shown in Figure 3. To
        abbreviate the size of the figure, we use AF for AddressingFiled, and
        RU for RecursiveUnit In the following figures.</t>

        <t><figure>
            <artwork><![CDATA[  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  | TotalLen| BitString | AF 1 | AF 2 | ...| AF M-1 | RU 1 | RU 2 | ...| RU M | Padding |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
                                                   /         \        
                                                /                \
                                            /                        \
                                          +-+-+-+-+-+-+-+-+-+-+-+-+-+-+--+
                                          |BitString|AF 1...N-1|RU 1 ...N| 
                                          +-+-+-+-+-+-+-+-+-+-+-+-+-+-+--+        
                            Figure 3: RecursiveUnit Filed Structure]]></artwork>
          </figure>The BitString field guides the first-hop node 'R' to
        locally duplicate packets and forwarding. The length of BitString
        matches the Maxnumber of adjacencies in node 'R' (See Section
        3.3).</t>

        <t>The AddressingField consists M-1 fields. Each filed is an 8-bits
        filed and the value of it is the length of relative RecursiveUnit, and
        may be the offset in some scenario . The length of last RecursiveUnit
        M could be caculated by TotalLen.</t>

        <t>And each RecursiveUnit is structured in same mechnism as shown in
        Figurse 3.</t>
      </section>

      <section title="RBS BIFT">
        <t>RBS BIFT as shown in Figure 4 are containing for each BP an
        adjacency.</t>

        <t><figure>
            <artwork><![CDATA[   +--+---------+-------------+
   |BP|RecuFlag |    Adjacency|
   +--+---------+-------------+
   | 1|        1|adjacenct BFR|
   +--+---------+-------------+
   | 2|        0|    punt/host|
   +--+---------+-------------+
   |     .....    ...         |
   +--+---------+-------------+
   | N|      ...|         ... |
   +--+---------+-------------+

        Figure 4: RBS BIFT]]></artwork>
          </figure>The BP of the BIFT are all local to the BFR. When a BFR
        receives a packet encapuslated with RBS, it expects that the BitString
        filed length must be matched with N, which is configured by BFR.</t>
      </section>
    </section>

    <section title="End.RBS Segment Definition">
      <t>When the packet is received by an Replication Endpoint and the DA of
      this packet is a local SID with the function of End.RBS, the packet will
      be replicated based on the RBS sub-TLV defined in section 5. The DA of
      the replicated packets is replaced by the End.RBS for the next
      Replication Endpoinds.</t>

      <t>The behavior of End.RBS is defined in section 5 of <xref
      target="I-D.eckert-bier-cgm2-rbs"/>.</t>
    </section>

    <section title="RBS Sub-TLV">
      <t>MRH defined in <xref target="I-D.geng-msr6-traffic-engineering"/> is
      as follows:</t>

      <t><figure>
          <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
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    | Next Header   |  Hdr Ext Len  | Routing Type  | Segments Left |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |  MRH Sub-type |                   Reserved                    |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    //                                                             //
    //         Optional Type Length Value objects (variable)       //
    //                                                             //
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
                   Figure 5.MRH of RBS Type Encapsulation
]]></artwork>
        </figure></t>

      <t>MRH Sub-type: 8-bit identifier of the sub-type. The sub-type of RBS
      is to be assigned by IANA.</t>

      <t>Segments Left: MUST be set to 0 when the MRH sub-type is RBS
      sub-type.</t>

      <t>Type Length Value objects: Must habe RBS sub-TLV when the MRH
      sub-type is RBS sub-type.</t>

      <t/>

      <t>A "RBS" type sub-TLV is defined for RBS in the feild of Optional Type
      Length Value Objects. The format is shown as below</t>

      <t><figure>
          <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
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |      Type     |           Length          |      RESERVED     |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                                                               |
   |                      RBS Address(variable)                   //
   |                                                              //
   |                                                              //
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
                      Figure 6.RBS Sub-TLV
]]></artwork>
        </figure></t>

      <t>Type: 8-bit identifier of the type of sub-TLV. The type of RBS option
      is to be assigned by IANA.</t>

      <t>Length: 16-bit unsigned integer indicates the length of the option
      Data field of this option, in octets. The value of Opt Data Len of RBS
      option depends on the encoding of multicast tree, according to the
      mechanism defined in section 3.</t>

      <t>RBS Address: defined in <xref target="I-D.eckert-bier-cgm2-rbs"/>.
      The packet is forwarded based on the multicast tree indicated by the RBS
      Address.</t>
    </section>

    <section title="Illustration">
      <t>Figure 7 shows an example for RBS forwarding.</t>

      <t><figure>
          <artwork><![CDATA[                                      +-+
                                 /-=>-|C|-=> Client2
                                /     +-+
                               /     
               +-+    +-+    +-+    +-+
    Client1 =>-|B|-=>-|R|-=>-|S|-=>-|D|-=> Client3
               +-+    +-+    +-+    +-+
                         \       
                          \     +-+
                           \-=>-|E|-=> Client4
                                +-+

                     Figure 7: Example Network Topology]]></artwork>
        </figure>A packet from Client1 connected to BFR B is intended to be
      replicated to Client2,3,4.</t>

      <t>The encapsulation of RBS at BFR-B is shown in Figure 8.</t>

      <t><figure>
          <artwork><![CDATA[               ........................ RecursiveUnit ...................................
               .                                                                        .
  +-----------+------------+-----------------------------------------------------------+-------+
  |TotalLen:34|BitString:01|RU1:(R:011|AF:00010010|S:011|AF:00000011|C:001|D:0001|E:001)|Padding|
  +-----------+------------+-----------------------------------------------------------+-------+
                               Figure 8: Encapsulation of RBS at BFR-B]]></artwork>
        </figure>Since there is only one RecursiveUnit, the AddressingField is
      omitted at BFR-B.</t>

      <t>BFR-B rewrites the RBS by replacing the RecursiveUnit with
      RecursiveUnit 1 and adjusts the TotalLen and Padding fileds.</t>

      <t>And BFR-R receives the packet with RBS, which has been processed by
      BFR-B, shown in Figure 9.</t>

      <t><figure>
          <artwork><![CDATA[               .......................... RecursiveUnit ..............................
               .                                                                     .
  +-----------+-------------+------------+----------------------------------------------+-------+
  |TotalLen:32|BitString:011|AF1:00010010|RU1(S:011|AF1:00000011|C:001|D:0001)RU2(E:001)|Padding|
  +-----------+-------------+------------+----------------------------------------------+-------+
                               Figure 9: Encapsulation of RBS at BFR-R]]></artwork>
        </figure></t>

      <t>And BFR-R parse the Bitstring filed using BIFT shown in Figure
      10.</t>

      <t>Because there are two recursive BP set in the BitString for R, one
      AddressingFiled is required to indicate the length of RecursiveUnit
      1.</t>

      <t><figure>
          <artwork><![CDATA[   +--+---------+---------+
   |BP|RecuFlag |Adjacency|
   +--+---------+---------+
   | 1|        1|       B |
   +--+---------+---------+
   | 2|        1|       S |
   +--+---------+---------+
   | 3|        1|       E |
   +--+---------+---------+
 Figure 10: RBS BIFT on BFR-R
]]></artwork>
        </figure>BFR-R accordingly creates one copy for BFR-S using
      RecursiveUnit 1, and only copy for BFR-E using RecursiveUnit 2, updating
      Padding accordingly for each copy.</t>

      <t>BFR-S receives from BFR-R the packet as shown in Figure 11.</t>

      <t><figure>
          <artwork><![CDATA[              ............. RecursiveUnit ......................
              .                                                .
  +-----------+-------------+------------+---------------------+-------+
  |TotalLen:18|BitString:011|AF1:00000011|RU1(C:001)RU2(D:0001)|Padding|
  +-----------+-------------+------------+---------------------+-------+
            Figure 11: Encapsulation of RBS at BFR-S]]></artwork>
        </figure></t>

      <t>BFR-E receives from BFR-R the packet as shown in Figure 12.</t>

      <t><figure>
          <artwork><![CDATA[   +-----------+-------------+-------+
   |TotalLen:32|BitString:001|Padding|
   +-----------+-------------+-------+
  Figure 12: Encapsulation of RBS at BFR-E]]></artwork>
        </figure>BFR-E would impose or rewrite a unicast encapsulation to make
      the packet become a unicast packet directed to Client 4.</t>

      <t/>

      <t>The procedures for processing of the packet on BFR-S are very much
      the same as on BFR-R.</t>

      <t>BFR-C receives from BFR-R the packet as shown in Figure 13. And it
      will make the packet become a unicast packet directed to Client 2.</t>

      <t><figure>
          <artwork><![CDATA[   +-----------+-------------+-------+
   |TotalLen:3 |BitString:001|Padding|
   +-----------+-------------+-------+
 Figure 13: Encapsulation of RBS at BFR-C
]]></artwork>
        </figure></t>

      <t>BFR-D receives from BFR-R the packet as shown in Figure 14. And it
      will make the packet become a unicast packet directed to Client 3.</t>

      <t><figure>
          <artwork><![CDATA[   +-----------+--------------+-------+
   |TotalLen:4 |BitString:0001|Padding|
   +-----------+--------------+-------+
 Figure 14: Encapsulation of RBS at BFR-D
]]></artwork>
        </figure></t>

      <t>The brief of RBS BitString conversion is shown in Figure 15.</t>

      <t><figure>
          <artwork><![CDATA[                                                                  +------------+
                                                                  |{S=S , D=C} |
                                                                  +------------+
                                                                  |[BitStr=001]|
                                                                  +============+
                                                                  | (C-MC Pkt) |        
                                                                  +============+ +-+ 
                                                                /--------=>------|C|----=>---Client2
                     +------------+     +------------+         /+------------+   +-+ +==========+
                     |{S=B , D=R} |     |{S=R , D=S} |        / |{S=S , D=D} |       |(C-MC Pkt)|
                     +------------+     +------------+       /  +------------+       +==========+ 
                     |[BitStr=011]|     |[BitStr=011]|      /   |[BitStr=0001]|        
  +==========+       +============+     +=============+    /    +============+        
  |(C-MC Pkt)|       | (C-MC Pkt) |     | (C-MC Pkt) |    /     | (C-MC Pkt) |          
  +==========+   +-+ +============+ +-+ +============+ +-+      +============+ +-+
  Client1---=>---|B|-------=>-------|R|-------=>-------|S|---------=>-=--------|D|----=>----Client3
                 +-+                +-+                +-+                     +-+ +==========+
                         +------------+ \                                          |(C-MC Pkt)|
                         |{S=R , D=E}|   \     +-+                                 +==========+ 
                         +------------+   \-=>-|E|-----=>------ Client4
                         |[BitStr=001]|        +-+  +==========+
                         +============+             |(C-MC Pkt)|
                         | (C-MC Pkt) |             +==========+
                         +============+

                     Figure 15: Brief of RBS BitString coversion
]]></artwork>
        </figure></t>

      <t/>
    </section>

    <section anchor="IANA" title="IANA Considerations">
      <t>This document makes no request of IANA.</t>

      <t>Note to RFC Editor: this section may be removed on publication as an
      RFC.</t>
    </section>

    <section anchor="Security" title="Security Considerations">
      <t/>
    </section>

    <section anchor="Acknowledgements" title="Acknowledgements">
      <t/>
    </section>
  </middle>

  <back>
    <references title="Normative References">
      <?rfc include="reference.RFC.2119"?>

      <?rfc include='reference.I-D.cheng-spring-ipv6-msr-design-consideration'?>

      <?rfc include='reference.I-D.geng-msr6-traffic-engineering'?>

      <?rfc include='reference.I-D.chen-pim-srv6-p2mp-path'?>

      <?rfc include='reference.I-D.geng-msr6-rlb-segment'?>

      <?rfc include='reference.I-D.eckert-bier-cgm2-rbs'?>
    </references>
  </back>
</rfc>
