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


<!DOCTYPE rfc [
  <!ENTITY nbsp    "&#160;">
  <!ENTITY zwsp   "&#8203;">
  <!ENTITY nbhy   "&#8209;">
  <!ENTITY wj     "&#8288;">
]>

<rfc xmlns:xi="http://www.w3.org/2001/XInclude" category="exp" docName="draft-ietf-idr-bgp-sr-segtypes-ext-08" number="9831" consensus="true" ipr="trust200902" obsoletes="" updates="" submissionType="IETF" xml:lang="en" sortRefs="true" symRefs="true" tocInclude="true" tocDepth="3" version="3">

  <front>
    
    <title abbrev="Segment Type Ext for BGP SR Policy">Segment Type Extensions for BGP Segment Routing (SR) Policy</title>
    <seriesInfo name="RFC" value="9831"/>
    <author fullname="Ketan Talaulikar" initials="K." role="editor" surname="Talaulikar">
      <organization>Cisco Systems</organization>
      <address>
        <postal>
          <country>India</country>
        </postal>
        <email>ketant.ietf@gmail.com</email>
      </address>
    </author>
    <author fullname="Clarence Filsfils" initials="C." surname="Filsfils">
      <organization>Cisco Systems</organization>
      <address>
        <postal>
          <city>Brussels</city>
          <country>Belgium</country>
        </postal>
        <email>cfilsfil@cisco.com</email>
      </address>
    </author>
    <author fullname="Stefano Previdi" initials="S." surname="Previdi">
      <organization>Huawei Technologies</organization>
      <address>
        <postal>
          <country>Italy</country>
        </postal>
        <email>stefano@previdi.net</email>
      </address>
    </author>
    <author fullname="Paul Mattes" initials="P." surname="Mattes">
      <organization>Microsoft</organization>
      <address>
        <postal>
          <street>One Microsoft Way</street>
          <city>Redmond</city>
          <region>WA</region>
          <code>98052</code>
          <country>United States of America</country>
        </postal>
        <email>pamattes@microsoft.com</email>
      </address>
    </author>
    <author fullname="Dhanendra Jain" initials="D." surname="Jain">
      <organization>Google</organization>
      <address>
        <email>dhanendra.ietf@gmail.com</email>
      </address>
    </author>
    <date month="September" year="2025"/>

    <area>RTG</area>
    <workgroup>idr</workgroup>

    <abstract>
      <t>This document specifies the signaling of additional Segment Routing (SR) 
      Segment Types for SR Policies in BGP
      using the SR Policy Subsequent Address Family Identifier (SAFI).</t>
    </abstract>
  </front>
  <middle>
    <section anchor="INTRO" numbered="true" toc="default">
      <name>Introduction</name>
      <t>The BGP Segment Routing (SR) Policy Subsequent Address Family Identifier
      (SAFI) was introduced by <xref target="RFC9830" format="default"/>
      for the advertisement of SR Policies <xref target="RFC8402" format="default"/>. <xref target="RFC9830" format="default"/> introduced the base SR Segment
      Types A and B as specified by the SR Policy Architecture <xref target="RFC9256" format="default"/>.</t>
      <t>This document specifies the extensions for the advertisement of the
      remaining SR Segment Types defined in <xref target="RFC9256" format="default"/> in the SR
      Policy SAFI for both SR-MPLS (see <xref target="RFC8660" format="default"/>) and Segment Routing over IPv6 (SRv6) (see <xref target="RFC8754" format="default"/> and <xref target="RFC8986" format="default"/>).</t>
      <t>The extensions in this document do not impact the SR Policy
      operations or fault management as specified in <xref target="RFC9830" format="default"/>.</t>
      <section numbered="true" toc="default">
        <name>Requirements Language</name>
        <t>
    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&nbsp;14 <xref target="RFC2119"/> <xref target="RFC8174"/> 
    when, and only when, they appear in all capitals, as shown here.
        </t>
      </section>
    </section>
    <section anchor="SEGMENTTLV" numbered="true" toc="default">
      <name>Segment Type Sub-TLVs</name>

      
      <t>The Segment List sub-TLV <xref target="RFC9830" format="default"/>
      encodes a single explicit path towards the endpoint as described in
      <xref target="RFC9256" sectionFormat="of" section="5.1"/>. The Segment List sub-TLV
      includes the elements of the paths (i.e., segments).</t>
      <t>A Segment sub-TLV describes a single segment in a segment list (i.e.,
      a single element of the explicit path).</t>
      <t><xref target="RFC9256" sectionFormat="of" section="4"/> defines several Segment Types
      for SR-MPLS and SRv6 that are listed below as a reminder:</t>

      <dl spacing="normal" newline="false" indent="10">
	<dt>Type A:</dt><dd>SR-MPLS Label</dd>
	<dt>Type B:</dt><dd>SRv6 SID</dd>
	<dt>Type C:</dt><dd>IPv4 Prefix with optional SR Algorithm</dd>
	<dt>Type D:</dt><dd>IPv6 Global Prefix with optional SR Algorithm for SR-MPLS</dd>
	<dt>Type E:</dt><dd>IPv4 Prefix with Local Interface ID</dd>
	<dt>Type F:</dt><dd>IPv4 Addresses for link endpoints as Local, Remote pair</dd>
	<dt>Type G:</dt><dd>IPv6 Prefix and Interface ID for link endpoints as Local, Remote pair for SR-MPLS</dd>
	<dt>Type H:</dt><dd>IPv6 Addresses for link endpoints as Local, Remote pair for SR-MPLS</dd>
	<dt>Type I:</dt><dd>IPv6 Global Prefix with optional SR Algorithm for SRv6</dd>
	<dt>Type J:</dt><dd>IPv6 Prefix and Interface ID for link endpoints as Local, Remote pair for SRv6</dd>
	<dt>Type K:</dt><dd>IPv6 Addresses for link endpoints as Local, Remote pair for SRv6</dd>
      </dl>

      <t><xref target="RFC9830" format="default"/> specifies Segment Type
      Sub-TLVs for the Segment Types A and B. The following subsections
      specify the sub-TLVs used for encoding each of the other Segment Types
      above.</t>
      

      <t>As specified in Sections <xref target="RFC9830" sectionFormat="bare" section="2.4.4"/> and <xref target="RFC9830" sectionFormat="bare" section="2.4.4.2"/> of <xref target="RFC9830" format="default"/>, validation of an explicit path
      encoded by the Segment List sub-TLV is beyond the scope of BGP and
      performed by the Segment Routing Policy Module (SRPM) as described in
      <xref target="RFC9830" sectionFormat="of" section="5"/>. As specified in 
      <xref target="RFC9256" sectionFormat="of" section="5.1"/>, a mix of SR-MPLS and SRv6 segments make the
      segment-list invalid.</t>
      <section anchor="TYPEC" numbered="true" toc="default">
        <name>Segment Type C</name>
        <t>The Type C Segment sub-TLV encodes an IPv4 node address, SR
        Algorithm, and an optional SR-MPLS Segment Identifier (SID). The format is as follows:
        </t>
