<?xml version='1.0' encoding='utf-8'?>

<rfc
      xmlns:xi="http://www.w3.org/2001/XInclude"
      category="std"
      docName="draft-chen-spring-srv6-compressed-bsid-insertion-02"
      ipr="trust200902"
      obsoletes=""
      updates=""
      submissionType="IETF"
      xml:lang="en"
      tocInclude="true"
      tocDepth="4"
      symRefs="true"
      sortRefs="true"
      version="3">
  <!-- xml2rfc v2v3 conversion 2.38.1 -->
  <!-- category values: std, bcp, info, exp, and historic
    ipr values: trust200902, noModificationTrust200902, noDerivativesTrust200902,
       or pre5378Trust200902
    you can add the attributes updates="NNNN" and obsoletes="NNNN" 
    they will automatically be output with "(if approved)" -->

 <!-- ***** FRONT MATTER ***** -->

 <front>
    <!-- The abbreviated title is used in the page header - it is only necessary if the 
        full title is longer than 39 characters -->

   <title abbrev="Compressed BSID Insertion">SRv6 NET-PGM extension: Compressed BSID Insertion</title>
    <seriesInfo name="Internet-Draft" value="draft-chen-spring-srv6-compressed-bsid-insertion-02"/>
    <!-- add 'role="editor"' below for the editors if appropriate -->

   <!-- Another author who claims to be an editor -->

   <author fullname="Ran Chen" initials="R." surname="Chen">
      <organization>ZTE Corporation</organization>
      <address>
        <postal>
          <street/>
          <!-- Reorder these if your country does things differently -->

         <city>Nanjing</city>
          <region/>
          <code/>
          <country>China</country>
        </postal>
        <email>chen.ran@zte.com.cn</email>
        <!-- uri and facsimile elements may also be added -->
     </address>
    </author>

      <author fullname="Detao Zhao" initials="D." surname="Zhao">
      <organization>ZTE Corporation</organization>
      <address>
        <postal>
          <street/>
          <!-- Reorder these if your country does things differently -->

         <city>Nanjing</city>
          <region/>
          <code/>
          <country>China</country>
        </postal>
        <email>zhao.detao@zte.com.cn</email>
        <!-- uri and facsimile elements may also be added -->
     </address>
    </author>
    
    <date year="2026"/>
    <!-- If the month and year are both specified and are the current ones, xml2rfc will fill 
        in the current day for you. If only the current year is specified, xml2rfc will fill 
     in the current day and month for you. If the year is not the current one, it is 
     necessary to specify at least a month (xml2rfc assumes day="1" if not specified for the 
     purpose of calculating the expiry date).  With drafts it is normally sufficient to 
     specify just the year. -->

   <!-- Meta-data Declarations -->

   <area>Routing</area>
    <workgroup>SPRING</workgroup>
    <!-- WG name at the upperleft corner of the doc,
        IETF is fine for individual submissions.  
     If this element is not present, the default is "Network Working Group",
        which is used by the RFC Editor as a nod to the history of the IETF. -->

   <keyword>Internet Draft</keyword>
    <!-- Keywords will be incorporated into HTML output
        files in a meta tag but they have no effect on text or nroff
        output. If you submit your draft to the RFC Editor, the
        keywords will be used for the search engine. -->
   
   <abstract>
      <t>The End.B6.Insert and End.B6.Insert.Red SHOULD support the NEXT-C-SID flavor either individually or in combinations. This document defines the SRH processing of the End.B6.Insert and End.B6.Insert.Red with NEXT-C-SID flavor.</t>
    </abstract>
  </front>
  <middle>
  
    <section numbered="true" toc="default">
      <name>Introduction</name>
     <t><xref target="I-D.filsfils-spring-srv6-net-pgm-insertion" format="default"/> extends the SRv6 Network Programming <xref target="RFC8986" format="default"></xref> model with new endpoint and transit behaviors enabling the insertion of an SRH after the outer IPv6 header of the SR domain, called End.B6.Insert and End.B6.Insert.Red.</t>
     <t><xref target="RFC9800" format="default"></xref> specifies the new flavors to the SR segment endpoint behaviors defined in <xref target="RFC8986" format="default"></xref> that enable a compressed encoding of the SRv6 segment list. One of the flavor is the NEXT-C-SID flavor. With the NEXT-C-SID flavor, each C-SID container is a fully formed SRv6 SID with the common Locator-Block for all the C-SIDs in the C-SID container, a Locator-Node and Function that are those of the first C-SID, and an Argument carrying the subsequent C-SIDs.</t>
     <t>The End.B6.Insert and End.B6.Insert.Red SHOULD support the NEXT-C-SID flavor either individually or in combinations. This document defines the SRH processing of the End.B6.Insert and End.B6.Insert.Red with NEXT-C-SID flavor.</t>
     <section numbered="true" toc="default">
        <name>Requirements Language</name>
        <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 BCP 14 <xref target="RFC2119" format="default"></xref> <xref target="RFC8174" format="default"></xref> when, and only when, they appear in all capitals, as shown here.</t>
      </section>  
      </section>
   <section numbered="true" toc="default">
   <name>SRv6 endpoint behaviors</name>
   <t>This section defines the SRH processing of the End.B6.Insert and End.B6.Insert.Red with NEXT-C-SID flavor.</t>
    <section numbered="true" toc="default">
   <name>End.B6.Insert with NEXT-C-SID flavor</name>
    <t>End.B6.Insert with NEXT-C-SID: Endpoint bound to an SRv6 policy. The "Endpoint bound to an SRv6 Policy" is a variant of the End behavior.</t>
    <t>When N receives a packet whose IPv6 DA is S and S matching a FIB entry locally instantiated as an End.B6.Insert SID with NEXT-C-SID Flavor, does:</t>
     <artwork name="" type="" align="left" alt=""><![CDATA[
   N01. If (DA.Argument!= 0) {
   N02. If (IPv6 Hop Limit <= 1) {
   N03. Send an ICMP Time Exceeded message to the Source 
        Address, Code 0 (Hop limit exceeded in transit),
        interrupt packet processing and discard the packet.
   N04. }
   N05. Copy DA.Argument into the bits [LBL..(LBL+AL-1)] 
        of the Destination Address.
   N06. Set the bits [(LBL+AL)..127] of the Destination 
        Address to zero.
   N07. Decrement IPv6 Hop Limit by 1.
   N08.1.Insert a new SRH in between the IPv6 Header and 
        the received SRH containing the list of segments of B.
   N08.2. Set the new SRH[0] to the IPv6 DA .
   N08.3. Set the IPv6 DA to the first segment of B.
   N08.4. Submit the packet to the egress IPv6 FIB lookup for
          transmission to the next destination.
   N09. }
   S02. If (Segments Left == 0) {
   S03. Stop processing the SRH, and proceed to process the next
        header in the packet, whose type is identified by
        the Next Header field in the routing header.
   S04. }
   S05. If (IPv6 Hop Limit <= 1) {
   S06. Send an ICMP Time Exceeded message to the Source Address
        with Code 0 (Hop limit exceeded in transit),
        interrupt packet processing, and discard the packet.
   S07. }
   S08. max_LE = (Hdr Ext Len / 2) - 1
   S09. If ((Last Entry > max_LE)or(Segments Left > Last Entry+1)){
   S10. Send an ICMP Parameter Problem to the Source Address
        with Code 0 (Erroneous header field encountered)
        and Pointer set to the Segments Left field,
        interrupt packet processing, and discard the packet.
   S11. }
   S12. Decrement IPv6 Hop Limit by 1.
   S13. Decrement Segments Left by 1.
   S14. Update IPv6 DA with Segment List[Segments Left].
   S15. Insert a new SRH in between the IPv6 Header and the received 
        SRH containing the list of segments of B.
   S16. Set the IPv6 DA to the first SID of B.
   S17. Submit the packet to the egress IPv6 FIB lookup for
          transmission to the new destination.
   S18. }  
           ]]></artwork>
    <t>Examples:</t>
     <artwork name="" type="" align="left" alt=""><![CDATA[
uBSID is an End.B6.Insert with NEXT-C-SID Flavor SID, and the 
corresponding segment-list is <fc00:2024:uSID20::,fc00:2024:uSID21>.
case1,  uBSID is the non-last SID of the container:
        Node N receives a packet:
        IPv6：SA = 2024::1, DA=FC00:2024:uBSID:uSID2:uSID3
                               :uSID4::uSID5:uSID6::
        SRH1:(FC00:2024:uSID7:uSID8::,FC00:2024:uBSID:uSID2
             :uSID3:uSID4:uSID5:uSID6::;SL=1)
        After the End.B6.Insert with NEXT-C-SID Flavor behavior, 
        the packet looks like:
        IPv6：SA = 2024::1, DA=FC00:2024:uSID20:uSID21::
        SRH2:(FC00:2024:uSID2:uSID3:uSID4::uSID5:uSID6::,
             FC00:2024:uSID20:uSID21::;SL=1)
        SRH1:(FC00:2024:uSID7:uSID8::,
             FC00:2024:uBSID:uSID2:uSID3:uSID4:uSID5:uSID6::;SL=1)

case2, uBSID is the last SID of the C-SID container:
       Node N receives a packet:
       IPv6：SA = 2024::1, DA=FC00:2024:uBSID::
       SRH1:(FC00:2024:uSID7:uSID8::,
            FC00:2024:uSID2:uSID3:uSID4:uSID5:uSID6:uBSID::;SL=1)
       After the End.B6.Insert with NEXT-C-SID Flavor behavior, 
       the packet looks like:
       IPv6：SA = 2024::1, DA=FC00:2024:uSID20:uSID21::
       SRH2:(FC00:2024:uSID20:uSID21::;SL=0);SRH2 may be omit
       SRH1:(FC00:2024:uSID7:uSID8::,
             FC00:2024:uSID2:uSID3:uSID4:uSID5:uSID6:uBSID::;SL=1)

case3, uBSID is in the last of the C-SID container of the SRH:
       Node N receives a packet:
       IPv6：SA = 2024::1, DA=FC00:2024:uBSID:uSID7:uSID8::
       SRH1:(FC00:2024:uBSID:uSID7:uSID8::,
             FC00:2024:uSID1:uSID2:uSID3:uSID4:uSID5:uSID6::;SL=0)
       After the End.B6.Insert with NEXT-C-SID Flavor behavior, 
       the packet looks like:
       IPv6：SA = 2024::1, DA=FC00:2024:uSID20:uSID21::
       SRH2:(FC00:2024:uSID7:uSID8::,FC00:2024:uSID20:uSID21::;SL=1)
       SRH1:(FC00:2024:uBSID:uSID7:uSID8::,
            FC00:2024:uSID1:uSID2:uSID3:uSID4:uSID5:uSID6::;SL=0)
      ]]></artwork>
    </section>         
 <section numbered="true" toc="default">
   <name>End.B6.Insert red with NEXT-C-SID flavor</name>
    <t>This is an optimization of the End.B6.Insert with NEXT-C-SID flavor behavior.</t>
    <t>End.B6.Insert.Red with NEXT-C-SID flavor reduces the size of the new SRH by one SID by avoiding the insertion of the first SID in the pushed SRH. In this way, the first SID is only written in the DA and the packet is forwarded according to it.</t>
    <t>The new SRH is created as described in Section 4.1.1 of <xref target="RFC8754" format="default"></xref>.</t> 
    </section>         
    </section>             
   
   <section anchor="IANA" numbered="true" toc="default">
      <name>IANA Considerations</name>
      <t>The document defines two new SRv6 Endpoint behaviors called End.B6.Insert with NEXT-C-SID flavor and End.B6.Insert.Red with NEXT-C-SID flavor.</t>
      <t>This document requests the IANA to allocate, within the "SRv6 Endpoint Behaviors" sub-registry belonging to the top-level "Segment-routing with IPv6 dataplane (SRv6) Parameters" registry, the following allocations:</t>
      <figure>
        <artwork align="left" name=""><![CDATA[
Value                Endpoint Behavior              Reference
------------------------------------------------------------------
TBD1     End.B6.Insert with NEXT-C-SID flavor      This document
TBD2     End.B6.Insert.Red with NEXT-C-SID flavor  This document
            ]]></artwork>     
      </figure>
     </section>
     
     <section anchor="Security" numbered="true" toc="default">
      <name>Security Considerations</name>
     <t> The security requirements and mechanisms described in <xref target="RFC8402" format="default"></xref>, <xref target="RFC8754" format="default"></xref> and <xref target="RFC8986" format="default"></xref> also apply to this document, and this document does not introduce any new security considerations.</t>
    </section>
     
      <section anchor="Acknowledgements" numbered="true" toc="default">
      <name>Acknowledgements</name>
      <t>TBD.</t>
    </section>
    <!-- Possibly a 'Contributors' section ... -->
  </middle>
  <!--  *****BACK MATTER ***** -->

 <back>
    

 <references>
        <name>Normative References</name>
        <!--?rfc include="http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml"?-->
      <?rfc include="reference.RFC.2119.xml"?>
      <?rfc include="reference.RFC.8402.xml"?>
      <?rfc include="reference.RFC.8174.xml"?>
      <?rfc include="reference.RFC.8754.xml"?>
      <?rfc include="reference.RFC.8986.xml"?>
      <?rfc include="reference.RFC.9800.xml"?>
       <?rfc include='reference.I-D.filsfils-spring-srv6-net-pgm-insertion.xml'?>
      </references>
       
    <!-- Change Log

v00 2006-03-15  EBD   Initial version

v01 2006-04-03  EBD   Moved PI location back to position 1 -
                     v3.1 of XMLmind is better with them at this location.
v02 2007-03-07  AH    removed extraneous nested_list attribute,
                     other minor corrections
v03 2007-03-09  EBD   Added comments on null IANA sections and fixed heading capitalization.
                     Modified comments around figure to reflect non-implementation of
                     figure indent control.  Put in reference using anchor="DOMINATION".
                     Fixed up the date specification comments to reflect current truth.
v04 2007-03-09 AH     Major changes: shortened discussion of PIs,
                     added discussion of rfc include.
v05 2007-03-10 EBD    Added preamble to C program example to tell about ABNF and alternative 
                     images. Removed meta-characters from comments (causes problems).

v06 2010-04-01 TT     Changed ipr attribute values to latest ones. Changed date to
                     year only, to be consistent with the comments. Updated the 
                     IANA guidelines reference from the I-D to the finished RFC.
v07 2020-01-21 HL    Converted the template to use XML schema version 3.
    -->
 </back>
</rfc>
