<?xml version='1.0' encoding='utf-8'?>
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" version="3" ipr="trust200902" docName="draft-ietf-spring-srv6-srh-compression-23" number="9800" category="std" consensus="true" submissionType="IETF" updates="8754" obsoletes="" tocInclude="true" sortRefs="true" symRefs="true" xml:lang="en" prepTime="2025-06-30T13:17:39" indexInclude="true" scripts="Common,Latin" tocDepth="3">
  <link href="https://datatracker.ietf.org/doc/draft-ietf-spring-srv6-srh-compression-23" rel="prev"/>
  <link href="https://dx.doi.org/10.17487/rfc9800" rel="alternate"/>
  <link href="urn:issn:2070-1721" rel="alternate"/>
  <front>
    <title abbrev="Compressed SRv6 Segment List Encoding">Compressed SRv6 Segment List Encoding</title>
    <seriesInfo name="RFC" value="9800" stream="IETF"/>
    <author initials="W." surname="Cheng" fullname="Weiqiang Cheng" role="editor">
      <organization showOnFrontPage="true">China Mobile</organization>
      <address>
        <postal>
          <country>China</country>
        </postal>
        <email>chengweiqiang@chinamobile.com</email>
      </address>
    </author>
    <author initials="C." surname="Filsfils" fullname="Clarence Filsfils">
      <organization showOnFrontPage="true">Cisco Systems, Inc.</organization>
      <address>
        <postal>
          <country>Belgium</country>
        </postal>
        <email>cf@cisco.com</email>
      </address>
    </author>
    <author initials="Z." surname="Li" fullname="Zhenbin Li">
      <organization showOnFrontPage="true">Huawei Technologies</organization>
      <address>
        <postal>
          <country>China</country>
        </postal>
        <email>lizhenbin@huawei.com</email>
      </address>
    </author>
    <author initials="B." surname="Decraene" fullname="Bruno Decraene">
      <organization showOnFrontPage="true">Orange</organization>
      <address>
        <postal>
          <country>France</country>
        </postal>
        <email>bruno.decraene@orange.com</email>
      </address>
    </author>
    <author initials="F." surname="Clad" fullname="Francois Clad" role="editor">
      <organization showOnFrontPage="true">Cisco Systems, Inc.</organization>
      <address>
        <postal>
          <country>France</country>
        </postal>
        <email>fclad.ietf@gmail.com</email>
      </address>
    </author>
    <date month="06" year="2025"/>
    <area>RTG</area>
    <workgroup>spring</workgroup>
    <keyword>Segment Routing</keyword>
    <keyword>IPv6 Segment Routing</keyword>
    <keyword>Compressed SID</keyword>
    <keyword>CSID</keyword>
    <keyword>NEXT-CSID</keyword>
    <keyword>REPLACE-SID</keyword>
    <keyword>SRH Compression</keyword>
    <abstract pn="section-abstract">
      <t indent="0" pn="section-abstract-1">Segment Routing over IPv6 (SRv6) is the instantiation of Segment Routing (SR) on the IPv6 data plane. This document specifies new flavors for the SRv6 endpoint behaviors defined in RFC 8986, which enable the compression of an SRv6 segment list. Such compression significantly reduces the size of the SRv6 encapsulation needed to steer packets over long segment lists.</t>
      <t indent="0" pn="section-abstract-2">This document updates RFC 8754 by allowing a Segment List entry in the Segment Routing Header (SRH) to be either an IPv6 address, as specified in RFC 8754, or a REPLACE-CSID container in packed format, as specified in this document.</t>
    </abstract>
    <boilerplate>
      <section anchor="status-of-memo" numbered="false" removeInRFC="false" toc="exclude" pn="section-boilerplate.1">
        <name slugifiedName="name-status-of-this-memo">Status of This Memo</name>
        <t indent="0" pn="section-boilerplate.1-1">
            This is an Internet Standards Track document.
        </t>
        <t indent="0" pn="section-boilerplate.1-2">
            This document is a product of the Internet Engineering Task Force
            (IETF).  It represents the consensus of the IETF community.  It has
            received public review and has been approved for publication by
            the Internet Engineering Steering Group (IESG).  Further
            information on Internet Standards is available in Section 2 of 
            RFC 7841.
        </t>
        <t indent="0" pn="section-boilerplate.1-3">
            Information about the current status of this document, any
            errata, and how to provide feedback on it may be obtained at
            <eref target="https://www.rfc-editor.org/info/rfc9800" brackets="none"/>.
        </t>
      </section>
      <section anchor="copyright" numbered="false" removeInRFC="false" toc="exclude" pn="section-boilerplate.2">
        <name slugifiedName="name-copyright-notice">Copyright Notice</name>
        <t indent="0" pn="section-boilerplate.2-1">
            Copyright (c) 2025 IETF Trust and the persons identified as the
            document authors. All rights reserved.
        </t>
        <t indent="0" pn="section-boilerplate.2-2">
            This document is subject to BCP 78 and the IETF Trust's Legal
            Provisions Relating to IETF Documents
            (<eref target="https://trustee.ietf.org/license-info" brackets="none"/>) in effect on the date of
            publication of this document. Please review these documents
            carefully, as they describe your rights and restrictions with
            respect to this document. Code Components extracted from this
            document must include Revised BSD License text as described in
            Section 4.e of the Trust Legal Provisions and are provided without
            warranty as described in the Revised BSD License.
        </t>
      </section>
    </boilerplate>
    <toc>
      <section anchor="toc" numbered="false" removeInRFC="false" toc="exclude" pn="section-toc.1">
        <name slugifiedName="name-table-of-contents">Table of Contents</name>
        <ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1">
          <li pn="section-toc.1-1.1">
            <t indent="0" keepWithNext="true" pn="section-toc.1-1.1.1"><xref derivedContent="1" format="counter" sectionFormat="of" target="section-1"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-introduction">Introduction</xref></t>
          </li>
          <li pn="section-toc.1-1.2">
            <t indent="0" keepWithNext="true" pn="section-toc.1-1.2.1"><xref derivedContent="2" format="counter" sectionFormat="of" target="section-2"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-terminology">Terminology</xref></t>
            <ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.2.2">
              <li pn="section-toc.1-1.2.2.1">
                <t indent="0" keepWithNext="true" pn="section-toc.1-1.2.2.1.1"><xref derivedContent="2.1" format="counter" sectionFormat="of" target="section-2.1"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-requirements-language">Requirements Language</xref></t>
              </li>
            </ul>
          </li>
          <li pn="section-toc.1-1.3">
            <t indent="0" pn="section-toc.1-1.3.1"><xref derivedContent="3" format="counter" sectionFormat="of" target="section-3"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-basic-concepts">Basic Concepts</xref></t>
          </li>
          <li pn="section-toc.1-1.4">
            <t indent="0" pn="section-toc.1-1.4.1"><xref derivedContent="4" format="counter" sectionFormat="of" target="section-4"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-sr-segment-endpoint-flavors">SR Segment Endpoint Flavors</xref></t>
            <ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.4.2">
              <li pn="section-toc.1-1.4.2.1">
                <t indent="0" pn="section-toc.1-1.4.2.1.1"><xref derivedContent="4.1" format="counter" sectionFormat="of" target="section-4.1"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-next-csid-flavor">NEXT-CSID Flavor</xref></t>
                <ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.4.2.1.2">
                  <li pn="section-toc.1-1.4.2.1.2.1">
                    <t indent="0" pn="section-toc.1-1.4.2.1.2.1.1"><xref derivedContent="4.1.1" format="counter" sectionFormat="of" target="section-4.1.1"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-end-with-next-csid">End with NEXT-CSID</xref></t>
                  </li>
                  <li pn="section-toc.1-1.4.2.1.2.2">
                    <t indent="0" pn="section-toc.1-1.4.2.1.2.2.1"><xref derivedContent="4.1.2" format="counter" sectionFormat="of" target="section-4.1.2"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-endx-with-next-csid">End.X with NEXT-CSID</xref></t>
                  </li>
                  <li pn="section-toc.1-1.4.2.1.2.3">
                    <t indent="0" pn="section-toc.1-1.4.2.1.2.3.1"><xref derivedContent="4.1.3" format="counter" sectionFormat="of" target="section-4.1.3"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-endt-with-next-csid">End.T with NEXT-CSID</xref></t>
                  </li>
                  <li pn="section-toc.1-1.4.2.1.2.4">
                    <t indent="0" pn="section-toc.1-1.4.2.1.2.4.1"><xref derivedContent="4.1.4" format="counter" sectionFormat="of" target="section-4.1.4"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-endb6encaps-with-next-csid">End.B6.Encaps with NEXT-CSID</xref></t>
                  </li>
                  <li pn="section-toc.1-1.4.2.1.2.5">
                    <t indent="0" pn="section-toc.1-1.4.2.1.2.5.1"><xref derivedContent="4.1.5" format="counter" sectionFormat="of" target="section-4.1.5"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-endb6encapsred-with-next-cs">End.B6.Encaps.Red with NEXT-CSID</xref></t>
                  </li>
                  <li pn="section-toc.1-1.4.2.1.2.6">
                    <t indent="0" pn="section-toc.1-1.4.2.1.2.6.1"><xref derivedContent="4.1.6" format="counter" sectionFormat="of" target="section-4.1.6"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-endbm-with-next-csid">End.BM with NEXT-CSID</xref></t>
                  </li>
                  <li pn="section-toc.1-1.4.2.1.2.7">
                    <t indent="0" pn="section-toc.1-1.4.2.1.2.7.1"><xref derivedContent="4.1.7" format="counter" sectionFormat="of" target="section-4.1.7"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-combination-with-psp-usp-an">Combination with PSP, USP, and USD Flavors</xref></t>
                  </li>
                </ul>
              </li>
              <li pn="section-toc.1-1.4.2.2">
                <t indent="0" pn="section-toc.1-1.4.2.2.1"><xref derivedContent="4.2" format="counter" sectionFormat="of" target="section-4.2"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-replace-csid-flavor">REPLACE-CSID Flavor</xref></t>
                <ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.4.2.2.2">
                  <li pn="section-toc.1-1.4.2.2.2.1">
                    <t indent="0" pn="section-toc.1-1.4.2.2.2.1.1"><xref derivedContent="4.2.1" format="counter" sectionFormat="of" target="section-4.2.1"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-end-with-replace-csid">End with REPLACE-CSID</xref></t>
                  </li>
                  <li pn="section-toc.1-1.4.2.2.2.2">
                    <t indent="0" pn="section-toc.1-1.4.2.2.2.2.1"><xref derivedContent="4.2.2" format="counter" sectionFormat="of" target="section-4.2.2"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-endx-with-replace-csid">End.X with REPLACE-CSID</xref></t>
                  </li>
                  <li pn="section-toc.1-1.4.2.2.2.3">
                    <t indent="0" pn="section-toc.1-1.4.2.2.2.3.1"><xref derivedContent="4.2.3" format="counter" sectionFormat="of" target="section-4.2.3"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-endt-with-replace-csid">End.T with REPLACE-CSID</xref></t>
                  </li>
                  <li pn="section-toc.1-1.4.2.2.2.4">
                    <t indent="0" pn="section-toc.1-1.4.2.2.2.4.1"><xref derivedContent="4.2.4" format="counter" sectionFormat="of" target="section-4.2.4"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-endb6encaps-with-replace-cs">End.B6.Encaps with REPLACE-CSID</xref></t>
                  </li>
                  <li pn="section-toc.1-1.4.2.2.2.5">
                    <t indent="0" pn="section-toc.1-1.4.2.2.2.5.1"><xref derivedContent="4.2.5" format="counter" sectionFormat="of" target="section-4.2.5"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-endb6encapsred-with-replace">End.B6.Encaps.Red with REPLACE-CSID</xref></t>
                  </li>
                  <li pn="section-toc.1-1.4.2.2.2.6">
                    <t indent="0" pn="section-toc.1-1.4.2.2.2.6.1"><xref derivedContent="4.2.6" format="counter" sectionFormat="of" target="section-4.2.6"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-endbm-with-replace-csid">End.BM with REPLACE-CSID</xref></t>
                  </li>
                  <li pn="section-toc.1-1.4.2.2.2.7">
                    <t indent="0" pn="section-toc.1-1.4.2.2.2.7.1"><xref derivedContent="4.2.7" format="counter" sectionFormat="of" target="section-4.2.7"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-enddx-and-enddt-with-replac">End.DX and End.DT with REPLACE-CSID</xref></t>
                  </li>
                  <li pn="section-toc.1-1.4.2.2.2.8">
                    <t indent="0" pn="section-toc.1-1.4.2.2.2.8.1"><xref derivedContent="4.2.8" format="counter" sectionFormat="of" target="section-4.2.8"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-combination-with-psp-usp-and">Combination with PSP, USP, and USD Flavors</xref></t>
                  </li>
                </ul>
              </li>
            </ul>
          </li>
          <li pn="section-toc.1-1.5">
            <t indent="0" pn="section-toc.1-1.5.1"><xref derivedContent="5" format="counter" sectionFormat="of" target="section-5"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-csid-allocation">CSID Allocation</xref></t>
            <ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.5.2">
              <li pn="section-toc.1-1.5.2.1">
                <t indent="0" pn="section-toc.1-1.5.2.1.1"><xref derivedContent="5.1" format="counter" sectionFormat="of" target="section-5.1"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-global-csid">Global CSID</xref></t>
              </li>
              <li pn="section-toc.1-1.5.2.2">
                <t indent="0" pn="section-toc.1-1.5.2.2.1"><xref derivedContent="5.2" format="counter" sectionFormat="of" target="section-5.2"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-local-csid">Local CSID</xref></t>
              </li>
              <li pn="section-toc.1-1.5.2.3">
                <t indent="0" pn="section-toc.1-1.5.2.3.1"><xref derivedContent="5.3" format="counter" sectionFormat="of" target="section-5.3"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-recommended-installation-of">Recommended Installation of CSIDs in FIB</xref></t>
              </li>
            </ul>
          </li>
          <li pn="section-toc.1-1.6">
            <t indent="0" pn="section-toc.1-1.6.1"><xref derivedContent="6" format="counter" sectionFormat="of" target="section-6"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-sr-source-node">SR Source Node</xref></t>
            <ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.6.2">
              <li pn="section-toc.1-1.6.2.1">
                <t indent="0" pn="section-toc.1-1.6.2.1.1"><xref derivedContent="6.1" format="counter" sectionFormat="of" target="section-6.1"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-sid-validation-for-compress">SID Validation for Compression</xref></t>
              </li>
              <li pn="section-toc.1-1.6.2.2">
                <t indent="0" pn="section-toc.1-1.6.2.2.1"><xref derivedContent="6.2" format="counter" sectionFormat="of" target="section-6.2"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-segment-list-compression">Segment List Compression</xref></t>
              </li>
              <li pn="section-toc.1-1.6.2.3">
                <t indent="0" pn="section-toc.1-1.6.2.3.1"><xref derivedContent="6.3" format="counter" sectionFormat="of" target="section-6.3"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-rules-for-segment-lists-con">Rules for Segment Lists Containing NEXT-CSID Flavor SIDs</xref></t>
              </li>
              <li pn="section-toc.1-1.6.2.4">
                <t indent="0" pn="section-toc.1-1.6.2.4.1"><xref derivedContent="6.4" format="counter" sectionFormat="of" target="section-6.4"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-rules-for-segment-lists-cont">Rules for Segment Lists Containing REPLACE-CSID Flavor SIDs</xref></t>
              </li>
              <li pn="section-toc.1-1.6.2.5">
                <t indent="0" pn="section-toc.1-1.6.2.5.1"><xref derivedContent="6.5" format="counter" sectionFormat="of" target="section-6.5"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-upper-layer-checksums">Upper-Layer Checksums</xref></t>
              </li>
            </ul>
          </li>
          <li pn="section-toc.1-1.7">
            <t indent="0" pn="section-toc.1-1.7.1"><xref derivedContent="7" format="counter" sectionFormat="of" target="section-7"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-inter-domain-compression">Inter-Domain Compression</xref></t>
            <ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.7.2">
              <li pn="section-toc.1-1.7.2.1">
                <t indent="0" pn="section-toc.1-1.7.2.1.1"><xref derivedContent="7.1" format="counter" sectionFormat="of" target="section-7.1"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-endlbs-locator-block-swap">End.LBS: Locator-Block Swap</xref></t>
                <ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.7.2.1.2">
                  <li pn="section-toc.1-1.7.2.1.2.1">
                    <t indent="0" pn="section-toc.1-1.7.2.1.2.1.1"><xref derivedContent="7.1.1" format="counter" sectionFormat="of" target="section-7.1.1"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-endlbs-with-next-csid">End.LBS with NEXT-CSID</xref></t>
                  </li>
                  <li pn="section-toc.1-1.7.2.1.2.2">
                    <t indent="0" pn="section-toc.1-1.7.2.1.2.2.1"><xref derivedContent="7.1.2" format="counter" sectionFormat="of" target="section-7.1.2"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-endlbs-with-replace-csid">End.LBS with REPLACE-CSID</xref></t>
                  </li>
                </ul>
              </li>
              <li pn="section-toc.1-1.7.2.2">
                <t indent="0" pn="section-toc.1-1.7.2.2.1"><xref derivedContent="7.2" format="counter" sectionFormat="of" target="section-7.2"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-endxlbs-l3-cross-connect-an">End.XLBS: L3 Cross-Connect and Locator-Block Swap</xref></t>
                <ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.7.2.2.2">
                  <li pn="section-toc.1-1.7.2.2.2.1">
                    <t indent="0" pn="section-toc.1-1.7.2.2.2.1.1"><xref derivedContent="7.2.1" format="counter" sectionFormat="of" target="section-7.2.1"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-endxlbs-with-next-csid">End.XLBS with NEXT-CSID</xref></t>
                  </li>
                  <li pn="section-toc.1-1.7.2.2.2.2">
                    <t indent="0" pn="section-toc.1-1.7.2.2.2.2.1"><xref derivedContent="7.2.2" format="counter" sectionFormat="of" target="section-7.2.2"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-endxlbs-with-replace-csid">End.XLBS with REPLACE-CSID</xref></t>
                  </li>
                </ul>
              </li>
            </ul>
          </li>
          <li pn="section-toc.1-1.8">
            <t indent="0" pn="section-toc.1-1.8.1"><xref derivedContent="8" format="counter" sectionFormat="of" target="section-8"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-control-plane">Control Plane</xref></t>
          </li>
          <li pn="section-toc.1-1.9">
            <t indent="0" pn="section-toc.1-1.9.1"><xref derivedContent="9" format="counter" sectionFormat="of" target="section-9"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-operational-considerations">Operational Considerations</xref></t>
            <ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.9.2">
              <li pn="section-toc.1-1.9.2.1">
                <t indent="0" pn="section-toc.1-1.9.2.1.1"><xref derivedContent="9.1" format="counter" sectionFormat="of" target="section-9.1"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-flavor-block-and-csid-lengt">Flavor, Block, and CSID Length</xref></t>
              </li>
              <li pn="section-toc.1-1.9.2.2">
                <t indent="0" pn="section-toc.1-1.9.2.2.1"><xref derivedContent="9.2" format="counter" sectionFormat="of" target="section-9.2"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-gib-lib-usage">GIB/LIB Usage</xref></t>
              </li>
              <li pn="section-toc.1-1.9.2.3">
                <t indent="0" pn="section-toc.1-1.9.2.3.1"><xref derivedContent="9.3" format="counter" sectionFormat="of" target="section-9.3"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-pinging-a-sid">Pinging a SID</xref></t>
              </li>
              <li pn="section-toc.1-1.9.2.4">
                <t indent="0" pn="section-toc.1-1.9.2.4.1"><xref derivedContent="9.4" format="counter" sectionFormat="of" target="section-9.4"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-icmp-error-processing">ICMP Error Processing</xref></t>
              </li>
            </ul>
          </li>
          <li pn="section-toc.1-1.10">
            <t indent="0" pn="section-toc.1-1.10.1"><xref derivedContent="10" format="counter" sectionFormat="of" target="section-10"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-applicability-to-other-srv6">Applicability to Other SRv6 Endpoint Behaviors</xref></t>
          </li>
          <li pn="section-toc.1-1.11">
            <t indent="0" pn="section-toc.1-1.11.1"><xref derivedContent="11" format="counter" sectionFormat="of" target="section-11"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-security-considerations">Security Considerations</xref></t>
          </li>
          <li pn="section-toc.1-1.12">
            <t indent="0" pn="section-toc.1-1.12.1"><xref derivedContent="12" format="counter" sectionFormat="of" target="section-12"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-iana-considerations">IANA Considerations</xref></t>
            <ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.12.2">
              <li pn="section-toc.1-1.12.2.1">
                <t indent="0" pn="section-toc.1-1.12.2.1.1"><xref derivedContent="12.1" format="counter" sectionFormat="of" target="section-12.1"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-srv6-endpoint-behaviors">SRv6 Endpoint Behaviors</xref></t>
              </li>
            </ul>
          </li>
          <li pn="section-toc.1-1.13">
            <t indent="0" pn="section-toc.1-1.13.1"><xref derivedContent="13" format="counter" sectionFormat="of" target="section-13"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-references">References</xref></t>
            <ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.13.2">
              <li pn="section-toc.1-1.13.2.1">
                <t indent="0" pn="section-toc.1-1.13.2.1.1"><xref derivedContent="13.1" format="counter" sectionFormat="of" target="section-13.1"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-normative-references">Normative References</xref></t>
              </li>
              <li pn="section-toc.1-1.13.2.2">
                <t indent="0" pn="section-toc.1-1.13.2.2.1"><xref derivedContent="13.2" format="counter" sectionFormat="of" target="section-13.2"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-informative-references">Informative References</xref></t>
              </li>
            </ul>
          </li>
          <li pn="section-toc.1-1.14">
            <t indent="0" pn="section-toc.1-1.14.1"><xref derivedContent="Appendix A" format="default" sectionFormat="of" target="section-appendix.a"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-complete-pseudocodes">Complete Pseudocodes</xref></t>
            <ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.14.2">
              <li pn="section-toc.1-1.14.2.1">
                <t indent="0" pn="section-toc.1-1.14.2.1.1"><xref derivedContent="A.1" format="counter" sectionFormat="of" target="section-appendix.a.1"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-end-with-next-csid-2">End with NEXT-CSID</xref></t>
              </li>
              <li pn="section-toc.1-1.14.2.2">
                <t indent="0" pn="section-toc.1-1.14.2.2.1"><xref derivedContent="A.2" format="counter" sectionFormat="of" target="section-appendix.a.2"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-endx-with-next-csid-2">End.X with NEXT-CSID</xref></t>
              </li>
              <li pn="section-toc.1-1.14.2.3">
                <t indent="0" pn="section-toc.1-1.14.2.3.1"><xref derivedContent="A.3" format="counter" sectionFormat="of" target="section-appendix.a.3"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-endt-with-next-csid-2">End.T with NEXT-CSID</xref></t>
              </li>
              <li pn="section-toc.1-1.14.2.4">
                <t indent="0" pn="section-toc.1-1.14.2.4.1"><xref derivedContent="A.4" format="counter" sectionFormat="of" target="section-appendix.a.4"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-endb6encaps-with-next-csid-2">End.B6.Encaps with NEXT-CSID</xref></t>
              </li>
              <li pn="section-toc.1-1.14.2.5">
                <t indent="0" pn="section-toc.1-1.14.2.5.1"><xref derivedContent="A.5" format="counter" sectionFormat="of" target="section-appendix.a.5"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-endbm-with-next-csid-2">End.BM with NEXT-CSID</xref></t>
              </li>
              <li pn="section-toc.1-1.14.2.6">
                <t indent="0" pn="section-toc.1-1.14.2.6.1"><xref derivedContent="A.6" format="counter" sectionFormat="of" target="section-appendix.a.6"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-end-with-replace-csid-2">End with REPLACE-CSID</xref></t>
              </li>
              <li pn="section-toc.1-1.14.2.7">
                <t indent="0" pn="section-toc.1-1.14.2.7.1"><xref derivedContent="A.7" format="counter" sectionFormat="of" target="section-appendix.a.7"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-endx-with-replace-csid-2">End.X with REPLACE-CSID</xref></t>
              </li>
              <li pn="section-toc.1-1.14.2.8">
                <t indent="0" pn="section-toc.1-1.14.2.8.1"><xref derivedContent="A.8" format="counter" sectionFormat="of" target="section-appendix.a.8"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-endt-with-replace-csid-2">End.T with REPLACE-CSID</xref></t>
              </li>
              <li pn="section-toc.1-1.14.2.9">
                <t indent="0" pn="section-toc.1-1.14.2.9.1"><xref derivedContent="A.9" format="counter" sectionFormat="of" target="section-appendix.a.9"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-endb6encaps-with-replace-csi">End.B6.Encaps with REPLACE-CSID</xref></t>
              </li>
              <li pn="section-toc.1-1.14.2.10">
                <t indent="0" pn="section-toc.1-1.14.2.10.1"><xref derivedContent="A.10" format="counter" sectionFormat="of" target="section-appendix.a.10"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-endbm-with-replace-csid-2">End.BM with REPLACE-CSID</xref></t>
              </li>
            </ul>
          </li>
          <li pn="section-toc.1-1.15">
            <t indent="0" pn="section-toc.1-1.15.1"><xref derivedContent="" format="none" sectionFormat="of" target="section-appendix.b"/><xref derivedContent="" format="title" sectionFormat="of" target="name-acknowledgements">Acknowledgements</xref></t>
          </li>
          <li pn="section-toc.1-1.16">
            <t indent="0" pn="section-toc.1-1.16.1"><xref derivedContent="" format="none" sectionFormat="of" target="section-appendix.c"/><xref derivedContent="" format="title" sectionFormat="of" target="name-contributors">Contributors</xref></t>
          </li>
          <li pn="section-toc.1-1.17">
            <t indent="0" pn="section-toc.1-1.17.1"><xref derivedContent="" format="none" sectionFormat="of" target="section-appendix.d"/><xref derivedContent="" format="title" sectionFormat="of" target="name-authors-addresses">Authors' Addresses</xref></t>
          </li>
        </ul>
      </section>
    </toc>
  </front>
  <middle>
    <section anchor="introduction" numbered="true" removeInRFC="false" toc="include" pn="section-1">
      <name slugifiedName="name-introduction">Introduction</name>
      <t indent="0" pn="section-1-1">The Segment Routing (SR) architecture <xref target="RFC8402" format="default" sectionFormat="of" derivedContent="RFC8402"/> describes two data plane instantiations of SR: SR over MPLS (SR-MPLS) and SR over IPv6 (SRv6).</t>
      <t indent="0" pn="section-1-2">SRv6 Network Programming <xref target="RFC8986" format="default" sectionFormat="of" derivedContent="RFC8986"/> builds upon the IPv6 Segment Routing Header (SRH) <xref target="RFC8754" format="default" sectionFormat="of" derivedContent="RFC8754"/> to define a framework for constructing a network program with topological and service segments.</t>
      <t indent="0" pn="section-1-3">Some SRv6 applications, such as strict path traffic engineering, may require long segment lists. Compressing the encoding of these long segment lists in the packet header can significantly reduce the header size. This document specifies new flavors to the SRv6 endpoint behaviors defined in <xref target="RFC8986" format="default" sectionFormat="of" derivedContent="RFC8986"/> that enable a compressed encoding of the SRv6 segment list.