<figure>
  <name>Type C Segment Sub-TLV</name>
        <artwork align="left" name="" type="" alt=""><![CDATA[
 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|     Type      |   Length      |     Flags     |  SR Algorithm |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                 IPv4 Node Address (4 octets)                  |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                SR-MPLS SID (optional, 4 octets)               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
]]></artwork>
</figure>


<t>Where:</t>

<dl spacing="normal" newline="false">
  <dt>Type:</dt><dd>3</dd>
  <dt>Length:</dt><dd>Specifies the length of the value field (i.e., not
  including Type and Length fields) in terms of octets. The value
  <bcp14>MUST</bcp14> be 10 when the SR-MPLS SID is present; else, it
  <bcp14>MUST</bcp14> be 6.</dd>
  <dt>Flags:</dt><dd>1 octet of flags as defined in <xref
  target="SEGMENTFLAGS" format="default"/>.</dd>
  <dt>SR Algorithm:</dt><dd>1 octet specifying the SR Algorithm as described in
  <xref target="RFC8402" sectionFormat="of" section="3.1.1"/> when the A-Flag as
  defined in <xref target="SEGMENTFLAGS" format="default"/> is set. The SR
  Algorithm is used by the SRPM <xref target="RFC9830"
  format="default"/> as described in <xref target="RFC9256" sectionFormat="of"
  section="4"/>. When the A-Flag is not set, this field <bcp14>MUST</bcp14> be set
  to zero on transmission and <bcp14>MUST</bcp14> be ignored on receipt.</dd>
  <dt>IPv4 Node Address:</dt><dd>A 4-octet IPv4 address representing a
  node.</dd>
  
  <dt>SR-MPLS SID:</dt><dd>Optional. A 4-octet field containing a label, Traffic Class (TC), bottom-of-stack (S), and
  TTL as defined for Segment Type A <xref target="RFC9830"
  format="default"/>.</dd>
</dl>

      </section>
      <section anchor="TYPED" numbered="true" toc="default">
        <name>Segment Type D</name>
        <t>The Type D Segment sub-TLV encodes an IPv6 node address, SR
        Algorithm, and an optional SR-MPLS SID. The format is as follows:
        </t>

