<?xml version="1.0" encoding="US-ASCII"?>
<!-- This template is for creating an Internet Draft using xml2rfc,
     which is available here: http://xml.resource.org. -->
<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
<!-- One method to get references from the online citation libraries.
     There has to be one entity for each item to be referenced.
     An alternate method (rfc include) is described in the references. -->
<!ENTITY RFC2119 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml">
<!ENTITY RFC6241 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.6241.xml">
<!ENTITY RFC7950 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.7950.xml">
<!ENTITY RFC7149 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.7149.xml">
<!ENTITY RFC7426 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.7426.xml">
<!ENTITY RFC8299 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.8299.xml">
<!ENTITY RFC8309 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.8309.xml">
<!ENTITY RFC8340 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.8340.xml">
<!ENTITY RFC8453 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.8453.xml">
<!ENTITY RFC8174 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.8174.xml">
<!ENTITY RFC8345 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.8345.xml">
]>
<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>
<!-- used by XSLT processors -->
<!-- For a complete list and description of processing instructions (PIs),
     please see http://xml.resource.org/authoring/README.html. -->
<!-- Below are generally applicable Processing Instructions (PIs) that most I-Ds might want to use.
     (Here they are set differently than their defaults in xml2rfc v1.32) -->
<?rfc strict="yes" ?>
<!-- give errors regarding ID-nits and DTD validation -->
<!-- control the table of contents (ToC) -->
<?rfc toc="yes"?>
<!-- generate a ToC -->
<?rfc tocdepth="4"?>
<!-- the number of levels of subsections in ToC. default: 3 -->
<!-- control references -->
<?rfc symrefs="yes"?>
<!-- use symbolic references tags, i.e, [RFC2119] instead of [1] -->
<?rfc sortrefs="yes" ?>
<!-- sort the reference entries alphabetically -->
<!-- control vertical white space
     (using these PIs as follows is recommended by the RFC Editor) -->
