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

<!DOCTYPE rfc SYSTEM "rfc2629-xhtml.ent">
<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>

<rfc
      xmlns:xi="http://www.w3.org/2001/XInclude"
      category="std"
      docName="draft-ietf-opsawg-ipfix-path-segment-06"
      ipr="trust200902"
      obsoletes=""
      updates=""
      submissionType="IETF"
      xml:lang="en"
      tocInclude="true"
      tocDepth="4"
      symRefs="true"
      sortRefs="true"
      version="3">

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

 <front>
   <title abbrev="IPFIX for PSID">Export of Segment Routing Path Segment Identifier (PSID) Information in IPFIX</title>
    <seriesInfo name="Internet-Draft" value="draft-ietf-opsawg-ipfix-path-segment-06"/>
   <author fullname="Yao Liu" surname="Liu">
      <organization>ZTE</organization>
      <address>
        <postal>
          <street/>
          <!-- Reorder these if your country does things differently -->

         <city>Nanjing</city>
          <region/>
          <code/>
          <country>China</country>
        </postal>
        <phone></phone>
        <email>liu.yao71@zte.com.cn</email>
        <!-- uri and facsimile elements may also be added -->
     </address>
    </author>
   <author fullname="Zhenqiang Li" surname="Li">
      <organization>China Mobile</organization>
      <address>
        <postal>
          <street/>
          <!-- Reorder these if your country does things differently -->

         <city></city>
          <region/>
          <code/>
          <country></country>
        </postal>
        <phone></phone>
        <email>lizhenqiang@chinamobile.com</email>
        <!-- uri and facsimile elements may also be added -->
     </address>
    </author>
   <author fullname="Yisong Liu" surname="Liu">
      <organization>China Mobile</organization>
      <address>
        <postal>
          <street/>
          <!-- Reorder these if your country does things differently -->

         <city></city>
          <region/>
          <code/>
          <country></country>
        </postal>
        <phone></phone>
        <email>liuyisong@chinamobile.com</email>
        <!-- uri and facsimile elements may also be added -->
     </address>
    </author>	
   <author fullname="Changwang Lin" surname="Lin">
      <organization>New H3C Technologies</organization>
      <address>
        <postal>
          <street/>
          <!-- Reorder these if your country does things differently -->

         <city></city>
          <region/>
          <code/>
          <country></country>
        </postal>
        <phone></phone>
        <email>linchangwang.04414@h3c.com</email>
        <!-- uri and facsimile elements may also be added -->
     </address>
    </author>
   <author fullname="Guozhen Dong" surname="Dong">
      <organization>China Telecom</organization>
      <address>
        <postal>
          <street/>
          <!-- Reorder these if your country does things differently -->

         <city></city>
          <region/>
          <code/>
          <country></country>
        </postal>
        <phone></phone>
        <email>donggz@chinatelecom.cn</email>
        <!-- uri and facsimile elements may also be added -->
     </address>
    </author>	
    <date year="2026"/>

   <!-- Meta-data Declarations -->

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

   <keyword>IPFIX</keyword>
   <keyword>SR</keyword>
   <keyword>Path Segment</keyword>
    <!-- Keywords will be incorporated into HTML output
        files in a meta tag but they have no effect on text or nroff
        output. If you submit your draft to the RFC Editor, the
        keywords will be used for the search engine. -->

   <abstract>
      <t>This document introduces new IPFIX Information Elements to identify the Segment Routing (SR) Path Segment Identifier (PSID) for SR-MPLS and SRv6 paths identification.</t>
    </abstract>
  </front>
  <middle>
    <section numbered="true" toc="default">
      <name>Introduction</name>  
	<t>When monitoring a traffic flow in an SR network, a typical use case is to answer the following questions:</t>
		<ul spacing="normal">
		<li>How many packets are steered into a certain SR path ?</li>
		<li>Which SR Policy or candidate path or segment list this SR path belongs to ?</li>
		</ul>
	<t>To answer these questions, when exporting IPFIX flow records, the SR path information needs to be included. However, there are still some shortcomings with the existing mechanisms.</t>

    <section numbered="true" toc="default">
      <name>SR-MPLS Path Identification</name>
	  <t>In SR-MPLS <xref target="RFC8660"></xref>, a segment is encoded as an MPLS label. For MPLS label stack information collection, IPFIX IE mplsLabelStackSection (elementID:316) <xref target="RFC5477"></xref> can carry a series of n octets from the MPLS label stack of a sampled packet, which can be leveraged to carry the whole or part of the MPLS label stack. And IEs from mplsTopLabelStackSection, mplsLabelStackSection2, mplsLabelStackSection3 to mplsLabelStackSection10 (elementID from 70 to 79) <xref target="RFC5102"></xref> provide mechanism to carry the individual MPLS label information in the IPFIX message.</t>
	  <t>But the above IEs are not sufficient for SR-MPLS path identification:</t>
	  <ul spacing="normal">
		<li>The intermediate node and the egress node cannot use the SR label stack to determine along which SR path the packet came, because when a packet is transmitted along an SR path, the labels in the MPLS label stack will be swapped or popped.</li>
		<li>Although the headend node may have the information of the whole segment list, the size of IPFIX messages (especially the data record) would be big when a segment list contains many SIDs, making the collecting and analyzing of flow records inefficient.</li>