<figure>
  <name>Type D Segment Sub-TLV</name>
        <artwork align="left" name="" type="" alt=""><![CDATA[
 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|     Type      |   Length      |     Flags     |  SR Algorithm |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
//                IPv6 Node Address (16 octets)                //
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                SR-MPLS SID (optional, 4 octets)               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
]]></artwork>
</figure>
	<t>Where:</t>

	<dl spacing="normal" newline="false">
          <dt>Type:</dt><dd>4</dd>
          <dt>Length:</dt><dd>Specifies the length of the value field (i.e.,
          not including Type and Length fields) in terms of octets. The value
          <bcp14>MUST</bcp14> be 22 when the SR-MPLS SID is present; else, it
          <bcp14>MUST</bcp14> be 18.</dd>
          <dt>Flags:</dt><dd>1 octet of flags as defined in <xref
          target="SEGMENTFLAGS" format="default"/>.</dd>
          <dt>SR Algorithm:</dt><dd>1 octet specifying the SR Algorithm as
          described in <xref target="RFC8402" sectionFormat="of"
          section="3.1.1"/> when the A-Flag as defined in <xref
          target="SEGMENTFLAGS" format="default"/> is set. The SR Algorithm is
          used by the SRPM <xref target="RFC9830"
          format="default"/> as described in <xref target="RFC9256"
          sectionFormat="of" section="4"/>. When the A-Flag is not set, this field
          <bcp14>MUST</bcp14> be set to zero on transmission and
          <bcp14>MUST</bcp14> be ignored on receipt.</dd>
          <dt>IPv6 Node Address:</dt><dd>A 16-octet IPv6 address representing
          a node.</dd>
          <dt>SR-MPLS SID:</dt><dd>Optional.  A 4-octet field containing a label,
          TC, S, and TTL as defined for Segment Type A <xref
          target="RFC9830" format="default"/>.</dd>
        </dl>
      </section>
      <section anchor="TYPEE" numbered="true" toc="default">
        <name>Segment Type E</name>
        <t>The Type E Segment sub-TLV encodes an IPv4 node address, a local
        interface Identifier (Local Interface ID), and an optional SR-MPLS
        SID. The format is as follows: </t>

<figure>
  <name>Type E Segment Sub-TLV</name>
        <artwork align="left" name="" type="" alt=""><![CDATA[
 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|     Type      |   Length      |     Flags     |   RESERVED    |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                 Local Interface ID (4 octets)                 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                 IPv4 Node Address (4 octets)                  |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                SR-MPLS SID (optional, 4 octets)               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
]]></artwork>
</figure>

<t>Where:</t>

<dl spacing="normal" newline="false">
  <dt>Type:</dt><dd>5</dd>
  <dt>Length:</dt><dd>Specifies the length of the value field (i.e., not
  including Type and Length fields) in terms of octets. The value
  <bcp14>MUST</bcp14> be 14 when the SR-MPLS SID is present; else, it
  <bcp14>MUST</bcp14> be 10.</dd>
  <dt>Flags:</dt><dd>1 octet of flags as defined in <xref
  target="SEGMENTFLAGS" format="default"/>.</dd>
  <dt>RESERVED:</dt><dd>1 octet of reserved bits. This field
  <bcp14>MUST</bcp14> be set to zero on transmission and <bcp14>MUST</bcp14>
  be ignored on receipt.</dd>


  <dt>Local Interface ID:</dt><dd>4 octets carrying the interface index of the local
  interface (refer to TLV 258 of <xref target="RFC9552" format="default"/>).</dd>
  <dt>IPv4 Node Address:</dt><dd>A 4-octet IPv4 address representing a
  node.</dd>
  <dt>SR-MPLS SID:</dt><dd>Optional.  A 4-octet field containing a label, TC, S, and
  TTL as defined for Segment Type A <xref target="RFC9830"
  format="default"/>.</dd>
</dl>
      </section>
      <section anchor="TYPEF" numbered="true" toc="default">
        <name>Segment Type F</name>
        <t>The Type F Segment sub-TLV encodes an adjacency local address, an
        adjacency remote address, and an optional SR-MPLS SID. The format is
        as follows: </t>

<figure>
  <name>Type F Segment Sub-TLV</name>
        <artwork align="left" name="" type="" alt=""><![CDATA[
 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|     Type      |   Length      |     Flags     |   RESERVED    |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                Local IPv4 Address (4 octets)                  |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                Remote IPv4 Address  (4 octets)                |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                SR-MPLS SID (optional, 4 octets)               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
]]></artwork>
</figure>