This document also specifies new SRv6 endpoint behaviors to preserve the compression efficiency in multi-domain environments.</t>
      <t indent="0" pn="section-1-4">The SRv6 endpoint behaviors defined in this document leverage the SRv6 data plane defined in <xref target="RFC8754" format="default" sectionFormat="of" derivedContent="RFC8754"/> and <xref target="RFC8986" format="default" sectionFormat="of" derivedContent="RFC8986"/>; the behaviors are compatible with the SRv6 control plane extensions for IS-IS <xref target="RFC9352" format="default" sectionFormat="of" derivedContent="RFC9352"/>, OSPF <xref target="RFC9513" format="default" sectionFormat="of" derivedContent="RFC9513"/>, and BGP <xref target="RFC9252" format="default" sectionFormat="of" derivedContent="RFC9252"/>.</t>
      <t indent="0" pn="section-1-5">This document updates <xref target="RFC8754" format="default" sectionFormat="of" derivedContent="RFC8754"/> by allowing a Segment List entry in the SRH to be either an IPv6 address, as specified in <xref target="RFC8754" format="default" sectionFormat="of" derivedContent="RFC8754"/>, or a REPLACE-CSID container in packed format, as specified in <xref target="sec-replace" format="default" sectionFormat="of" derivedContent="Section 4.2"/>.</t>
    </section>
    <section anchor="terminology" numbered="true" removeInRFC="false" toc="include" pn="section-2">
      <name slugifiedName="name-terminology">Terminology</name>
      <t indent="0" pn="section-2-1">This document leverages the terms defined in <xref target="RFC8402" format="default" sectionFormat="of" derivedContent="RFC8402"/>, <xref target="RFC8754" format="default" sectionFormat="of" derivedContent="RFC8754"/>, and <xref target="RFC8986" format="default" sectionFormat="of" derivedContent="RFC8986"/>, in particular segment, segment list, Segment Identifier (SID), SID list, SR policy, prefix segment, adjacency segment, SRH, SR domain, SR source node, SR segment endpoint node, transit node, SRv6 endpoint behavior, flavor, SID block, locator, function, and argument. The reader is assumed to be familiar with this terminology.</t>
      <t indent="0" pn="section-2-2">This document introduces the following new terms:</t>
      <dl spacing="normal" newline="false" indent="3" pn="section-2-3">
        <dt pn="section-2-3.1">Locator-Block:</dt>
        <dd pn="section-2-3.2">The most significant bits of a SID locator
        that represent the SRv6 SID block. The Locator-Block is referred to as
        "B" in <xref target="RFC8986" sectionFormat="of" section="3.1" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8986#section-3.1" derivedContent="RFC8986"/>.</dd>
        <dt pn="section-2-3.3">Locator-Node:</dt>
        <dd pn="section-2-3.4">The least significant bits of a SID locator
        that identify the SR segment endpoint node instantiating the SID. The
        Locator-Node is referred to as "N" in <xref target="RFC8986" sectionFormat="of" section="3.1" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8986#section-3.1" derivedContent="RFC8986"/>.</dd>
        <dt pn="section-2-3.5">Compressed-SID (CSID):</dt>
        <dd pn="section-2-3.6">A compressed encoding of a SID. The
        CSID includes the Locator-Node and Function bits of the SID being
        compressed. If either constituent of the SID is empty (zero length),
        then the same applies to its CSID encoding.</dd>
        <dt pn="section-2-3.7">CSID container:</dt>
        <dd pn="section-2-3.8">A 128-bit IPv6 address that functions as a
        container holding a list of one or more CSIDs and the Argument (if
        any) of the last CSID.</dd>
        <dt pn="section-2-3.9">CSID sequence:</dt>
        <dd pn="section-2-3.10">A group of one or more consecutive SID list
        entries encoding the common Locator-Block and at least one CSID
        container.</dd>
        <dt pn="section-2-3.11">Compressed SID list:</dt>
        <dd pn="section-2-3.12">A segment list encoding that reduces
        the packet header length thanks to one or more CSID sequences. A
        compressed SID list also contains zero, one, or more uncompressed
        SIDs.</dd>
        <dt pn="section-2-3.13">Global Identifiers Block (GIB):</dt>
        <dd pn="section-2-3.14">The pool of CSID values
        available for global allocation.</dd>
        <dt pn="section-2-3.15">Local Identifiers Block (LIB):</dt>
        <dd pn="section-2-3.16">The pool of CSID values
        available for local allocation.</dd>
      </dl>
      <t indent="0" pn="section-2-4">In this document, the length of each constituent part of a SID is referred to as follows:</t>
      <ul spacing="normal" bare="false" empty="false" indent="3" pn="section-2-5">
        <li pn="section-2-5.1">
          <t indent="0" pn="section-2-5.1.1">LBL is the Locator-Block length of the SID.</t>
        </li>
        <li pn="section-2-5.2">
          <t indent="0" pn="section-2-5.2.1">LNL is the Locator-Node length of the SID.</t>
        </li>
        <li pn="section-2-5.3">
          <t indent="0" pn="section-2-5.3.1">FL is the Function length of the SID.</t>
        </li>
        <li pn="section-2-5.4">
          <t indent="0" pn="section-2-5.4.1">AL is the Argument length of the SID.</t>
        </li>
      </ul>
      <t indent="0" pn="section-2-6">In addition, the Locator-Node and Function length (LNFL) is the sum of the LNL and the FL of the SID. It is also referred to as the "CSID length".</t>
      <section anchor="requirements-language" numbered="true" removeInRFC="false" toc="include" pn="section-2.1">
        <name slugifiedName="name-requirements-language">Requirements Language</name>
        <t indent="0" pn="section-2.1-1">
    The key words "<bcp14>MUST</bcp14>", "<bcp14>MUST NOT</bcp14>", "<bcp14>REQUIRED</bcp14>", "<bcp14>SHALL</bcp14>", "<bcp14>SHALL NOT</bcp14>", "<bcp14>SHOULD</bcp14>", "<bcp14>SHOULD NOT</bcp14>", "<bcp14>RECOMMENDED</bcp14>", "<bcp14>NOT RECOMMENDED</bcp14>",
    "<bcp14>MAY</bcp14>", and "<bcp14>OPTIONAL</bcp14>" in this document are to be interpreted as
    described in BCP 14 <xref target="RFC2119" format="default" sectionFormat="of" derivedContent="RFC2119"/> <xref target="RFC8174" format="default" sectionFormat="of" derivedContent="RFC8174"/> 
    when, and only when, they appear in all capitals, as shown here.
        </t>
      </section>
    </section>
    <section anchor="basic-concepts" numbered="true" removeInRFC="false" toc="include" pn="section-3">
      <name slugifiedName="name-basic-concepts">Basic Concepts</name>
      <t indent="0" pn="section-3-1">In an SR domain, all SRv6 SIDs instantiated from the same Locator-Block share the same most significant bits. In addition, when the combined length of the SRv6 SID Locator, Function, and Argument is smaller than 128 bits, the least significant bits of the SID are padded with zeros.
The compressed segment list encoding seeks to decrease the packet header length by avoiding the repetition of the same Locator-Block and reducing the use of padding bits.</t>
      <t indent="0" pn="section-3-2">Building upon, and fully compatible with the mechanisms specified in <xref target="RFC8754" format="default" sectionFormat="of" derivedContent="RFC8754"/> and <xref target="RFC8986" format="default" sectionFormat="of" derivedContent="RFC8986"/>, the compressed segment list encoding leverages a SID list compression logic at the SR source node (see <xref target="sec-source-node" format="default" sectionFormat="of" derivedContent="Section 6"/>) in combination with new flavors of the SRv6 endpoint behaviors that process the compressed SID list (see <xref target="sec-endpoint" format="default" sectionFormat="of" derivedContent="Section 4"/>).</t>
      <t indent="0" pn="section-3-3">An SR source node constructs and compresses the SID list depending on the SIDs instantiated on each SR segment endpoint node that the packet is intended to traverse, as well as its own compression capabilities. The resulting compressed SID list is a combination of CSID sequences, for the SIDs that the SR source node was able to compress, and uncompressed SIDs, which could not be compressed. In case the SR source node is able to compress all the SIDs in the SID list, the compressed SID list comprises only CSID sequences (one or more) and no uncompressed SIDs. Conversely, the compressed SID list comprises only uncompressed SIDs when the SR source is unable to compress any of the constituent SIDs.</t>
    </section>
    <section anchor="sec-endpoint" numbered="true" removeInRFC="false" toc="include" pn="section-4">
      <name slugifiedName="name-sr-segment-endpoint-flavors">SR Segment Endpoint Flavors</name>
      <t indent="0" pn="section-4-1">This section defines two SR segment endpoint flavors: NEXT-CSID and REPLACE-CSID, for the End, End.X, End.T, End.B6.Encaps, End.B6.Encaps.Red, and End.BM behaviors of <xref target="RFC8986" format="default" sectionFormat="of" derivedContent="RFC8986"/>.</t>
      <t indent="0" pn="section-4-2">This section also defines a REPLACE-CSID flavor for the End.DX6, End.DX4, End.DT6, End.DT4, End.DT46, End.DX2, End.DX2V, End.DT2U, and End.DT2M behaviors of <xref target="RFC8986" format="default" sectionFormat="of" derivedContent="RFC8986"/>.
A counterpart NEXT-CSID flavor is not defined for these behaviors. Any SID can be the last element of a CSID sequence compressed using the NEXT-CSID flavor (see <xref target="sec-next" format="default" sectionFormat="of" derivedContent="Section 4.1"/>) and the aforementioned SRv6 endpoint behaviors are always in the last position in a SID list; thus, there is no need for any modification of the behaviors defined in <xref target="RFC8986" format="default" sectionFormat="of" derivedContent="RFC8986"/>.</t>
      <t indent="0" pn="section-4-3">Future documents may extend the applicability of the NEXT-CSID and REPLACE-CSID flavors to other SRv6 endpoint behaviors (see <xref target="sec-future" format="default" sectionFormat="of" derivedContent="Section 10"/>).</t>
      <t indent="0" pn="section-4-4">The use of these flavors, either individually or in combination, enables the compressed segment list encoding.</t>
      <t indent="0" pn="section-4-5">The NEXT-CSID flavor and the REPLACE-CSID flavor both leverage the SID Argument to determine the next SID to be processed, but employ different SID list compression schemes.
With the NEXT-CSID flavor, each CSID container is a fully formed SRv6 SID with the common Locator-Block for all the CSIDs in the CSID container, a Locator-Node and Function that are those of the first CSID, and an Argument carrying the subsequent CSIDs.
With the REPLACE-CSID flavor, only the first element in a CSID sequence is a fully formed SRv6 SID. It has the common Locator-Block for all the CSIDs in the CSID sequence, and a Locator-Node and Function that are those of the first CSID. The remaining elements in the CSID sequence are CSID containers carrying the subsequent CSIDs without the Locator-Block.</t>
      <t indent="0" pn="section-4-6">Regardless of which flavor is used, the IPv6 address carried in the Destination Address field of the IPv6 header is a valid SRv6 SID conforming to <xref target="RFC9602" format="default" sectionFormat="of" derivedContent="RFC9602"/>.</t>
      <t indent="0" pn="section-4-7">In the remainder of this document, the term "a SID of this document" refers to any End, End.X, End.T, End.B6.Encaps, End.B6.Encaps.Red, or End.BM SID with the NEXT-CSID or the REPLACE-CSID flavor and with any combination of Penultimate Segment Pop (PSP), Ultimate Segment Pop (USP), and Ultimate Segment Decapsulation (USD) flavor, or any End.DX6, End.DX4, End.DT6, End.DT4, End.DT46, End.DX2, End.DX2V, End.DT2U, or End.DT2M with the REPLACE-CSID flavor. All the SRv6 endpoint behaviors introduced in this document are listed in <xref target="tbl-iana-endpoint-behaviors" format="default" sectionFormat="of" derivedContent="Table 1"/>.</t>
      <t indent="0" pn="section-4-8">In the remainder of this document, the terms "NEXT-CSID flavor SID" and "REPLACE-CSID flavor SID" refer to any SID of this document with the NEXT-CSID flavor and with the REPLACE-CSID flavor, respectively.</t>
      <section anchor="sec-next" numbered="true" removeInRFC="false" toc="include" pn="section-4.1">
        <name slugifiedName="name-next-csid-flavor">NEXT-CSID Flavor</name>
        <t indent="0" pn="section-4.1-1">A CSID sequence compressed using the mechanism of the NEXT-CSID flavor comprises one or more CSID containers. Each CSID container is a fully formed 128-bit SID structured as shown in <xref target="fig-next-struct" format="default" sectionFormat="of" derivedContent="Figure 1"/>. It carries a Locator-Block followed by a series of CSIDs. The Locator-Node and Function of the CSID container are those of the first CSID, and its Argument is the contiguous series of subsequent CSIDs. The second CSID is encoded in the most significant bits of the CSID container Argument.  The third CSID is encoded in the bits of the Argument that immediately follow the second CSID, and so on. When all CSIDs have the same length, a CSID container can carry up to K CSIDs, where K is computed as floor((128-LBL)/LNFL) (floor(x) is the greatest integer less than or equal to x <xref target="GKP94" format="default" sectionFormat="of" derivedContent="GKP94"/>). Each CSID container for NEXT-CSID is independent, such that contiguous CSID containers in a CSID sequence can be considered to be separate CSID sequences.</t>
        <t indent="0" pn="section-4.1-2">When a CSID sequence compressed using the NEXT-CSID flavor comprises at least two CSIDs, the last CSID in the sequence is not required to have the NEXT-CSID flavor. It can be bound to any SRv6 endpoint behavior, including <xref target="RFC8986" format="default" sectionFormat="of" derivedContent="RFC8986"/> behaviors and REPLACE-CSID flavor, as long as the updated Destination Address resulting from the processing of the previous CSID in the sequence is a valid form for that last SID. Line S12 of the first pseudocode in <xref target="sec-source-compression" format="default" sectionFormat="of" derivedContent="Section 6.2"/> provides sufficient conditions to ensure this property.</t>
        <figure anchor="fig-next-struct" align="left" suppress-title="false" pn="figure-1">
          <name slugifiedName="name-structure-of-a-next-csid-fl">Structure of a NEXT-CSID Flavor SID (Scaled for a 48-Bit Locator‑Block, 16-Bit Combined Locator-Node and Function, and 64-Bit Argument)</name>
          <artset pn="section-4.1-3.1">
            <artwork type="svg" align="left" pn="section-4.1-3.1.1"><svg xmlns="http://www.w3.org/2000/svg" version="1.1" height="128" width="552" viewBox="0 0 552 128" class="diagram" text-anchor="middle" font-family="monospace" font-size="13px" stroke-linecap="round">
                <path d="M 8,32 L 8,80" fill="none" stroke="black"/>
                <path d="M 208,40 L 208,72" fill="none" stroke="black"/>
                <path d="M 280,40 L 280,72" fill="none" stroke="black"/>
                <path d="M 544,32 L 544,80" fill="none" stroke="black"/>
                <path d="M 8,32 L 544,32" fill="none" stroke="black"/>
                <path d="M 8,80 L 544,80" fill="none" stroke="black"/>
                <path d="M 16,96 L 200,96" fill="none" stroke="black"/>
                <path d="M 216,96 L 272,96" fill="none" stroke="black"/>
                <path d="M 288,96 L 536,96" fill="none" stroke="black"/>
                <polygon class="arrowhead" points="544,96 532,90.4 532,101.6" fill="black" transform="rotate(0,536,96)"/>
                <polygon class="arrowhead" points="296,96 284,90.4 284,101.6" fill="black" transform="rotate(180,288,96)"/>
                <polygon class="arrowhead" points="280,96 268,90.4 268,101.6" fill="black" transform="rotate(0,272,96)"/>
                <polygon class="arrowhead" points="224,96 212,90.4 212,101.6" fill="black" transform="rotate(180,216,96)"/>
                <polygon class="arrowhead" points="208,96 196,90.4 196,101.6" fill="black" transform="rotate(0,200,96)"/>
                <polygon class="arrowhead" points="24,96 12,90.4 12,101.6" fill="black" transform="rotate(180,16,96)"/>
                <g class="text">
                  <text x="104" y="52">Locator-Block</text>
                  <text x="244" y="52">Loc-Node</text>
                  <text x="412" y="52">Argument</text>
                  <text x="244" y="68">Function</text>
                  <text x="104" y="116">LBL</text>
                  <text x="244" y="116">LNFL</text>
                  <text x="412" y="116">AL</text>
                </g>
              </svg>
            </artwork>
            <artwork type="ascii-art" align="left" pn="section-4.1-3.1.2">
+------------------------------------------------------------------+
|     Locator-Block      |Loc-Node|            Argument            |
|                        |Function|                                |
+------------------------------------------------------------------+
 &lt;----------------------&gt; &lt;------&gt; &lt;------------------------------&gt;
           LBL              LNFL                  AL