<li>In the cases that different SR (whether it is SR-MPLS or SRv6) policies use the same segment list for traffic steering, it is difficult to distinguish the traffic flow of different SR policies even with the whole SR list information of the traffic flow.</li>
		</ul>
	 </section>

    <section numbered="true" toc="default">
      <name>SRv6 Path Identification</name>
<t><xref target="RFC9487"></xref> introduces new IP Flow Information Export (IPFIX) Information Elements (IEs) to identify a set of information related to Segment Routing over IPv6 (SRv6). For the SRv6 segment list, two IPFIX IPv6 SRH IEs are defined in <xref target="RFC9487"></xref>, srhSegmentIPv6BasicList (elementID:496) and srhSegmentIPv6ListSection (elementID:497), both encoding the Segment List in the SRH starting from Segment List[0].</t>	  

<t>An SRv6 path could be identified by the content of a segment list in IPFIX using IE496 or IE497, but the segment list is not always the best key identifier due to the following reasons:</t>
		<ul spacing="normal">
		<li>The size of an SRv6 SID is much bigger than an SR-MPLS SID, making the size of IPFIX message even larger when the segment list contains many SIDs.</li>	
		<li>An SRv6 path may not be identified by the segment list carried by the SRH in reduced mode as described in Section 4.1.1 of <xref target="RFC8754"></xref> where the first SID is not present in the SRH.</li>
		<li>When the srhSegmentIPv6BasicList or srhSegmentIPv6ListSection contains compressed-SID containers <xref target="RFC9800"></xref>, additional information and processing procedures are required to decode compressed-SID containers as described in Section 6.2 of <xref target="RFC9487"></xref> to obtain the original segment list information before compression.</li>
		</ul>
	 </section>		
		
		
    <section numbered="true" toc="default">
      <name>SR Path Segment</name>
<t>Path Segment is a type of Segment Routing (SR) segment, and a Path Segment Identifier (PSID) is used to identify an SR path.</t>
<t>For SR-MPLS, as specified in <xref target="RFC9545" format="default"></xref>, a PSID is a single label that is assigned from the Segment Routing Local Block (SRLB) of the egress node of an SR path, and it immediately follows the last label of the SR path.</t>
<t>PSID for SRv6 networks is defined in <xref target="I-D.ietf-spring-srv6-path-segment"></xref>. In SRH, the PSID appears in the last entry in the segment list.</t>

<t>This document introduces new IPFIX Information Elements to identify the PSIDs for SR-MPLS and SRv6 paths identification.</t>
	 </section>	 
	  </section>