<t>Where:</t>
        <dl spacing="normal" newline="false">
          <dt>Type:</dt><dd>6</dd>
          <dt>Length:</dt><dd>Specifies the length of the value field (i.e.,
          not including Type and Length fields) in terms of octets. The value
          <bcp14>MUST</bcp14> be 14 when the SR-MPLS SID is present; else, it
          <bcp14>MUST</bcp14> be 10.</dd>
          <dt>Flags:</dt><dd>1 octet of flags as defined in <xref
          target="SEGMENTFLAGS" format="default"/>.</dd>
          <dt>RESERVED:</dt><dd>1 octet of reserved bits. This field
          <bcp14>MUST</bcp14> be set to zero on transmission and
          <bcp14>MUST</bcp14> be ignored on receipt.</dd>
          <dt>Local IPv4 Address:</dt><dd>A 4-octet IPv4 address representing
          the local link address of the node.</dd>
          <dt>Remote IPv4 Address:</dt><dd>A 4-octet IPv4 address representing
          the link address of the neighbor node.</dd>
          <dt>SR-MPLS SID:</dt><dd>Optional. A 4-octet field containing a label,
          TC, S, and TTL as defined for Segment Type A <xref
          target="RFC9830" format="default"/>.</dd>
        </dl>
      </section>
      <section anchor="TYPEG" numbered="true" toc="default">
        <name>Segment Type G</name>
        <t>The Type G Segment sub-TLV encodes an IPv6 link-local adjacency
        with an IPv6 local node address, a local interface identifier (Local
        Interface ID), an IPv6 remote node address, a remote interface identifier
        (Remote Interface ID), and an optional SR-MPLS SID. The format is as
        follows: </t>

<figure>
  <name>Type G Segment Sub-TLV</name>
        <artwork align="left" name="" type="" alt=""><![CDATA[
 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|     Type      |   Length      |     Flags     |   RESERVED    |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                 Local Interface ID (4 octets)                 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
//                IPv6 Local Node Address (16 octets)          //
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                 Remote Interface ID (4 octets)                |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
//                IPv6 Remote Node Address (16 octets)         //
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                SR-MPLS SID (optional, 4 octets)               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
]]></artwork>
</figure>
<t>Where:</t>
        <dl spacing="normal" newline="false">
          <dt>Type:</dt><dd>7</dd>
          <dt>Length:</dt><dd>Specifies the length of the value field (i.e.,
          not including Type and Length fields) in terms of octets. The value
          <bcp14>MUST</bcp14> be 46 when the SR-MPLS SID is present; else, it
          <bcp14>MUST</bcp14> be 42.</dd>
          <dt>Flags:</dt><dd>1 octet of flags as defined in <xref
          target="SEGMENTFLAGS" format="default"/>.</dd>
          <dt>RESERVED:</dt><dd>1 octet of reserved bits. This field
          <bcp14>MUST</bcp14> be set to zero on transmission and
          <bcp14>MUST</bcp14> be ignored on receipt.</dd>
          <dt>Local Interface ID:</dt><dd>4 octets of interface index of local
          interface (refer to TLV 258 of <xref target="RFC9552"
          format="default"/>).</dd>
          <dt>IPv6 Local Node Address:</dt><dd>A 16-octet IPv6 address
          representing the node.</dd>
          <dt>Remote Interface ID:</dt><dd>4 octets of interface index of
          remote interface (refer to TLV 258 of <xref target="RFC9552"
          format="default"/>). The value <bcp14>MAY</bcp14> be set to zero
          when the local node address and interface identifiers are sufficient
          to describe the link.</dd>
          <dt>IPv6 Remote Node Address:</dt><dd>A 16-octet IPv6 address. The
          value <bcp14>MAY</bcp14> be set to zero when the local node address
          and interface identifiers are sufficient to describe the link.</dd>
          <dt>SR-MPLS SID:</dt><dd>Optional. A 4-octet field containing a label,
          TC, S, and TTL as defined for Segment Type A <xref
          target="RFC9830" format="default"/>.</dd>
        </dl>
      </section>
      <section anchor="TYPEH" numbered="true" toc="default">
        <name>Segment Type H</name>
        <t>The Type H Segment sub-TLV encodes an adjacency local address, an
        adjacency remote address, and an optional SR-MPLS SID. The format is
        as follows: </t>