<?rfc compact="yes" ?>
<!-- do not start each main section on a new page -->
<?rfc subcompact="no" ?>
<!-- keep one blank line between list items -->
<!-- end of list of popular I-D processing instructions -->
<rfc category="std" docName="draft-he-6man-icmpv6-extensions-ipv6-ext-header-02"
     ipr="trust200902">
  <front>
    <title>LOOPBACK6: A Utility For Detecting IPv6 Extension Header Changes</title>

    <author fullname="Xiaoming He" initials="X." surname="He">
      <organization>China Telecom</organization>

      <address>
        <email>hexm4@chinatelecom.cn</email>
      </address>
    </author>

    <author fullname="Ron Bonica" initials="R." surname="Bonica">
      <organization>Juniper Networks</organization>

      <address>
        <postal>
          <country>USA</country>
        </postal>

        <email>rbonica@juniper.net</email>
      </address>
      
    </author>
    <author fullname="Xiao Min" initials="X." surname="Min">
      <organization>ZTE Corp.</organization>

      <address>
        <email>xiao.min2@zte.com.cn</email>
      </address>
    </author>

    <author fullname="Chongfeng Xie" initials="C." surname="Xie">
      <organization>China Telecom</organization>

      <address>
        <email>xiechf@chinatelecom.cn</email>
      </address>
    </author>

    <author fullname="Tal Mizrahi" initials="T." surname="Mizrahi">
      <organization>Huawei</organization>

      <address>
        <email>tal.mizrahi.phd@gmail.com</email>
      </address>
    </author>

    <author fullname="Zhenqiang Li" initials="Z." surname="Li">
      <organization>China Mobile</organization>

      <address>
        <email>li_zhenqiang@hotmail.com</email>
      </address>
    </author>

    <date year="2024"/>

    <area>Internet</area>

    <workgroup>6MAN Working Group</workgroup>

    <keyword>ICMPv6 extensions</keyword>

    <abstract>
      <t>This document describes LOOPBACK6. LOOPBACK6 is a utility that
      network operators can use to determine how IPv6 extension headers have
      been altered by transit nodes. Its operation is similar to that of PING
      and PROBE.</t>
    </abstract>
  </front>

  <middle>
    <section anchor="Introduction" title="Introduction">
      <t>IPv6 [RFC8200] is an extensible protocol. Source nodes use IPv6
   extension headers to elicit extended IPv6 behaviors. The following
   are a subset of IPv6 extension header types:</t>

            <ul spacing="normal">
        <li>
          <t>Hop-by-Hop Options</t>
        </li>

        <li>
          <t>Routing</t>
        </li>

        <li>
          <t>Destination Options</t>
        </li>
      </ul>

      <t>The Hop-by-hop Options extension header can be processed by each node
      along a packet's delivery path. However, the Routing extension header is
      processed by only a selected set of nodes along a packet's delivery
      path. And finally, the Destination Options extension header is processed
      by a packet's destination node only.</t>

      <t>Depending on their contents, IPv6 extensions headers can be mutable
      or immutable. Transit nodes can alter the contents of a mutable
      extension header. In at least one example <xref target="RFC9197"/> <xref
      target="RFC9486"/>, transit routers accumulate OAM information in
      mutable extension headers. However, transit nodes cannot alter the
      contents of an immutable extension header.</t>

      <t>LOOPBACK6 is a utility that network operators can use to determine
      how IPv6 extension headers have been altered by transit nodes. Its
      operation is similar to that of PING <xref target="RFC2151"/> and PROBE
      <xref target="RFC8335"/>. This document describes LOOPBACK6
      operation.</t>
    </section>

    <section title="Conventions">    
      <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"/> <xref target="RFC8174"/> when, and only when,
      they appear in all capitals, as shown here.</t>
    </section>

    

    <section anchor="theory-of-operation">
      <name>Theory of Operation</name>

      <t>LOOPBACK6 executes on a probing node. It originates and sends an ICMPv6 Extended
      Echo Request message <xref target="RFC4443"/> <xref target="RFC8335"/>
      from the probing node to a probed interface that resides on a probed
      node. The L-bit of the ICMPv6 Extended Echo Request message
      <bcp14>MUST</bcp14> be set to 1. This indicates that the probed
      interface resides on the probed node.</t>

      <t>The ICMP Extended Echo Request contains an ICMP Extension Structure
      <xref target="RFC4884"/> and the ICMP Extension Structure contains one
      or more of the following ICMP Extension Objects:</t>

      <ul spacing="normal">
        <li>
          <t>Hop-by-Hop Options Header</t>
        </li>

        <li>
          <t>Routing Header</t>
        </li>

        <li>
          <t>Destination Options Header</t>
        </li>
      </ul>

      <t>The above-mentioned ICMP Extension Objects are defined in Section 4 of this document. When they are used in the ICMPv6
      Extended Echo Request message, they carry no payload. Therefore, their
      length <bcp14>MUST</bcp14> be equal to 4 octets.</t>

      <t>The ICMP Extended Echo Request is encapsulated in an IPv6 header and
      the IPv6 header can carry IPv6 extension headers.</t>

      <t>When the probed node receives the ICMPv6 Extended Echo Request
      message, it formats and sends an ICMPv6 Extended Reply message. The ICMP Extended
      Echo Reply contains an ICMP Extension Structure and the ICMP Extension
      Structure contains the same set of ICMP Extension Objects that the ICMP
      Extended Request message contained. However, the ICMP Extension objects
      <bcp14>MUST</bcp14> include payloads. Specifically:</t>

      <ul spacing="normal">
        <li>
          <t>The payload field for the Hop-by-Hop Options Header option
          <bcp14>MUST</bcp14> reflect the Hop-by-Hop Option extension
          header from the packet that carried the ICMPv6 Extended Echo Request
          message to the probed node.</t>
        </li>

        <li>
          <t>The payload field for the Routing Header option
          <bcp14>MUST</bcp14> reflect the Routing extension header from the
          packet that carried the ICMPv6 Extended Echo Request message to the
          probed node.</t>
        </li>

        <li>
          <t>The payload field for the Destination Options Header option
          <bcp14>MUST</bcp14> reflect the Destination Option extension header
          from the packet that carried the ICMPv6 Extended Echo Request
          message to the probed node.</t>
        </li>
      </ul>
    </section>
    
    <section title="The Extended ICMPv6 Messages">
      <t>LOOPBACK6 leverages two extended ICMPv6 messages: the Extended Echo Request Message and the Extended Echo Reply Message defined in [RFC8335].</t>
      
     <section title="ICMPv6 Extended Echo Request Message">
      <t>the ICMPv6 Extended Echo Request message is encapsulated in an IPv6 header. Figure 1 depicts the ICMPv6 Extended Echo Request message.</t>
       <t><figure
       title="ICMPv6 Extended Echo Request Message">
       <artwork>
  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      |     Code      |          Checksum             |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |           Identifier          |Sequence Number|   Reserved  |L|
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                 ICMP Extension Structure                      |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+</artwork>
       </figure></t>

      <t>ICMPv6 Fields:</t>

	 <t>Type: Extended Echo Request. As defined in [RFC8335], The value is 160.</t>

	 <t>Code: MUST be set to 0.</t>

	 <t>Checksum: As defined in [RFC4443].</t>

	 <t>Identifier: As defined in [RFC4443], the identifier to aid in matching Echo Replies to this Echo Request. May be zero.</t>

	 <t>Sequence Number: As defined in [RFC4443], the sequence number to aid in matching Echo Replies to this Echo Request. May be zero.</t>

	 <t>Reserved: This field MUST be set to 0 and ignored upon receipt.</t>

	 <t>L (local): As defined in [RFC8335]. MUST be set to 0 in this document.</t>

	 <t>ICMP Extension Structure: As defined in [RFC4884], it contains exactly one Extension Header followed by one or more extension objects.</t>
	 
	  <section title="ICMP Extension Objects">
	   <t>Each extension object contains one 32-bit word, representing an object header without any payload. All object headers share a common format. Figure 2 depicts the object header.</t>

	   <t><figure
          title="Object header without any Payload">
          <artwork>
  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
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |             Length            |   Class-Num   |   C-Type      |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+</artwork>                 
	 	</figure></t>

	  <t>AS defined in [RFC4884], an object header has the following fields:</t>

	  <t>Length: 16 bits, length of the object, measured in octets, including the object header.</t>

	  <t>Class-Num: 8 bits, identifies object class.</t>

	  <t>C-Type: 8 bits, identifies object sub-type.</t>

	  <t>This document defines the values of Class-Num and C-Type as follows:

	  <list style="symbols">
	   <t>Class-Num: IPv6 extension header Object, which instructs the
   Echo responder to copy the corresponding IPv6
   extension header into the Object payload field in the extended Echo Reply
   packet. The values are listed as the following:</t>
	   <t><artwork>
      Value         Object Name
      -----         -----------
      TBD1          the Hop-by-Hop Options header
      TBD2          the Destination Options header
      TBD3          the Routing header</artwork>
	  </t>
      </list>

	 <list style="symbols">
	  <t>C-Type: Values are listed as the following:</t>
       <t><artwork>
      Class-Num     C-Type     C-Type Name
      ---------     ------     -----------
      TBD1          0          Reserved
      TBD2          0          Reserved
      TBD3          0          Reserved</artwork>
	  </t>
 	 </list>
 	 </t>   
	 </section>
	</section>
	
     <section title="ICMPv6 Extended Echo Reply Message">
      <t>The ICMPv6 Extended Echo Reply message is encapsulated in an IPv6 header. Figure 3 depicts the ICMPv6 Extended Echo Reply message.</t>
      <t><figure
       title="ICMPv6 Extended Echo Reply Message">
       <artwork>
  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      |     Code      |          Checksum             |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |           Identifier          |Sequence Number|State|Res|A|4|6|
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                 ICMP Extension Structure                      |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+</artwork>
      </figure></t>
       
	 <t>ICMPv6 Fields:</t>

	 <t>Type: Extended Echo Reply. As defined in [RFC8335], The value is 161.</t>

	 <t>Code: MUST be set to 0.</t>

	 <t>Identifier: As defined in [RFC4443], the identifier from the invoking Echo Request message.</t>

	 <t>Sequence Number: As defined in [RFC4443], the sequence number from the invoking Echo Request message.</t>

	 <t>State: As defined in [RFC8335].This field MUST be set to 0 in this document.</t>

	 <t>Res: This field MUST be set to 0 and ignored upon receipt.</t>

	 <t>A (Active): As defined in [RFC8335].</t>

	 <t>4 (IPv4): As defined in [RFC8335].</t>

	 <t>6 (IPv6): As defined in [RFC8335].</t>

	 <t>ICMP Extension Structure: As defined in [RFC4884], it contains exactly one Extension Header followed by one or more extension objects.</t>

	 <section title="ICMP Extension Objects">
	   <t>Each extension object contains one or more 32-bit words, including an object header and payload.  All object headers share a common format.  Figure 4 depicts the object header and payload.</t>

	   <t><figure
          title="Object header and payload">
          <artwork>
  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
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |             Length            |   Class-Num   |   C-Type      |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                   // (Object payload) //                      |
 |                                                               |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+</artwork>
      </figure></t>
      
	  <t>AS defined in [RFC4884], an object header has the following fields:</t>

	  <t>Length: 16 bits, length of the object, measured in octets, including the object header.</t>

	  <t>Class-Num: 8 bits, and its values are defined in Section 4.1.1.</t>

	  <t>C-Type: 8 bits, and its values are defined in Section 4.1.1.</t>

	  <t>Object payload: n*32 bits, MUST contain the integral IPv6 extension header, including Next Header field, Hdr Ext Len field and Options field, defined in [RFC8200].</t>
      </section>
     </section>
    </section>

	
    <section title="Example of Reflecting IOAM Trace Information">
      <t>In situ Operations, Administration, and Maintenance (IOAM) collects operational and telemetry information in packets while they traverse a path between two points in the network. The IOAM data fields are defined in [RFC9197]. This document presents an example of leveraging the ICMPv6 extensions for carrying and reflecting IPv6 options header, which contains the IOAM Trace Option. IPv6 encapsulation for IOAM data is defined in [RFC9486], which uses the IPv6 Hop-by-Hop option header to collect information along the path a packet traverses. Clearly in some cases, the sender is more concerned about these trace information. Some possible needs are listed as follows:

	  <list style="symbols">
	  <t>Which nodes and links does the specified traffic flow traverse?</t>

	  <t>In an Equal-Cost Multipath (ECMP) scenario, which ECMP path does a specified N-tuple of flow pass through?</t>

	  <t> Is the specified traffic flow forwarding path consistent on both forward and reverse path?</t>
	  </list>
	 </t>

	<t>An integral extended Echo Request packet includes IPv6 header, Hop-by-Hop option header, ICMPv6 header and ICMP extension structure that contains one object, instructing the Echo responder to reflect IOAM trace information. This extended Echo Request packet is depicted as follows:</t>

	 <t><figure
      title="An integral extended Echo Request packet">
      <artwork>	                                                          
  +----------------------------+                          
  |        IPv6 Header         |                          
  +----------------------------+                          
  |  Hop-by-Hop Option Header  |                          
  +----------------------------+                          
  |       ICMPv6 Header        |                          
  +----------------------------+--+                       
  |   ICMP Extension Header    |  |                       
  +----------------------------+ ICMP Extension Structure 
  |        Object Header       |  |                       
  +----------------------------+--+</artwork>                                                                                
      </figure></t>

    <t>Similarly, an integral extended Echo Reply packet also includes IPv6 header, Hop-by-Hop option header, ICMPv6 header and ICMP extension structure that contains one object with object payload field filled with Hop-by-Hop option header. This extended Echo Reply packet is depicted as follows:</t>

   	 <t><figure
      title="An integral extended Echo Reply packet">
      <artwork>                                                                      
  +----------------------------------+                          
  |          IPv6 Header             |                          
  +----------------------------------+                          
  |     Hop-by-Hop Options Header    |                          
  +----------------------------------+                          
  |           ICMPv6 Header          |                          
  +----------------------------------+--+                       
  |       ICMP Extension Header      |  |                       
  +----------------------------------+  |                       
  |          Object Header           |ICMP Extension Structure  
  +----------------------------------+  |                       
  |       Object payload             |  |                       
  | (IPv6 Hop-by-Hop Options Header) |  |                       
  +----------------------------------+--+</artwork>                       
      </figure></t>                                                                                                                           			 	                   

	<section title="Operation of the Extended ICMPv6 Messages">  
	 <t>The sender (source) of the Echo request messages can be a host or network device. When a host or a network device sends an Echo request message, if it acts as an IOAM encapsulating node, it MUST perform the operation of IOAM Data-Fields encapsulation, i.e., it MUST place the IOAM Data-Fields directly in the IPv6 Hop-by-Hop Option Header.</t>

	 <t>To accurately retrieve the trace information the Echo request packet traverses, including all nodes and links it passes through, the IOAM encapsulating node MUST set both the Most significant bit (Bit 0) and Bit 1 of the IOAM Trace-Type value to "1". Therefore, when processing this trace option, every transit node (including encapsulating node) in IOAM-Domain MUST populates its IOAM data with two data fields, namely, the Hop_Lim and node_id data field and ingress_if_id and egress_if_id data field.</t>

	 <t>The rest of the bits of IOAM-Trace-Type MAY be set "1" or "0" depending on implementation.</t>

	 <t>Similarly, the responder (destination) of the Echo request messages can also be a host or network device.  When a host or a network device receives an Echo request message, if it acts as an IOAM node, no matter what node (encapsulating node, transit node or decapsulating node) it is, it MUST originate an Echo reply message, copying the entire IPv6 Hop-by-Hop Option Header with IOAM Data into the Object payload field of ICMP Extension Structure.</t>

	 <t>In reverse path, to accurately retrieve the trace information the Echo reply packet traverses, similarly, when processing this trace option, every transit node in IOAM-Domain MUST populates IOAM Data with two data fields, namely, the Hop_Lim and node_id data field and ingress_if_id and egress_if_id data field.</t>

	 <t>The sender can determine the consistence of the forward and reverse path by comparing the Object payload of ICMP Extension Structure with the IPv6 Hop-by-Hop Options Header carrying IOAM data in the received Echo reply packet.</t>

	 <t>Notably, to simulate the real path the specified traffic flow traverses, especially in ECMP scenario, the same value or values in any ECMP affecting fields (e.g., the 3-tuple of the Flow Label, Source Address, and Destination Address fields [RFC6437]) MUST be populated in Echo request packets, ensuring the fate sharing between the Echo request/reply packets and the specified traffic flow packets.</t>
     </section> 
    </section>           

    <section anchor="IANA" title="IANA Considerations">

	  <t>IANA is requested to allocate the following values in the "ICMP Extension Object Classes and Class Sub-types" registry.</t>

	  <t><figure
        title="ICMP Extension Object Classes and Class Sub-types values">
        <artwork>                                                                                                     
  +--------------+------------------+----------+---------------+-----------------+  
  |  Class-Num   |    Object Name   |  C-Type  |  C-Type Name  |     Reference   |  
  +--------------+------------------+----------+---------------+-----------------+  
  |     TBD1     | Hop-by-Hop       |    0     |  Reserved     | [This document] |  
  |              | Options Header   |          |               |                 |
  +--------------+------------------+----------+---------------+-----------------+  
  |     TBD2     | Destination      |    0     |  Reserved     | [This document] |  
  |              | Options Header   |          |               |                 |
  +--------------+------------------+----------+---------------+-----------------+  
  |     TBD3     | Routing Header   |    0     |  Reserved     | [This document] |  
  +--------------+------------------+----------+---------------+-----------------+</artwork>
        </figure></t>
    </section>

    <section anchor="security-considerations">
      <name>Security Considerations</name>

      <t>The technology described in this document inherits all of the
      vulnerabilities described in <xref target="RFC4443"/>.</t>

      <t>Because the ICMPv6 Extended Echo Reply message can be longer than the
      ICMPv6 Extended Echo Request message, there is a slight risk that this
      technology could be used as a vector for denial of service attacks.
      However, this risk is minimal, because the ICMPv6 Extended Echo Reply
      message, along with its IPv6 header, cannot exceed 1280 octets.</t>
    </section>
  </middle>

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

      <?rfc include="reference.RFC.2151.xml"?>

      <?rfc include="reference.RFC.4443.xml"?>

      <?rfc include="reference.RFC.4884.xml"?>

      <?rfc include="reference.RFC.8174.xml"?>

      <?rfc include="reference.RFC.8335.xml"?>

      <?rfc include="reference.RFC.9197.xml"?>

      <?rfc include="reference.RFC.9486.xml"?>    
    </references>

    <references title="Informative References">
      <?rfc include="reference.RFC.8126.xml"?>

      <?rfc include="reference.RFC.9343.xml"?>
    </references>
  </back>
</rfc>