<section numbered="true" toc="default">
        <name>Terminology</name>
		<t>The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 <xref target="RFC2119" format="default"></xref> <xref target="RFC8174" format="default"></xref> when, and only when, they appear in all capitals, as shown here.</t>
		<t>This document makes use of the terms defined in <xref target="RFC7011" format="default"></xref>, <xref target="RFC8402" format="default"></xref>, <xref target="RFC8754" format="default"></xref> and <xref target="RFC9545" format="default"></xref>.</t>
		<t>The following terms are used as defined in <xref target="RFC7011" format="default"></xref>:</t>	
		<ul spacing="normal">
		<li>IPFIX</li>
		<li>IPFIX Information Elements</li>
		<li>Metering Process</li>
		<li>Template Record</li>
		<li>Data Record</li>
		<li>Collector</li>		
		</ul>
		<t>The following terms are used as defined in <xref target="RFC8402" format="default"></xref>:</t>	
		<ul spacing="normal">
		<li>Segment Routing (SR)</li>
		<li>Segment List</li>
		<li>SRv6</li>	
		</ul>
		<t>The following terms are used as defined in <xref target="RFC8754" format="default"></xref>:</t>	
		<ul spacing="normal">
		<li>SRH</li>
		<li>Last Entry</li>
		</ul>
		<t>The following terms are used as defined in <xref target="RFC9545" format="default"></xref> and <xref target="I-D.ietf-spring-srv6-path-segment"></xref>:</t>	
		<ul spacing="normal">
		<li>PSID: Path Segment Identifier</li>
		</ul>		
      </section>

<section numbered="true" toc="default">
	<name>PSID in IPFIX</name>	
	
<section numbered="true" toc="default" anchor="section3.1" >
<name>SR-MPLS PSID in IPFIX</name>
		<t>A new IE "psidMplsLabelStackSection" is defined in this document to identify the SR-MPLS PSID, it carries an MPLS label that represents an SR-MPLS PSID, as well as the Exp, and S fields from the label stack entry that containing a PSID.</t>
		<dl newline="false" indent="3" spacing="normal" >
          <dt>Name:</dt>
          <dd>
            <t>psidMplsLabelStackSection</t>
          </dd>
          <dt>ElementID:</dt>
          <dd >
            <t>TBD1</t>
          </dd>
          <dt>Description:</dt>
          <dd>
            <t indent="0">The Label (i.e., the MPLS PSID), Exp, and S fields from the label stack entry that contains a PSID. The size of this Information Element is 3 octets.</t> 
			        <artwork align="center" name=""><![CDATA[
 0                   1                   2
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|          Label(PSID)                  | Exp |S|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+  
           ]]></artwork>
			
<t>Label: the MPLS PSID, 20 bits</t>
<t>Exp: Experimental Use, 3 bits</t>
<t>S: Bottom of Stack, 1 bit</t>
			
          </dd>
          <dt>Abstract Data Type:</dt>
          <dd>
            <t indent="0" >octetArray</t>
          </dd>
          <dt>Data Type Semantics:</dt>
          <dd >
            <t indent="0">default</t>
          </dd>
          <dt>Additional Information:</dt>
          <dd>
            <t indent="0">Specified in <xref target="RFC9545" format="default"></xref>.</t>
          </dd>
          <dt>Reference:</dt>
          <dd>
            <t indent="0" >This document.</t>
          </dd>
        </dl>
</section>
<section numbered="true" toc="default" anchor="section3.2">
	<name>SRv6 PSID in IPFIX</name>
		<t>A new IE "srhPsidIPv6" is defined in this document to identify the PSID in the SRH, it carries a 128-bit value that represents an SRv6 PSID.</t>
		<dl newline="false" indent="3" spacing="normal" >
          <dt>Name:</dt>
          <dd>
            <t>srhPsidIPv6</t>
          </dd>
          <dt>ElementID:</dt>
          <dd >
            <t>TBD2</t>
          </dd>
          <dt>Description:</dt>
          <dd>
            <t indent="0">The 128-bit value that represents an SRv6 PSID.</t> 
          </dd>
          <dt>Abstract Data Type:</dt>
          <dd>
            <t indent="0" >octetArray</t>
          </dd>
          <dt>Data Type Semantics:</dt>
          <dd >
            <t indent="0">default</t>
          </dd>
          <dt>Additional Information:</dt>
          <dd>
            <t indent="0">Specified in Section 3 of <xref target="I-D.ietf-spring-srv6-path-segment"></xref>.</t>
          </dd>
          <dt>Reference:</dt>
          <dd>
            <t indent="0" >This document.</t>
          </dd>
        </dl>
		
		<t>Although IE srhPsidIPv6 is used to identify an SRv6 path, this document doesn't limit using srhPsidIPv6 together with srhSegmentIPv6BasicList or srhSegmentIPv6ListSection in the same IPFIX message, see Section 4.2 for more information.</t>
		</section>