<figure>
  <name>Type H Segment Sub-TLV</name>
        <artwork align="left" name="" type="" alt=""><![CDATA[
 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|     Type      |   Length      |     Flags     |   RESERVED    |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
//               Local IPv6 Address (16 octets)                //
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
//               Remote IPv6 Address  (16 octets)              //
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                SR-MPLS SID (optional, 4 octets)               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
]]></artwork>
</figure>
<t>Where:</t>
        <dl spacing="normal" newline="false">
          <dt>Type:</dt><dd>8</dd>
          <dt>Length:</dt><dd>Specifies the length of the value field (i.e.,
          not including Type and Length fields) in terms of octets. The value
          <bcp14>MUST</bcp14> be 38 when the SR-MPLS SID is present; else, it
          <bcp14>MUST</bcp14> be 34.</dd>
          <dt>Flags:</dt><dd>1 octet of flags as defined in <xref
          target="SEGMENTFLAGS" format="default"/>.</dd>
	  <dt>RESERVED:</dt><dd>1 octet of reserved bits. This field
	  <bcp14>MUST</bcp14> be set to zero on transmission and
	  <bcp14>MUST</bcp14> be ignored on receipt.</dd>
          <dt>Local IPv6 Address:</dt><dd>A 16-octet IPv6 address
          representing the local link address of the node.</dd>
          <dt>Remote IPv6 Address:</dt><dd>A 16-octet IPv6 address
          representing the link address of the neighbor node.</dd>
          <dt>SR-MPLS SID:</dt><dd>Optional. A 4-octet field containing a label,
          TC, S, and TTL as defined for Segment Type A <xref
          target="RFC9830" format="default"/>.</dd>
        </dl>
      </section>
      <section anchor="TYPEI" numbered="true" toc="default">
        <name>Segment Type I</name>
        <t>The Type I Segment sub-TLV encodes an IPv6 node address, an SR
        Algorithm, and an optional SRv6 SID. The format is as follows: </t>

<figure>
  <name>Type I Segment Sub-TLV</name>
        <artwork align="left" name="" type="" alt=""><![CDATA[
 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|     Type      |   Length      |     Flags     | SR Algorithm  |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
//                 IPv6 Node Address (16 octets)               //
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
//                    SRv6 SID (optional, 16 octets)           //
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
//           SRv6 Endpoint Behavior and SID Structure          //
//                    (optional, 8 octets)                     //
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
]]></artwork>
</figure>
<t>Where:</t>

        <dl spacing="normal" newline="false">
          <dt>Type:</dt><dd>14</dd>
          <dt>Length:</dt><dd><t>Specifies the length of the value field (i.e.,
          not including Type and Length fields) in terms of octets. The value
          <bcp14>MUST</bcp14> be one of the following:</t>
	  <ul spacing="compact">
	    <li>42 when both SRv6 SID and SRv6
            Endpoint Behavior and SID Structure are present,</li>
	    <li>34 when only SRv6
            SID is present, or</li>
	    <li>18 when the SRv6 SID is not present.</li>
	  </ul>
	</dd>
          <dt>Flags:</dt><dd>1 octet of flags as defined in <xref
          target="SEGMENTFLAGS" format="default"/>.</dd>
          <dt>SR Algorithm:</dt><dd>1 octet specifying the SR Algorithm as
          described in <xref target="RFC8402" sectionFormat="of"
          section="3.1.1"/> when the A-Flag as defined in <xref
          target="SEGMENTFLAGS" format="default"/> is set. The SR Algorithm is
          used by the SRPM <xref target="RFC9830"
          format="default"/> as described in <xref target="RFC9256"
          sectionFormat="of" section="4"/>. When the A-Flag is not set, this field
          <bcp14>MUST</bcp14> be set to zero on transmission and
          <bcp14>MUST</bcp14> be ignored on receipt.</dd>
          <dt>IPv6 Node Address:</dt><dd>A 16-octet IPv6 address representing
          the node.</dd>
          <dt>SRv6 SID:</dt><dd>Optional.  A 16-octet IPv6 address. The value 0
          <bcp14>MAY</bcp14> be used when the controller wants to indicate the
          desired SRv6 Endpoint Behavior or SID Structure without specifying
          the SID.</dd>
          <dt>SRv6 Endpoint Behavior and SID Structure:</dt><dd>Optional, as
          defined in <xref target="RFC9830"
          sectionFormat="of" section="2.4.4.2.4"/>. The SRv6 Endpoint Behavior
          or SID Structure <bcp14>MUST NOT</bcp14> be included when the SRv6
          SID has not been included.</dd>
        </dl>
        <t>TLV 10 defined for the advertisement of Segment Type I in the
        early draft versions of <xref target="RFC9830" format="default"/>
        has been deprecated to avoid backward-compatibility issues.</t>
      </section>
      <section anchor="TYPEJ" numbered="true" toc="default">
        <name>Segment Type J</name>
        <t>The Type J Segment sub-TLV encodes an IPv6 link-local adjacency
        with a local node address, a local interface identifier (Local Interface
        ID), a remote IPv6 node address, a remote interface identifier (Remote
        Interface ID), and an optional SRv6 SID. The format is as follows:
        </t>