</artwork>
          </artset>
        </figure>
        <t indent="0" pn="section-4.1-4"><xref target="fig-next-csid-list" format="default" sectionFormat="of" derivedContent="Figure 2"/> illustrates a compressed SID list as could be produced by an SR source node steering a packet into an SR policy with a SID list of eight NEXT-CSID flavor SIDs. All SIDs in this example have a 48-bit Locator-Block, 16-bit combined Locator-Node and Function, and 64-bit Argument. The SR source node compresses the SR policy SID list as a compressed SID list of two CSID containers. The first CSID container carries a Locator-Block and the first five CSIDs. The second CSID container carries a Locator-Block and the sixth, seventh, and eighth CSIDs. Since the SR source node does not use the second CSID container at full capacity, it sets the 32 least significant bits to zero. The SR source node sets the IPv6 Destination Address (DA) with the value of the first CSID container and the first element of the SRH Segment List with the value of the second CSID container. Without reduced SRH (see <xref target="RFC8754" sectionFormat="of" section="4.1.1" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8754#section-4.1.1" derivedContent="RFC8754"/>), the SR source node also writes the first CSID container as the second element of the SRH Segment List.</t>
        <t indent="0" pn="section-4.1-5">Note that the CSIDs within a given CSID container appear in forward order to leverage the longest-prefix match IP forwarding, while the entries in the SRH Segment List appear in reversed order of their processing, as specified in <xref target="RFC8754" sectionFormat="of" section="4.1" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8754#section-4.1" derivedContent="RFC8754"/>.</t>
        <figure anchor="fig-next-csid-list" align="left" suppress-title="false" pn="figure-2">
          <name slugifiedName="name-compressed-sid-list-of-eigh">Compressed SID List of Eight NEXT-CSID Flavor SIDs with a 48-Bit Locator‑Block, 16-Bit Combined Locator-Node and Function, and 64-Bit Argument</name>
          <artset pn="section-4.1-6.1">
            <artwork type="svg" align="left" pn="section-4.1-6.1.1"><svg xmlns="http://www.w3.org/2000/svg" version="1.1" height="432" width="528" viewBox="0 0 528 432" class="diagram" text-anchor="middle" font-family="monospace" font-size="13px" stroke-linecap="round">
                <path d="M 8,64 L 8,192" fill="none" stroke="black"/>
                <path d="M 8,272 L 8,400" fill="none" stroke="black"/>
                <path d="M 264,96 L 264,192" fill="none" stroke="black"/>
                <path d="M 264,304 L 264,368" fill="none" stroke="black"/>
                <path d="M 520,64 L 520,192" fill="none" stroke="black"/>
                <path d="M 520,272 L 520,400" fill="none" stroke="black"/>
                <path d="M 8,64 L 520,64" fill="none" stroke="black"/>
                <path d="M 264,96 L 520,96" fill="none" stroke="black"/>
                <path d="M 8,128 L 520,128" fill="none" stroke="black"/>
                <path d="M 8,160 L 520,160" fill="none" stroke="black"/>
                <path d="M 8,192 L 520,192" fill="none" stroke="black"/>
                <path d="M 8,272 L 520,272" fill="none" stroke="black"/>
                <path d="M 264,304 L 520,304" fill="none" stroke="black"/>
                <path d="M 8,336 L 520,336" fill="none" stroke="black"/>
                <path d="M 8,368 L 520,368" fill="none" stroke="black"/>
                <path d="M 8,400 L 520,400" fill="none" stroke="black"/>
                <g class="text">
                  <text x="16" y="36">0</text>
                  <text x="176" y="36">1</text>
                  <text x="336" y="36">2</text>
                  <text x="496" y="36">3</text>
                  <text x="16" y="52">0</text>
                  <text x="32" y="52">1</text>
                  <text x="48" y="52">2</text>
                  <text x="64" y="52">3</text>
                  <text x="80" y="52">4</text>
                  <text x="96" y="52">5</text>
                  <text x="112" y="52">6</text>
                  <text x="128" y="52">7</text>
                  <text x="144" y="52">8</text>
                  <text x="160" y="52">9</text>
                  <text x="176" y="52">0</text>
                  <text x="192" y="52">1</text>
                  <text x="208" y="52">2</text>
                  <text x="224" y="52">3</text>
                  <text x="240" y="52">4</text>
                  <text x="256" y="52">5</text>
                  <text x="272" y="52">6</text>
                  <text x="288" y="52">7</text>
                  <text x="304" y="52">8</text>
                  <text x="320" y="52">9</text>
                  <text x="336" y="52">0</text>
                  <text x="352" y="52">1</text>
                  <text x="368" y="52">2</text>
                  <text x="384" y="52">3</text>
                  <text x="400" y="52">4</text>
                  <text x="416" y="52">5</text>
                  <text x="432" y="52">6</text>
                  <text x="448" y="52">7</text>
                  <text x="464" y="52">8</text>
                  <text x="480" y="52">9</text>
                  <text x="496" y="52">0</text>
                  <text x="512" y="52">1</text>
                  <text x="136" y="100">Locator-Block</text>
                  <text x="368" y="116">1st</text>
                  <text x="404" y="116">CSID</text>
                  <text x="112" y="148">2nd</text>
                  <text x="148" y="148">CSID</text>
                  <text x="368" y="148">3rd</text>
                  <text x="404" y="148">CSID</text>
                  <text x="112" y="180">4th</text>
                  <text x="148" y="180">CSID</text>
                  <text x="368" y="180">5th</text>
                  <text x="404" y="180">CSID</text>
                  <text x="200" y="212">First</text>
                  <text x="244" y="212">CSID</text>
                  <text x="304" y="212">container</text>
                  <text x="16" y="244">0</text>
                  <text x="176" y="244">1</text>
                  <text x="336" y="244">2</text>
                  <text x="496" y="244">3</text>
                  <text x="16" y="260">0</text>
                  <text x="32" y="260">1</text>
                  <text x="48" y="260">2</text>
                  <text x="64" y="260">3</text>
                  <text x="80" y="260">4</text>
                  <text x="96" y="260">5</text>
                  <text x="112" y="260">6</text>
                  <text x="128" y="260">7</text>
                  <text x="144" y="260">8</text>
                  <text x="160" y="260">9</text>
                  <text x="176" y="260">0</text>
                  <text x="192" y="260">1</text>
                  <text x="208" y="260">2</text>
                  <text x="224" y="260">3</text>
                  <text x="240" y="260">4</text>
                  <text x="256" y="260">5</text>
                  <text x="272" y="260">6</text>
                  <text x="288" y="260">7</text>
                  <text x="304" y="260">8</text>
                  <text x="320" y="260">9</text>
                  <text x="336" y="260">0</text>
                  <text x="352" y="260">1</text>
                  <text x="368" y="260">2</text>
                  <text x="384" y="260">3</text>
                  <text x="400" y="260">4</text>
                  <text x="416" y="260">5</text>
                  <text x="432" y="260">6</text>
                  <text x="448" y="260">7</text>
                  <text x="464" y="260">8</text>
                  <text x="480" y="260">9</text>
                  <text x="496" y="260">0</text>
                  <text x="512" y="260">1</text>
                  <text x="136" y="308">Locator-Block</text>
                  <text x="368" y="324">6th</text>
                  <text x="404" y="324">CSID</text>
                  <text x="112" y="356">7th</text>
                  <text x="148" y="356">CSID</text>
                  <text x="368" y="356">8th</text>
                  <text x="404" y="356">CSID</text>
                  <text x="264" y="388">0</text>
                  <text x="204" y="420">Second</text>
                  <text x="252" y="420">CSID</text>
                  <text x="312" y="420">container</text>
                </g>
              </svg>
            </artwork>
            <artwork type="ascii-art" align="left" pn="section-4.1-6.1.2">
 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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
+         Locator-Block         +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                               |           1st CSID            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|           2nd CSID            |           3rd CSID            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|           4th CSID            |           5th CSID            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
                      First CSID Container

 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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
+         Locator-Block         +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                               |           6th CSID            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|           7th CSID            |           8th CSID            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                               0                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
                      Second CSID Container
</artwork>
          </artset>
        </figure>
        <t indent="0" pn="section-4.1-7">An implementation <bcp14>MUST</bcp14> support a 32-bit LBL and a 16-bit CSID length (LNFL) for NEXT-CSID flavor SIDs, and it <bcp14>MAY</bcp14> support any additional Locator-Block and CSID length.</t>
        <t indent="0" pn="section-4.1-8">The AL for NEXT-CSID flavor SIDs is equal to 128-LBL-LNFL.</t>
        <t indent="0" pn="section-4.1-9">When processing an IPv6 packet that matches a Forwarding Information Base (FIB) entry locally instantiated as a SID with the NEXT-CSID flavor, the SR segment endpoint node applies the procedure specified in the following subsection that corresponds to the SID behavior. If the SID also has the PSP, USP, or USD flavor, the procedure is modified as described in <xref target="sec-next-flavors" format="default" sectionFormat="of" derivedContent="Section 4.1.7"/>.</t>
        <t indent="0" pn="section-4.1-10">An SR segment endpoint node instantiating a SID of this document with the NEXT-CSID flavor <bcp14>MUST</bcp14> accept any Argument value for that SID.</t>
        <t indent="0" pn="section-4.1-11">At a high level, for any SID with the NEXT-CSID flavor, the SR segment endpoint node determines the next SID of the SID list as follows. If the Argument value of the active SID is non-zero, the SR segment endpoint node constructs the next SID from the active SID by copying the entire SID Argument value to the bits that immediately follow the Locator-Block, thus overwriting the active SID Locator-Node and Function with those of the next CSID, and filling the least significant LNFL bits of the Argument with zeros. Otherwise (if the Argument value is 0), the SR segment endpoint node copies the next 128-bit Segment List entry from the SRH to the Destination Address field of the IPv6 header.</t>
        <section anchor="sec-next-end" numbered="true" removeInRFC="false" toc="include" pn="section-4.1.1">
          <name slugifiedName="name-end-with-next-csid">End with NEXT-CSID</name>
          <t indent="0" pn="section-4.1.1-1">When processing an IPv6 packet that matches a FIB entry locally instantiated as an End SID with the NEXT-CSID flavor, the procedure described in <xref target="RFC8986" sectionFormat="of" section="4.1" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8986#section-4.1" derivedContent="RFC8986"/> is executed with the following modifications.</t>
          <t indent="0" pn="section-4.1.1-2">The below pseudocode is inserted between lines S01 and S02 of the SRH processing in <xref target="RFC8986" sectionFormat="of" section="4.1" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8986#section-4.1" derivedContent="RFC8986"/>.  In addition, this pseudocode is executed before processing the first
header in the IPv6 extension header chain that is not an SRH, a Hop-by-Hop header, or a Destination Options header.  If the IPv6
extension header chain does not include any header matching this
criterion, this pseudocode is executed before processing the upper-layer header.</t>
          <sourcecode type="pseudocode" markers="false" pn="section-4.1.1-3">
N01. If (DA.Argument != 0) {
N02.   If (IPv6 Hop Limit &lt;= 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.   Submit the packet to the egress IPv6 FIB lookup for
         transmission to the next destination.
N09. }
</sourcecode>
          <aside pn="section-4.1.1-4">
            <t indent="0" pn="section-4.1.1-4.1">Notes:</t>
            <ul spacing="normal" bare="false" empty="false" indent="3" pn="section-4.1.1-4.2">
              <li pn="section-4.1.1-4.2.1">
                <t indent="0" pn="section-4.1.1-4.2.1.1"><tt>DA.Argument</tt> identifies the value contained in the bits <tt>[(LBL+LNFL)..127]</tt> in the Destination Address of the IPv6 header.</t>
              </li>
              <li pn="section-4.1.1-4.2.2">
                <t indent="0" pn="section-4.1.1-4.2.2.1">The value in the Segments Left field of the SRH is not modified when <tt>DA.Argument</tt> in the received packet has a non-zero value.</t>
              </li>
            </ul>
          </aside>
          <t indent="0" pn="section-4.1.1-5">A rendering of the complete pseudocode is provided in <xref target="sec-next-end-complete" format="default" sectionFormat="of" derivedContent="Appendix A.1"/>.</t>
        </section>
        <section anchor="sec-next-endx" numbered="true" removeInRFC="false" toc="include" pn="section-4.1.2">
          <name slugifiedName="name-endx-with-next-csid">End.X with NEXT-CSID</name>
          <t indent="0" pn="section-4.1.2-1">When processing an IPv6 packet that matches a FIB entry locally instantiated as an End.X SID with the NEXT-CSID flavor, the procedure described in <xref target="RFC8986" sectionFormat="of" section="4.2" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8986#section-4.2" derivedContent="RFC8986"/> is executed with the following modifications.</t>
          <t indent="0" pn="section-4.1.2-2">The pseudocode in <xref target="sec-next-end" format="default" sectionFormat="of" derivedContent="Section 4.1.1"/> of this document is modified by replacing line N08 as shown below.</t>
          <sourcecode type="pseudocode" markers="false" pn="section-4.1.2-3">
N08.   Submit the packet to the IPv6 module for transmission to the
         new destination via a member of J.
</sourcecode>
          <aside pn="section-4.1.2-4">
            <t indent="0" pn="section-4.1.2-4.1">Note: the variable J is defined in <xref target="RFC8986" sectionFormat="of" section="4.2" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8986#section-4.2" derivedContent="RFC8986"/>.</t>
          </aside>
          <t indent="0" pn="section-4.1.2-5">The resulting pseudocode is inserted between lines S01 and S02 of the SRH processing in <xref target="RFC8986" sectionFormat="of" section="4.1" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8986#section-4.1" derivedContent="RFC8986"/> after applying the modification described in <xref target="RFC8986" sectionFormat="of" section="4.2" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8986#section-4.2" derivedContent="RFC8986"/>. In addition, this pseudocode is executed before processing the first
header in the IPv6 extension header chain that is not an SRH, a Hop-by-Hop header, or a Destination Options header. If the IPv6
extension header chain does not include any header matching this
criterion, this pseudocode is executed before processing the upper-layer header.</t>
          <t indent="0" pn="section-4.1.2-6">A rendering of the complete pseudocode is provided in <xref target="sec-next-endx-complete" format="default" sectionFormat="of" derivedContent="Appendix A.2"/>.</t>
        </section>
        <section anchor="sec-next-endt" numbered="true" removeInRFC="false" toc="include" pn="section-4.1.3">
          <name slugifiedName="name-endt-with-next-csid">End.T with NEXT-CSID</name>
          <t indent="0" pn="section-4.1.3-1">When processing an IPv6 packet that matches a FIB entry locally instantiated as an End.T SID with the NEXT-CSID flavor, the procedure described in <xref target="RFC8986" sectionFormat="of" section="4.3" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8986#section-4.3" derivedContent="RFC8986"/> is executed with the following modifications.</t>
          <t indent="0" pn="section-4.1.3-2">The pseudocode in <xref target="sec-next-end" format="default" sectionFormat="of" derivedContent="Section 4.1.1"/> of this document is modified by replacing line N08 as shown below.</t>
          <sourcecode type="pseudocode" markers="false" pn="section-4.1.3-3">
N08.1.   Set the packet's associated FIB table to T.
N08.2.   Submit the packet to the egress IPv6 FIB lookup for
           transmission to the new destination.
</sourcecode>
          <aside pn="section-4.1.3-4">
            <t indent="0" pn="section-4.1.3-4.1">Note: the variable T is defined in <xref target="RFC8986" sectionFormat="of" section="4.3" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8986#section-4.3" derivedContent="RFC8986"/>.</t>
          </aside>
          <t indent="0" pn="section-4.1.3-5">The resulting pseudocode is inserted between lines S01 and S02 of the SRH processing in <xref target="RFC8986" sectionFormat="of" section="4.1" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8986#section-4.1" derivedContent="RFC8986"/> after applying the modification described in <xref target="RFC8986" sectionFormat="of" section="4.3" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8986#section-4.3" derivedContent="RFC8986"/>.  In addition, this pseudocode is executed before processing the first
header in the IPv6 extension header chain that is not an SRH, a Hop-by-Hop header, or a Destination Options header. If the IPv6
extension header chain does not include any header matching this
criterion, this pseudocode is executed before processing the upper-layer header.</t>
          <t indent="0" pn="section-4.1.3-6">A rendering of the complete pseudocode is provided in <xref target="sec-next-endt-complete" format="default" sectionFormat="of" derivedContent="Appendix A.3"/>.</t>
        </section>
        <section anchor="sec-next-endb6" numbered="true" removeInRFC="false" toc="include" pn="section-4.1.4">
          <name slugifiedName="name-endb6encaps-with-next-csid">End.B6.Encaps with NEXT-CSID</name>
          <t indent="0" pn="section-4.1.4-1">When processing an IPv6 packet that matches a FIB entry locally instantiated as an End.B6.Encaps SID with the NEXT-CSID flavor, the procedure described in <xref target="RFC8986" sectionFormat="of" section="4.13" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8986#section-4.13" derivedContent="RFC8986"/> is executed with the following modifications.</t>
          <t indent="0" pn="section-4.1.4-2">The pseudocode in <xref target="sec-next-end" format="default" sectionFormat="of" derivedContent="Section 4.1.1"/> of this document is modified by replacing line N08 as shown below.</t>
          <sourcecode type="pseudocode" markers="false" pn="section-4.1.4-3">
N08.1.   Push a new IPv6 header with its own SRH containing B.
N08.2.   Set the outer IPv6 SA to A.
N08.3.   Set the outer IPv6 DA to the first SID of B.
N08.4.   Set the outer Payload Length, Traffic Class, Flow Label,
           Hop Limit, and Next Header fields.
N08.5.   Submit the packet to the egress IPv6 FIB lookup for
           transmission to the next destination.
</sourcecode>
          <aside pn="section-4.1.4-4">
            <t indent="0" pn="section-4.1.4-4.1">Note: the variables A and B, as well as the values of the Payload Length, Traffic Class, Flow Label, Hop Limit, and Next Header are defined in <xref target="RFC8986" sectionFormat="of" section="4.13" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8986#section-4.13" derivedContent="RFC8986"/>.</t>
          </aside>
          <t indent="0" pn="section-4.1.4-5">The resulting pseudocode is inserted between lines S01 and S02 of the SRH processing in <xref target="RFC8986" sectionFormat="of" section="4.13" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8986#section-4.13" derivedContent="RFC8986"/>.  In addition, this pseudocode is executed before processing the first
header in the IPv6 extension header chain that is not an SRH, a Hop-by-Hop header, or a Destination Options header. If the IPv6
extension header chain does not include any header matching this
criterion, this pseudocode is executed before processing the upper-layer header.</t>
          <t indent="0" pn="section-4.1.4-6">A rendering of the complete pseudocode is provided in <xref target="sec-next-endb6-complete" format="default" sectionFormat="of" derivedContent="Appendix A.4"/>.</t>
          <t indent="0" pn="section-4.1.4-7">Similar to the base End.B6.Encaps SID defined in <xref target="RFC8986" sectionFormat="of" section="4.13" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8986#section-4.13" derivedContent="RFC8986"/>, the NEXT-CSID flavor variant updates the Destination Address field of the inner IPv6 header to the next SID in the original segment list before encapsulating the packet with the segment list of SR Policy B. At the endpoint of SR Policy B, the encapsulation is removed and the inner packet is forwarded towards the exposed Destination Address, which already contains the next SID in the original segment list.</t>
        </section>
        <section anchor="sec-next-endb6red" numbered="true" removeInRFC="false" toc="include" pn="section-4.1.5">
          <name slugifiedName="name-endb6encapsred-with-next-cs">End.B6.Encaps.Red with NEXT-CSID</name>
          <t indent="0" pn="section-4.1.5-1">This is an optimization of the End.B6.Encaps with NEXT-CSID behavior.</t>
          <t indent="0" pn="section-4.1.5-2">When processing an IPv6 packet that matches a FIB entry locally instantiated as an End.B6.Encaps.Red SID with the NEXT-CSID flavor, the procedure described in <xref target="sec-next-endb6" format="default" sectionFormat="of" derivedContent="Section 4.1.4"/> of this document is executed with the modifications in <xref target="RFC8986" sectionFormat="of" section="4.14" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8986#section-4.14" derivedContent="RFC8986"/>.</t>
        </section>
        <section anchor="sec-next-endbm" numbered="true" removeInRFC="false" toc="include" pn="section-4.1.6">
          <name slugifiedName="name-endbm-with-next-csid">End.BM with NEXT-CSID</name>
          <t indent="0" pn="section-4.1.6-1">When processing an IPv6 packet that matches a FIB entry locally instantiated as an End.BM SID with the NEXT-CSID flavor, the procedure described in <xref target="RFC8986" sectionFormat="of" section="4.15" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8986#section-4.15" derivedContent="RFC8986"/> is executed with the following modifications.</t>
          <t indent="0" pn="section-4.1.6-2">The pseudocode in <xref target="sec-next-end" format="default" sectionFormat="of" derivedContent="Section 4.1.1"/> of this document is modified by replacing line N08 as shown below.</t>
          <sourcecode type="pseudocode" markers="false" pn="section-4.1.6-3">
N08.1.   Push the MPLS label stack for B.
N08.2.   Submit the packet to the MPLS engine for transmission.
</sourcecode>
          <aside pn="section-4.1.6-4">
            <t indent="0" pn="section-4.1.6-4.1">Note: the variable B is defined in <xref target="RFC8986" sectionFormat="of" section="4.15" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8986#section-4.15" derivedContent="RFC8986"/>.</t>
          </aside>
          <t indent="0" pn="section-4.1.6-5">The resulting pseudocode is inserted between lines S01 and S02 of the SRH processing in <xref target="RFC8986" sectionFormat="of" section="4.15" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8986#section-4.15" derivedContent="RFC8986"/>. In addition, this pseudocode is executed before processing the first
header in the IPv6 extension header chain that is not an SRH, a Hop-by-Hop header, or a Destination Options header. If the IPv6
extension header chain does not include any header matching this
criterion, this pseudocode is executed before processing the upper-layer header.</t>
          <t indent="0" pn="section-4.1.6-6">A rendering of the complete pseudocode is provided in <xref target="sec-next-endbm-complete" format="default" sectionFormat="of" derivedContent="Appendix A.5"/>.</t>
        </section>
        <section anchor="sec-next-flavors" numbered="true" removeInRFC="false" toc="include" pn="section-4.1.7">
          <name slugifiedName="name-combination-with-psp-usp-an">Combination with PSP, USP, and USD Flavors</name>
          <dl spacing="normal" newline="false" indent="3" pn="section-4.1.7-1">
            <dt pn="section-4.1.7-1.1">PSP:</dt>
            <dd pn="section-4.1.7-1.2">The PSP flavor defined in <xref target="RFC8986" sectionFormat="of" section="4.16.1" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8986#section-4.16.1" derivedContent="RFC8986"/> is unchanged when combined
            with the NEXT-CSID flavor.</dd>
            <dt pn="section-4.1.7-1.3">USP:</dt>
            <dd pn="section-4.1.7-1.4">The USP flavor defined in <xref target="RFC8986" sectionFormat="of" section="4.16.2" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8986#section-4.16.2" derivedContent="RFC8986"/> is unchanged when combined
            with the NEXT-CSID flavor.</dd>
            <dt pn="section-4.1.7-1.5">USD:</dt>
            <dd pn="section-4.1.7-1.6">The USD flavor defined in <xref target="RFC8986" sectionFormat="of" section="4.16.3" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8986#section-4.16.3" derivedContent="RFC8986"/> is unchanged when combined
            with the NEXT-CSID flavor.</dd>
          </dl>
        </section>
      </section>
      <section anchor="sec-replace" numbered="true" removeInRFC="false" toc="include" pn="section-4.2">
        <name slugifiedName="name-replace-csid-flavor">REPLACE-CSID Flavor</name>
        <t indent="0" pn="section-4.2-1">A CSID sequence compressed using the mechanism of the REPLACE-CSID flavor starts with a CSID container in fully formed 128-bit SID format. The Locator-Block of this SID is the common Locator-Block for all the CSIDs in the CSID sequence, its Locator-Node and Function are those of the first CSID, and its Argument carries the index of the current CSID in the current CSID container. The Argument value is initially 0. When more segments are present in the segment list, the CSID sequence continues with one or more CSID containers in packed format carrying the series of subsequent CSIDs. Each container in packed format is a 128-bit Segment List entry split into K "positions" of LNFL bits, where K is computed as floor(128/LNFL). If LNFL does not divide into 128 perfectly, a zero pad is added in the least significant bits of the CSID container to fill the bits left over. The second CSID in the CSID sequence is encoded in the least significant bit position of the first CSID container in packed format (position K-1), the third CSID is encoded in position K-2, and so on.</t>
        <t indent="0" pn="section-4.2-2">The last CSID in the CSID sequence is not required to have the REPLACE-CSID flavor. It can be bound to any SRv6 endpoint behavior, including the behaviors described in <xref target="RFC8986" format="default" sectionFormat="of" derivedContent="RFC8986"/> and NEXT-CSID flavor, as long as it meets the conditions defined in <xref target="sec-source-node" format="default" sectionFormat="of" derivedContent="Section 6"/>.</t>
        <t indent="0" pn="section-4.2-3">The structure of a SID with the REPLACE-CSID flavor is shown in <xref target="fig-replace-struct" format="default" sectionFormat="of" derivedContent="Figure 3"/>. The same structure is also that of the CSID container for REPLACE-CSID in fully formed 128-bit SID format.</t>
        <figure anchor="fig-replace-struct" align="left" suppress-title="false" pn="figure-3">
          <name slugifiedName="name-structure-of-a-replace-csid">Structure of a REPLACE-CSID Flavor SID (Scaled for a 48-Bit Locator‑Block, 32-Bit Combined Locator-Node and Function, and 48-Bit Argument)</name>
          <artset pn="section-4.2-4.1">
            <artwork type="svg" align="left" pn="section-4.2-4.1.1"><svg xmlns="http://www.w3.org/2000/svg" version="1.1" height="128" width="560" viewBox="0 0 560 128" class="diagram" text-anchor="middle" font-family="monospace" font-size="13px" stroke-linecap="round">
                <path d="M 8,32 L 8,80" fill="none" stroke="black"/>
                <path d="M 208,40 L 208,72" fill="none" stroke="black"/>
                <path d="M 344,40 L 344,72" fill="none" stroke="black"/>
                <path d="M 552,32 L 552,80" fill="none" stroke="black"/>
                <path d="M 8,32 L 552,32" fill="none" stroke="black"/>
                <path d="M 8,80 L 552,80" fill="none" stroke="black"/>
                <path d="M 16,96 L 200,96" fill="none" stroke="black"/>
                <path d="M 216,96 L 336,96" fill="none" stroke="black"/>
                <path d="M 352,96 L 544,96" fill="none" stroke="black"/>
                <polygon class="arrowhead" points="552,96 540,90.4 540,101.6" fill="black" transform="rotate(0,544,96)"/>
                <polygon class="arrowhead" points="360,96 348,90.4 348,101.6" fill="black" transform="rotate(180,352,96)"/>
                <polygon class="arrowhead" points="344,96 332,90.4 332,101.6" fill="black" transform="rotate(0,336,96)"/>
                <polygon class="arrowhead" points="224,96 212,90.4 212,101.6" fill="black" transform="rotate(180,216,96)"/>
                <polygon class="arrowhead" points="208,96 196,90.4 196,101.6" fill="black" transform="rotate(0,200,96)"/>
                <polygon class="arrowhead" points="24,96 12,90.4 12,101.6" fill="black" transform="rotate(180,16,96)"/>
                <g class="text">
                  <text x="104" y="52">Locator-Block</text>
                  <text x="276" y="52">Locator-Node</text>
                  <text x="444" y="52">Argument</text>
                  <text x="240" y="68">+</text>
                  <text x="284" y="68">Function</text>
                  <text x="104" y="116">LBL</text>
                  <text x="276" y="116">LNFL</text>
                  <text x="444" y="116">AL</text>
                </g>
              </svg>
            </artwork>
            <artwork type="ascii-art" align="left" pn="section-4.2-4.1.2">
+-------------------------------------------------------------------+
|     Locator-Block      |  Locator-Node  |        Argument         |
|                        |   + Function   |                         |
+-------------------------------------------------------------------+
 &lt;----------------------&gt; &lt;--------------&gt; &lt;-----------------------&gt;
           LBL                  LNFL                  AL
</artwork>
          </artset>
        </figure>
        <t indent="0" pn="section-4.2-5">The structure of a CSID container for REPLACE-CSID in packed format is shown in <xref target="fig-replace-container" format="default" sectionFormat="of" derivedContent="Figure 4"/>.</t>
        <figure anchor="fig-replace-container" align="left" suppress-title="false" pn="figure-4">
          <name slugifiedName="name-structure-of-a-csid-contain">Structure of a CSID Container for REPLACE-CSID Using a 32-Bit CSID Length (K = 4)</name>
          <artset pn="section-4.2-6.1">
            <artwork type="svg" align="left" pn="section-4.2-6.1.1"><svg xmlns="http://www.w3.org/2000/svg" version="1.1" height="128" width="560" viewBox="0 0 560 128" class="diagram" text-anchor="middle" font-family="monospace" font-size="13px" stroke-linecap="round">
                <path d="M 8,32 L 8,80" fill="none" stroke="black"/>
                <path d="M 144,40 L 144,72" fill="none" stroke="black"/>
                <path d="M 280,40 L 280,72" fill="none" stroke="black"/>
                <path d="M 416,40 L 416,72" fill="none" stroke="black"/>
                <path d="M 552,32 L 552,80" fill="none" stroke="black"/>
                <path d="M 8,32 L 552,32" fill="none" stroke="black"/>
                <path d="M 8,80 L 552,80" fill="none" stroke="black"/>
                <path d="M 16,96 L 136,96" fill="none" stroke="black"/>
                <path d="M 152,96 L 272,96" fill="none" stroke="black"/>
                <path d="M 288,96 L 408,96" fill="none" stroke="black"/>
                <path d="M 424,96 L 544,96" fill="none" stroke="black"/>
                <polygon class="arrowhead" points="552,96 540,90.4 540,101.6" fill="black" transform="rotate(0,544,96)"/>
                <polygon class="arrowhead" points="432,96 420,90.4 420,101.6" fill="black" transform="rotate(180,424,96)"/>
                <polygon class="arrowhead" points="416,96 404,90.4 404,101.6" fill="black" transform="rotate(0,408,96)"/>
                <polygon class="arrowhead" points="296,96 284,90.4 284,101.6" fill="black" transform="rotate(180,288,96)"/>
                <polygon class="arrowhead" points="280,96 268,90.4 268,101.6" fill="black" transform="rotate(0,272,96)"/>
                <polygon class="arrowhead" points="160,96 148,90.4 148,101.6" fill="black" transform="rotate(180,152,96)"/>
                <polygon class="arrowhead" points="144,96 132,90.4 132,101.6" fill="black" transform="rotate(0,136,96)"/>
                <polygon class="arrowhead" points="24,96 12,90.4 12,101.6" fill="black" transform="rotate(180,16,96)"/>
                <g class="text">
                  <text x="52" y="52">Fourth</text>
                  <text x="100" y="52">CSID</text>
                  <text x="192" y="52">Third</text>
                  <text x="236" y="52">CSID</text>
                  <text x="324" y="52">Second</text>
                  <text x="372" y="52">CSID</text>
                  <text x="464" y="52">First</text>
                  <text x="508" y="52">CSID</text>
                  <text x="64" y="68">(position</text>
                  <text x="116" y="68">0)</text>
                  <text x="200" y="68">(position</text>
                  <text x="252" y="68">1)</text>
                  <text x="336" y="68">(position</text>
                  <text x="388" y="68">2)</text>
                  <text x="472" y="68">(position</text>
                  <text x="524" y="68">3)</text>
                  <text x="76" y="116">LNFL</text>
                  <text x="212" y="116">LNFL</text>
                  <text x="348" y="116">LNFL</text>
                  <text x="484" y="116">LNFL</text>
                </g>
              </svg>
            </artwork>
            <artwork type="ascii-art" align="left" pn="section-4.2-6.1.2">
+-------------------------------------------------------------------+
|  Fourth CSID   |   Third CSID   |  Second CSID   |   First CSID   |
|  (position 0)  |  (position 1)  |  (position 2)  |  (position 3)  |
+-------------------------------------------------------------------+
 &lt;--------------&gt; &lt;--------------&gt; &lt;--------------&gt; &lt;--------------&gt;
       LNFL             LNFL             LNFL             LNFL
</artwork>
          </artset>
        </figure>
        <t indent="0" pn="section-4.2-7"><xref target="fig-replace-csid-list" format="default" sectionFormat="of" derivedContent="Figure 5"/> illustrates a compressed SID list as could be produced by an SR source node steering a packet into an SR policy SID list of seven REPLACE-CSID flavor SIDs. All SIDs in this example have a 48-bit Locator-Block, 32-bit combined Locator-Node and Function, and 48-bit Argument. The SR source node compresses the SR policy SID list as a compressed SID list of three CSID containers. The first CSID container is in fully formed 128-bit SID format. It carries a Locator-Block, the first CSID, and the argument value zero. The second and third CSID containers are in packed format. The second CSID container carries the second, third, fourth, and fifth CSIDs. The third CSID container carries the sixth and seventh CSIDs. Since the SR source node does not use the third CSID container at full capacity, it sets the 64 least significant bits to zero. The SR source node sets the IPv6 DA with the value of the first CSID container, sets the first element in the SRH Segment List with the value of the third CSID container, and sets the second element of the SRH Segment List with the value of the second CSID container (the elements in the SRH Segment List appear in reversed order of their processing, as specified in <xref target="RFC8754" sectionFormat="of" section="4.1" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8754#section-4.1" derivedContent="RFC8754"/>). Without reduced SRH, the SR source node also writes the first CSID container as the third element of the SRH Segment List.</t>
        <figure anchor="fig-replace-csid-list" align="left" suppress-title="false" pn="figure-5">
          <name slugifiedName="name-compressed-sid-list-of-seve">Compressed SID List of Seven REPLACE-CSID Flavor SIDs with a 48-Bit Locator‑Block, 32-Bit Combined Locator-Node and Function, and 48-Bit Argument</name>
          <artset pn="section-4.2-8.1">
            <artwork type="svg" align="left" pn="section-4.2-8.1.1"><svg xmlns="http://www.w3.org/2000/svg" version="1.1" height="640" width="528" viewBox="0 0 528 640" class="diagram" text-anchor="middle" font-family="monospace" font-size="13px" stroke-linecap="round">
                <path d="M 8,64 L 8,192" fill="none" stroke="black"/>
                <path d="M 8,272 L 8,400" fill="none" stroke="black"/>
                <path d="M 8,480 L 8,608" fill="none" stroke="black"/>
                <path d="M 264,96 L 264,160" fill="none" stroke="black"/>
                <path d="M 520,64 L 520,192" fill="none" stroke="black"/>
                <path d="M 520,272 L 520,400" fill="none" stroke="black"/>
                <path d="M 520,480 L 520,608" fill="none" stroke="black"/>
                <path d="M 8,64 L 520,64" fill="none" stroke="black"/>
                <path d="M 264,96 L 520,96" fill="none" stroke="black"/>
                <path d="M 8,128 L 520,128" fill="none" stroke="black"/>
                <path d="M 8,160 L 264,160" fill="none" stroke="black"/>
                <path d="M 8,192 L 520,192" fill="none" stroke="black"/>
                <path d="M 8,272 L 520,272" fill="none" stroke="black"/>
                <path d="M 8,304 L 520,304" fill="none" stroke="black"/>
                <path d="M 8,336 L 520,336" fill="none" stroke="black"/>
                <path d="M 8,368 L 520,368" fill="none" stroke="black"/>
                <path d="M 8,400 L 520,400" fill="none" stroke="black"/>
                <path d="M 8,480 L 520,480" fill="none" stroke="black"/>
                <path d="M 8,544 L 520,544" fill="none" stroke="black"/>
                <path d="M 8,576 L 520,576" fill="none" stroke="black"/>
                <path d="M 8,608 L 520,608" fill="none" stroke="black"/>
                <g class="text">
                  <text x="16" y="36">0</text>
                  <text x="176" y="36">1</text>
                  <text x="336" y="36">2</text>
                  <text x="496" y="36">3</text>
                  <text x="16" y="52">0</text>
                  <text x="32" y="52">1</text>
                  <text x="48" y="52">2</text>
                  <text x="64" y="52">3</text>
                  <text x="80" y="52">4</text>
                  <text x="96" y="52">5</text>
                  <text x="112" y="52">6</text>
                  <text x="128" y="52">7</text>
                  <text x="144" y="52">8</text>
                  <text x="160" y="52">9</text>
                  <text x="176" y="52">0</text>
                  <text x="192" y="52">1</text>
                  <text x="208" y="52">2</text>
                  <text x="224" y="52">3</text>
                  <text x="240" y="52">4</text>
                  <text x="256" y="52">5</text>
                  <text x="272" y="52">6</text>
                  <text x="288" y="52">7</text>
                  <text x="304" y="52">8</text>
                  <text x="320" y="52">9</text>
                  <text x="336" y="52">0</text>
                  <text x="352" y="52">1</text>
                  <text x="368" y="52">2</text>
                  <text x="384" y="52">3</text>
                  <text x="400" y="52">4</text>
                  <text x="416" y="52">5</text>
                  <text x="432" y="52">6</text>
                  <text x="448" y="52">7</text>
                  <text x="464" y="52">8</text>
                  <text x="480" y="52">9</text>
                  <text x="496" y="52">0</text>
                  <text x="512" y="52">1</text>
                  <text x="136" y="100">Locator-Block</text>
                  <text x="368" y="116">1st</text>
                  <text x="404" y="116">CSID</text>
                  <text x="72" y="148">1st</text>
                  <text x="108" y="148">CSID</text>
                  <text x="168" y="148">continued</text>
                  <text x="392" y="164">0</text>
                  <text x="200" y="212">First</text>
                  <text x="244" y="212">CSID</text>
                  <text x="304" y="212">container</text>
                  <text x="16" y="244">0</text>
                  <text x="176" y="244">1</text>
                  <text x="336" y="244">2</text>
                  <text x="496" y="244">3</text>
                  <text x="16" y="260">0</text>
                  <text x="32" y="260">1</text>
                  <text x="48" y="260">2</text>
                  <text x="64" y="260">3</text>
                  <text x="80" y="260">4</text>
                  <text x="96" y="260">5</text>
                  <text x="112" y="260">6</text>
                  <text x="128" y="260">7</text>
                  <text x="144" y="260">8</text>
                  <text x="160" y="260">9</text>
                  <text x="176" y="260">0</text>
                  <text x="192" y="260">1</text>
                  <text x="208" y="260">2</text>
                  <text x="224" y="260">3</text>
                  <text x="240" y="260">4</text>
                  <text x="256" y="260">5</text>
                  <text x="272" y="260">6</text>
                  <text x="288" y="260">7</text>
                  <text x="304" y="260">8</text>
                  <text x="320" y="260">9</text>
                  <text x="336" y="260">0</text>
                  <text x="352" y="260">1</text>
                  <text x="368" y="260">2</text>
                  <text x="384" y="260">3</text>
                  <text x="400" y="260">4</text>
                  <text x="416" y="260">5</text>
                  <text x="432" y="260">6</text>
                  <text x="448" y="260">7</text>
                  <text x="464" y="260">8</text>
                  <text x="480" y="260">9</text>
                  <text x="496" y="260">0</text>
                  <text x="512" y="260">1</text>
                  <text x="240" y="292">5th</text>
                  <text x="276" y="292">CSID</text>
                  <text x="240" y="324">4th</text>
                  <text x="276" y="324">CSID</text>
                  <text x="240" y="356">3rd</text>
                  <text x="276" y="356">CSID</text>
                  <text x="240" y="388">2nd</text>
                  <text x="276" y="388">CSID</text>
                  <text x="204" y="420">Second</text>
                  <text x="252" y="420">CSID</text>
                  <text x="312" y="420">container</text>
                  <text x="16" y="452">0</text>
                  <text x="176" y="452">1</text>
                  <text x="336" y="452">2</text>
                  <text x="496" y="452">3</text>
                  <text x="16" y="468">0</text>
                  <text x="32" y="468">1</text>
                  <text x="48" y="468">2</text>
                  <text x="64" y="468">3</text>
                  <text x="80" y="468">4</text>
                  <text x="96" y="468">5</text>
                  <text x="112" y="468">6</text>
                  <text x="128" y="468">7</text>
                  <text x="144" y="468">8</text>
                  <text x="160" y="468">9</text>
                  <text x="176" y="468">0</text>
                  <text x="192" y="468">1</text>
                  <text x="208" y="468">2</text>
                  <text x="224" y="468">3</text>
                  <text x="240" y="468">4</text>
                  <text x="256" y="468">5</text>
                  <text x="272" y="468">6</text>
                  <text x="288" y="468">7</text>
                  <text x="304" y="468">8</text>
                  <text x="320" y="468">9</text>
                  <text x="336" y="468">0</text>
                  <text x="352" y="468">1</text>
                  <text x="368" y="468">2</text>
                  <text x="384" y="468">3</text>
                  <text x="400" y="468">4</text>
                  <text x="416" y="468">5</text>
                  <text x="432" y="468">6</text>
                  <text x="448" y="468">7</text>
                  <text x="464" y="468">8</text>
                  <text x="480" y="468">9</text>
                  <text x="496" y="468">0</text>
                  <text x="512" y="468">1</text>
                  <text x="264" y="516">0</text>
                  <text x="240" y="564">7th</text>
                  <text x="276" y="564">CSID</text>
                  <text x="240" y="596">6th</text>
                  <text x="276" y="596">CSID</text>
                  <text x="200" y="628">Third</text>
                  <text x="244" y="628">CSID</text>
                  <text x="304" y="628">container</text>
                </g>
              </svg>
            </artwork>
            <artwork type="ascii-art" align="left" pn="section-4.2-8.1.2">
 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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
+         Locator-Block         +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                               |           1st CSID            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|      1st CSID continued       |                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+               0               +
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
                      First CSID Container

 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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                           5th CSID                            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                           4th CSID                            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                           3rd CSID                            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                           2nd CSID                            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
                      Second CSID Container

 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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
+                               0                               +
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                           7th CSID                            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                           6th CSID                            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
                      Third CSID Container
</artwork>
          </artset>
        </figure>
        <t indent="0" pn="section-4.2-9">This document updates <xref target="RFC8754" format="default" sectionFormat="of" derivedContent="RFC8754"/> by allowing each entry in the SRH Segment List to be either an IPv6 address or a REPLACE-CSID container in packed format. The SRv6 endpoint behaviors specified herein ensure that this entry is never copied as is to the IPv6 header and that the Destination Address field of the IPv6 header is always a valid SRv6 SID conforming to <xref target="RFC9602" format="default" sectionFormat="of" derivedContent="RFC9602"/>.</t>
        <t indent="0" pn="section-4.2-10">The REPLACE-CSID flavor SIDs support any LBL, depending on the needs of the operator, as long as it does not exceed 128-LNFL-ceiling(log_2(128/LNFL)) (ceiling(x) is the least integer greater than or equal to x <xref target="GKP94" format="default" sectionFormat="of" derivedContent="GKP94"/>), so that enough bits remain available for the CSID and Argument. An LBL of 48, 56, 64, 72, or 80 bits is recommended for easier reading in operation.</t>
        <t indent="0" pn="section-4.2-11">This document defines the REPLACE-CSID flavor for 16-bit and 32-bit CSID lengths (LNFL). An implementation <bcp14>MUST</bcp14> support a 32-bit CSID length for REPLACE-CSID flavor SIDs.</t>
        <t indent="0" pn="section-4.2-12">The AL for REPLACE-CSID flavor SIDs is equal to 128-LBL-LNFL. The index value is encoded in the least significant X bits of the Argument, where X is computed as ceiling(log_2(128/LNFL)).</t>
        <t indent="0" pn="section-4.2-13">When processing an IPv6 packet that matches a FIB entry locally instantiated as a SID with the REPLACE-CSID flavor, the SR segment endpoint node applies the procedure specified in the following subsection that corresponds to the SID behavior. If the SID also has the PSP, USP, or USD flavor, the procedure is modified as described in <xref target="sec-replace-flavors" format="default" sectionFormat="of" derivedContent="Section 4.2.8"/>.</t>
        <t indent="0" pn="section-4.2-14">At a high level, at the start of a CSID sequence using the REPLACE-CSID flavor, the first CSID container in fully formed 128-bit SID format is copied to the Destination Address of the IPv6 header. Then, for any SID with the REPLACE-CSID flavor, the SR segment endpoint node determines the next SID of the SID list as follows. When an SRH is present, the SR segment endpoint node decrements the index value in the Argument of the active SID if the index value is not 0 or, if it is 0, decrements the Segments Left value in the SRH and sets the index value in the Argument of the active SID to K-1. The updated index value indicates the position of the next CSID within the CSID container in packed format at the "Segment List" index "Segments Left" in the SRH. The SR segment endpoint node then constructs the next SID by copying this next CSID to the bits that immediately follow the Locator-Block in the Destination Address field of the IPv6 header, thus overwriting the active SID Locator-Node and Function with those of the next CSID. If no SRH is present, the SR segment endpoint node ignores the index value in the SID Argument (except End.DT2M, see <xref target="sec-replace-enddx" format="default" sectionFormat="of" derivedContent="Section 4.2.7"/>) and processes the upper-layer header as per <xref target="RFC8986" format="default" sectionFormat="of" derivedContent="RFC8986"/>. The CSID sequence ends with a last CSID in the last CSID container that does not have the REPLACE-CSID flavor, or with the special CSID value 0, or when reaching the end of the segment list, whichever comes first.</t>
        <section anchor="sec-replace-end" numbered="true" removeInRFC="false" toc="include" pn="section-4.2.1">
          <name slugifiedName="name-end-with-replace-csid">End with REPLACE-CSID</name>
          <t indent="0" pn="section-4.2.1-1">When processing an IPv6 packet that matches a FIB entry locally instantiated as an End SID with the REPLACE-CSID flavor, the SRH processing described in <xref target="RFC8986" sectionFormat="of" section="4.1" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8986#section-4.1" derivedContent="RFC8986"/> is executed with the following modifications.</t>
          <t indent="0" pn="section-4.2.1-2">Line S02 of SRH processing in <xref target="RFC8986" sectionFormat="of" section="4.1" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8986#section-4.1" derivedContent="RFC8986"/> is replaced as follows.</t>
          <sourcecode type="pseudocode" markers="false" pn="section-4.2.1-3">
S02.   If (Segments Left == 0 and (DA.Arg.Index == 0 or
           Segment List[0][DA.Arg.Index-1] == 0)) {
</sourcecode>
          <t indent="0" pn="section-4.2.1-4">Lines S09 to S15 are replaced by the following pseudocode.</t>
          <sourcecode type="pseudocode" markers="false" pn="section-4.2.1-5">
R01. If (DA.Arg.Index != 0) {
R02.   If ((Last Entry &gt; max_LE) or (Segments Left &gt; Last Entry)) {
R03.     Send an ICMP Parameter Problem to the Source Address,
           Code 0 (Erroneous header field encountered),
           Pointer set to the Segments Left field,
           interrupt packet processing and discard the packet.
R04.   }
R05.   Decrement DA.Arg.Index by 1.
R06.   If (Segment List[Segments Left][DA.Arg.Index] == 0) {
R07.     Decrement Segments Left by 1.
R08.     Decrement IPv6 Hop Limit by 1.
R09.     Update IPv6 DA with Segment List[Segments Left]
R10.     Submit the packet to the egress IPv6 FIB lookup for
          transmission to the new destination.
R11.   }
R12. } Else {
R13.   If((Last Entry &gt; max_LE) or (Segments Left &gt; Last Entry+1)){
R14.     Send an ICMP Parameter Problem to the Source Address,
           Code 0 (Erroneous header field encountered),
           Pointer set to the Segments Left field,
           interrupt packet processing and discard the packet.
R15.   }
R16.   Decrement Segments Left by 1.
R17.   Set DA.Arg.Index to (floor(128/LNFL) - 1).
R18. }
R19. Decrement IPv6 Hop Limit by 1.
R20. Write Segment List[Segments Left][DA.Arg.Index] into the bits
       [LBL..LBL+LNFL-1] of the Destination Address of the IPv6
       header.
R21. Submit the packet to the egress IPv6 FIB lookup for
       transmission to the new destination.
</sourcecode>
          <aside pn="section-4.2.1-6">
            <t indent="0" pn="section-4.2.1-6.1">Notes:</t>
            <ul spacing="normal" bare="false" empty="false" indent="3" pn="section-4.2.1-6.2">
              <li pn="section-4.2.1-6.2.1">
                <t indent="0" pn="section-4.2.1-6.2.1.1"><tt>DA.Arg.Index</tt> identifies the value contained in the bits <tt>[(128-ceiling(log_2(128/LNFL)))..127]</tt> in the Destination Address of the IPv6 header.</t>
              </li>
              <li pn="section-4.2.1-6.2.2">
                <t indent="0" pn="section-4.2.1-6.2.2.1"><tt>Segment List[Segments Left][DA.Arg.Index]</tt> identifies the value contained in the bits <tt>[DA.Arg.Index*LNFL..(DA.Arg.Index+1)*LNFL-1]</tt> in the SRH Segment List entry at index Segments Left.</t>
              </li>
            </ul>
          </aside>
          <t indent="0" pn="section-4.2.1-7">The upper-layer header processing described in <xref target="RFC8986" sectionFormat="of" section="4.1.1" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8986#section-4.1.1" derivedContent="RFC8986"/> is unchanged.</t>
          <t indent="0" pn="section-4.2.1-8">A rendering of the complete pseudocode is provided in <xref target="sec-replace-end-complete" format="default" sectionFormat="of" derivedContent="Appendix A.6"/>.</t>
        </section>
        <section anchor="sec-replace-endx" numbered="true" removeInRFC="false" toc="include" pn="section-4.2.2">
          <name slugifiedName="name-endx-with-replace-csid">End.X with REPLACE-CSID</name>
          <t indent="0" pn="section-4.2.2-1">When processing an IPv6 packet that matches a FIB entry locally instantiated as an End.X SID with the REPLACE-CSID flavor, the procedure described in <xref target="RFC8986" sectionFormat="of" section="4.2" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8986#section-4.2" derivedContent="RFC8986"/> is executed with the following modifications.</t>
          <t indent="0" pn="section-4.2.2-2">The pseudocode in <xref target="sec-replace-end" format="default" sectionFormat="of" derivedContent="Section 4.2.1"/> of this document is modified by replacing lines R10 and R21 as shown below.</t>
          <sourcecode type="pseudocode" markers="false" pn="section-4.2.2-3">
R10. Submit the packet to the IPv6 module for transmission to the
       new destination via a member of J.
</sourcecode>
          <sourcecode type="pseudocode" markers="false" pn="section-4.2.2-4">
R21. Submit the packet to the IPv6 module for transmission to the
       new destination via a member of J.
</sourcecode>
          <aside pn="section-4.2.2-5">
            <t indent="0" pn="section-4.2.2-5.1">Note: the variable J is defined in <xref target="RFC8986" sectionFormat="of" section="4.2" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8986#section-4.2" derivedContent="RFC8986"/>.</t>
          </aside>
          <t indent="0" pn="section-4.2.2-6">The SRH processing in <xref target="RFC8986" sectionFormat="of" section="4.2" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8986#section-4.2" derivedContent="RFC8986"/> is replaced with the resulting pseudocode. The upper-layer header processing is unchanged.</t>
          <t indent="0" pn="section-4.2.2-7">A rendering of the complete pseudocode is provided in <xref target="sec-replace-endx-complete" format="default" sectionFormat="of" derivedContent="Appendix A.7"/>.</t>
        </section>
        <section anchor="sec-replace-endt" numbered="true" removeInRFC="false" toc="include" pn="section-4.2.3">
          <name slugifiedName="name-endt-with-replace-csid">End.T with REPLACE-CSID</name>
          <t indent="0" pn="section-4.2.3-1">When processing an IPv6 packet that matches a FIB entry locally instantiated as an End.T SID with the REPLACE-CSID flavor, the procedure described in <xref target="RFC8986" sectionFormat="of" section="4.3" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8986#section-4.3" derivedContent="RFC8986"/> is executed with the following modifications.</t>
          <t indent="0" pn="section-4.2.3-2">The pseudocode in <xref target="sec-replace-end" format="default" sectionFormat="of" derivedContent="Section 4.2.1"/> of this document is modified by replacing lines R10 and R21 as shown below.</t>
          <sourcecode type="pseudocode" markers="false" pn="section-4.2.3-3">
R10.1. Set the packet's associated FIB table to T.
R10.2. Submit the packet to the egress IPv6 FIB lookup for
         transmission to the new destination.
</sourcecode>
          <sourcecode type="pseudocode" markers="false" pn="section-4.2.3-4">
R21.1. Set the packet's associated FIB table to T.
R21.2. Submit the packet to the egress IPv6 FIB lookup for
         transmission to the new destination.
</sourcecode>
          <aside pn="section-4.2.3-5">
            <t indent="0" pn="section-4.2.3-5.1">Note: the variable T is defined in <xref target="RFC8986" sectionFormat="of" section="4.3" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8986#section-4.3" derivedContent="RFC8986"/>.</t>
          </aside>
          <t indent="0" pn="section-4.2.3-6">The SRH processing in <xref target="RFC8986" sectionFormat="of" section="4.3" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8986#section-4.3" derivedContent="RFC8986"/> is replaced with the resulting pseudocode. The upper-layer header processing is unchanged.</t>
          <t indent="0" pn="section-4.2.3-7">A rendering of the complete pseudocode is provided in <xref target="sec-replace-endt-complete" format="default" sectionFormat="of" derivedContent="Appendix A.8"/>.</t>
        </section>
        <section anchor="sec-replace-endb6" numbered="true" removeInRFC="false" toc="include" pn="section-4.2.4">
          <name slugifiedName="name-endb6encaps-with-replace-cs">End.B6.Encaps with REPLACE-CSID</name>
          <t indent="0" pn="section-4.2.4-1">When processing an IPv6 packet that matches a FIB entry locally instantiated as an End.B6.Encaps SID with the REPLACE-CSID flavor, the procedure described in <xref target="RFC8986" sectionFormat="of" section="4.13" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8986#section-4.13" derivedContent="RFC8986"/> is executed with the following modifications.</t>
          <t indent="0" pn="section-4.2.4-2">The pseudocode in <xref target="sec-replace-end" format="default" sectionFormat="of" derivedContent="Section 4.2.1"/> of this document is modified by replacing lines R10 and R21 as shown below.</t>
          <sourcecode type="pseudocode" markers="false" pn="section-4.2.4-3">
R10.1. Push a new IPv6 header with its own SRH containing B.
R10.2. Set the outer IPv6 SA to A.
R10.3. Set the outer IPv6 DA to the first SID of B.
R10.4. Set the outer Payload Length, Traffic Class, Flow Label,
         Hop Limit, and Next Header fields.
R10.5. Submit the packet to the egress IPv6 FIB lookup for
         transmission to the next destination.
</sourcecode>
          <sourcecode type="pseudocode" markers="false" pn="section-4.2.4-4">
R21.1. Push a new IPv6 header with its own SRH containing B.
R21.2. Set the outer IPv6 SA to A.
R21.3. Set the outer IPv6 DA to the first SID of B.
R21.4. Set the outer Payload Length, Traffic Class, Flow Label,
         Hop Limit, and Next Header fields.
R21.5. Submit the packet to the egress IPv6 FIB lookup for
         transmission to the next destination.
</sourcecode>
          <aside pn="section-4.2.4-5">
            <t indent="0" pn="section-4.2.4-5.1">Note: the variables A and B, as well as the values of the Payload Length, Traffic Class, Flow Label, Hop Limit, and Next Header are defined in <xref target="RFC8986" sectionFormat="of" section="4.13" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8986#section-4.13" derivedContent="RFC8986"/>.</t>
          </aside>
          <t indent="0" pn="section-4.2.4-6">The SRH processing in <xref target="RFC8986" sectionFormat="of" section="4.13" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8986#section-4.13" derivedContent="RFC8986"/> is replaced with the resulting pseudocode. The upper-layer header processing is unchanged.</t>
          <t indent="0" pn="section-4.2.4-7">A rendering of the complete pseudocode is provided in <xref target="sec-replace-endb6-complete" format="default" sectionFormat="of" derivedContent="Appendix A.9"/>.</t>
        </section>
        <section anchor="sec-replace-endb6red" numbered="true" removeInRFC="false" toc="include" pn="section-4.2.5">
          <name slugifiedName="name-endb6encapsred-with-replace">End.B6.Encaps.Red with REPLACE-CSID</name>
          <t indent="0" pn="section-4.2.5-1">This is an optimization of the End.B6.Encaps with REPLACE-CSID behavior.</t>
          <t indent="0" pn="section-4.2.5-2">When processing an IPv6 packet that matches a FIB entry locally instantiated as an End.B6.Encaps.Red SID with the REPLACE-CSID flavor, the procedure described in <xref target="sec-replace-endb6" format="default" sectionFormat="of" derivedContent="Section 4.2.4"/> of this document is executed with the modifications in <xref target="RFC8986" sectionFormat="of" section="4.14" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8986#section-4.14" derivedContent="RFC8986"/>.</t>
        </section>
        <section anchor="sec-replace-endbm" numbered="true" removeInRFC="false" toc="include" pn="section-4.2.6">
          <name slugifiedName="name-endbm-with-replace-csid">End.BM with REPLACE-CSID</name>
          <t indent="0" pn="section-4.2.6-1">When processing an IPv6 packet that matches a FIB entry locally instantiated as an End.BM SID with the REPLACE-CSID flavor, the procedure described in <xref target="RFC8986" sectionFormat="of" section="4.15" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8986#section-4.15" derivedContent="RFC8986"/> is executed with the following modifications.</t>
          <t indent="0" pn="section-4.2.6-2">The pseudocode in <xref target="sec-replace-end" format="default" sectionFormat="of" derivedContent="Section 4.2.1"/> of this document is modified by replacing lines R10 and R21 as shown below.</t>
          <sourcecode type="pseudocode" markers="false" pn="section-4.2.6-3">
R10.1. Push the MPLS label stack for B.
R10.2. Submit the packet to the MPLS engine for transmission.
</sourcecode>
          <sourcecode type="pseudocode" markers="false" pn="section-4.2.6-4">
R21.1. Push the MPLS label stack for B.
R21.2. Submit the packet to the MPLS engine for transmission.
</sourcecode>
          <aside pn="section-4.2.6-5">
            <t indent="0" pn="section-4.2.6-5.1">Note: the variable B is defined in <xref target="RFC8986" sectionFormat="of" section="4.15" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8986#section-4.15" derivedContent="RFC8986"/>.</t>
          </aside>
          <t indent="0" pn="section-4.2.6-6">The SRH processing in <xref target="RFC8986" sectionFormat="of" section="4.15" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8986#section-4.15" derivedContent="RFC8986"/> is replaced with the resulting pseudocode. The upper-layer header processing is unchanged.</t>
          <t indent="0" pn="section-4.2.6-7">A rendering of the complete pseudocode is provided in <xref target="sec-replace-endbm-complete" format="default" sectionFormat="of" derivedContent="Appendix A.10"/>.</t>
        </section>
        <section anchor="sec-replace-enddx" numbered="true" removeInRFC="false" toc="include" pn="section-4.2.7">
          <name slugifiedName="name-enddx-and-enddt-with-replac">End.DX and End.DT with REPLACE-CSID</name>
          <t indent="0" pn="section-4.2.7-1">When processing an IPv6 packet that matches a FIB entry locally instantiated as an End.DX6, End.DX4, End.DT6, End.DT4, End.DT46, End.DX2, End.DX2V, or End.DT2U SID with the REPLACE-CSID flavor, the corresponding procedure described in Sections <xref target="RFC8986" sectionFormat="bare" section="4.4" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8986#section-4.4" derivedContent="RFC8986"/> through <xref target="RFC8986" sectionFormat="bare" section="4.11" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8986#section-4.11" derivedContent="RFC8986"/> of <xref target="RFC8986" format="default" sectionFormat="of" derivedContent="RFC8986"/> is executed.</t>
          <t indent="0" pn="section-4.2.7-2">These SIDs differ from those defined in <xref target="RFC8986" format="default" sectionFormat="of" derivedContent="RFC8986"/> by the presence of an Argument as part of the SID structure. The Argument value is ignored by the SR segment endpoint node.</t>
          <t indent="0" pn="section-4.2.7-3">When processing an IPv6 packet that matches a FIB entry locally instantiated as an End.DT2M SID with the REPLACE-CSID flavor, the procedure described in <xref target="RFC8986" sectionFormat="of" section="4.12" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8986#section-4.12" derivedContent="RFC8986"/> is executed with the following modification.</t>
          <t indent="0" pn="section-4.2.7-4">For any End.DT2M SID with the REPLACE-CSID flavor, the value of <tt>Arg.FE2</tt> is 16 bits long. The SR segment endpoint node obtains the value <tt>Arg.FE2</tt> from the 16 most significant bits of <tt>DA.Argument</tt> if <tt>DA.Arg.Index</tt> is zero or from the 16 least significant bits of the next position in the current CSID container (<tt>Segment List[Segments Left][DA.Arg.Index-1]</tt>) otherwise (<tt>DA.Arg.Index</tt> is non-zero).</t>
        </section>
        <section anchor="sec-replace-flavors" numbered="true" removeInRFC="false" toc="include" pn="section-4.2.8">
          <name slugifiedName="name-combination-with-psp-usp-and">Combination with PSP, USP, and USD Flavors</name>
          <t indent="0" pn="section-4.2.8-1">PSP:
When combined with the REPLACE-CSID flavor, the additional PSP flavor instructions defined in <xref target="RFC8986" sectionFormat="of" section="4.16.1.2" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8986#section-4.16.1.2" derivedContent="RFC8986"/> are inserted after lines R09 and R20 of the pseudocode in <xref target="sec-replace-end" format="default" sectionFormat="of" derivedContent="Section 4.2.1"/>, and the first line of the inserted instructions after R20 is modified as follows.</t>
          <sourcecode type="pseudocode" markers="false" pn="section-4.2.8-2">
R20.1.   If (Segments Left == 0 and (DA.Arg.Index == 0 or
             Segment List[0][DA.Arg.Index-1] == 0)) {
</sourcecode>
          <aside pn="section-4.2.8-3">
            <t indent="0" pn="section-4.2.8-3.1">Note: <tt>Segment List[Segments Left][DA.Arg.Index-1]</tt> identifies the value contained in the bits <tt>[(DA.Arg.Index-1)*LNFL..DA.Arg.Index*LNFL-1]</tt> in the SRH Segment List entry at index Segments Left.</t>
          </aside>
          <dl spacing="normal" newline="false" indent="3" pn="section-4.2.8-4">
            <dt pn="section-4.2.8-4.1">USP:</dt>
            <dd pn="section-4.2.8-4.2">When combined with the REPLACE-CSID flavor, the
            line S03 of the pseudocode in <xref target="sec-replace-end" format="default" sectionFormat="of" derivedContent="Section 4.2.1"/> are
            substituted by the USP flavor instructions S03.1 to S03.4 defined
            in <xref target="RFC8986" sectionFormat="of" section="4.16.2" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8986#section-4.16.2" derivedContent="RFC8986"/>. Note that S03 is shown in the complete
            pseudocode in <xref target="sec-replace-end-complete" format="default" sectionFormat="of" derivedContent="Appendix A.6"/>.</dd>
            <dt pn="section-4.2.8-4.3">USD:</dt>
            <dd pn="section-4.2.8-4.4">The USD flavor defined in <xref target="RFC8986" sectionFormat="of" section="4.16.3" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8986#section-4.16.3" derivedContent="RFC8986"/> is unchanged when combined
            with the REPLACE-CSID flavor.</dd>
          </dl>
        </section>
      </section>
    </section>
    <section anchor="csid-allocation" numbered="true" removeInRFC="false" toc="include" pn="section-5">
      <name slugifiedName="name-csid-allocation">CSID Allocation</name>
      <t indent="0" pn="section-5-1">The CSID value of 0 is reserved. It is used to indicate the end of a CSID container.</t>
      <t indent="0" pn="section-5-2">In order to efficiently manage the CSID numbering space, a deployment may divide it into two non-overlapping sub-spaces: a GIB and a LIB.</t>
      <t indent="0" pn="section-5-3">The CSID values that are allocated from the GIB have a global semantic within the Locator-Block, while those that are allocated from the LIB have a local semantic on an SR segment endpoint node and within the scope of the Locator-Block.</t>
      <t indent="0" pn="section-5-4">The concept of LIB is applicable to SRv6 and specifically to its NEXT-CSID and REPLACE-CSID flavors. The shorter the CSID, the more benefit the LIB brings.</t>
      <t indent="0" pn="section-5-5">The opportunity to use these sub-spaces, their size, and their CSID allocation policy depends on the CSID length relative to the size of the network (e.g., number of nodes, links, service routes). Some guidelines for a typical deployment scenario are provided in the below subsections.</t>
      <section anchor="global-csid" numbered="true" removeInRFC="false" toc="include" pn="section-5.1">
        <name slugifiedName="name-global-csid">Global CSID</name>
        <t indent="0" pn="section-5.1-1">A global CSID is a CSID allocated from the GIB.</t>
        <t indent="0" pn="section-5.1-2">A global CSID identifies a segment defined at the Locator-Block level. The tuple (Locator-Block, CSID) identifies the same segment across all nodes of the SR domain. A typical example is a prefix segment bound to the End behavior.</t>
        <t indent="0" pn="section-5.1-3">A node can have multiple global CSIDs under the same Locator-Block (e.g., one per IGP flexible algorithm (<xref target="RFC9350" format="default" sectionFormat="of" derivedContent="RFC9350"/>)). Multiple nodes may share the same global CSID (e.g., anycast <xref target="RFC4786" format="default" sectionFormat="of" derivedContent="RFC4786"/>).</t>
      </section>
      <section anchor="local-csid" numbered="true" removeInRFC="false" toc="include" pn="section-5.2">
        <name slugifiedName="name-local-csid">Local CSID</name>
        <t indent="0" pn="section-5.2-1">A local CSID is a CSID allocated from the LIB.</t>
        <t indent="0" pn="section-5.2-2">A local CSID identifies a segment defined at the node level and within the scope of a particular Locator-Block. The tuple (Locator-Block, CSID) identifies a different segment on each node of the SR domain. A typical example is a non-routed Adjacency segment bound to the End.X behavior.</t>
        <t indent="0" pn="section-5.2-3">Let N1 and N2 be two different physical nodes of the SR domain and I a local CSID value: N1 may allocate value I to SID S1 and N2 may allocate the same value I to SID S2.</t>
      </section>
      <section anchor="sec-csid-installation" numbered="true" removeInRFC="false" toc="include" pn="section-5.3">
        <name slugifiedName="name-recommended-installation-of">Recommended Installation of CSIDs in FIB</name>
        <t indent="0" pn="section-5.3-1"><xref target="RFC8754" sectionFormat="of" section="4.3" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8754#section-4.3" derivedContent="RFC8754"/> defines how an SR segment endpoint node identifies a locally instantiated SRv6 SID. To ensure that any valid argument value is accepted, an SR segment endpoint node instantiating a NEXT-CSID or REPLACE-CSID flavor SID should install a corresponding FIB entry that matches only the Locator and Function parts of the SID (i.e., with a prefix length of LBL + LNL + FL).</t>
        <t indent="0" pn="section-5.3-2">In addition, an SR segment endpoint node instantiating NEXT-CSID flavor SIDs from both the GIB and LIB may install combined "Global + Local" FIB entries to match a sequence of global and local CSIDs in a single longest-prefix match (LPM) lookup.</t>
        <t indent="0" pn="section-5.3-3">For example, let us consider an SR segment endpoint node 10 instantiating the following two NEXT-CSID flavor SIDs according to the CSID length, LBL, and GIB/LIB recommendations in this section.</t>
        <ul spacing="normal" bare="false" empty="false" indent="3" pn="section-5.3-4">
          <li pn="section-5.3-4.1">
            <t indent="0" pn="section-5.3-4.1.1">The SID <tt>2001:db8:b1:10::</tt> bound to the End behavior with the NEXT-CSID flavor is instantiated from a GIB with:
            </t>
            <ul spacing="normal" bare="false" empty="false" indent="3" pn="section-5.3-4.1.2">
              <li pn="section-5.3-4.1.2.1">
                <t indent="0" pn="section-5.3-4.1.2.1.1">LBL = 48 (Locator-Block value <tt>0x20010db800b1</tt>),</t>
              </li>
              <li pn="section-5.3-4.1.2.2">
                <t indent="0" pn="section-5.3-4.1.2.2.1">LNL = 16 (Locator-Node value <tt>0x0010</tt>),</t>
              </li>
              <li pn="section-5.3-4.1.2.3">
                <t indent="0" pn="section-5.3-4.1.2.3.1">FL = 0, and</t>
              </li>
              <li pn="section-5.3-4.1.2.4">
                <t indent="0" pn="section-5.3-4.1.2.4.1">AL = 64.</t>
              </li>
            </ul>
          </li>
          <li pn="section-5.3-4.2">
            <t indent="0" pn="section-5.3-4.2.1">The SID <tt>2001:db8:b1:f123::</tt> bound to the End.X behavior for its local IGP adjacency <tt>123</tt> with the NEXT-CSID flavor is instantiated from a LIB with:
            </t>
            <ul spacing="normal" bare="false" empty="false" indent="3" pn="section-5.3-4.2.2">
              <li pn="section-5.3-4.2.2.1">
                <t indent="0" pn="section-5.3-4.2.2.1.1">LBL = 48 (Locator-Block value <tt>0x20010db800b1</tt>),</t>
              </li>
              <li pn="section-5.3-4.2.2.2">
                <t indent="0" pn="section-5.3-4.2.2.2.1">LNL = 0,</t>
              </li>
              <li pn="section-5.3-4.2.2.3">
                <t indent="0" pn="section-5.3-4.2.2.3.1">FL = 16 (Function value <tt>0xf123</tt>), and</t>
              </li>
              <li pn="section-5.3-4.2.2.4">
                <t indent="0" pn="section-5.3-4.2.2.4.1">AL = 64.</t>
              </li>
            </ul>
          </li>
        </ul>
        <t indent="0" pn="section-5.3-5">For SID <tt>2001:db8:b1:10::</tt>, Node 10 would install the FIB entry <tt>2001:db8:b1:10::/64</tt> bound to the End SID with the NEXT-CSID flavor.</t>
        <t indent="0" pn="section-5.3-6">For SID <tt>2001:db8:b1:f123::</tt>, Node 10 would install the FIB entry <tt>2001:db8:b1:f123::/64</tt> bound to the End.X SID for adjacency <tt>123</tt> with the NEXT-CSID flavor.</t>
        <t indent="0" pn="section-5.3-7">In addition, Node 10 may also install the combined FIB entry <tt>2001:db8:b1:10:f123::/80</tt> bound to the End.X SID for adjacency <tt>123</tt> with the NEXT-CSID flavor.</t>
        <t indent="0" pn="section-5.3-8">As another example, let us consider an SR segment endpoint node 20 instantiating the following two REPLACE-CSID flavor SIDs according to the CSID length, LBL, and GIB/LIB recommendations in this section.</t>
        <ul spacing="normal" bare="false" empty="false" indent="3" pn="section-5.3-9">
          <li pn="section-5.3-9.1">
            <t indent="0" pn="section-5.3-9.1.1"><tt>2001:db8:b2:20:1::</tt> from a GIB with LBL = 48, LNL = 16, FL = 16, AL = 48, and bound to the End behavior with the REPLACE-CSID flavor.</t>
          </li>
          <li pn="section-5.3-9.2">
            <t indent="0" pn="section-5.3-9.2.1"><tt>2001:db8:b2:20:123::</tt> from a GIB with LBL = 48, LNL = 16, FL = 16, AL = 48, and bound to the End.X behavior for its local IGP adjacency <tt>123</tt> with the REPLACE-CSID flavor.</t>
          </li>
        </ul>
        <t indent="0" pn="section-5.3-10">For SID <tt>2001:db8:b2:20:1::</tt>, Node 20 would install the FIB entry <tt>2001:db8:b2:20:1::/80</tt> bound to the End SID with the REPLACE-CSID flavor.</t>
        <t indent="0" pn="section-5.3-11">For SID <tt>2001:db8:b2:20:123::</tt>, Node 20 would install the FIB entry <tt>2001:db8:b2:20:123::/80</tt> bound to the End.X SID for adjacency <tt>123</tt> with the REPLACE-CSID flavor.</t>
      </section>
    </section>
    <section anchor="sec-source-node" numbered="true" removeInRFC="false" toc="include" pn="section-6">
      <name slugifiedName="name-sr-source-node">SR Source Node</name>
      <t indent="0" pn="section-6-1">An SR source node may learn from a control plane protocol (see <xref target="sec-control-plane" format="default" sectionFormat="of" derivedContent="Section 8"/>) or local configuration the SIDs that it can use in a segment list, along with their respective SRv6 endpoint behavior, structure, and any other relevant attribute (e.g., the set of L3 adjacencies associated with an End.X SID).</t>
      <section anchor="sid-validation-for-compression" numbered="true" removeInRFC="false" toc="include" pn="section-6.1">
        <name slugifiedName="name-sid-validation-for-compress">SID Validation for Compression</name>
        <t indent="0" pn="section-6.1-1">As part of the compression process or as a preliminary step, the SR source node <bcp14>MUST</bcp14> validate the SID structure of each SID of this document in the segment list. The SR source node does so regardless of whether the segment list is explicitly configured, locally computed, or advertised by a controller (e.g., via BGP <xref target="I-D.ietf-idr-sr-policy-safi" format="default" sectionFormat="of" derivedContent="BGP-SR-Policy"/> or PCEP <xref target="RFC9603" format="default" sectionFormat="of" derivedContent="RFC9603"/>).</t>
        <t indent="0" pn="section-6.1-2">A SID structure is valid for compression if it meets all the following conditions:</t>
        <ul spacing="normal" bare="false" empty="false" indent="3" pn="section-6.1-3">
          <li pn="section-6.1-3.1">
            <t indent="0" pn="section-6.1-3.1.1">The LBL is not 0.</t>
          </li>
          <li pn="section-6.1-3.2">
            <t indent="0" pn="section-6.1-3.2.1">The LNFL is not 0.</t>
          </li>
          <li pn="section-6.1-3.3">
            <t indent="0" pn="section-6.1-3.3.1">The AL is equal to 128-LBL-LNL-FL.</t>
          </li>
        </ul>
        <t indent="0" pn="section-6.1-4">When compressing a SID list, the SR source node <bcp14>MUST</bcp14> treat an invalid SID structure as unknown. A SID with an unknown SID structure is  not compressible.</t>
        <t indent="0" pn="section-6.1-5"><xref target="sec-control-plane" format="default" sectionFormat="of" derivedContent="Section 8"/> discusses how the SIDs of this document and their structure can be advertised to the SR source node through various control plane protocols. The SID structure may also be learned through configuration or
other management protocols. The details of such mechanisms are outside the scope of this document.</t>
      </section>
      <section anchor="sec-source-compression" numbered="true" removeInRFC="false" toc="include" pn="section-6.2">
        <name slugifiedName="name-segment-list-compression">Segment List Compression</name>
        <t indent="0" pn="section-6.2-1">An SR source node <bcp14>MAY</bcp14> compress a SID list when it includes NEXT-CSID and/or REPLACE-CSID flavor SIDs to reduce the packet header length.</t>
        <t indent="0" pn="section-6.2-2">It is out of the scope of this document to describe the mechanism through which an uncompressed SID list is derived, since such a mechanism may include a wide range of considerations independent of compression (e.g., minimizing a specific metric, excluding certain links, or providing a loop-free fast-reroute path). As general guidance for implementation or future specification, such a mechanism should aim to select the combination of SIDs that would result in the shortest compressed SID list. For example, by selecting a CSID flavor SID over an equivalent non-CSID flavor SID or by consistently selecting SIDs of the same CSID flavor within each routing domain.</t>
        <t indent="0" pn="section-6.2-3">The SID list that the SR source node pushes onto the packet <bcp14>MUST</bcp14> comply with the rules in Sections <xref target="sec-source-next" format="counter" sectionFormat="of" derivedContent="6.3"/> and <xref target="sec-source-replace" format="counter" sectionFormat="of" derivedContent="6.4"/> and express the same list of segments as the original SID list. If these rules are not followed, the packet may get dropped or misrouted.</t>
        <t indent="0" pn="section-6.2-4">If an SR source node chooses to compress the SID list, one method is described below for illustrative purposes. Any other method producing a compressed SID list of equal or shorter length than the uncompressed SID list <bcp14>MAY</bcp14> be used.</t>
        <t indent="0" pn="section-6.2-5">This method walks the uncompressed SID list and compresses each series of consecutive NEXT-CSID flavor SIDs and each series of consecutive REPLACE-CSID flavor SIDs.</t>
        <ul spacing="normal" bare="false" empty="false" indent="3" pn="section-6.2-6">
          <li pn="section-6.2-6.1">
            <t indent="0" pn="section-6.2-6.1.1">When the compression method encounters a series of one or
          more consecutive compressible NEXT-CSID flavor SIDs, it compresses
          the series as follows. A SID with the NEXT-CSID flavor is
          compressible if its structure is known to the SR source node and its
          Argument value is 0.</t>
            <sourcecode type="pseudocode" markers="false" pn="section-6.2-6.1.2">
S01. Initialize a NEXT-CSID container equal to the first SID in
       the series and initialize the remaining capacity of the
       CSID container to the AL of that SID
S02. For each subsequent SID in the series {
S03.   If the current SID Locator-Block matches that of the CSID
         container and the current SID LNFL is lower than or equal
         to the remaining capacity of the NEXT-CSID container {
S04.     Copy the current SID Locator-Node and Function to the
           most significant remaining Argument bits of the
           NEXT-CSID container and decrement the remaining
           capacity by LNFL
S05.   } Else {
S06.     Push the NEXT-CSID container onto the compressed SID list
S07.     Initialize a new NEXT-CSID container equal to the current
           SID in the series and initialize the remaining capacity
           of the NEXT-CSID container to the AL of that SID
S08.   } // End If
S09. } // End For
S10. If at least one SID remains in the uncompressed SID list
       (following the series of compressible NEXT-CSID flavor
       SIDs) {
S11.   Set S to the next SID in the uncompressed SID list
S12.   If S is advertised with a SID structure, and the
         Locator-Block of S matches that of the NEXT-CSID
         container, and the sum of the Locator-Node, Function, and
         Argument length of S is lower than or equal to the
         remaining capacity of the CSID container {
S13.     Copy the Locator-Node, Function, and Argument of S to the
           most significant remaining Argument bits of the CSID
           container
S14.   } // End If
S15. } // End If
S16. Push the NEXT-CSID container onto the compressed SID list
</sourcecode>
          </li>
          <li pn="section-6.2-6.2">
            <t indent="0" pn="section-6.2-6.2.1">When the compression method encounters a series of
          REPLACE-CSID flavor SIDs of the same CSID length in the uncompressed
          SID list, it compresses the series as per the following high-level
          pseudocode. A compression checking function ComCheck(F, S) is
          defined to check if two SIDs F and S share the same SID structure
          and Locator-Block value, and if S has either no Argument or an
          Argument with value 0. If the check passes, then ComCheck(F,S)
          returns true.</t>
            <sourcecode type="pseudocode" markers="false" pn="section-6.2-6.2.2">
S01. Initialize a REPLACE-CSID container in full SID format equal
       to the first SID in the series
S02. Push the REPLACE-CSID container onto the compressed SID list
S03. Initialize a new REPLACE-CSID container in packed format if
       there are more than one SIDs and initialize the remaining
       capacity of the REPLACE-CSID container to 128 bits
S04. For each subsequent SID in the uncompressed SID list {
S05.   Set S to the current SID in the uncompressed SID list
S06.   If ComCheck(First SID, S) {
S07.     If the LNFL of S is lower than or equal to
           the remaining capacity of the REPLACE-CSID container {
S08.       Copy the Locator-Node and Function of S to the least
             significant remaining bits of the REPLACE-CSID
             container and decrement the remaining capacity by
             LNFL  // Note
S09.     } Else {
S10.       Push the REPLACE-CSID container onto the compressed SID
             list
S11.       Initialize a new REPLACE-CSID container in packed
             format with all bits set to 0
S12.       Copy the Locator-Node and Function of S to the least
             significant remaining bits of the REPLACE-CSID
             container and decrement the remaining capacity by
             LNFL  // Note
S13.     }
S14.     If S is not a REPLACE-CSID flavor SID, then break
S15.   } Else {
S16.     Break
S17.   } // End If
S18. } // End For
S19. Push the REPLACE-CSID container (if it is not empty) onto the
       compressed SID list
</sourcecode>
          </li>
        </ul>
        <aside pn="section-6.2-7">
          <t indent="0" pn="section-6.2-7.1">Note: When the last CSID is an End.DT2M SID with the REPLACE-CSID flavor, if there are 0 or at least two CSID positions left in the current REPLACE-CSID container, the CSID is encoded as described above and the value of the <tt>Arg.FE2</tt> argument is placed in the 16 least significant bits of the next CSID position. Otherwise (if there is only one CSID position left in the current REPLACE-CSID container), the current REPLACE-CSID container is pushed onto the SID list (the value of the CSID position 0 remains zero) and the End.DT2M SID with the REPLACE-CSID flavor is encoded in full SID format with the value of the <tt>Arg.FE2</tt> argument in the 16 most significant bits of the SID Argument.</t>
        </aside>
        <t indent="0" pn="section-6.2-8">In all remaining cases (i.e., when the compression method encounters a SID in the uncompressed SID list that is not handled by any of the previous subroutines), it pushes this SID as is onto the compressed SID list.</t>
        <t indent="0" pn="section-6.2-9">Regardless of how a compressed SID list is produced, the SR source node writes it in the IPv6 packet as described in Sections <xref target="RFC8754" sectionFormat="bare" section="4.1" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8754#section-4.1" derivedContent="RFC8754"/> and <xref target="RFC8754" sectionFormat="bare" section="4.1.1" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8754#section-4.1.1" derivedContent="RFC8754"/> of <xref target="RFC8754" format="default" sectionFormat="of" derivedContent="RFC8754"/>. The text is reproduced below for reference.</t>
        <blockquote pn="section-6.2-10">
          <t indent="0" pn="section-6.2-10.1">A source node steers a packet into an SR Policy. If the SR Policy
results in a Segment List containing a single segment, and there is
no need to add information to the SRH flag or add TLV; the DA is set
to the single Segment List entry, and the SRH <bcp14>MAY</bcp14> be omitted.</t>
          <t indent="0" pn="section-6.2-10.2">When needed, the SRH is created as follows:</t>
          <t indent="0" pn="section-6.2-10.3">The Next Header and Hdr Ext Len fields are set as specified in
  <xref target="RFC8200" format="default" sectionFormat="of" derivedContent="RFC8200"/>.</t>
          <t indent="0" pn="section-6.2-10.4">The Routing Type field is set to 4.</t>
          <t indent="0" pn="section-6.2-10.5">The DA of the packet is set with the value of the first segment.</t>
          <t indent="0" pn="section-6.2-10.6">The first element of the SRH Segment List is the ultimate segment.
  The second element is the penultimate segment, and so on.</t>
          <t indent="0" pn="section-6.2-10.7">The Segments Left field is set to n-1, where n is the number of
  elements in the SR Policy.</t>
          <t indent="0" pn="section-6.2-10.8">The Last Entry field is set to n-1, where n is the number of
  elements in the SR Policy.</t>
          <t indent="0" pn="section-6.2-10.9">TLVs (including HMAC) may be set according to their specification.</t>
          <t indent="0" pn="section-6.2-10.10">The packet is forwarded toward the packet's Destination Address
  (the first segment).</t>
          <t indent="0" pn="section-6.2-10.11">When a source does not require the entire SID list to be preserved
in the SRH, a reduced SRH may be used.</t>
          <t indent="0" pn="section-6.2-10.12">A reduced SRH does not contain the first segment of the related SR
Policy (the first segment is the one already in the DA of the IPv6
header), and the Last Entry field is set to n-2, where n is the
number of elements in the SR Policy.</t>
        </blockquote>
      </section>
      <section anchor="sec-source-next" numbered="true" removeInRFC="false" toc="include" pn="section-6.3">
        <name slugifiedName="name-rules-for-segment-lists-con">Rules for Segment Lists Containing NEXT-CSID Flavor SIDs</name>
        <ol spacing="normal" type="1" indent="adaptive" start="1" pn="section-6.3-1"><li pn="section-6.3-1.1" derivedCounter="1.">
            <t indent="0" pn="section-6.3-1.1.1">If a Destination Options header would follow an SRH with a segment list of more than one segment compressed as a single NEXT-CSID container, the SR source node <bcp14>MUST NOT</bcp14> omit the SRH.</t>
          </li>
          <li pn="section-6.3-1.2" derivedCounter="2.">
            <t indent="0" pn="section-6.3-1.2.1">When the last Segment List entry (index 0) in the SRH is a NEXT-CSID container representing more than one segment and the segment S preceding the first segment of this NEXT-CSID container in the segment list has the PSP flavor, then the PSP operation is performed at the SR segment endpoint node of S. If the PSP behavior should instead be performed at the penultimate segment along the path, then the SR source node <bcp14>MUST NOT</bcp14> compress the ultimate SID of the SID list into a NEXT-CSID container.</t>
          </li>
          <li pn="section-6.3-1.3" derivedCounter="3.">
            <t indent="0" pn="section-6.3-1.3.1">If a Destination Options header would follow an SRH with a last Segment List entry being a NEXT-CSID container representing more than one segment, the SR source node <bcp14>MUST</bcp14> ensure that the PSP operation is not performed before the penultimate SR segment endpoint node along the path.</t>
          </li>
          <li pn="section-6.3-1.4" derivedCounter="4.">
            <t indent="0" pn="section-6.3-1.4.1">When the Argument of a NEXT-CSID container is not used to full capacity, the remaining least significant bits of that Argument <bcp14>MUST</bcp14> be set to 0.</t>
          </li>
        </ol>
      </section>
      <section anchor="sec-source-replace" numbered="true" removeInRFC="false" toc="include" pn="section-6.4">
        <name slugifiedName="name-rules-for-segment-lists-cont">Rules for Segment Lists Containing REPLACE-CSID Flavor SIDs</name>
        <ol spacing="normal" type="1" indent="adaptive" start="1" pn="section-6.4-1"><li pn="section-6.4-1.1" derivedCounter="1.">
            <t indent="0" pn="section-6.4-1.1.1">All SIDs compressed in a REPLACE-CSID sequence <bcp14>MUST</bcp14> share the same Locator-Block and the same compression scheme.</t>
          </li>
          <li pn="section-6.4-1.2" derivedCounter="2.">
            <t indent="0" pn="section-6.4-1.2.1">All SIDs except the last one in a CSID sequence for REPLACE-CSID <bcp14>MUST</bcp14> have the REPLACE-CSID flavor. If the last REPLACE-CSID container is fully filled (i.e., the last CSID is at position 0 in the REPLACE-CSID container) and the last SID in the CSID sequence is not the last segment in the segment list, the last SID in the CSID sequence <bcp14>MUST NOT</bcp14> have the REPLACE-CSID flavor.</t>
          </li>
          <li pn="section-6.4-1.3" derivedCounter="3.">
            <t indent="0" pn="section-6.4-1.3.1">When a REPLACE-CSID flavor CSID is present as the last SID in a container that is not the last Segment List entry (index 0) in the SRH, the next element in the SID list <bcp14>MUST</bcp14> be a REPLACE-CSID container in packed format carrying at least one CSID.</t>
          </li>
        </ol>
        <t indent="0" pn="section-6.4-2">The SR source node determines the compression scheme of REPLACE-CSID flavor SIDs as follows.</t>
        <t indent="0" pn="section-6.4-3">When receiving a SID advertisement for a REPLACE-CSID flavor SID with LNL = 16, FL = 0, AL = 128-LBL-LNFL, and all zeros as the value of the Argument, the SR source node marks both the SID and its locator as using 16-bit compression. All other SIDs allocated from this locator with LNL = 16, FL = 16, AL = 128-LBL-LNFL, and all zeros as the value of the Argument are also marked as using 16-bit compression. When receiving a SID advertisement for a REPLACE-CSID flavor SID with LNFL = 32, AL = 128-LBL-LNFL, and all zeros as the value of the Argument, the SR source node marks both the SID and its locator as using 32-bit compression.</t>
      </section>
      <section anchor="sec-source-checksum" numbered="true" removeInRFC="false" toc="include" pn="section-6.5">
        <name slugifiedName="name-upper-layer-checksums">Upper-Layer Checksums</name>
        <t indent="0" pn="section-6.5-1">The Destination Address used in the IPv6 pseudo-header (<xref target="RFC8200" sectionFormat="of" section="8.1" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8200#section-8.1" derivedContent="RFC8200"/>) is that of the ultimate destination.</t>
        <t indent="0" pn="section-6.5-2">At the SR source node, that address will be the Destination Address as it is expected to be received by the ultimate destination. When the last element in the compressed SID list is a CSID container, this address can be obtained from the last element in the uncompressed SID list or by repeatedly applying the segment behavior as described in <xref target="sec-operations-icmp-error" format="default" sectionFormat="of" derivedContent="Section 9.4"/>. This applies regardless of whether an SRH is present in the IPv6 packet or is omitted.</t>
        <t indent="0" pn="section-6.5-3">At the ultimate destination(s), that address will be in the Destination Address field of the IPv6 header.</t>
      </section>
    </section>
    <section anchor="sec-inter-domain" numbered="true" removeInRFC="false" toc="include" pn="section-7">
      <name slugifiedName="name-inter-domain-compression">Inter-Domain Compression</name>
      <t indent="0" pn="section-7-1">Some SRv6 traffic may need to cross multiple routing domains, such as different Autonomous Systems (ASes) or different routing areas within an SR domain. Different routing domains may use different addressing schema and Locator-Blocks.</t>
      <t indent="0" pn="section-7-2">A property of a CSID sequence is that all CSIDs in the sequence share the same Locator-Block. Therefore, a segment list that spans multiple routing domains using different Locator-Blocks may need a separate CSID sequence for each domain.</t>
      <t indent="0" pn="section-7-3">This section defines a solution to improve the efficiency of CSID compression in multi-domain environments by enabling a CSID sequence to combine CSIDs having different Locator-Blocks.</t>
      <t indent="0" pn="section-7-4">The solution leverages two new SRv6 endpoint behaviors, "Endpoint with SRv6 Locator-Block Swap" ("End.LBS" for short) and "Endpoint with L3 cross-connect and SRv6 Locator-Block Swap" ("End.XLBS" for short), that enable modifying the Locator-Block for the next CSID in the CSID sequence at the routing domain boundary.</t>
      <section anchor="endlbs-locator-block-swap" numbered="true" removeInRFC="false" toc="include" pn="section-7.1">
        <name slugifiedName="name-endlbs-locator-block-swap">End.LBS: Locator-Block Swap</name>
        <t indent="0" pn="section-7.1-1">The End.LBS behavior is a variant of the End behavior that modifies the Locator-Block of the active CSID sequence. This document defines the End.LBS behavior with the NEXT-CSID flavor and the End.LBS behavior with the REPLACE-CSID flavor.</t>
        <t indent="0" pn="section-7.1-2">An End.LBS SID is used to transition to a new Locator-Block when the routing domain boundary is on the SR segment endpoint node.</t>
        <t indent="0" pn="section-7.1-3">Each instance of an End.LBS SID is associated with a target Locator-Block B2/m, where B2 is an IPv6 address prefix and m is the associated prefix length.
The original and target Locator-Blocks can have different prefix lengths as long as the new Destination Address formed by combining the target Locator-Block with the Locator-Node, Function, and Argument as described in the pseudocode of Sections <xref target="sec-next-endlbs" format="counter" sectionFormat="of" derivedContent="7.1.1"/> and <xref target="sec-replace-endlbs" format="counter" sectionFormat="of" derivedContent="7.1.2"/> is a valid IPv6 address.
The target Locator-Block is a local property of the End.LBS SID on the SR segment endpoint node.</t>
        <aside pn="section-7.1-4">
          <t indent="0" pn="section-7.1-4.1">Note: a local SID property is an attribute associated with the SID when it is instantiated on the SR segment endpoint node. When the SR segment endpoint node identifies the Destination Address of a received packet as a locally instantiated SID, it also retrieves any local property associated with this SID. Other examples of local SID properties include the set of L3 adjacencies of an End.X SID (<xref target="RFC8986" sectionFormat="of" section="4.2" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8986#section-4.2" derivedContent="RFC8986"/>) and the lookup table of an End.DT6 SID (<xref target="RFC8986" sectionFormat="of" section="4.6" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8986#section-4.6" derivedContent="RFC8986"/>).</t>
        </aside>
        <t indent="0" pn="section-7.1-5">The means by which an SR source node learns the target Locator-Block associated with an End.LBS SID are outside the scope of this document. As examples, it could be learned via configuration or signaled by a controller.</t>
        <section anchor="sec-next-endlbs" numbered="true" removeInRFC="false" toc="include" pn="section-7.1.1">
          <name slugifiedName="name-endlbs-with-next-csid">End.LBS with NEXT-CSID</name>
          <t indent="0" pn="section-7.1.1-1">When processing an IPv6 packet that matches a FIB entry locally instantiated as an End.LBS SID with the NEXT-CSID flavor and associated with the target Locator-Block B2/m, the SR segment endpoint node applies the procedure specified in <xref target="sec-next-end" format="default" sectionFormat="of" derivedContent="Section 4.1.1"/> with the lines N05 to N06 replaced as follows.</t>
          <sourcecode type="pseudocode" markers="false" pn="section-7.1.1-2">
N05.1. Initialize an IPv6 address A equal to B2.
N05.2. Copy DA.Argument into the bits [m..(m+AL-1)] of A.
N06.   Copy A to the Destination Address of the IPv6 header.
</sourcecode>
        </section>
        <section anchor="sec-replace-endlbs" numbered="true" removeInRFC="false" toc="include" pn="section-7.1.2">
          <name slugifiedName="name-endlbs-with-replace-csid">End.LBS with REPLACE-CSID</name>
          <t indent="0" pn="section-7.1.2-1">When processing an IPv6 packet that matches a FIB entry locally instantiated as an End.LBS SID with the REPLACE-CSID flavor and associated with the target Locator-Block B2/m, the SR segment endpoint node applies the procedure specified in <xref target="sec-replace-end" format="default" sectionFormat="of" derivedContent="Section 4.2.1"/> with the line R20 replaced as follows.</t>
          <sourcecode type="pseudocode" markers="false" pn="section-7.1.2-2">
R20.1. Initialize an IPv6 address A equal to B2.
R20.2. Write Segment List[Segments Left][DA.Arg.Index] into the bits
         [m..m+LNFL-1] of A.
R20.3. Write DA.Arg.Index into the bits
         [(128-ceiling(log_2(128/LNFL)))..127] of A.
R20.4. Copy A to the Destination Address of the IPv6 header.
</sourcecode>
        </section>
      </section>
      <section anchor="endxlbs-l3-cross-connect-and-locator-block-swap" numbered="true" removeInRFC="false" toc="include" pn="section-7.2">
        <name slugifiedName="name-endxlbs-l3-cross-connect-an">End.XLBS: L3 Cross-Connect and Locator-Block Swap</name>
        <t indent="0" pn="section-7.2-1">The End.XLBS behavior is a variant of the End.X behavior that modifies the Locator-Block of the active CSID sequence. This document defines the End.XLBS behavior with the NEXT-CSID flavor and the End.XLBS behavior with the REPLACE-CSID flavor.</t>
        <t indent="0" pn="section-7.2-2">An End.XLBS SID is used to transition to a new Locator-Block when the routing domain boundary is on a link adjacent to the SR segment endpoint node.</t>
        <t indent="0" pn="section-7.2-3">Each instance of an End.XLBS SID is associated with a target Locator-Block B2/m and a set, J, of one or more L3 adjacencies.
The original and target Locator-Blocks can have different prefix lengths as long as the new Destination Address formed by combining the target Locator-Block with the Locator-Node, Function, and Argument as described in the pseudocode of Sections <xref target="sec-next-endxlbs" format="counter" sectionFormat="of" derivedContent="7.2.1"/> and <xref target="sec-replace-endxlbs" format="counter" sectionFormat="of" derivedContent="7.2.2"/> is a valid IPv6 address.
The target Locator-Block and set of adjacencies are local properties of the End.XLBS SID on the SR segment endpoint node.</t>
        <t indent="0" pn="section-7.2-4">The means by which an SR source node learns the target Locator-Block associated with an End.XLBS SID are outside the scope of this document. As examples, it could be learned via configuration or signaled by a controller.</t>
        <section anchor="sec-next-endxlbs" numbered="true" removeInRFC="false" toc="include" pn="section-7.2.1">
          <name slugifiedName="name-endxlbs-with-next-csid">End.XLBS with NEXT-CSID</name>
          <t indent="0" pn="section-7.2.1-1">When processing an IPv6 packet that matches a FIB entry locally instantiated as an End.XLBS SID with the NEXT-CSID flavor and associated with the target Locator-Block B2/m, the SR segment endpoint node applies the procedure specified in <xref target="sec-next-endx" format="default" sectionFormat="of" derivedContent="Section 4.1.2"/> with the lines N05 to N06 (of the pseudocode in <xref target="sec-next-end" format="default" sectionFormat="of" derivedContent="Section 4.1.1"/>) replaced as follows.</t>
          <sourcecode type="pseudocode" markers="false" pn="section-7.2.1-2">
N05.1. Initialize an IPv6 address A equal to B2.
N05.2. Copy DA.Argument into the bits [m..(m+AL-1)] of A.
N06.   Copy A to the Destination Address of the IPv6 header.
</sourcecode>
        </section>
        <section anchor="sec-replace-endxlbs" numbered="true" removeInRFC="false" toc="include" pn="section-7.2.2">
          <name slugifiedName="name-endxlbs-with-replace-csid">End.XLBS with REPLACE-CSID</name>
          <t indent="0" pn="section-7.2.2-1">When processing an IPv6 packet that matches a FIB entry locally instantiated as an End.XLBS SID with the REPLACE-CSID flavor and associated with the target Locator-Block B2/m, the SR segment endpoint node applies the procedure specified in <xref target="sec-replace-endx" format="default" sectionFormat="of" derivedContent="Section 4.2.2"/> with the line R20 (of the pseudocode in <xref target="sec-replace-end" format="default" sectionFormat="of" derivedContent="Section 4.2.1"/>) replaced as follows.</t>
          <sourcecode type="pseudocode" markers="false" pn="section-7.2.2-2">
R20.1. Initialize an IPv6 address A equal to B2.
R20.2. Write Segment List[Segments Left][DA.Arg.Index] into the bits
         [m..m+LNFL-1] of A.
R20.3. Write DA.Arg.Index into the bits
         [(128-ceiling(log_2(128/LNFL)))..127] of A.
R20.4. Copy A to the Destination Address of the IPv6 header.
</sourcecode>
        </section>
      </section>
    </section>
    <section anchor="sec-control-plane" numbered="true" removeInRFC="false" toc="include" pn="section-8">
      <name slugifiedName="name-control-plane">Control Plane</name>
      <t indent="0" pn="section-8-1"><xref target="RFC8986" sectionFormat="of" section="8" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8986#section-8" derivedContent="RFC8986"/> provides an overview of the control plane protocols used for signaling of the SRv6 endpoint behaviors introduced by that document, including the base SRv6 endpoint behaviors that are extended in the present document.</t>
      <t indent="0" pn="section-8-2">The CSID-flavored behaviors introduced by this document are advertised in the same manner as their base SRv6 endpoint behaviors using the SRv6 extensions for various routing protocols, such as:</t>
      <ul spacing="normal" bare="false" empty="false" indent="3" pn="section-8-3">
        <li pn="section-8-3.1">
          <t indent="0" pn="section-8-3.1.1">IS-IS <xref target="RFC9352" format="default" sectionFormat="of" derivedContent="RFC9352"/></t>
        </li>
        <li pn="section-8-3.2">
          <t indent="0" pn="section-8-3.2.1">OSPFv3 <xref target="RFC9513" format="default" sectionFormat="of" derivedContent="RFC9513"/></t>
        </li>
        <li pn="section-8-3.3">
          <t indent="0" pn="section-8-3.3.1">BGP <xref target="RFC9252" format="default" sectionFormat="of" derivedContent="RFC9252"/>, <xref target="RFC9514" format="default" sectionFormat="of" derivedContent="RFC9514"/>, <xref target="I-D.ietf-idr-sr-policy-safi" format="default" sectionFormat="of" derivedContent="BGP-SR-Policy"/></t>
        </li>
        <li pn="section-8-3.4">
          <t indent="0" pn="section-8-3.4.1">BGP-LS <xref target="I-D.ietf-idr-bgp-ls-sr-policy" format="default" sectionFormat="of" derivedContent="BGP-LS-SR-Policy"/></t>
        </li>
        <li pn="section-8-3.5">
          <t indent="0" pn="section-8-3.5.1">PCEP <xref target="RFC9603" format="default" sectionFormat="of" derivedContent="RFC9603"/></t>
        </li>
      </ul>
      <t indent="0" pn="section-8-4">The SR segment endpoint node <bcp14>MUST</bcp14> set the SID Argument bits to 0 when advertising a locally instantiated SID of this document in the routing protocol (e.g., IS-IS <xref target="RFC9352" format="default" sectionFormat="of" derivedContent="RFC9352"/>, OSPF <xref target="RFC9513" format="default" sectionFormat="of" derivedContent="RFC9513"/>, or BGP-LS <xref target="RFC9514" format="default" sectionFormat="of" derivedContent="RFC9514"/>).</t>
      <t indent="0" pn="section-8-5">Signaling the SRv6 SID Structure is <bcp14>REQUIRED</bcp14> for all the SIDs introduced in this document. It is used by an SR source node to compress a SID list as described in <xref target="sec-source-node" format="default" sectionFormat="of" derivedContent="Section 6"/>.
The node initiating the SID advertisement <bcp14>MUST</bcp14> set the length values in the SRv6 SID Structure to match the format of the SID on the SR segment endpoint node. For example, for a SID of this document instantiated from a /48 SRv6 SID block and a /64 Locator, and having a 16-bit Function, the SRv6 SID Structure advertisement carries the following values.</t>
      <ul spacing="normal" bare="false" empty="false" indent="3" pn="section-8-6">
        <li pn="section-8-6.1">
          <t indent="0" pn="section-8-6.1.1">LBL: 48</t>
        </li>
        <li pn="section-8-6.2">
          <t indent="0" pn="section-8-6.2.1">LNL: 16</t>
        </li>
        <li pn="section-8-6.3">
          <t indent="0" pn="section-8-6.3.1">FL: 16</t>
        </li>
        <li pn="section-8-6.4">
          <t indent="0" pn="section-8-6.4.1">AL: 48 (= 128-48-16-16)</t>
        </li>
      </ul>
      <t indent="0" pn="section-8-7">A local CSID may be advertised in the control plane individually and/or in combination with a global CSID instantiated on the same SR segment endpoint node, with the End behavior, and the same Locator-Block and flavor as the local CSID. A combined global and local CSID is advertised as follows:</t>
      <ul spacing="normal" bare="false" empty="false" indent="3" pn="section-8-8">
        <li pn="section-8-8.1">
          <t indent="0" pn="section-8-8.1.1">The SID Locator-Block is that shared by the global and local CSIDs</t>
        </li>
        <li pn="section-8-8.2">
          <t indent="0" pn="section-8-8.2.1">The SID Locator-Node is that of the global CSID</t>
        </li>
        <li pn="section-8-8.3">
          <t indent="0" pn="section-8-8.3.1">The SID Function is that of the local CSID</t>
        </li>
        <li pn="section-8-8.4">
          <t indent="0" pn="section-8-8.4.1">The SID AL is equal to 128-LBL-LNL-FL and the SID Argument value is 0</t>
        </li>
        <li pn="section-8-8.5">
          <t indent="0" pn="section-8-8.5.1">All other attributes of the SID (e.g., SRv6 endpoint behavior or algorithm) are those of the local CSID</t>
        </li>
      </ul>
      <t indent="0" pn="section-8-9">The combined advertisement of local CSIDs with a global CSID is needed in particular for control plane protocols mandating that the SID is a subnet of a locator advertised in the same protocol (e.g., <xref target="RFC9352" sectionFormat="of" section="8" format="default" derivedLink="https://rfc-editor.org/rfc/rfc9352#section-8" derivedContent="RFC9352"/> and <xref target="RFC9513" sectionFormat="of" section="9" format="default" derivedLink="https://rfc-editor.org/rfc/rfc9513#section-9" derivedContent="RFC9513"/> for advertising Adjacency SIDs in IS-IS and OSPFv3, respectively).</t>
      <t indent="0" pn="section-8-10">For a segment list computed by a controller and signaled to an SR source node (e.g., via BGP <xref target="I-D.ietf-idr-sr-policy-safi" format="default" sectionFormat="of" derivedContent="BGP-SR-Policy"/> or PCEP <xref target="RFC9603" format="default" sectionFormat="of" derivedContent="RFC9603"/>), the controller provides the ordered segment list comprising the uncompressed SIDs, with their respective behavior and structure, to the SR source node. The SR source node may then compress the SID list as described in <xref target="sec-source-node" format="default" sectionFormat="of" derivedContent="Section 6"/>.</t>
      <t indent="0" pn="section-8-11">When a node receives an advertisement of a SID of this document that it does not support, it handles the advertisement as described in the corresponding control plane specification (e.g., Sections <xref target="RFC9352" sectionFormat="bare" section="7.2" format="default" derivedLink="https://rfc-editor.org/rfc/rfc9352#section-7.2" derivedContent="RFC9352"/>, <xref target="RFC9352" sectionFormat="bare" section="8.1" format="default" derivedLink="https://rfc-editor.org/rfc/rfc9352#section-8.1" derivedContent="RFC9352"/>, and <xref target="RFC9352" sectionFormat="bare" section="8.2" format="default" derivedLink="https://rfc-editor.org/rfc/rfc9352#section-8.2" derivedContent="RFC9352"/> of <xref target="RFC9352" format="default" sectionFormat="of" derivedContent="RFC9352"/>, Sections <xref target="RFC9513" sectionFormat="bare" section="8" format="default" derivedLink="https://rfc-editor.org/rfc/rfc9513#section-8" derivedContent="RFC9513"/>, <xref target="RFC9513" sectionFormat="bare" section="9.1" format="default" derivedLink="https://rfc-editor.org/rfc/rfc9513#section-9.1" derivedContent="RFC9513"/>, and <xref target="RFC9513" sectionFormat="bare" section="9.2" format="default" derivedLink="https://rfc-editor.org/rfc/rfc9513#section-9.2" derivedContent="RFC9513"/> of <xref target="RFC9513" format="default" sectionFormat="of" derivedContent="RFC9513"/>, and <xref target="RFC9252" sectionFormat="of" section="3.1" format="default" derivedLink="https://rfc-editor.org/rfc/rfc9252#section-3.1" derivedContent="RFC9252"/>).</t>
    </section>
    <section anchor="operational-considerations" numbered="true" removeInRFC="false" toc="include" pn="section-9">
      <name slugifiedName="name-operational-considerations">Operational Considerations</name>
      <section anchor="flavor-block-and-csid-length" numbered="true" removeInRFC="false" toc="include" pn="section-9.1">
        <name slugifiedName="name-flavor-block-and-csid-lengt">Flavor, Block, and CSID Length</name>
        <t indent="0" pn="section-9.1-1">SRv6 is intended for use in a variety of networks that require different prefix lengths and SID numbering spaces. Each of the two flavors introduced in this document comes with its own recommendations for Locator-Block and CSID length, as specified in Sections <xref target="sec-next" format="counter" sectionFormat="of" derivedContent="4.1"/> and <xref target="sec-replace" format="counter" sectionFormat="of" derivedContent="4.2"/>. These flavors are best suited for different environments, depending on the requirements of the network. For instance, larger CSID lengths may be more suitable for networks requiring ample SID numbering space, while smaller CSID lengths are better for compression efficiency. The two compression flavors allow the compressed segment list encoding to adapt to a range of requirements, with support for multiple compression levels. Network operators can choose the flavor that best suits their use case, deployment design, and network scale.</t>
        <t indent="0" pn="section-9.1-2">Both CSID flavors can coexist in the same SR domain, on the same SR segment endpoint node, and even in the same segment list. However, operators should generally avoid instantiating SIDs of different CSID flavors within the same routing domain or Locator-Block since these SIDs have different length and allocation recommendations (see Sections <xref target="sec-next" format="counter" sectionFormat="of" derivedContent="4.1"/>, <xref target="sec-replace" format="counter" sectionFormat="of" derivedContent="4.2"/>, and <xref target="sec-csid-lib-recommendation" format="counter" sectionFormat="of" derivedContent="9.2"/>). In a multi-domain deployment, different flavors may be used in different routing domains of the SR domain.</t>
        <t indent="0" pn="section-9.1-3">A deployment should use consistent LBLs and CSID lengths for all SIDs within a routing domain. Heterogeneous lengths, while possible, may impact the compression efficiency.</t>
        <t indent="0" pn="section-9.1-4">The compressed segment list encoding works with various Locator-Block allocations. For example, each routing domain within the SR domain can be allocated a /48 Locator-Block from a global IPv6 block available to the operator or from a prefix allocated to SRv6 SIDs as discussed in <xref target="RFC9602" sectionFormat="of" section="5" format="default" derivedLink="https://rfc-editor.org/rfc/rfc9602#section-5" derivedContent="RFC9602"/>.</t>
      </section>
      <section anchor="sec-csid-lib-recommendation" numbered="true" removeInRFC="false" toc="include" pn="section-9.2">
        <name slugifiedName="name-gib-lib-usage">GIB/LIB Usage</name>
        <t indent="0" pn="section-9.2-1">GIB and LIB usage is a local implementation and/or configuration decision; however, some guidelines for determining usage for specific SRv6 endpoint behaviors and recommendations are provided.</t>
        <t indent="0" pn="section-9.2-2">The GIB number space is shared among all SR segment endpoint nodes using SRv6 locators under a Locator-Block space.  The more SIDs assigned from this space, per node, the faster it is exhausted.  Therefore, its use is prioritized for global segments, such as SIDs that identify a node.</t>
        <t indent="0" pn="section-9.2-3">The LIB number space is unique per node. Each node can fully utilize the entire LIB number space without consideration for assignments at other nodes.  Therefore, its use is prioritized for local segments, such as SIDs that identify services (of which there may be many) at nodes, cross-connects, or adjacencies.</t>
        <t indent="0" pn="section-9.2-4">While a longer CSID length permits more flexibility in which SRv6 endpoint behaviors may be assigned from the GIB, it also reduces the compression efficiency.</t>
        <t indent="0" pn="section-9.2-5">Given the previous Locator-Block and CSID length recommendations, the following GIB/LIB usage is recommended:</t>
        <ul spacing="normal" bare="false" empty="false" indent="3" pn="section-9.2-6">
          <li pn="section-9.2-6.1">
            <t indent="0" pn="section-9.2-6.1.1">NEXT-CSID:
            </t>
            <ul spacing="normal" bare="false" empty="false" indent="3" pn="section-9.2-6.1.2">
              <li pn="section-9.2-6.1.2.1">
                <t indent="0" pn="section-9.2-6.1.2.1.1">GIB: End</t>
              </li>
              <li pn="section-9.2-6.1.2.2">
                <t indent="0" pn="section-9.2-6.1.2.2.1">LIB: End.X, End.T, End.DT4/6/46/2U/2M, End.DX4/6/2/2V (including large-scale pseudowire), End.B6.Encaps, End.B6.Encaps.Red, End.BM, End.LBS, and End.XLBS</t>
              </li>
            </ul>
          </li>
          <li pn="section-9.2-6.2">
            <t indent="0" pn="section-9.2-6.2.1">REPLACE-CSID:
            </t>
            <ul spacing="normal" bare="false" empty="false" indent="3" pn="section-9.2-6.2.2">
              <li pn="section-9.2-6.2.2.1">
                <t indent="0" pn="section-9.2-6.2.2.1.1">GIB: End, End.X, End.T, End.DT4/6/46/2U/2M, End.DX4/6/2/2V, End.B6.Encaps, End.B6.Encaps.Red, End.BM, End.LBS, and End.XLBS</t>
              </li>
              <li pn="section-9.2-6.2.2.2">
                <t indent="0" pn="section-9.2-6.2.2.2.1">LIB: End.DX2/2V for large-scale pseudowire</t>
              </li>
            </ul>
          </li>
        </ul>
        <t indent="0" pn="section-9.2-7">Any other allocation is possible but may lead to a suboptimal use of the CSID numbering space.</t>
      </section>
      <section anchor="pinging-a-sid" numbered="true" removeInRFC="false" toc="include" pn="section-9.3">
        <name slugifiedName="name-pinging-a-sid">Pinging a SID</name>
        <t indent="0" pn="section-9.3-1">An SR source node may ping an SRv6 SID by sending an ICMPv6 echo request packet destined to the SRv6 SID. The SR source node may ping the target SID with a SID list comprising only that target SID or with a longer one that comprises two or more SIDs. In that case, the target SID is the last element in the SID list. This operation is illustrated in <xref section="A.1.2" target="RFC9259" format="default" sectionFormat="of" derivedLink="https://rfc-editor.org/rfc/rfc9259#appendix-A.1.2" derivedContent="RFC9259"/>.</t>
        <t indent="0" pn="section-9.3-2">When pinging a SID of this document, the SR source node <bcp14>MUST</bcp14> construct the IPv6 packet as described in <xref target="sec-source-node" format="default" sectionFormat="of" derivedContent="Section 6"/>, including computing the ICMPv6 checksum as described in <xref target="sec-source-checksum" format="default" sectionFormat="of" derivedContent="Section 6.5"/>.</t>
        <t indent="0" pn="section-9.3-3">In particular, when pinging a SID of this document with a SID list comprising only the target SID, the SR source node places the SID with Argument value 0 in the Destination Address of the ICMPv6 echo request and computes the ICMPv6 checksum using this SID as the Destination Address in the IPv6 pseudo-header. The Argument value 0 allows the SID SR segment endpoint node (<xref target="sec-endpoint" format="default" sectionFormat="of" derivedContent="Section 4"/>) to identify itself as the ultimate destination of the packet and process the ICMPv6 payload.
Therefore, any existing IPv6 ping implementation can originate ICMP echo requests to a NEXT-CSID or REPLACE-CSID flavor SID with a SID list comprising only the target SID, provided that the user ensures that the SID Argument is 0.</t>
      </section>
      <section anchor="sec-operations-icmp-error" numbered="true" removeInRFC="false" toc="include" pn="section-9.4">
        <name slugifiedName="name-icmp-error-processing">ICMP Error Processing</name>
        <t indent="0" pn="section-9.4-1">When an IPv6 node encounters an error while processing a packet, it may report that error by sending an IPv6 error message to the packet source with an enclosed copy of the invoking packet. For the source of an invoking packet to process the ICMP error message, the ultimate Destination Address of the IPv6 header may be required.</t>
        <t indent="0" pn="section-9.4-2"><xref target="RFC8754" sectionFormat="of" section="5.4" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8754#section-5.4" derivedContent="RFC8754"/> defines the logic that an SR source node follows to determine the ultimate destination of an invoking packet containing an SRH.</t>
        <t indent="0" pn="section-9.4-3">For an SR source node that supports the compressed segment list encoding defined in this document, the logic to determine the ultimate destination is generalized as follows.</t>
        <ul spacing="normal" bare="false" empty="false" indent="3" pn="section-9.4-4">
          <li pn="section-9.4-4.1">
            <t indent="0" pn="section-9.4-4.1.1">If the Destination Address of the invoking IPv6 packet matches a known SRv6 SID, modify the invoking IPv6 packet by applying the SRv6 endpoint behavior associated with the matched SRv6 SID;</t>
          </li>
          <li pn="section-9.4-4.2">
            <t indent="0" pn="section-9.4-4.2.1">Repeat until the application of the SRv6 endpoint behavior would result in the processing of the upper-layer header.</t>
          </li>
        </ul>
        <t indent="0" pn="section-9.4-5">The Destination Address of the resulting IPv6 packet may be used as the ultimate destination of the invoking IPv6 packet.</t>
        <t indent="0" pn="section-9.4-6">Since the SR source node that needs to determine the ultimate destination is the same node that originally built the SID list in the invoking packet, it can perform this operation for all the SIDs in the packet.</t>
      </section>
    </section>
    <section anchor="sec-future" numbered="true" removeInRFC="false" toc="include" pn="section-10">
      <name slugifiedName="name-applicability-to-other-srv6">Applicability to Other SRv6 Endpoint Behaviors</name>
      <t indent="0" pn="section-10-1">Future documents may extend the applicability of the NEXT-CSID and REPLACE-CSID flavors to other SRv6 endpoint behaviors.</t>
      <t indent="0" pn="section-10-2">For an SRv6 endpoint behavior that can be used before the last position of a segment list, a CSID flavor is defined by reproducing the same logic as described in Sections <xref target="sec-next" format="counter" sectionFormat="of" derivedContent="4.1"/> and <xref target="sec-replace" format="counter" sectionFormat="of" derivedContent="4.2"/> to determine the next SID in the SID list.</t>
    </section>
    <section anchor="security-considerations" numbered="true" removeInRFC="false" toc="include" pn="section-11">
      <name slugifiedName="name-security-considerations">Security Considerations</name>
      <t indent="0" pn="section-11-1"><xref target="RFC8402" sectionFormat="of" section="8" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8402#section-8" derivedContent="RFC8402"/> discusses the security considerations for Segment Routing.</t>
      <t indent="0" pn="section-11-2"><xref target="RFC8754" sectionFormat="of" section="5" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8754#section-5" derivedContent="RFC8754"/> describes the intra-SR-domain deployment model and how to secure it. <xref target="RFC8754" sectionFormat="of" section="7" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8754#section-7" derivedContent="RFC8754"/> describes the threats applicable to SRv6 and how to mitigate them.</t>
      <t indent="0" pn="section-11-3"><xref target="RFC8986" sectionFormat="of" section="9" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8986#section-9" derivedContent="RFC8986"/> discusses the security considerations applicable to the SRv6 network programming framework, as well as the SR source node and SR segment endpoint node behaviors that it defines.</t>
      <t indent="0" pn="section-11-4">This document introduces two new flavors, NEXT-CSID and REPLACE-CSID, for some of the SRv6 endpoint behaviors defined in <xref target="RFC8986" format="default" sectionFormat="of" derivedContent="RFC8986"/> and a method by which an SR source node may leverage the SIDs of these flavors to produce a compressed segment list encoding.</t>
      <t indent="0" pn="section-11-5">This document also introduces two new SRv6 endpoint behaviors, End.LBS and End.XLBS, to preserve the efficiency of CSID compression in multi-domain environments.</t>
      <t indent="0" pn="section-11-6">An SR source node constructs an IPv6 packet with a compressed segment list encoding as defined in Sections <xref target="RFC8754" sectionFormat="bare" section="3.1" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8754#section-3.1" derivedContent="RFC8754"/> and <xref target="RFC8754" sectionFormat="bare" section="4.1" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8754#section-4.1" derivedContent="RFC8754"/> of <xref target="RFC8754" format="default" sectionFormat="of" derivedContent="RFC8754"/> and <xref target="RFC8986" sectionFormat="of" section="5" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8986#section-5" derivedContent="RFC8986"/>. The paths that an SR source node may enforce using a compressed segment list encoding are the same, from a topology and service perspective, as those that an SR source node could enforce using the SIDs of <xref target="RFC8986" format="default" sectionFormat="of" derivedContent="RFC8986"/>.</t>
      <t indent="0" pn="section-11-7">An SR segment endpoint node processes an IPv6 packet matching a locally instantiated SID as defined in <xref target="RFC8986" format="default" sectionFormat="of" derivedContent="RFC8986"/>, with the pseudocode modifications in <xref target="sec-endpoint" format="default" sectionFormat="of" derivedContent="Section 4"/> of this document. These modifications change how the SR segment endpoint node determines the next SID in the packet but not the semantic of either the active or the next SID. For example, an adjacency segment instantiated with the End.X behavior remains an adjacency segment regardless of whether it uses the base End.X behavior defined in <xref target="RFC8986" sectionFormat="of" section="4.2" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8986#section-4.2" derivedContent="RFC8986"/> or a CSID flavor of that behavior. This document does not introduce any new SID semantic.</t>
      <t indent="0" pn="section-11-8">Any other transit node processes the packet as described in <xref target="RFC8754" sectionFormat="of" section="4.2" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8754#section-4.2" derivedContent="RFC8754"/>.</t>
      <t indent="0" pn="section-11-9">This document defines a new method of encoding the SIDs inside a SID list at the SR source node (<xref target="sec-source-node" format="default" sectionFormat="of" derivedContent="Section 6"/>) and decoding them at the SR segment endpoint node (see Sections <xref target="sec-endpoint" format="counter" sectionFormat="of" derivedContent="4"/> and <xref target="sec-inter-domain" format="counter" sectionFormat="of" derivedContent="7"/>), but it does not change how the SID list itself is encoded in the IPv6 packet nor the semantic of any segment that it comprises. Therefore, this document is subject to the same security considerations that are discussed in <xref target="RFC8402" format="default" sectionFormat="of" derivedContent="RFC8402"/>, <xref target="RFC8754" format="default" sectionFormat="of" derivedContent="RFC8754"/>, and <xref target="RFC8986" format="default" sectionFormat="of" derivedContent="RFC8986"/>.</t>
    </section>
    <section anchor="iana-considerations" numbered="true" removeInRFC="false" toc="include" pn="section-12">
      <name slugifiedName="name-iana-considerations">IANA Considerations</name>
      <section anchor="srv6-endpoint-behaviors" numbered="true" removeInRFC="false" toc="include" pn="section-12.1">
        <name slugifiedName="name-srv6-endpoint-behaviors">SRv6 Endpoint Behaviors</name>
        <t indent="0" pn="section-12.1-1">IANA has updated the reference of the following registrations from the "SRv6 Endpoint Behaviors" registry under the "Segment Routing" registry group (<eref brackets="angle" target="https://www.iana.org/assignments/segment-routing/"/>) to point to this document and transfer change control to the IETF.</t>
        <table anchor="tbl-iana-endpoint-behaviors" align="center" pn="table-1">
          <name slugifiedName="name-srv6-endpoint-behaviors-reg">SRv6 Endpoint Behaviors Registration List</name>
          <thead>
            <tr>
              <th align="left" colspan="1" rowspan="1">Value</th>
              <th align="left" colspan="1" rowspan="1">Description</th>
              <th align="left" colspan="1" rowspan="1">Reference</th>
            </tr>
          </thead>
          <tbody>
            <tr>
              <td align="left" colspan="1" rowspan="1">43</td>
              <td align="left" colspan="1" rowspan="1">End with NEXT-CSID</td>
              <td align="left" colspan="1" rowspan="1">RFC 9800</td>
            </tr>
            <tr>
              <td align="left" colspan="1" rowspan="1">44</td>
              <td align="left" colspan="1" rowspan="1">End with NEXT-CSID &amp; PSP</td>
              <td align="left" colspan="1" rowspan="1">RFC 9800</td>
            </tr>
            <tr>
              <td align="left" colspan="1" rowspan="1">45</td>
              <td align="left" colspan="1" rowspan="1">End with NEXT-CSID &amp; USP</td>
              <td align="left" colspan="1" rowspan="1">RFC 9800</td>
            </tr>
            <tr>
              <td align="left" colspan="1" rowspan="1">46</td>
              <td align="left" colspan="1" rowspan="1">End with NEXT-CSID, PSP &amp; USP</td>
              <td align="left" colspan="1" rowspan="1">RFC 9800</td>
            </tr>
            <tr>
              <td align="left" colspan="1" rowspan="1">47</td>
              <td align="left" colspan="1" rowspan="1">End with NEXT-CSID &amp; USD</td>
              <td align="left" colspan="1" rowspan="1">RFC 9800</td>
            </tr>
            <tr>
              <td align="left" colspan="1" rowspan="1">48</td>
              <td align="left" colspan="1" rowspan="1">End with NEXT-CSID, PSP &amp; USD</td>
              <td align="left" colspan="1" rowspan="1">RFC 9800</td>
            </tr>
            <tr>
              <td align="left" colspan="1" rowspan="1">49</td>
              <td align="left" colspan="1" rowspan="1">End with NEXT-CSID, USP &amp; USD</td>
              <td align="left" colspan="1" rowspan="1">RFC 9800</td>
            </tr>
            <tr>
              <td align="left" colspan="1" rowspan="1">50</td>
              <td align="left" colspan="1" rowspan="1">End with NEXT-CSID, PSP, USP &amp; USD</td>
              <td align="left" colspan="1" rowspan="1">RFC 9800</td>
            </tr>
            <tr>
              <td align="left" colspan="1" rowspan="1">52</td>
              <td align="left" colspan="1" rowspan="1">End.X with NEXT-CSID</td>
              <td align="left" colspan="1" rowspan="1">RFC 9800</td>
            </tr>
            <tr>
              <td align="left" colspan="1" rowspan="1">53</td>
              <td align="left" colspan="1" rowspan="1">End.X with NEXT-CSID &amp; PSP</td>
              <td align="left" colspan="1" rowspan="1">RFC 9800</td>
            </tr>
            <tr>
              <td align="left" colspan="1" rowspan="1">54</td>
              <td align="left" colspan="1" rowspan="1">End.X with NEXT-CSID &amp; USP</td>
              <td align="left" colspan="1" rowspan="1">RFC 9800</td>
            </tr>
            <tr>
              <td align="left" colspan="1" rowspan="1">55</td>
              <td align="left" colspan="1" rowspan="1">End.X with NEXT-CSID, PSP &amp; USP</td>
              <td align="left" colspan="1" rowspan="1">RFC 9800</td>
            </tr>
            <tr>
              <td align="left" colspan="1" rowspan="1">56</td>
              <td align="left" colspan="1" rowspan="1">End.X with NEXT-CSID &amp; USD</td>
              <td align="left" colspan="1" rowspan="1">RFC 9800</td>
            </tr>
            <tr>
              <td align="left" colspan="1" rowspan="1">57</td>
              <td align="left" colspan="1" rowspan="1">End.X with NEXT-CSID, PSP &amp; USD</td>
              <td align="left" colspan="1" rowspan="1">RFC 9800</td>
            </tr>
            <tr>
              <td align="left" colspan="1" rowspan="1">58</td>
              <td align="left" colspan="1" rowspan="1">End.X with NEXT-CSID, USP &amp; USD</td>
              <td align="left" colspan="1" rowspan="1">RFC 9800</td>
            </tr>
            <tr>
              <td align="left" colspan="1" rowspan="1">59</td>
              <td align="left" colspan="1" rowspan="1">End.X with NEXT-CSID, PSP, USP &amp; USD</td>
              <td align="left" colspan="1" rowspan="1">RFC 9800</td>
            </tr>
            <tr>
              <td align="left" colspan="1" rowspan="1">85</td>
              <td align="left" colspan="1" rowspan="1">End.T with NEXT-CSID</td>
              <td align="left" colspan="1" rowspan="1">RFC 9800</td>
            </tr>
            <tr>
              <td align="left" colspan="1" rowspan="1">86</td>
              <td align="left" colspan="1" rowspan="1">End.T with NEXT-CSID &amp; PSP</td>
              <td align="left" colspan="1" rowspan="1">RFC 9800</td>
            </tr>
            <tr>
              <td align="left" colspan="1" rowspan="1">87</td>
              <td align="left" colspan="1" rowspan="1">End.T with NEXT-CSID &amp; USP</td>
              <td align="left" colspan="1" rowspan="1">RFC 9800</td>
            </tr>
            <tr>
              <td align="left" colspan="1" rowspan="1">88</td>
              <td align="left" colspan="1" rowspan="1">End.T with NEXT-CSID, PSP &amp; USP</td>
              <td align="left" colspan="1" rowspan="1">RFC 9800</td>
            </tr>
            <tr>
              <td align="left" colspan="1" rowspan="1">89</td>
              <td align="left" colspan="1" rowspan="1">End.T with NEXT-CSID &amp; USD</td>
              <td align="left" colspan="1" rowspan="1">RFC 9800</td>
            </tr>
            <tr>
              <td align="left" colspan="1" rowspan="1">90</td>
              <td align="left" colspan="1" rowspan="1">End.T with NEXT-CSID, PSP &amp; USD</td>
              <td align="left" colspan="1" rowspan="1">RFC 9800</td>
            </tr>
            <tr>
              <td align="left" colspan="1" rowspan="1">91</td>
              <td align="left" colspan="1" rowspan="1">End.T with NEXT-CSID, USP &amp; USD</td>
              <td align="left" colspan="1" rowspan="1">RFC 9800</td>
            </tr>
            <tr>
              <td align="left" colspan="1" rowspan="1">92</td>
              <td align="left" colspan="1" rowspan="1">End.T with NEXT-CSID, PSP, USP &amp; USD</td>
              <td align="left" colspan="1" rowspan="1">RFC 9800</td>
            </tr>
            <tr>
              <td align="left" colspan="1" rowspan="1">93</td>
              <td align="left" colspan="1" rowspan="1">End.B6.Encaps with NEXT-CSID</td>
              <td align="left" colspan="1" rowspan="1">RFC 9800</td>
            </tr>
            <tr>
              <td align="left" colspan="1" rowspan="1">94</td>
              <td align="left" colspan="1" rowspan="1">End.B6.Encaps.Red with NEXT-CSID</td>
              <td align="left" colspan="1" rowspan="1">RFC 9800</td>
            </tr>
            <tr>
              <td align="left" colspan="1" rowspan="1">95</td>
              <td align="left" colspan="1" rowspan="1">End.BM with NEXT-CSID</td>
              <td align="left" colspan="1" rowspan="1">RFC 9800</td>
            </tr>
            <tr>
              <td align="left" colspan="1" rowspan="1">96</td>
              <td align="left" colspan="1" rowspan="1">End.LBS with NEXT-CSID</td>
              <td align="left" colspan="1" rowspan="1">RFC 9800</td>
            </tr>
            <tr>
              <td align="left" colspan="1" rowspan="1">97</td>
              <td align="left" colspan="1" rowspan="1">End.XLBS with NEXT-CSID</td>
              <td align="left" colspan="1" rowspan="1">RFC 9800</td>
            </tr>
            <tr>
              <td align="left" colspan="1" rowspan="1">101</td>
              <td align="left" colspan="1" rowspan="1">End with REPLACE-CSID</td>
              <td align="left" colspan="1" rowspan="1">RFC 9800</td>
            </tr>
            <tr>
              <td align="left" colspan="1" rowspan="1">102</td>
              <td align="left" colspan="1" rowspan="1">End with REPLACE-CSID &amp; PSP</td>
              <td align="left" colspan="1" rowspan="1">RFC 9800</td>
            </tr>
            <tr>
              <td align="left" colspan="1" rowspan="1">103</td>
              <td align="left" colspan="1" rowspan="1">End with REPLACE-CSID &amp; USP</td>
              <td align="left" colspan="1" rowspan="1">RFC 9800</td>
            </tr>
            <tr>
              <td align="left" colspan="1" rowspan="1">104</td>
              <td align="left" colspan="1" rowspan="1">End with REPLACE-CSID, PSP &amp; USP</td>
              <td align="left" colspan="1" rowspan="1">RFC 9800</td>
            </tr>
            <tr>
              <td align="left" colspan="1" rowspan="1">105</td>
              <td align="left" colspan="1" rowspan="1">End.X with REPLACE-CSID</td>
              <td align="left" colspan="1" rowspan="1">RFC 9800</td>
            </tr>
            <tr>
              <td align="left" colspan="1" rowspan="1">106</td>
              <td align="left" colspan="1" rowspan="1">End.X with REPLACE-CSID &amp; PSP</td>
              <td align="left" colspan="1" rowspan="1">RFC 9800</td>
            </tr>
            <tr>
              <td align="left" colspan="1" rowspan="1">107</td>
              <td align="left" colspan="1" rowspan="1">End.X with REPLACE-CSID &amp; USP</td>
              <td align="left" colspan="1" rowspan="1">RFC 9800</td>
            </tr>
            <tr>
              <td align="left" colspan="1" rowspan="1">108</td>
              <td align="left" colspan="1" rowspan="1">End.X with REPLACE-CSID, PSP &amp; USP</td>
              <td align="left" colspan="1" rowspan="1">RFC 9800</td>
            </tr>
            <tr>
              <td align="left" colspan="1" rowspan="1">109</td>
              <td align="left" colspan="1" rowspan="1">End.T with REPLACE-CSID</td>
              <td align="left" colspan="1" rowspan="1">RFC 9800</td>
            </tr>
            <tr>
              <td align="left" colspan="1" rowspan="1">110</td>
              <td align="left" colspan="1" rowspan="1">End.T with REPLACE-CSID &amp; PSP</td>
              <td align="left" colspan="1" rowspan="1">RFC 9800</td>
            </tr>
            <tr>
              <td align="left" colspan="1" rowspan="1">111</td>
              <td align="left" colspan="1" rowspan="1">End.T with REPLACE-CSID &amp; USP</td>
              <td align="left" colspan="1" rowspan="1">RFC 9800</td>
            </tr>
            <tr>
              <td align="left" colspan="1" rowspan="1">112</td>
              <td align="left" colspan="1" rowspan="1">End.T with REPLACE-CSID, PSP &amp; USP</td>
              <td align="left" colspan="1" rowspan="1">RFC 9800</td>
            </tr>
            <tr>
              <td align="left" colspan="1" rowspan="1">114</td>
              <td align="left" colspan="1" rowspan="1">End.B6.Encaps with REPLACE-CSID</td>
              <td align="left" colspan="1" rowspan="1">RFC 9800</td>
            </tr>
            <tr>
              <td align="left" colspan="1" rowspan="1">115</td>
              <td align="left" colspan="1" rowspan="1">End.BM with REPLACE-CSID</td>
              <td align="left" colspan="1" rowspan="1">RFC 9800</td>
            </tr>
            <tr>
              <td align="left" colspan="1" rowspan="1">116</td>
              <td align="left" colspan="1" rowspan="1">End.DX6 with REPLACE-CSID</td>
              <td align="left" colspan="1" rowspan="1">RFC 9800</td>
            </tr>
            <tr>
              <td align="left" colspan="1" rowspan="1">117</td>
              <td align="left" colspan="1" rowspan="1">End.DX4 with REPLACE-CSID</td>
              <td align="left" colspan="1" rowspan="1">RFC 9800</td>
            </tr>
            <tr>
              <td align="left" colspan="1" rowspan="1">118</td>
              <td align="left" colspan="1" rowspan="1">End.DT6 with REPLACE-CSID</td>
              <td align="left" colspan="1" rowspan="1">RFC 9800</td>
            </tr>
            <tr>
              <td align="left" colspan="1" rowspan="1">119</td>
              <td align="left" colspan="1" rowspan="1">End.DT4 with REPLACE-CSID</td>
              <td align="left" colspan="1" rowspan="1">RFC 9800</td>
            </tr>
            <tr>
              <td align="left" colspan="1" rowspan="1">120</td>
              <td align="left" colspan="1" rowspan="1">End.DT46 with REPLACE-CSID</td>
              <td align="left" colspan="1" rowspan="1">RFC 9800</td>
            </tr>
            <tr>
              <td align="left" colspan="1" rowspan="1">121</td>
              <td align="left" colspan="1" rowspan="1">End.DX2 with REPLACE-CSID</td>
              <td align="left" colspan="1" rowspan="1">RFC 9800</td>
            </tr>
            <tr>
              <td align="left" colspan="1" rowspan="1">122</td>
              <td align="left" colspan="1" rowspan="1">End.DX2V with REPLACE-CSID</td>
              <td align="left" colspan="1" rowspan="1">RFC 9800</td>
            </tr>
            <tr>
              <td align="left" colspan="1" rowspan="1">123</td>
              <td align="left" colspan="1" rowspan="1">End.DT2U with REPLACE-CSID</td>
              <td align="left" colspan="1" rowspan="1">RFC 9800</td>
            </tr>
            <tr>
              <td align="left" colspan="1" rowspan="1">124</td>
              <td align="left" colspan="1" rowspan="1">End.DT2M with REPLACE-CSID</td>
              <td align="left" colspan="1" rowspan="1">RFC 9800</td>
            </tr>
            <tr>
              <td align="left" colspan="1" rowspan="1">127</td>
              <td align="left" colspan="1" rowspan="1">End.B6.Encaps.Red with REPLACE-CSID</td>
              <td align="left" colspan="1" rowspan="1">RFC 9800</td>
            </tr>
            <tr>
              <td align="left" colspan="1" rowspan="1">128</td>
              <td align="left" colspan="1" rowspan="1">End with REPLACE-CSID &amp; USD</td>
              <td align="left" colspan="1" rowspan="1">RFC 9800</td>
            </tr>
            <tr>
              <td align="left" colspan="1" rowspan="1">129</td>
              <td align="left" colspan="1" rowspan="1">End with REPLACE-CSID, PSP &amp; USD</td>
              <td align="left" colspan="1" rowspan="1">RFC 9800</td>
            </tr>
            <tr>
              <td align="left" colspan="1" rowspan="1">130</td>
              <td align="left" colspan="1" rowspan="1">End with REPLACE-CSID, USP &amp; USD</td>
              <td align="left" colspan="1" rowspan="1">RFC 9800</td>
            </tr>
            <tr>
              <td align="left" colspan="1" rowspan="1">131</td>
              <td align="left" colspan="1" rowspan="1">End with REPLACE-CSID, PSP, USP &amp; USD</td>
              <td align="left" colspan="1" rowspan="1">RFC 9800</td>
            </tr>
            <tr>
              <td align="left" colspan="1" rowspan="1">132</td>
              <td align="left" colspan="1" rowspan="1">End.X with REPLACE-CSID &amp; USD</td>
              <td align="left" colspan="1" rowspan="1">RFC 9800</td>
            </tr>
            <tr>
              <td align="left" colspan="1" rowspan="1">133</td>
              <td align="left" colspan="1" rowspan="1">End.X with REPLACE-CSID, PSP &amp; USD</td>
              <td align="left" colspan="1" rowspan="1">RFC 9800</td>
            </tr>
            <tr>
              <td align="left" colspan="1" rowspan="1">134</td>
              <td align="left" colspan="1" rowspan="1">End.X with REPLACE-CSID, USP &amp; USD</td>
              <td align="left" colspan="1" rowspan="1">RFC 9800</td>
            </tr>
            <tr>
              <td align="left" colspan="1" rowspan="1">135</td>
              <td align="left" colspan="1" rowspan="1">End.X with REPLACE-CSID, PSP, USP &amp; USD</td>
              <td align="left" colspan="1" rowspan="1">RFC 9800</td>
            </tr>
            <tr>
              <td align="left" colspan="1" rowspan="1">136</td>
              <td align="left" colspan="1" rowspan="1">End.T with REPLACE-CSID &amp; USD</td>
              <td align="left" colspan="1" rowspan="1">RFC 9800</td>
            </tr>
            <tr>
              <td align="left" colspan="1" rowspan="1">137</td>
              <td align="left" colspan="1" rowspan="1">End.T with REPLACE-CSID, PSP &amp; USD</td>
              <td align="left" colspan="1" rowspan="1">RFC 9800</td>
            </tr>
            <tr>
              <td align="left" colspan="1" rowspan="1">138</td>
              <td align="left" colspan="1" rowspan="1">End.T with REPLACE-CSID, USP &amp; USD</td>
              <td align="left" colspan="1" rowspan="1">RFC 9800</td>
            </tr>
            <tr>
              <td align="left" colspan="1" rowspan="1">139</td>
              <td align="left" colspan="1" rowspan="1">End.T with REPLACE-CSID, PSP, USP &amp; USD</td>
              <td align="left" colspan="1" rowspan="1">RFC 9800</td>
            </tr>
            <tr>
              <td align="left" colspan="1" rowspan="1">140</td>
              <td align="left" colspan="1" rowspan="1">End.LBS with REPLACE-CSID</td>
              <td align="left" colspan="1" rowspan="1">RFC 9800</td>
            </tr>
            <tr>
              <td align="left" colspan="1" rowspan="1">141</td>
              <td align="left" colspan="1" rowspan="1">End.XLBS with REPLACE-CSID</td>
              <td align="left" colspan="1" rowspan="1">RFC 9800</td>
            </tr>
          </tbody>
        </table>
      </section>
    </section>
  </middle>
  <back>
    <displayreference target="I-D.ietf-idr-bgp-ls-sr-policy" to="BGP-LS-SR-Policy"/>
    <displayreference target="I-D.ietf-idr-sr-policy-safi" to="BGP-SR-Policy"/>
    <references anchor="sec-combined-references" pn="section-13">
      <name slugifiedName="name-references">References</name>
      <references anchor="sec-normative-references" pn="section-13.1">
        <name slugifiedName="name-normative-references">Normative References</name>
        <reference anchor="RFC2119" target="https://www.rfc-editor.org/info/rfc2119" quoteTitle="true" derivedAnchor="RFC2119">
          <front>
            <title>Key words for use in RFCs to Indicate Requirement Levels</title>
            <author fullname="S. Bradner" initials="S." surname="Bradner"/>
            <date month="March" year="1997"/>
            <abstract>
              <t indent="0">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="RFC8174" target="https://www.rfc-editor.org/info/rfc8174" quoteTitle="true" derivedAnchor="RFC8174">
          <front>
            <title>Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words</title>
            <author fullname="B. Leiba" initials="B." surname="Leiba"/>
            <date month="May" year="2017"/>
            <abstract>
              <t indent="0">RFC 2119 specifies common key words that may be used in protocol specifications. This document aims to reduce the ambiguity by clarifying that only UPPERCASE usage of the key words have the defined special meanings.</t>
            </abstract>
          </front>
          <seriesInfo name="BCP" value="14"/>
          <seriesInfo name="RFC" value="8174"/>
          <seriesInfo name="DOI" value="10.17487/RFC8174"/>
        </reference>
        <reference anchor="RFC8200" target="https://www.rfc-editor.org/info/rfc8200" quoteTitle="true" derivedAnchor="RFC8200">
          <front>
            <title>Internet Protocol, Version 6 (IPv6) Specification</title>
            <author fullname="S. Deering" initials="S." surname="Deering"/>
            <author fullname="R. Hinden" initials="R." surname="Hinden"/>
            <date month="July" year="2017"/>
            <abstract>
              <t indent="0">This document specifies version 6 of the Internet Protocol (IPv6). It obsoletes RFC 2460.</t>
            </abstract>
          </front>
          <seriesInfo name="STD" value="86"/>
          <seriesInfo name="RFC" value="8200"/>
          <seriesInfo name="DOI" value="10.17487/RFC8200"/>
        </reference>
        <reference anchor="RFC8402" target="https://www.rfc-editor.org/info/rfc8402" quoteTitle="true" derivedAnchor="RFC8402">
          <front>
            <title>Segment Routing Architecture</title>
            <author fullname="C. Filsfils" initials="C." role="editor" surname="Filsfils"/>
            <author fullname="S. Previdi" initials="S." role="editor" surname="Previdi"/>
            <author fullname="L. Ginsberg" initials="L." surname="Ginsberg"/>
            <author fullname="B. Decraene" initials="B." surname="Decraene"/>
            <author fullname="S. Litkowski" initials="S." surname="Litkowski"/>
            <author fullname="R. Shakir" initials="R." surname="Shakir"/>
            <date month="July" year="2018"/>
            <abstract>
              <t indent="0">Segment Routing (SR) leverages the source routing paradigm. A node steers a packet through an ordered list of instructions, called "segments". A segment can represent any instruction, topological or service based. A segment can have a semantic local to an SR node or global within an SR domain. SR provides a mechanism that allows a flow to be restricted to a specific topological path, while maintaining per-flow state only at the ingress node(s) to the SR domain.</t>
              <t indent="0">SR can be directly applied to the MPLS architecture with no change to the forwarding plane. A segment is encoded as an MPLS label. An ordered list of segments is encoded as a stack of labels. The segment to process is on the top of the stack. Upon completion of a segment, the related label is popped from the stack.</t>
              <t indent="0">SR can be applied to the IPv6 architecture, with a new type of routing header. A segment is encoded as an IPv6 address. An ordered list of segments is encoded as an ordered list of IPv6 addresses in the routing header. The active segment is indicated by the Destination Address (DA) of the packet. The next active segment is indicated by a pointer in the new routing header.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="8402"/>
          <seriesInfo name="DOI" value="10.17487/RFC8402"/>
        </reference>
        <reference anchor="RFC8754" target="https://www.rfc-editor.org/info/rfc8754" quoteTitle="true" derivedAnchor="RFC8754">
          <front>
            <title>IPv6 Segment Routing Header (SRH)</title>
            <author fullname="C. Filsfils" initials="C." role="editor" surname="Filsfils"/>
            <author fullname="D. Dukes" initials="D." role="editor" surname="Dukes"/>
            <author fullname="S. Previdi" initials="S." surname="Previdi"/>
            <author fullname="J. Leddy" initials="J." surname="Leddy"/>
            <author fullname="S. Matsushima" initials="S." surname="Matsushima"/>
            <author fullname="D. Voyer" initials="D." surname="Voyer"/>
            <date month="March" year="2020"/>
            <abstract>
              <t indent="0">Segment Routing can be applied to the IPv6 data plane using a new type of Routing Extension Header called the Segment Routing Header (SRH). This document describes the SRH and how it is used by nodes that are Segment Routing (SR) capable.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="8754"/>
          <seriesInfo name="DOI" value="10.17487/RFC8754"/>
        </reference>
        <reference anchor="RFC8986" target="https://www.rfc-editor.org/info/rfc8986" quoteTitle="true" derivedAnchor="RFC8986">
          <front>
            <title>Segment Routing over IPv6 (SRv6) Network Programming</title>
            <author fullname="C. Filsfils" initials="C." role="editor" surname="Filsfils"/>
            <author fullname="P. Camarillo" initials="P." role="editor" surname="Camarillo"/>
            <author fullname="J. Leddy" initials="J." surname="Leddy"/>
            <author fullname="D. Voyer" initials="D." surname="Voyer"/>
            <author fullname="S. Matsushima" initials="S." surname="Matsushima"/>
            <author fullname="Z. Li" initials="Z." surname="Li"/>
            <date month="February" year="2021"/>
            <abstract>
              <t indent="0">The Segment Routing over IPv6 (SRv6) Network Programming framework enables a network operator or an application to specify a packet processing program by encoding a sequence of instructions in the IPv6 packet header.</t>
              <t indent="0">Each instruction is implemented on one or several nodes in the network and identified by an SRv6 Segment Identifier in the packet.</t>
              <t indent="0">This document defines the SRv6 Network Programming concept and specifies the base set of SRv6 behaviors that enables the creation of interoperable overlays with underlay optimization.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="8986"/>
          <seriesInfo name="DOI" value="10.17487/RFC8986"/>
        </reference>
      </references>
      <references anchor="sec-informative-references" pn="section-13.2">
        <name slugifiedName="name-informative-references">Informative References</name>
        <reference anchor="I-D.ietf-idr-bgp-ls-sr-policy" target="https://datatracker.ietf.org/doc/html/draft-ietf-idr-bgp-ls-sr-policy-17" quoteTitle="true" derivedAnchor="BGP-LS-SR-Policy">
          <front>
            <title>Advertisement of Segment Routing Policies using BGP Link-State</title>
            <author initials="S." surname="Previdi" fullname="Stefano Previdi">
              <organization showOnFrontPage="true">Individual</organization>
            </author>
            <author initials="K." surname="Talaulikar" fullname="Ketan Talaulikar" role="editor">
              <organization showOnFrontPage="true">Cisco Systems</organization>
            </author>
            <author initials="J." surname="Dong" fullname="Jie Dong">
              <organization showOnFrontPage="true">Huawei Technologies</organization>
            </author>
            <author initials="H." surname="Gredler" fullname="Hannes Gredler">
              <organization showOnFrontPage="true">RtBrick Inc.</organization>
            </author>
            <author initials="J." surname="Tantsura" fullname="Jeff Tantsura">
              <organization showOnFrontPage="true">Nvidia</organization>
            </author>
            <date month="March" day="6" year="2025"/>
          </front>
          <seriesInfo name="Internet-Draft" value="draft-ietf-idr-bgp-ls-sr-policy-17"/>
          <refcontent>Work in Progress</refcontent>
        </reference>
        <reference anchor="I-D.ietf-idr-sr-policy-safi" target="https://datatracker.ietf.org/doc/html/draft-ietf-idr-sr-policy-safi-13" quoteTitle="true" derivedAnchor="BGP-SR-Policy">
          <front>
            <title>Advertising Segment Routing Policies in BGP</title>
            <author initials="S." surname="Previdi" fullname="Stefano Previdi">
              <organization showOnFrontPage="true">Huawei Technologies</organization>
            </author>
            <author initials="C." surname="Filsfils" fullname="Clarence Filsfils">
              <organization showOnFrontPage="true">Cisco Systems</organization>
            </author>
            <author initials="K." surname="Talaulikar" fullname="Ketan Talaulikar" role="editor">
              <organization showOnFrontPage="true">Cisco Systems</organization>
            </author>
            <author initials="P." surname="Mattes" fullname="Paul Mattes">
              <organization showOnFrontPage="true">Microsoft</organization>
            </author>
            <author initials="D." surname="Jain" fullname="Dhanendra Jain">
              <organization showOnFrontPage="true">Google</organization>
            </author>
            <date month="February" day="6" year="2025"/>
          </front>
          <seriesInfo name="Internet-Draft" value="draft-ietf-idr-sr-policy-safi-13"/>
          <refcontent>Work in Progress</refcontent>
        </reference>
        <reference anchor="GKP94" quoteTitle="true" derivedAnchor="GKP94">
          <front>
            <title>Concrete Mathematics: A Foundation for Computer Science</title>
            <author initials="R." surname="Graham" fullname="Ronald Graham">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="D." surname="Knuth" fullname="Donald Knuth">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="O." surname="Patashnik" fullname="Oren Patashnik">
              <organization showOnFrontPage="true"/>
            </author>
            <date year="1994"/>
          </front>
          <seriesInfo name="ISBN" value="9780201558029"/>
        </reference>
        <reference anchor="RFC4786" target="https://www.rfc-editor.org/info/rfc4786" quoteTitle="true" derivedAnchor="RFC4786">
          <front>
            <title>Operation of Anycast Services</title>
            <author fullname="J. Abley" initials="J." surname="Abley"/>
            <author fullname="K. Lindqvist" initials="K." surname="Lindqvist"/>
            <date month="December" year="2006"/>
            <abstract>
              <t indent="0">As the Internet has grown, and as systems and networked services within enterprises have become more pervasive, many services with high availability requirements have emerged. These requirements have increased the demands on the reliability of the infrastructure on which those services rely.</t>
              <t indent="0">Various techniques have been employed to increase the availability of services deployed on the Internet. This document presents commentary and recommendations for distribution of services using anycast. 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="126"/>
          <seriesInfo name="RFC" value="4786"/>
          <seriesInfo name="DOI" value="10.17487/RFC4786"/>
        </reference>
        <reference anchor="RFC9252" target="https://www.rfc-editor.org/info/rfc9252" quoteTitle="true" derivedAnchor="RFC9252">
          <front>
            <title>BGP Overlay Services Based on Segment Routing over IPv6 (SRv6)</title>
            <author fullname="G. Dawra" initials="G." role="editor" surname="Dawra"/>
            <author fullname="K. Talaulikar" initials="K." role="editor" surname="Talaulikar"/>
            <author fullname="R. Raszuk" initials="R." surname="Raszuk"/>
            <author fullname="B. Decraene" initials="B." surname="Decraene"/>
            <author fullname="S. Zhuang" initials="S." surname="Zhuang"/>
            <author fullname="J. Rabadan" initials="J." surname="Rabadan"/>
            <date month="July" year="2022"/>
            <abstract>
              <t indent="0">This document defines procedures and messages for SRv6-based BGP services, including Layer 3 Virtual Private Network (L3VPN), Ethernet VPN (EVPN), and Internet services. It builds on "BGP/MPLS IP Virtual Private Networks (VPNs)" (RFC 4364) and "BGP MPLS-Based Ethernet VPN" (RFC 7432).</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="9252"/>
          <seriesInfo name="DOI" value="10.17487/RFC9252"/>
        </reference>
        <reference anchor="RFC9259" target="https://www.rfc-editor.org/info/rfc9259" quoteTitle="true" derivedAnchor="RFC9259">
          <front>
            <title>Operations, Administration, and Maintenance (OAM) in Segment Routing over IPv6 (SRv6)</title>
            <author fullname="Z. Ali" initials="Z." surname="Ali"/>
            <author fullname="C. Filsfils" initials="C." surname="Filsfils"/>
            <author fullname="S. Matsushima" initials="S." surname="Matsushima"/>
            <author fullname="D. Voyer" initials="D." surname="Voyer"/>
            <author fullname="M. Chen" initials="M." surname="Chen"/>
            <date month="June" year="2022"/>
            <abstract>
              <t indent="0">This document describes how the existing IPv6 mechanisms for ping and traceroute can be used in a Segment Routing over IPv6 (SRv6) network. The document also specifies the OAM flag (O-flag) in the Segment Routing Header (SRH) for performing controllable and predictable flow sampling from segment endpoints. In addition, the document describes how a centralized monitoring system performs a path continuity check between any nodes within an SRv6 domain.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="9259"/>
          <seriesInfo name="DOI" value="10.17487/RFC9259"/>
        </reference>
        <reference anchor="RFC9350" target="https://www.rfc-editor.org/info/rfc9350" quoteTitle="true" derivedAnchor="RFC9350">
          <front>
            <title>IGP Flexible Algorithm</title>
            <author fullname="P. Psenak" initials="P." role="editor" surname="Psenak"/>
            <author fullname="S. Hegde" initials="S." surname="Hegde"/>
            <author fullname="C. Filsfils" initials="C." surname="Filsfils"/>
            <author fullname="K. Talaulikar" initials="K." surname="Talaulikar"/>
            <author fullname="A. Gulko" initials="A." surname="Gulko"/>
            <date month="February" year="2023"/>
            <abstract>
              <t indent="0">IGP protocols historically compute the best paths over the network based on the IGP metric assigned to the links. Many network deployments use RSVP-TE or Segment Routing - Traffic Engineering (SR-TE) to steer traffic over a path that is computed using different metrics or constraints than the shortest IGP path. This document specifies a solution that allows IGPs themselves to compute constraint-based paths over the network. This document also specifies a way of using Segment Routing (SR) Prefix-SIDs and SRv6 locators to steer packets along the constraint-based paths.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="9350"/>
          <seriesInfo name="DOI" value="10.17487/RFC9350"/>
        </reference>
        <reference anchor="RFC9352" target="https://www.rfc-editor.org/info/rfc9352" quoteTitle="true" derivedAnchor="RFC9352">
          <front>
            <title>IS-IS Extensions to Support Segment Routing over the IPv6 Data Plane</title>
            <author fullname="P. Psenak" initials="P." role="editor" surname="Psenak"/>
            <author fullname="C. Filsfils" initials="C." surname="Filsfils"/>
            <author fullname="A. Bashandy" initials="A." surname="Bashandy"/>
            <author fullname="B. Decraene" initials="B." surname="Decraene"/>
            <author fullname="Z. Hu" initials="Z." surname="Hu"/>
            <date month="February" year="2023"/>
            <abstract>
              <t indent="0">The Segment Routing (SR) architecture allows a flexible definition of the end-to-end path by encoding it as a sequence of topological elements called "segments". It can be implemented over the MPLS or the IPv6 data plane. This document describes the IS-IS extensions required to support SR over the IPv6 data plane.</t>
              <t indent="0">This document updates RFC 7370 by modifying an existing registry.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="9352"/>
          <seriesInfo name="DOI" value="10.17487/RFC9352"/>
        </reference>
        <reference anchor="RFC9513" target="https://www.rfc-editor.org/info/rfc9513" quoteTitle="true" derivedAnchor="RFC9513">
          <front>
            <title>OSPFv3 Extensions for Segment Routing over IPv6 (SRv6)</title>
            <author fullname="Z. Li" initials="Z." surname="Li"/>
            <author fullname="Z. Hu" initials="Z." surname="Hu"/>
            <author fullname="K. Talaulikar" initials="K." role="editor" surname="Talaulikar"/>
            <author fullname="P. Psenak" initials="P." surname="Psenak"/>
            <date month="December" year="2023"/>
            <abstract>
              <t indent="0">The Segment Routing (SR) architecture allows a flexible definition of the end-to-end path by encoding it as a sequence of topological elements called segments. It can be implemented over an MPLS or IPv6 data plane. This document describes the OSPFv3 extensions required to support SR over the IPv6 data plane.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="9513"/>
          <seriesInfo name="DOI" value="10.17487/RFC9513"/>
        </reference>
        <reference anchor="RFC9514" target="https://www.rfc-editor.org/info/rfc9514" quoteTitle="true" derivedAnchor="RFC9514">
          <front>
            <title>Border Gateway Protocol - Link State (BGP-LS) Extensions for Segment Routing over IPv6 (SRv6)</title>
            <author fullname="G. Dawra" initials="G." surname="Dawra"/>
            <author fullname="C. Filsfils" initials="C." surname="Filsfils"/>
            <author fullname="K. Talaulikar" initials="K." role="editor" surname="Talaulikar"/>
            <author fullname="M. Chen" initials="M." surname="Chen"/>
            <author fullname="D. Bernier" initials="D." surname="Bernier"/>
            <author fullname="B. Decraene" initials="B." surname="Decraene"/>
            <date month="December" year="2023"/>
            <abstract>
              <t indent="0">Segment Routing over IPv6 (SRv6) allows for a flexible definition of end-to-end paths within various topologies by encoding paths as sequences of topological or functional sub-paths called "segments". These segments are advertised by various protocols such as BGP, IS-IS, and OSPFv3.</t>
              <t indent="0">This document defines extensions to BGP - Link State (BGP-LS) to advertise SRv6 segments along with their behaviors and other attributes via BGP. The BGP-LS address-family solution for SRv6 described in this document is similar to BGP-LS for SR for the MPLS data plane, which is defined in RFC 9085.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="9514"/>
          <seriesInfo name="DOI" value="10.17487/RFC9514"/>
        </reference>
        <reference anchor="RFC9602" target="https://www.rfc-editor.org/info/rfc9602" quoteTitle="true" derivedAnchor="RFC9602">
          <front>
            <title>Segment Routing over IPv6 (SRv6) Segment Identifiers in the IPv6 Addressing Architecture</title>
            <author fullname="S. Krishnan" initials="S." surname="Krishnan"/>
            <date month="October" year="2024"/>
            <abstract>
              <t indent="0">Segment Routing over IPv6 (SRv6) uses IPv6 as the underlying data plane. Thus, Segment Identifiers (SIDs) used by SRv6 can resemble IPv6 addresses and behave like them while exhibiting slightly different behaviors in some situations. This document explores the characteristics of SRv6 SIDs and focuses on the relationship of SRv6 SIDs to the IPv6 Addressing Architecture. This document allocates and makes a dedicated prefix available for SRv6 SIDs.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="9602"/>
          <seriesInfo name="DOI" value="10.17487/RFC9602"/>
        </reference>
        <reference anchor="RFC9603" target="https://www.rfc-editor.org/info/rfc9603" quoteTitle="true" derivedAnchor="RFC9603">
          <front>
            <title>Path Computation Element Communication Protocol (PCEP) Extensions for IPv6 Segment Routing</title>
            <author fullname="C. Li" initials="C." role="editor" surname="Li"/>
            <author fullname="P. Kaladharan" initials="P." surname="Kaladharan"/>
            <author fullname="S. Sivabalan" initials="S." surname="Sivabalan"/>
            <author fullname="M. Koldychev" initials="M." surname="Koldychev"/>
            <author fullname="Y. Zhu" initials="Y." surname="Zhu"/>
            <date month="July" year="2024"/>
            <abstract>
              <t indent="0">Segment Routing (SR) can be used to steer packets through a network using the IPv6 or MPLS data plane, employing the source routing paradigm.</t>
              <t indent="0">An SR Path can be derived from a variety of mechanisms, including an IGP Shortest Path Tree (SPT), explicit configuration, or a Path Computation Element (PCE).</t>
              <t indent="0">Since SR can be applied to both MPLS and IPv6 data planes, a PCE should be able to compute an SR Path for both MPLS and IPv6 data planes. The Path Computation Element Communication Protocol (PCEP) extension and mechanisms to support SR-MPLS have been defined. This document outlines the necessary extensions to support SR for the IPv6 data plane within PCEP.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="9603"/>
          <seriesInfo name="DOI" value="10.17487/RFC9603"/>
        </reference>
      </references>
    </references>
    <section anchor="complete-pseudocodes" numbered="true" removeInRFC="false" toc="include" pn="section-appendix.a">
      <name slugifiedName="name-complete-pseudocodes">Complete Pseudocodes</name>
      <t indent="0" pn="section-appendix.a-1">The content of this section is purely informative rendering of the pseudocodes of <xref target="RFC8986" format="default" sectionFormat="of" derivedContent="RFC8986"/> with the modifications in this document. This rendering may not be used as a reference.</t>
      <section anchor="sec-next-end-complete" numbered="true" removeInRFC="false" toc="include" pn="section-appendix.a.1">
        <name slugifiedName="name-end-with-next-csid-2">End with NEXT-CSID</name>
        <t indent="0" pn="section-appendix.a.1-1">When processing the SRH of a packet matching a FIB entry locally instantiated as an End SID with the NEXT-CSID flavor:</t>
        <sourcecode type="pseudocode" markers="false" pn="section-appendix.a.1-2">
N01. If (DA.Argument != 0) {
N02.   If (IPv6 Hop Limit &lt;= 1) {
N03.     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.
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.   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 &lt;= 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 &gt; max_LE) or (Segments Left &gt; 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. Submit the packet to the egress IPv6 FIB lookup for
       transmission to the new destination.
</sourcecode>
        <t indent="0" pn="section-appendix.a.1-3">Before processing the upper-layer header or any IPv6 extension header other than Hop-by-Hop or Destination Options of a packet matching a FIB entry locally instantiated as an End SID with the NEXT-CSID flavor:</t>
        <sourcecode type="pseudocode" markers="false" pn="section-appendix.a.1-4">
N01. If (DA.Argument != 0) {
N02.   If (IPv6 Hop Limit &lt;= 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.   Submit the packet to the egress IPv6 FIB lookup for
         transmission to the next destination.
N09. }
</sourcecode>
        <t indent="0" pn="section-appendix.a.1-5">When processing the upper-layer header of a packet matching a FIB entry locally instantiated as an End SID with the NEXT-CSID flavor:</t>
        <sourcecode type="pseudocode" markers="false" pn="section-appendix.a.1-6">
S01. If (upper-layer header type is allowed by local configuration) {
S02.   Proceed to process the upper-layer header
S03. } Else {
S04.   Send an ICMP Parameter Problem to the Source Address
         with Code 4 (SR Upper-layer Header Error)
         and Pointer set to the offset of the upper-layer header,
         interrupt packet processing, and discard the packet.
S05. }
</sourcecode>
      </section>
      <section anchor="sec-next-endx-complete" numbered="true" removeInRFC="false" toc="include" pn="section-appendix.a.2">
        <name slugifiedName="name-endx-with-next-csid-2">End.X with NEXT-CSID</name>
        <t indent="0" pn="section-appendix.a.2-1">When processing the SRH of a packet matching a FIB entry locally instantiated as an End.X SID with the NEXT-CSID flavor:</t>
        <sourcecode type="pseudocode" markers="false" pn="section-appendix.a.2-2">
N01. If (DA.Argument != 0) {
N02.   If (IPv6 Hop Limit &lt;= 1) {
N03.     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.
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.   Submit the packet to the IPv6 module for transmission to the
         new destination via a member of J.
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 &lt;= 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 &gt; max_LE) or (Segments Left &gt; 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. Submit the packet to the IPv6 module for transmission
       to the new destination via a member of J.
</sourcecode>
        <t indent="0" pn="section-appendix.a.2-3">Before processing the upper-layer header or any IPv6 extension header other than Hop-by-Hop or Destination Options of a packet matching a FIB entry locally instantiated as an End.X SID with the NEXT-CSID flavor:</t>
        <sourcecode type="pseudocode" markers="false" pn="section-appendix.a.2-4">
N01. If (DA.Argument != 0) {
N02.   If (IPv6 Hop Limit &lt;= 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.   Submit the packet to the IPv6 module for transmission to the
         new destination via a member of J.
N09. }
</sourcecode>
        <t indent="0" pn="section-appendix.a.2-5">When processing the upper-layer header of a packet matching a FIB entry locally instantiated as an End.X SID with the NEXT-CSID flavor:</t>
        <sourcecode type="pseudocode" markers="false" pn="section-appendix.a.2-6">
S01. If (upper-layer header type is allowed by local configuration) {
S02.   Proceed to process the upper-layer header
S03. } Else {
S04.   Send an ICMP Parameter Problem to the Source Address
         with Code 4 (SR Upper-layer Header Error)
         and Pointer set to the offset of the upper-layer header,
         interrupt packet processing, and discard the packet.
S05. }
</sourcecode>
      </section>
      <section anchor="sec-next-endt-complete" numbered="true" removeInRFC="false" toc="include" pn="section-appendix.a.3">
        <name slugifiedName="name-endt-with-next-csid-2">End.T with NEXT-CSID</name>
        <t indent="0" pn="section-appendix.a.3-1">When processing the SRH of a packet matching a FIB entry locally instantiated as an End.T SID with the NEXT-CSID flavor:</t>
        <sourcecode type="pseudocode" markers="false" pn="section-appendix.a.3-2">
N01. If (DA.Argument != 0) {
N02.   If (IPv6 Hop Limit &lt;= 1) {
N03.     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.
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. Set the packet's associated FIB table to T.
N08.2. Submit the packet to the egress IPv6 FIB lookup for
         transmission to the new 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 &lt;= 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 &gt; max_LE) or (Segments Left &gt; 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.1. Set the packet's associated FIB table to T.
S15.2. Submit the packet to the egress IPv6 FIB lookup for
         transmission to the new destination.
</sourcecode>
        <t indent="0" pn="section-appendix.a.3-3">Before processing the upper-layer header or any IPv6 extension header other than Hop-by-Hop or Destination Options of a packet matching a FIB entry locally instantiated as an End.T SID with the NEXT-CSID flavor:</t>
        <sourcecode type="pseudocode" markers="false" pn="section-appendix.a.3-4">
N01. If (DA.Argument != 0) {
N02.   If (IPv6 Hop Limit &lt;= 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. Set the packet's associated FIB table to T.
N08.2. Submit the packet to the egress IPv6 FIB lookup for
         transmission to the new destination.
N09. }
</sourcecode>
        <t indent="0" pn="section-appendix.a.3-5">When processing the upper-layer header of a packet matching a FIB entry locally instantiated as an End.T SID with the NEXT-CSID flavor:</t>
        <sourcecode type="pseudocode" markers="false" pn="section-appendix.a.3-6">
S01. If (upper-layer header type is allowed by local configuration) {
S02.   Proceed to process the upper-layer header
S03. } Else {
S04.   Send an ICMP Parameter Problem to the Source Address
         with Code 4 (SR Upper-layer Header Error)
         and Pointer set to the offset of the upper-layer header,
         interrupt packet processing, and discard the packet.
S05. }
</sourcecode>
      </section>
      <section anchor="sec-next-endb6-complete" numbered="true" removeInRFC="false" toc="include" pn="section-appendix.a.4">
        <name slugifiedName="name-endb6encaps-with-next-csid-2">End.B6.Encaps with NEXT-CSID</name>
        <t indent="0" pn="section-appendix.a.4-1">When processing the SRH of a packet matching a FIB entry locally instantiated as an End.B6.Encaps SID with the NEXT-CSID flavor:</t>
        <sourcecode type="pseudocode" markers="false" pn="section-appendix.a.4-2">
N01. If (DA.Argument != 0) {
N02.   If (IPv6 Hop Limit &lt;= 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. Push a new IPv6 header with its own SRH containing B.
N08.2. Set the outer IPv6 SA to A.
N08.3. Set the outer IPv6 DA to the first SID of B.
N08.4. Set the outer Payload Length, Traffic Class, Flow Label,
         Hop Limit, and Next Header fields.
N08.5. 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 &lt;= 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 &gt; max_LE) or (Segments Left &gt; 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. Push a new IPv6 header with its own SRH containing B.
S16. Set the outer IPv6 SA to A.
S17. Set the outer IPv6 DA to the first SID of B.
S18. Set the outer Payload Length, Traffic Class, Flow Label,
       Hop Limit, and Next Header fields.
S19. Submit the packet to the egress IPv6 FIB lookup for
       transmission to the new destination.
</sourcecode>
        <t indent="0" pn="section-appendix.a.4-3">Before processing the upper-layer header or any IPv6 extension header other than Hop-by-Hop or Destination Options of a packet matching a FIB entry locally instantiated as an End.B6.Encaps SID with the NEXT-CSID flavor:</t>
        <sourcecode type="pseudocode" markers="false" pn="section-appendix.a.4-4">
N01. If (DA.Argument != 0) {
N02.   If (IPv6 Hop Limit &lt;= 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. Push a new IPv6 header with its own SRH containing B.
N08.2. Set the outer IPv6 SA to A.
N08.3. Set the outer IPv6 DA to the first SID of B.
N08.4. Set the outer Payload Length, Traffic Class, Flow Label,
         Hop Limit, and Next Header fields.
N08.5. Submit the packet to the egress IPv6 FIB lookup for
         transmission to the next destination.
N09. }
</sourcecode>
        <t indent="0" pn="section-appendix.a.4-5">When processing the upper-layer header of a packet matching a FIB entry locally instantiated as an End.B6.Encaps SID with the NEXT-CSID flavor:</t>
        <sourcecode type="pseudocode" markers="false" pn="section-appendix.a.4-6">
S01. If (upper-layer header type is allowed by local configuration) {
S02.   Proceed to process the upper-layer header
S03. } Else {
S04.   Send an ICMP Parameter Problem to the Source Address
         with Code 4 (SR Upper-layer Header Error)
         and Pointer set to the offset of the upper-layer header,
         interrupt packet processing, and discard the packet.
S05. }
</sourcecode>
      </section>
      <section anchor="sec-next-endbm-complete" numbered="true" removeInRFC="false" toc="include" pn="section-appendix.a.5">
        <name slugifiedName="name-endbm-with-next-csid-2">End.BM with NEXT-CSID</name>
        <t indent="0" pn="section-appendix.a.5-1">When processing the SRH of a packet matching a FIB entry locally instantiated as an End.BM SID with the NEXT-CSID flavor:</t>
        <sourcecode type="pseudocode" markers="false" pn="section-appendix.a.5-2">
N01. If (DA.Argument != 0) {
N02.   If (IPv6 Hop Limit &lt;= 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. Push the MPLS label stack for B.
N08.2. Submit the packet to the MPLS engine for transmission.
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 &lt;= 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 &gt; max_LE) or (Segments Left &gt; 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. Push the MPLS label stack for B.
S16. Submit the packet to the MPLS engine for transmission.
</sourcecode>
        <t indent="0" pn="section-appendix.a.5-3">Before processing the upper-layer header or any IPv6 extension header other than Hop-by-Hop or Destination Options of a packet matching a FIB entry locally instantiated as an End.BM SID with the NEXT-CSID flavor:</t>
        <sourcecode type="pseudocode" markers="false" pn="section-appendix.a.5-4">
N01. If (DA.Argument != 0) {
N02.   If (IPv6 Hop Limit &lt;= 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. Push the MPLS label stack for B.
N08.2. Submit the packet to the MPLS engine for transmission.
N09. }
</sourcecode>
        <t indent="0" pn="section-appendix.a.5-5">When processing the upper-layer header of a packet matching a FIB entry locally instantiated as an End.BM SID with the NEXT-CSID flavor:</t>
        <sourcecode type="pseudocode" markers="false" pn="section-appendix.a.5-6">
S01. If (upper-layer header type is allowed by local configuration) {
S02.   Proceed to process the upper-layer header
S03. } Else {
S04.   Send an ICMP Parameter Problem to the Source Address
         with Code 4 (SR Upper-layer Header Error)
         and Pointer set to the offset of the upper-layer header,
         interrupt packet processing, and discard the packet.
S05. }
</sourcecode>
      </section>
      <section anchor="sec-replace-end-complete" numbered="true" removeInRFC="false" toc="include" pn="section-appendix.a.6">
        <name slugifiedName="name-end-with-replace-csid-2">End with REPLACE-CSID</name>
        <t indent="0" pn="section-appendix.a.6-1">When processing the SRH of a packet matching a FIB entry locally instantiated as an End SID with the REPLACE-CSID flavor:</t>
        <sourcecode type="pseudocode" markers="false" pn="section-appendix.a.6-2">
S01. When an SRH is processed {
S02.   If (Segments Left == 0 and (DA.Arg.Index == 0 or
           Segment List[0][DA.Arg.Index-1] == 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 &lt;= 1) {
S06.     Send an ICMP Time Exceeded message to the Source Address,
           Code 0 (Hop limit exceeded in transit),
           interrupt packet processing and discard the packet.
S07.   }
S08.   max_LE = (Hdr Ext Len / 2) - 1
R01.   If (DA.Arg.Index != 0) {
R02.     If ((Last Entry &gt; max_LE) or (Segments Left &gt; Last Entry)) {
R03.       Send an ICMP Parameter Problem to the Source Address,
             Code 0 (Erroneous header field encountered),
             Pointer set to the Segments Left field,
             interrupt packet processing and discard the packet.
R04.     }
R05.     Decrement DA.Arg.Index by 1.
R06.     If (Segment List[Segments Left][DA.Arg.Index] == 0) {
R07.       Decrement Segments Left by 1.
R08.       Decrement IPv6 Hop Limit by 1.
R09.       Update IPv6 DA with Segment List[Segments Left]
R10.       Submit the packet to the egress IPv6 FIB lookup for
            transmission to the new destination.
R11.     }
R12.   } Else {
R13.     If((Last Entry &gt; max_LE) or (Segments Left &gt; Last Entry+1)){
R14.       Send an ICMP Parameter Problem to the Source Address,
             Code 0 (Erroneous header field encountered),
             Pointer set to the Segments Left field,
             interrupt packet processing and discard the packet.
R15.     }
R16.     Decrement Segments Left by 1.
R17.     Set DA.Arg.Index to (128/LNFL - 1).
R18.   }
R19.   Decrement IPv6 Hop Limit by 1.
R20.   Write Segment List[Segments Left][DA.Arg.Index] into the bits
         [LBL..LBL+LNFL-1] of the Destination Address of the IPv6
         header.
R21.   Submit the packet to the egress IPv6 FIB lookup for
         transmission to the new destination.
S16. }
</sourcecode>
        <t indent="0" pn="section-appendix.a.6-3">When processing the upper-layer header of a packet matching a FIB entry locally instantiated as an End SID with the REPLACE-CSID flavor:</t>
        <sourcecode type="pseudocode" markers="false" pn="section-appendix.a.6-4">
S01. If (upper-layer header type is allowed by local configuration) {
S02.   Proceed to process the upper-layer header
S03. } Else {
S04.   Send an ICMP Parameter Problem to the Source Address
          with Code 4 (SR Upper-layer Header Error)
          and Pointer set to the offset of the upper-layer header,
          interrupt packet processing, and discard the packet.
S05. }
</sourcecode>
      </section>
      <section anchor="sec-replace-endx-complete" numbered="true" removeInRFC="false" toc="include" pn="section-appendix.a.7">
        <name slugifiedName="name-endx-with-replace-csid-2">End.X with REPLACE-CSID</name>
        <t indent="0" pn="section-appendix.a.7-1">When processing the SRH of a packet matching a FIB entry locally instantiated as an End.X SID with the REPLACE-CSID flavor:</t>
        <sourcecode type="pseudocode" markers="false" pn="section-appendix.a.7-2">
S01. When an SRH is processed {
S02.   If (Segments Left == 0 and (DA.Arg.Index == 0 or
           Segment List[0][DA.Arg.Index-1] == 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 &lt;= 1) {
S06.     Send an ICMP Time Exceeded message to the Source Address,
           Code 0 (Hop limit exceeded in transit),
           interrupt packet processing and discard the packet.
S07.   }
S08.   max_LE = (Hdr Ext Len / 2) - 1
R01.   If (DA.Arg.Index != 0) {
R02.     If ((Last Entry &gt; max_LE) or (Segments Left &gt; Last Entry)) {
R03.       Send an ICMP Parameter Problem to the Source Address,
             Code 0 (Erroneous header field encountered),
             Pointer set to the Segments Left field,
             interrupt packet processing and discard the packet.
R04.     }
R05.     Decrement DA.Arg.Index by 1.
R06.     If (Segment List[Segments Left][DA.Arg.Index] == 0) {
R07.       Decrement Segments Left by 1.
R08.       Decrement IPv6 Hop Limit by 1.
R09.       Update IPv6 DA with Segment List[Segments Left]
R10.       Submit the packet to the IPv6 module for transmission to
             the new destination via a member of J.
R11.     }
R12.   } Else {
R13.     If((Last Entry &gt; max_LE) or (Segments Left &gt; Last Entry+1)){
R14.       Send an ICMP Parameter Problem to the Source Address,
             Code 0 (Erroneous header field encountered),
             Pointer set to the Segments Left field,
             interrupt packet processing and discard the packet.
R15.     }
R16.     Decrement Segments Left by 1.
R17.     Set DA.Arg.Index to (128/LNFL - 1).
R18.   }
R19.   Decrement IPv6 Hop Limit by 1.
R20.   Write Segment List[Segments Left][DA.Arg.Index] into the bits
         [LBL..LBL+LNFL-1] of the Destination Address of the IPv6
         header.
R21.   Submit the packet to the IPv6 module for transmission to the
         new destination via a member of J.
S16. }
</sourcecode>
        <t indent="0" pn="section-appendix.a.7-3">When processing the upper-layer header of a packet matching a FIB entry locally instantiated as an End.X SID with the REPLACE-CSID flavor:</t>
        <sourcecode type="pseudocode" markers="false" pn="section-appendix.a.7-4">
S01. If (upper-layer header type is allowed by local configuration) {
S02.   Proceed to process the upper-layer header
S03. } Else {
S04.   Send an ICMP Parameter Problem to the Source Address
          with Code 4 (SR Upper-layer Header Error)
          and Pointer set to the offset of the upper-layer header,
          interrupt packet processing, and discard the packet.
S05. }
</sourcecode>
      </section>
      <section anchor="sec-replace-endt-complete" numbered="true" removeInRFC="false" toc="include" pn="section-appendix.a.8">
        <name slugifiedName="name-endt-with-replace-csid-2">End.T with REPLACE-CSID</name>
        <t indent="0" pn="section-appendix.a.8-1">When processing the SRH of a packet matching a FIB entry locally instantiated as an End.T SID with the REPLACE-CSID flavor:</t>
        <sourcecode type="pseudocode" markers="false" pn="section-appendix.a.8-2">
S01. When an SRH is processed {
S02.   If (Segments Left == 0 and (DA.Arg.Index == 0 or
           Segment List[0][DA.Arg.Index-1] == 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 &lt;= 1) {
S06.     Send an ICMP Time Exceeded message to the Source Address,
           Code 0 (Hop limit exceeded in transit),
           interrupt packet processing and discard the packet.
S07.   }
S08.   max_LE = (Hdr Ext Len / 2) - 1
R01.   If (DA.Arg.Index != 0) {
R02.     If ((Last Entry &gt; max_LE) or (Segments Left &gt; Last Entry)) {
R03.       Send an ICMP Parameter Problem to the Source Address,
             Code 0 (Erroneous header field encountered),
             Pointer set to the Segments Left field,
             interrupt packet processing and discard the packet.
R04.     }
R05.     Decrement DA.Arg.Index by 1.
R06.     If (Segment List[Segments Left][DA.Arg.Index] == 0) {
R07.       Decrement Segments Left by 1.
R08.       Decrement IPv6 Hop Limit by 1.
R09.       Update IPv6 DA with Segment List[Segments Left]
R10.1.     Set the packet's associated FIB table to T.
R10.2.     Submit the packet to the egress IPv6 FIB lookup for
             transmission to the new destination.
R11.     }
R12.   } Else {
R13.     If((Last Entry &gt; max_LE) or (Segments Left &gt; Last Entry+1)){
R14.       Send an ICMP Parameter Problem to the Source Address,
             Code 0 (Erroneous header field encountered),
             Pointer set to the Segments Left field,
             interrupt packet processing and discard the packet.
R15.     }
R16.     Decrement Segments Left by 1.
R17.     Set DA.Arg.Index to (128/LNFL - 1).
R18.   }
R19.   Decrement IPv6 Hop Limit by 1.
R20.   Write Segment List[Segments Left][DA.Arg.Index] into the bits
         [LBL..LBL+LNFL-1] of the Destination Address of the IPv6
         header.
R21.1. Set the packet's associated FIB table to T.
R21.2. Submit the packet to the egress IPv6 FIB lookup for
         transmission to the new destination.
S16. }
</sourcecode>
        <t indent="0" pn="section-appendix.a.8-3">When processing the upper-layer header of a packet matching a FIB entry locally instantiated as an End.T SID with the REPLACE-CSID flavor:</t>
        <sourcecode type="pseudocode" markers="false" pn="section-appendix.a.8-4">
S01. If (upper-layer header type is allowed by local configuration) {
S02.   Proceed to process the upper-layer header
S03. } Else {
S04.   Send an ICMP Parameter Problem to the Source Address
          with Code 4 (SR Upper-layer Header Error)
          and Pointer set to the offset of the upper-layer header,
          interrupt packet processing, and discard the packet.
S05. }
</sourcecode>
      </section>
      <section anchor="sec-replace-endb6-complete" numbered="true" removeInRFC="false" toc="include" pn="section-appendix.a.9">
        <name slugifiedName="name-endb6encaps-with-replace-csi">End.B6.Encaps with REPLACE-CSID</name>
        <t indent="0" pn="section-appendix.a.9-1">When processing the SRH of a packet matching a FIB entry locally instantiated as an End.B6.Encaps SID with the REPLACE-CSID flavor:</t>
        <sourcecode type="pseudocode" markers="false" pn="section-appendix.a.9-2">
S01. When an SRH is processed {
S02.   If (Segments Left == 0 and (DA.Arg.Index == 0 or
           Segment List[0][DA.Arg.Index-1] == 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 &lt;= 1) {
S06.     Send an ICMP Time Exceeded message to the Source Address,
           Code 0 (Hop limit exceeded in transit),
           interrupt packet processing and discard the packet.
S07.   }
S08.   max_LE = (Hdr Ext Len / 2) - 1
R01.   If (DA.Arg.Index != 0) {
R02.     If ((Last Entry &gt; max_LE) or (Segments Left &gt; Last Entry)) {
R03.       Send an ICMP Parameter Problem to the Source Address,
             Code 0 (Erroneous header field encountered),
             Pointer set to the Segments Left field,
             interrupt packet processing and discard the packet.
R04.     }
R05.     Decrement DA.Arg.Index by 1.
R06.     If (Segment List[Segments Left][DA.Arg.Index] == 0) {
R07.       Decrement Segments Left by 1.
R08.       Decrement IPv6 Hop Limit by 1.
R09.       Update IPv6 DA with Segment List[Segments Left]
R10.1.     Push a new IPv6 header with its own SRH containing B.
R10.2.     Set the outer IPv6 SA to A.
R10.3.     Set the outer IPv6 DA to the first SID of B.
R10.4.     Set the outer Payload Length, Traffic Class, Flow Label,
             Hop Limit, and Next Header fields.
R10.5.     Submit the packet to the egress IPv6 FIB lookup for
             transmission to the next destination.
R11.     }
R12.   } Else {
R13.     If((Last Entry &gt; max_LE) or (Segments Left &gt; Last Entry+1)){
R14.       Send an ICMP Parameter Problem to the Source Address,
             Code 0 (Erroneous header field encountered),
             Pointer set to the Segments Left field,
             interrupt packet processing and discard the packet.
R15.     }
R16.     Decrement Segments Left by 1.
R17.     Set DA.Arg.Index to (128/LNFL - 1).
R18.   }
R19.   Decrement IPv6 Hop Limit by 1.
R20.   Write Segment List[Segments Left][DA.Arg.Index] into the bits
         [LBL..LBL+LNFL-1] of the Destination Address of the IPv6
         header.
R21.1. Push a new IPv6 header with its own SRH containing B.
R21.2. Set the outer IPv6 SA to A.
R21.3. Set the outer IPv6 DA to the first SID of B.
R21.4. Set the outer Payload Length, Traffic Class, Flow Label,
         Hop Limit, and Next Header fields.
R21.5. Submit the packet to the egress IPv6 FIB lookup for
         transmission to the next destination.
S16. }
</sourcecode>
        <t indent="0" pn="section-appendix.a.9-3">When processing the upper-layer header of a packet matching a FIB entry locally instantiated as an End.B6.Encaps SID with the REPLACE-CSID flavor:</t>
        <sourcecode type="pseudocode" markers="false" pn="section-appendix.a.9-4">
S01. If (upper-layer header type is allowed by local configuration) {
S02.   Proceed to process the upper-layer header
S03. } Else {
S04.   Send an ICMP Parameter Problem to the Source Address
          with Code 4 (SR Upper-layer Header Error)
          and Pointer set to the offset of the upper-layer header,
          interrupt packet processing, and discard the packet.
S05. }
</sourcecode>
      </section>
      <section anchor="sec-replace-endbm-complete" numbered="true" removeInRFC="false" toc="include" pn="section-appendix.a.10">
        <name slugifiedName="name-endbm-with-replace-csid-2">End.BM with REPLACE-CSID</name>
        <t indent="0" pn="section-appendix.a.10-1">When processing the SRH of a packet matching a FIB entry locally instantiated as an End.BM SID with the REPLACE-CSID flavor:</t>
        <sourcecode type="pseudocode" markers="false" pn="section-appendix.a.10-2">
S01. When an SRH is processed {
S02.   If (Segments Left == 0 and (DA.Arg.Index == 0 or
           Segment List[0][DA.Arg.Index-1] == 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 &lt;= 1) {
S06.     Send an ICMP Time Exceeded message to the Source Address,
           Code 0 (Hop limit exceeded in transit),
           interrupt packet processing and discard the packet.
S07.   }
S08.   max_LE = (Hdr Ext Len / 2) - 1
R01.   If (DA.Arg.Index != 0) {
R02.     If ((Last Entry &gt; max_LE) or (Segments Left &gt; Last Entry)) {
R03.       Send an ICMP Parameter Problem to the Source Address,
             Code 0 (Erroneous header field encountered),
             Pointer set to the Segments Left field,
             interrupt packet processing and discard the packet.
R04.     }
R05.     Decrement DA.Arg.Index by 1.
R06.     If (Segment List[Segments Left][DA.Arg.Index] == 0) {
R07.       Decrement Segments Left by 1.
R08.       Decrement IPv6 Hop Limit by 1.
R09.       Update IPv6 DA with Segment List[Segments Left]
R10.1.     Push the MPLS label stack for B.
R10.2.     Submit the packet to the MPLS engine for transmission.
R11.     }
R12.   } Else {
R13.     If((Last Entry &gt; max_LE) or (Segments Left &gt; Last Entry+1)){
R14.       Send an ICMP Parameter Problem to the Source Address,
             Code 0 (Erroneous header field encountered),
             Pointer set to the Segments Left field,
             interrupt packet processing and discard the packet.
R15.     }
R16.     Decrement Segments Left by 1.
R17.     Set DA.Arg.Index to (128/LNFL - 1).
R18.   }
R19.   Decrement IPv6 Hop Limit by 1.
R20.   Write Segment List[Segments Left][DA.Arg.Index] into the bits
         [LBL..LBL+LNFL-1] of the Destination Address of the IPv6
         header.
R21.1. Push the MPLS label stack for B.
R21.2. Submit the packet to the MPLS engine for transmission.
S16. }
</sourcecode>
        <t indent="0" pn="section-appendix.a.10-3">When processing the upper-layer header of a packet matching a FIB entry locally instantiated as an End.BM SID with the REPLACE-CSID flavor:</t>
        <sourcecode type="pseudocode" markers="false" pn="section-appendix.a.10-4">
S01. If (upper-layer header type is allowed by local configuration) {
S02.   Proceed to process the upper-layer header
S03. } Else {
S04.   Send an ICMP Parameter Problem to the Source Address
          with Code 4 (SR Upper-layer Header Error)
          and Pointer set to the offset of the upper-layer header,
          interrupt packet processing, and discard the packet.
S05. }
</sourcecode>
      </section>
    </section>
    <section anchor="acknowledgements" numbered="false" toc="include" removeInRFC="false" pn="section-appendix.b">
      <name slugifiedName="name-acknowledgements">Acknowledgements</name>
      <t indent="0" pn="section-appendix.b-1">The authors would like to thank <contact fullname="Kamran Raza"/>, <contact fullname="Xing Jiang"/>, <contact fullname="YuanChao Su"/>, <contact fullname="Han Li"/>, <contact fullname="Yisong Liu"/>, <contact fullname="Martin Vigoureux"/>, <contact fullname="Joel Halpern"/>, and <contact fullname="Tal Mizrahi"/> for their insightful feedback and suggestions.</t>
      <t indent="0" pn="section-appendix.b-2">The authors would also like to thank <contact fullname="Andrew Alston"/>, <contact fullname="Linda Dunbar"/>, <contact fullname="Adrian Farrel"/>, <contact fullname="Boris Hassanov"/>, <contact fullname="Alvaro Retana"/>, and <contact fullname="Gunter Van de Velde"/> for their thorough review of this document.</t>
    </section>
    <section anchor="contributors" numbered="false" toc="include" removeInRFC="false" pn="section-appendix.c">
      <name slugifiedName="name-contributors">Contributors</name>
      <contact initials="L." surname="Aihua" fullname="Liu Aihua">
        <organization showOnFrontPage="true">ZTE Corporation</organization>
        <address>
          <postal>
            <country>China</country>
          </postal>
          <email>liu.aihua@zte.com.cn</email>
        </address>
      </contact>
      <contact initials="D." surname="Cai" fullname="Dennis Cai">
        <organization showOnFrontPage="true">Alibaba</organization>
        <address>
          <postal>
            <country>USA</country>
          </postal>
          <email>d.cai@alibaba-inc.com</email>
        </address>
      </contact>
      <contact initials="D." surname="Dukes" fullname="Darren Dukes">
        <organization showOnFrontPage="true">Cisco Systems, Inc.</organization>
        <address>
          <postal>
            <country>Canada</country>
          </postal>
          <email>ddukes@cisco.com</email>
        </address>
      </contact>
      <contact initials="J." surname="Guichard" fullname="James N Guichard">
        <organization showOnFrontPage="true">Futurewei Technologies Ltd.</organization>
        <address>
          <postal>
            <country>USA</country>
          </postal>
          <email>james.n.guichard@futurewei.com</email>
        </address>
      </contact>
      <contact initials="C." surname="Li" fullname="Cheng Li">
        <organization showOnFrontPage="true">Huawei Technologies</organization>
        <address>
          <postal>
            <country>China</country>
          </postal>
          <email>c.l@huawei.com</email>
        </address>
      </contact>
      <contact initials="R." surname="Raszuk" fullname="Robert Raszuk">
        <organization showOnFrontPage="true">NTT Network Innovations</organization>
        <address>
          <postal>
            <country>USA</country>
          </postal>
          <email>robert@raszuk.net</email>
        </address>
      </contact>
      <contact initials="K." surname="Talaulikar" fullname="Ketan Talaulikar">
        <organization showOnFrontPage="true">Cisco Systems, Inc.</organization>
        <address>
          <postal>
            <country>India</country>
          </postal>
          <email>ketant.ietf@gmail.com</email>
        </address>
      </contact>
      <contact initials="D." surname="Voyer" fullname="Daniel Voyer">
        <organization showOnFrontPage="true">Bell Canada</organization>
        <address>
          <postal>
            <country>Canada</country>
          </postal>
          <email>daniel.voyer@bell.ca</email>
        </address>
      </contact>
      <contact initials="S." surname="Zadok" fullname="Shay Zadok">
        <organization showOnFrontPage="true">Broadcom</organization>
        <address>
          <postal>
            <country>Israel</country>
          </postal>
          <email>shay.zadok@broadcom.com</email>
        </address>
      </contact>
    </section>
    <section anchor="authors-addresses" numbered="false" removeInRFC="false" toc="include" pn="section-appendix.d">
      <name slugifiedName="name-authors-addresses">Authors' Addresses</name>
      <author initials="W." surname="Cheng" fullname="Weiqiang Cheng" role="editor">
        <organization showOnFrontPage="true">China Mobile</organization>
        <address>
          <postal>
            <country>China</country>
          </postal>
          <email>chengweiqiang@chinamobile.com</email>
        </address>
      </author>
      <author initials="C." surname="Filsfils" fullname="Clarence Filsfils">
        <organization showOnFrontPage="true">Cisco Systems, Inc.</organization>
        <address>
          <postal>
            <country>Belgium</country>
          </postal>
          <email>cf@cisco.com</email>
        </address>
      </author>
      <author initials="Z." surname="Li" fullname="Zhenbin Li">
        <organization showOnFrontPage="true">Huawei Technologies</organization>
        <address>
          <postal>
            <country>China</country>
          </postal>
          <email>lizhenbin@huawei.com</email>
        </address>
      </author>
      <author initials="B." surname="Decraene" fullname="Bruno Decraene">
        <organization showOnFrontPage="true">Orange</organization>
        <address>
          <postal>
            <country>France</country>
          </postal>
          <email>bruno.decraene@orange.com</email>
        </address>
      </author>
      <author initials="F." surname="Clad" fullname="Francois Clad" role="editor">
        <organization showOnFrontPage="true">Cisco Systems, Inc.</organization>
        <address>
          <postal>
            <country>France</country>
          </postal>
          <email>fclad.ietf@gmail.com</email>
        </address>
      </author>
    </section>
  </back>
</rfc>