<section numbered="true" toc="default">
	<name>PSID Use Cases</name>
	<t>Network Observability, as described in <xref target="RFC9940" format="default"></xref>, is the process of enabling network behavioral assessment through analysis of observed operational network data, and Network Telemetry (e.g., IPFIX) is the basis of Network Observability.</t>
<t>PSID benefits the SR IPFIX flow visibility for Network Observability. As described in Section 3 of <xref target="RFC9545" format="default"></xref> and Section 2 of <xref target="I-D.ietf-spring-srv6-path-segment"></xref>, SR-MPLS and SRv6 PSID may be used to identify an SR Path in use cases such as performance measurement, bi-directional path association, end-to-end path protection, etc. By carrying PSID information in IPFIX messages, SR path of the traffic flow can be easily identified in the above use cases.
</t>

<t>To achieve operational visibility into SR networks, operators can leverage PSID information exported in IPFIX records in conjunction with the mapping between the PSID and the SR path context. This enables operational use cases such as:</t>
<ul spacing="normal">
<li>Path selection visibility: Identifying which SR path a flow is using.</li>
<li>Policy selection visibility: Determining which SR Policy a flow is associated with.</li>
<li>Candidate-path churn detection: Observing PSID changes in subsequent Flow Records to detect path switches.</li>
<li>Performance measurement correlation: Associating performance metrics (e.g., delay, loss) with specific SR paths.</li>
</ul>
<t>The detailed procedures for correlating PSID with network events and diagnosing forwarding failures are deployment-specific and outside the scope of this document.</t>

	</section>	

</section>	
	
<section numbered="true" toc="default">
	<name>Operational Considerations</name>
	
	<section numbered="true" toc="default">
<name>Generic Operational Considerations</name>

<section numbered="true" toc="default">
<name>PSID-to-Path Mapping Model</name>
<t>The association between the exported PSID value and the corresponding SR path context (SR Policy, Candidate Path, or Segment List) can be established by the controller and signaled via BGP <xref target="I-D.ietf-idr-sr-policy-path-segment"></xref> or PCEP <xref target="I-D.ietf-pce-sr-path-segment"></xref>. Alternatively, the association can be instantiated on the ingress/egress node of the path and reported to the controller via PCEP <xref target="I-D.ietf-pce-sr-path-segment"></xref> or BGP-LS <xref target="I-D.ietf-idr-bgp-ls-sr-policy-path-segment"></xref>.</t>
<t>After decoding the IPFIX messages at the Collector, to get the flow record with the PSID, the Collector might process the flow record locally or send it to a data processing or analytics component. To recognize which SR path a PSID identifies, the analysis node needs to be aware of the association between the exported PSID value and the corresponding SR path context. This association can be obtained via the following methods:</t>
<ul spacing="normal">
<li>querying a centralized controller, where the controller has already acquired the mapping through local configuration policy or protocols (e.g., PCEP <xref target="I-D.ietf-pce-sr-path-segment"></xref> or BGP-LS <xref target="I-D.ietf-idr-bgp-ls-sr-policy-path-segment"></xref>);</li>
<li>obtaining BGP-LS updates from headend nodes (or from a BGP-LS speaker in the network) <xref target="RFC9857" format="default"></xref></li>
</ul>
<t>The detailed procedures for obtaining and maintaining this mapping are outside the scope of this document.</t>
</section>