<figure>
  <name>Type J Segment Sub-TLV</name>
        <artwork align="left" name="" type="" alt=""><![CDATA[
 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|     Type      |   Length      |     Flags     | SR Algorithm  |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                 Local Interface ID (4 octets)                 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
//                IPv6 Local Node Address (16 octets)          //
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                 Remote Interface ID (4 octets)                |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
//                IPv6 Remote Node Address (16 octets)         //
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
//                SRv6 SID (optional, 16 octets)               //
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
//           SRv6 Endpoint Behavior and SID Structure          //
//                    (optional, 8 octets)                     //
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
]]></artwork>
</figure>

	<t>Where:</t>
        <dl spacing="normal" newline="false">
          <dt>Type:</dt><dd>15</dd>
          <dt>Length:</dt><dd><t>Specifies the length of the value field (i.e.,
          not including Type and Length fields) in terms of octets. The value
          <bcp14>MUST</bcp14> be one of the following:</t>
	  <ul spacing="compact">
	    <li>66 when both SRv6 SID and SRv6
            Endpoint Behavior and SID Structure are present,</li>
	    <li>58 when only SRv6 SID is present, or</li>
	    <li>42 when the SRv6 SID is not present.</li>
	  </ul>
	</dd>
          <dt>Flags:</dt><dd>1 octet of flags as defined in <xref
          target="SEGMENTFLAGS" format="default"/>.</dd>
          <dt>SR Algorithm:</dt><dd>1 octet specifying the SR Algorithm as
          described in <xref target="RFC8402" sectionFormat="of"
          section="3.1.1"/> when the A-Flag as defined in <xref
          target="SEGMENTFLAGS" format="default"/> is set. The SR Algorithm is
          used by the SRPM <xref target="RFC9830"
          format="default"/> as described in <xref target="RFC9256"
          sectionFormat="of" section="4"/>. When the A-Flag is not set, this field
          <bcp14>MUST</bcp14> be set to zero on transmission and
          <bcp14>MUST</bcp14> be ignored on receipt.</dd>
          <dt>Local Interface ID:</dt><dd>4 octets of interface index of local
          interface (refer to TLV 258 of <xref target="RFC9552"
          format="default"/>).</dd>
          <dt>IPv6 Local Node Address:</dt><dd>A 16-octet IPv6 address
          representing the node.</dd>
          <dt>Remote Interface ID:</dt><dd>4 octets of interface index of
          remote interface (refer to TLV 258 of <xref target="RFC9552"
          format="default"/>). The value <bcp14>MAY</bcp14> be set to zero
          when the local node address and interface identifiers are sufficient
          to describe the link.</dd>
          <dt>IPv6 Remote Node Address:</dt><dd>A 16-octet IPv6 address. The
          value <bcp14>MAY</bcp14> be set to zero when the local node address
          and interface identifiers are sufficient to describe the link.</dd>
          <dt>SRv6 SID:</dt><dd>Optional.  A 16-octet IPv6 address. The value 0
          <bcp14>MAY</bcp14> be used when the controller wants to indicate the
          desired SRv6 Endpoint Behavior or SID Structure without specifying
          the SID.</dd>


          <dt>SRv6 Endpoint Behavior and SID Structure:</dt><dd>Optional, as
          defined in <xref target="RFC9830"
          sectionFormat="of" section="2.4.4.2.4"/>. The SRv6 Endpoint Behavior
          and SID Structure <bcp14>MUST NOT</bcp14> be included when the SRv6
          SID has not been included.</dd>
        </dl>
        <t>TLV 11 defined for the advertisement of Segment Type J in the
        early draft versions of <xref target="RFC9830" format="default"/>
        has been deprecated to avoid backward-compatibility issues.</t>
      </section>
      <section anchor="TYPEK" numbered="true" toc="default">
        <name>Segment Type K</name>
        <t>The Type K Segment sub-TLV encodes an adjacency local address, an
        adjacency remote address, and an optional SRv6 SID. The format is as
        follows: </t>

<figure>
  <name>Type K Segment Sub-TLV</name>
        <artwork align="left" name="" type="" alt=""><![CDATA[
 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|     Type      |   Length      |     Flags     | SR Algorithm  |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
//               Local IPv6 Address (16 octets)                //
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
//               Remote IPv6 Address  (16 octets)              //
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
//                SRv6 SID (optional, 16 octets)               //
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
//           SRv6 Endpoint Behavior and SID Structure          //
//                    (optional, 8 octets)                     //
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
]]></artwork>
</figure>
	<t>Where:</t>
        <dl spacing="normal" newline="false">
          <dt>Type:</dt><dd>16</dd>
          <dt>Length:</dt><dd><t>Specifies the length of the value field (i.e.,
          not including Type and Length fields) in terms of octets. The value
          <bcp14>MUST</bcp14> be one of the following:</t>
	  <ul spacing="compact">
	    <li>58 when both SRv6 SID and SRv6
            Endpoint Behavior and SID Structure are present,</li>
	    <li>50 when only SRv6
            SID is present, or</li>
	    <li>34 when the SRv6 SID is not present.</li>
	  </ul>
	</dd>
          <dt>Flags:</dt><dd>1 octet of flags as defined in <xref
          target="SEGMENTFLAGS" format="default"/>.</dd>
          <dt>SR Algorithm:</dt><dd>1 octet specifying the SR Algorithm as
          described in <xref target="RFC8402" sectionFormat="of"
          section="3.1.1"/> when the A-Flag as defined in <xref
          target="SEGMENTFLAGS" format="default"/> is set. The SR Algorithm is
          used by the SRPM <xref target="RFC9830"
          format="default"/> as described in <xref target="RFC9256"
          sectionFormat="of" section="4"/>. When the A-Flag is not set, this field
          <bcp14>MUST</bcp14> be set to zero on transmission and
          <bcp14>MUST</bcp14> be ignored on receipt.</dd>
          <dt>Local IPv6 Address:</dt><dd>A 16-octet IPv6 address representing
          the local link address of the node.</dd>
          <dt>Remote IPv6 Address:</dt><dd>A 16-octet IPv6 address
          representing the link address of the neighbor node.</dd>
          <dt>SRv6 SID:</dt><dd>Optional.  A 16-octet IPv6 address. The value 0
          <bcp14>MAY</bcp14> be used when the controller wants to indicate the
          desired SRv6 Endpoint Behavior or SID Structure without specifying
          the SID.</dd>
          <dt>SRv6 Endpoint Behavior and SID Structure:</dt><dd>Optional, as
          defined in <xref target="RFC9830"
          sectionFormat="of" section="2.4.4.2.4"/>. The SRv6 Endpoint Behavior
          and SID Structure <bcp14>MUST NOT</bcp14> be included when the SRv6
          SID has not been included.</dd>
        </dl>
        <t>TLV 12 defined for the advertisement of Segment Type K in the
        early draft versions of <xref target="RFC9830" format="default"/>
        has been deprecated to avoid backward-compatibility issues.</t>
      </section>
      <section anchor="SEGMENTFLAGS" numbered="true" toc="default">
        <name>SR Policy Segment Flags</name>
        <t>The Segment Type sub-TLVs described above may contain the
        following SR Policy Segment Flags <xref target="RFC9830" format="default"/> in their Flags field (see also
        <xref target="IANASIDFLAGS" format="default"/>). This document introduces
        additional flags below:</t>

<figure>
  <name>SR Policy Segment Flags</name>
        <artwork align="left" name="" type="" alt=""><![CDATA[
 0 1 2 3 4 5 6 7
+-+-+-+-+-+-+-+-+
|V|A|S|B|       |
+-+-+-+-+-+-+-+-+
]]></artwork>
</figure>
        <t>Where:</t>
        <dl spacing="normal" newline="false">
          <dt>V-Flag:</dt><dd>This is an existing flag as defined in <xref
          target="RFC9830" format="default"/>.</dd>
          <dt>A-Flag:</dt><dd>When set, this flag indicates the presence of
          the SR Algorithm id in the SR Algorithm field applicable to various
          Segment Types. The SR Algorithm is used by the SRPM <xref
          target="RFC9830" format="default"/> as described
          in <xref target="RFC9256" sectionFormat="of" section="4"/>.</dd>
          <dt>S-Flag:</dt><dd>When set, this flag indicates the presence of
          the SR-MPLS or SRv6 SID depending on the segment type.</dd>
          <dt>B-Flag:</dt><dd>This is an existing flag as defined in <xref
          target="RFC9830" format="default"/>.</dd>
        </dl>
        <t>The following applies to the Segment Flags:</t>
        <ul spacing="normal">
          <li>
            <t>The V-Flag applies to all Segment Types including those
            introduced by this document.</t>
          </li>
          <li>
            <t>The A-Flag applies to Segment Types C, D, I, J, and K. The value of
            the A-Flag <bcp14>MUST</bcp14> be ignored for Segment Types A, B, E, F, G, and H.</t>
          </li>
          <li>
            <t>The S-Flag applies to Segment Types C, D, E, F, G, H, I, J, and K.
            The value of the S-Flag <bcp14>MUST</bcp14> be ignored for Segment Types A and B.</t>
          </li>
          <li>
            <t>The B-Flag applies to Segment Types B, I, J, and K. The value of
            the B-Flag <bcp14>MUST</bcp14> be ignored for Segment Types A, C, D, E, F, G, and
            H.</t>
          </li>
        </ul>
      </section>
    </section>
    <section anchor="IANA" numbered="true" toc="default">
      <name>IANA Considerations</name>
    
      <section anchor="IANASIDLIST" numbered="true" toc="default">

	
        <name>SR Policy Segment List Sub-TLVs</name>
        <t>IANA has allocated the following code points
        from the "SR Policy Segment List Sub-TLVs" registry <xref
        target="RFC9830" format="default"/> under the "Border Gateway Protocol (BGP)
        Tunnel Encapsulation" registry group.</t>

	<table>
	  <name>SR Policy Segment List Code Points</name>
	  <thead>
	    <tr>
	      <th>Value</th>
	      <th>Description</th>
              <th>Reference</th>
	    </tr>
	  </thead>
	  <tbody>
	    <tr>
	      <td>3</td>
	      <td>Type C Segment sub-TLV</td>
              <td>RFC 9831</td>
	    </tr>
	    <tr>
	      <td>4</td>
	      <td>Type D Segment sub-TLV</td>
              <td>RFC 9831</td>
	    </tr>
	    <tr>
	      <td>5</td>
	      <td>Type E Segment sub-TLV</td>
              <td>RFC 9831</td>
	    </tr>
	    <tr>
	      <td>6</td>
	      <td>Type F Segment sub-TLV</td>
              <td>RFC 9831</td>
	    </tr>
	    <tr>
	      <td>7</td>
	      <td>Type G Segment sub-TLV</td>
              <td>RFC 9831</td>
	    </tr>
	    <tr>
	      <td>8</td>
	      <td>Type H Segment sub-TLV</td>
              <td>RFC 9831</td>
	    </tr>
	    <tr>
	      <td>14</td>
	      <td>Type I Segment sub-TLV</td>
              <td>RFC 9831</td>
	    </tr>
	    <tr>
	      <td>15</td>
	      <td>Type J Segment sub-TLV</td>
              <td>RFC 9831</td>
	    </tr>
	    <tr>
	      <td>16</td>
	      <td>Type K Segment sub-TLV</td>
              <td>RFC 9831</td>
	    </tr>
	  </tbody>
	</table>

      </section>
      <section anchor="IANASIDFLAGS" numbered="true" toc="default">
        <name>SR Policy Segment Flags</name>
        <t>IANA has allocated code points from the "SR
        Policy Segment Flags" registry <xref target="RFC9830" format="default"/> under the "Border Gateway Protocol (BGP) Tunnel
        Encapsulation" registry group.</t>