<section numbered="true" toc="default">
<name>PSID Under Path Changes</name>
<t>The following clarifications apply to the behavior of PSID when the network path changes:</t>
<ul spacing="normal">
<li>Path asymmetry does not affect PSID export or identification. An IPFIX record always exports the PSID of the current unidirectional SR path. The existence or absence of a reverse path has no impact on the PSID value exported for the forward path.</li>
<li>Path degradation is unrelated to PSID exporting. PSID is a path identifier, not a path quality indicator. While PSID may be used to assist performance measurement (e.g., by associating telemetry data with a specific SR path), it does not itself reflect changes in path quality.</li>
<li>Under failover scenarios: If the SR path switches to a backup Candidate Path, the packet carries the PSID associated with the new path. The IPFIX Metering Process observes and exports the new PSID in subsequent Flow Records. If the SR path remains unchanged but Fast Reroute (FRR) or other local protection mechanisms are used, the Segment List (and thus the PSID) does not change. The exported PSID remains the same.</li>
</ul>
</section>

<section numbered="true" toc="default">
<name>PSID Scope and Uniqueness</name>
<t>As specified in <xref target="RFC9545" format="default"></xref> and <xref target="I-D.ietf-spring-srv6-path-segment"></xref>, the same PSID value may be used to identify a single segment list, multiple segment lists, some or all segment lists under a Candidate Path, or some or all Candidate Paths within an SR Policy, depending on the use case. This flexibility allows operators to aggregate traffic statistics at different granularities.</t>
<t>To avoid ambiguity in the exported PSID value, the entity (e.g., the controller, the ingress node, or the egress node of the path) that generates the association between the PSID and the SR path is responsible for ensuring that the exported PSID values are distinguishable within the intended scope (e.g., within a node, or the SR network domain). Reuse of the same PSID value outside its intended scope is undefined for correlation purposes.</t>
<t>The Collector can resolve the association between an exported PSID value and the corresponding SR path by consulting the mapping information obtained from the entity responsible for the mapping, as described in Section 4.1.1. The detailed procedures for obtaining and maintaining this mapping are outside the scope of this document.</t>
</section>

</section>
	
<section numbered="true" toc="default">
	<name>Operational Considerations for psidMplsLabelStackSection</name>
	<t>To generate Flow Records with psidMplsLabelStackSection, the Metering Process needs to acquire the information of the corresponding PSID, i.e., which label is the PSID. This may be achieved by configuration or signaling. How to get this information is out of the scope of this document.</t>

</section>	
<section numbered="true" toc="default">
	<name>Operational Considerations for srhPsidIPv6</name>
	<t>As specified in <xref target="I-D.ietf-spring-srv6-path-segment"></xref>, the G-Flag in the SRH is set to indicate that the last entry of the Segment List contains a 128-bit metadata object as an opaque identifier or data payload defined by the specific application (e.g., a Path Segment Identifier). To generate Flow Records with PSID included, the Metering Process MUST understand the G-Flag.  Only when the G-Flag is set and the last entry carries an SRv6 PSID SHOULD the Metering Process capture the last entry in the SRH to get the PSID. If the G-Flag in the packet is unset or the last entry does not carry an SRv6 PSID, the srhPsidIPv6 SHOULD NOT be used in the template. When the srhPsidIPv6 appears in a Data Record with G-Flag unset, it SHOULD be ignored.</t>


	<t>As in <xref target="I-D.ietf-spring-srv6-path-segment"></xref> Section 3, the PSID allocation depends on the use cases, including:</t>
	<ul spacing="normal">
		<li>each segment list may have its own PSID with different value;</li>
		<li>the same PSID may be used for some or all the segment list under a Candidate path;</li>
		<li>the same PSID may be used for some or all Candidate Path within an SRv6 policy.</li>	
	</ul>		
	<t>If srhPsidIPv6 and srhSegmentIPv6BasicList/srhSegmentIPv6ListSection appear together, the srhPsidIPv6 MAY be used to identify an SR Policy or candidate path, and the information carried in srhSegmentIPv6BasicList/srhSegmentIPv6ListSection shows the detailed segment list belonging to this SR Policy or candidate path. This document does not limit how to use srhPsidIPv6 and the detail is out of scope.</t>
	</section>