<table>
  <name>SR Policy Segment Flags</name>
  <thead>
    <tr>
      <th>Bit</th>
      <th>Description</th>
      <th>Reference</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>1</td>
      <td>SR Algorithm Flag (A-Flag)</td>
      <td>RFC 9831</td>
    </tr>
    <tr>
      <td>2</td>
      <td>SID Specified Flag (S-Flag)</td>
      <td>RFC 9831</td>
    </tr>
  </tbody>
  </table>

      </section>
    </section>
    <section anchor="Security" numbered="true" toc="default">
      <name>Security Considerations</name>
      <t>The security considerations in <xref target="RFC9830" format="default"/> apply to the Segment Types
      defined in this document. No additional security considerations are
      introduced.</t>
    </section>
    <section anchor="Manageability" numbered="true" toc="default">
      <name>Manageability Considerations</name>
      <t>The operations and manageability considerations in <xref target="RFC9830" format="default"/> apply to the
      Segment Types
      defined in this document. No additional operations and manageability
      considerations are introduced.</t>
    </section>
  </middle>
  <back>

      <references>
        <name>Normative References</name>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8174.xml"/>



<reference anchor="RFC9830" target="https://www.rfc-editor.org/info/rfc9830">
  <front>
      <title>Advertising Segment Routing Policies in BGP</title>
      <author initials="S." surname="Previdi" fullname="Stefano Previdi">
         <organization>Huawei Technologies</organization>
      </author>
      <author initials="C." surname="Filsfils" fullname="Clarence Filsfils">
         <organization>Cisco Systems</organization>
      </author>
      <author initials="K." surname="Talaulikar" fullname="Ketan Talaulikar" role="editor">
         <organization>Cisco Systems</organization>
      </author>
      <author initials="P." surname="Mattes" fullname="Paul Mattes">
         <organization>Microsoft</organization>
      </author>
      <author initials="D." surname="Jain" fullname="Dhanendra Jain">
         <organization>Google</organization>
      </author>
    <date month='September' year='2025'/>
  </front>
  <seriesInfo name="RFC" value="9830"/>
  <seriesInfo name="DOI" value="10.17487/RFC9830"/>
</reference>

        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8402.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8660.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.9552.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8754.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.9256.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8986.xml"/>
      </references>

    <section numbered="false" toc="default">
      <name>Acknowledgments</name>
      <t>The authors would like to <contact fullname="Dan Romascanu"/>, <contact fullname="Stig
      Venaas"/>, and <contact fullname="Russ Housley"/> for their comments and review.
      The authors would like to thank <contact fullname="Susan Hares"/> for her detailed shepherd
      review that helped in improving the document.</t>
    </section>
  </back>
</rfc>