</section>


<section numbered="true" toc="default">
	<name>Security Considerations</name>
		<t>The export of PSID values in IPFIX records may reveal information about the SR path topology that is not exposed by standard 5-tuple flow records, including which SR paths exist and how traffic is distributed across them. An observer with access to the IPFIX data stream could potentially use this information to infer the SR network topology. Deployments should consider appropriate access controls for IPFIX data, as discussed in <xref target="RFC7011" format="default"></xref>, to limit exposure of this information to authorized entities only. The security considerations of the underlying SR-MPLS PSID <xref target="RFC9545" format="default"></xref> and SRv6 PSID <xref target="I-D.ietf-spring-srv6-path-segment"></xref> also apply.</t>
		
		
</section>	

<section numbered="true" toc="default">
	<name>IANA Considerations</name>
		<t>This document requests IANA to create new IEs under the "IPFIX Information Elements" registry <xref target="RFC7012" format="default"></xref> available at <xref target="IANA-IPFIX" format="default" sectionFormat="of" derivedContent="IANA-IPFIX"/>.</t>
		
		<table anchor="iana-psid">
		<name>IPFIX Information Elements Registry</name>
		<thead>
		<tr>
		<td>Element ID</td><td>Name</td><td>Reference</td>
		</tr>
		</thead>
		<tbody>
		<tr>
		<td>TBD1</td><td>psidMplsLabelStackSection</td><td><xref target="section3.1"/></td>
		</tr>
		</tbody>
		<tbody>
		<tr>
		<td>TBD2</td><td>srhPsidIPv6</td><td><xref target="section3.2"/></td>
		</tr>
		</tbody>
	</table>
		
		
		

	</section>


<section numbered="true" toc="default">
	<name>Acknowledgements</name>
    <t>Thanks to Thomas Graf, Paul Aitken and Saumya Dikshit for their detailed review and comments. Thanks to Cheng Li and Chongfeng Xie for their helpful comments and suggestions.</t>
</section>	
	
  </middle>
  <!--  *****BACK MATTER ***** -->

 <back>

   <references>
      <name>References</name>
      <references>
        <name>Normative References</name>

		<?rfc include="reference.RFC.2119.xml"?>
		<?rfc include="reference.RFC.8174.xml"?>
	  	<?rfc include='reference.I-D.ietf-spring-srv6-path-segment.xml'?>		
		<?rfc include="reference.RFC.9545.xml"?>			
		<?rfc include="reference.RFC.7012.xml"?>
		<?rfc include="reference.RFC.8754.xml"?>
 		<?rfc include="reference.RFC.8402.xml"?>
		<?rfc include="reference.RFC.7011.xml"?> 
		<reference anchor="IANA-IPFIX" target="https://www.iana.org/assignments/ipfix" quoteTitle="true" derivedAnchor="IANA-IPFIX">
          <front>
            <title>IP Flow Information Export (IPFIX) Entities</title>
            <author>
              <organization showOnFrontPage="true">IANA</organization>
            </author>
            <date/>
          </front>
        </reference>
	  
      </references>
      <references>
        <name>Informative References</name>
		<?rfc include="reference.RFC.9487.xml"?>
		<?rfc include="reference.RFC.5102.xml"?>
		<?rfc include="reference.RFC.8660.xml"?>
		<?rfc include="reference.RFC.5477.xml"?>		
	    <?rfc include="reference.RFC.9800.xml"?>
		<?rfc include="reference.RFC.9940.xml"?>
<?rfc include='reference.I-D.ietf-idr-sr-policy-path-segment.xml'?>
<?rfc include='reference.I-D.ietf-pce-sr-path-segment.xml'?>
<?rfc include='reference.I-D.ietf-idr-bgp-ls-sr-policy-path-segment.xml'?>
<?rfc include="reference.RFC.9857.xml"?>		
      </references>
    </references>


 </back>
</rfc>
