<?xml version='1.0' encoding='utf-8'?>
<!-- This template is for creating an Internet Draft using xml2rfc,
     which is available here: http://xml.resource.org. -->
<!DOCTYPE rfc SYSTEM "rfc2629-xhtml.ent">
<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>
<rfc
	xmlns:xi="http://www.w3.org/2001/XInclude"
	category="exp"
	docName="draft-irtf-icnrg-icnping-05"
	ipr="trust200902"
	obsoletes=""
	updates=""
	submissionType="IRTF"
	xml:lang="en"
	tocInclude="true"
	tocDepth="4"
	symRefs="true"
	sortRefs="true"
	version="3">
  <!-- xml2rfc v2v3 conversion 2.40.1 -->
  <!-- category values: std, bcp, info, exp, and historic
     ipr values: full3667, noModification3667, noDerivatives3667
     you can add the attributes updates="NNNN" and obsoletes="NNNN"
     they will automatically be output with "(if approved)" -->

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

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

    <title abbrev="ICN Ping">ICN Ping Protocol Specification</title>
    <seriesInfo name="Internet-Draft" value="draft-irtf-icnrg-icnping-05"/>
    <!-- add 'role="editor"' below for the editors if appropriate -->

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

    <author fullname="Spyridon Mastorakis" initials="S" surname="Mastorakis">
      <organization>University of Nebraska at Omaha</organization>
      <address>
        <postal>
          <street/>
          <!-- Reorder these if your country does things differently -->

          <city>Omaha</city>
          <region>NE</region>
          <code/>
          <country>US</country>
        </postal>
        <email>smastorakis@unomaha.edu</email>
        <!-- uri and facsimile elements may also be added -->
      </address>
    </author>
    <author fullname="Jim Gibson" initials="J" surname="Gibson">
      <organization>Cisco Systems</organization>
      <address>
        <postal>
          <street/>
          <!-- Reorder these if your country does things differently -->

          <city>Cambridge</city>
          <region>MA</region>
          <code/>
          <country>US</country>
        </postal>
        <email>gibson@cisco.com</email>
        <!-- uri and facsimile elements may also be added -->
      </address>
    </author>
    <author fullname="Ilya Moiseenko" initials="I" surname="Moiseenko">
      <organization>Apple Inc</organization>
      <address>
        <postal>
          <street/>
          <!-- Reorder these if your country does things differently -->

          <city>Cupertino</city>
          <region>CA</region>
          <code/>
          <country>US</country>
        </postal>
        <email>iliamo@mailbox.org</email>
        <!-- uri and facsimile elements may also be added -->
      </address>
    </author>
    <author fullname="Ralph Droms" initials="R" surname="Droms">
      <organization>Google Inc.</organization>
      <address>
        <postal>
          <street/>
          <!-- Reorder these if your country does things differently -->

          <city>Cambridge</city>
          <region>MA</region>
          <code/>
          <country>US</country>
        </postal>
        <email>rdroms.ietf@gmail.com</email>
        <!-- uri and facsimile elements may also be added -->
      </address>
    </author>
    <author fullname="Dave Oran" initials="D" surname="Oran">
      <organization>Network Systems Research and Design</organization>
      <address>
        <postal>
          <street/>
          <!-- Reorder these if your country does things differently -->

          <city>Cambridge</city>
          <region>MA</region>
          <code/>
          <country>US</country>
        </postal>
        <email>daveoran@orandom.net</email>
        <!-- uri and facsimile elements may also be added -->
      </address>
    </author>
    <date year="2022"/>


    <!-- Meta-data Declarations -->

    <area>General</area>
    <workgroup>ICNRG</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>template</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 presents the design of an ICN Ping protocol. It includes the operations of both the client and the forwarder.</t>
    </abstract>
  </front>

  <middle>
    <section numbered="true" toc="default">
      <name>Introduction</name>
      <t>Ascertaining data plane reachability to a destination and taking
	coarse performance measurements of round trip time are fundamental
	facilities for network administration and troubleshooting.  In IP,
	where routing and forwarding are based on IP addresses, ICMP echo
	and ICMP echo response are the protocol mechanisms used for this
	purpose, generally exercised through the familiar ping utility. In
	ICN, where routing and forwarding are based on name prefixes, the
	ability to ascertain reachability of names is required.</t>
      <t> This document proposes protocol mechanisms for a ping equivalent in
	ICN (<xref target="RFC8609">CCNx</xref> and <xref target="NDNTLV">NDN</xref>) networks. A non-normative appendix suggests useful properties for an ICN
	ping client application, analogous to IP ping, that originates echo requests
	and processes echo replies.</t>

      <section numbered="true" toc="default">
        <name>Requirements Language</name>
        <t>The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
        "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
        document are to be interpreted as described in <xref target="RFC2119" format="default"/>.</t>
      </section>

      <section numbered="true" toc="default">
        <name>Terminology</name>
        <t>To aid the understanding of readers, we define the following terms:</t>
        <ul spacing="normal">
            <li>Content object: A network-level packet that carries payload, uniquely identified
            by a name, and is directly secured <xref target="RFC8793" format="default"/>.</li>
            <li>Producer: An ICN entity that creates Data packets and makes them available
            for retrieval <xref target="RFC8793" format="default"/>.</li>
            <li>Producer's name: The name prefix that a request must carry in order to reach a producer over an ICN network.</li>
            <li>Named Data: A synonym for a content object.</li>
            <li>Round Trip Time (RTT): The time between sending a request for a specific piece of named data and receiving the corresponding piece of named data.</li>
            <li>Sender: An entity that sends a request for named data or a piece of named data.</li>
            <li>Name of a sender: An alias of producer's name.</li>
            <li>Border forwarder: The forwarder that is the border of a network region where a producer's name is directly routable (i.e., the producer's name is present in the FIB of forwarders within this network region).</li>
        </ul>
      </section>
    </section>
    <section numbered="true" toc="default">
      <name>Background on IP-Based Ping Operation</name>
      <t>In IP-based ping, an IP address is specified by the user either directly, or via
            translation of a domain name through DNS. The ping client application
            sends a number of ICMP Echo Request packets with the specified IP
            address as the IP destination address and an IP address from the client's host
            as the IP source address.</t>
      <t>Each ICMP Echo Request is forwarded across
            the network based on its destination IP address. If it eventually reaches the
            destination, the destination responds by sending back an ICMP Echo Reply
            packet to the IP source address from the ICMP Echo Request.</t>
      <t>If an ICMP Echo Request does not reach the destination or the
            Echo reply is lost, the ping client times out. Any ICMP error messages,
            such as "no route to destination", generated by the ICMP Echo Request message
            are returned to the client and reported.</t>
    </section>
    <section numbered="true" toc="default">
      <name>Ping Functionality Challenges and Opportunities in ICN</name>
      <t> In ICN, the communication paradigm is based exclusively on named
      objects. An Interest is forwarded across the network based on the name prefix that it carries.
      Eventually, a content object is retrieved either from a producer
      application or some forwarder's Content Store (CS).</t>
      <t>IP-based ping was built as an add-on measurement and debugging tool on top of an already existing network architecture. In ICN, we have the opportunity to incorporate diagnostic
      mechanisms directly in the network layer protocol, and hopefully provide more powerful
      diagnostic capability than can be realized through the layered ICMP Echo approach.</t>
      <t>An ICN network differs from an IP network in at least 4 important ways:</t>
      <ul spacing="normal">
        <li>IP identifies interfaces to an IP network with a fixed-length
              address, and delivers IP packets to one or more of these interfaces. ICN
              identifies units of data in the network with a variable length name
              consisting of a hierarchical list of name components.</li>
        <li>An IP-based network depends on the IP packets having source IP  addresses that are used as              the destination address for replies. On the other hand, ICN Interests do not have source addresses and they are forwarded  based on names, which do not refer to a unique end-point. Data packets follow the reverse path of the Interests based on hop-by-hop state
	      created during Interest forwarding.</li>
        <li>An IP network supports multi-path, single destination, stateless packet
              forwarding and delivery via unicast, a limited form of
              multi-destination selected delivery with anycast, and group-based
              multi-destination delivery via multicast. In contrast, ICN supports
              multi-path and multi-destination stateful Interest forwarding and
              multi-destination delivery of named data.  This single
              forwarding semantic subsumes the functions of unicast, anycast, and
              multicast.  As a result, consecutive (or retransmitted) ICN Interest
              messages may be forwarded through an ICN network along different
              paths, and may be forwarded to different data sources (e.g., end-node
              applications, in-network storage) holding a copy of the
              requested unit of data.  This can lead to a significant variance in
              round-trip times, which while resulting in a more robust overall forwarding architecture, has implications for a network
              troubleshooting mechanism like ping.</li>
        <li>In the case of multiple Interests with the same name arriving
              at a forwarder, a number of Interests may be aggregated in a common Pending
              Interest Table (PIT) entry and only one of them forwarded onward. Depending on the lifetime of a PIT entry,
              the round-trip time an Interest-Data exchange might significantly vary
              (e.g., it might be shorter than the full round-trip time to reach the
              original content producer). To this end, the round-trip time experienced
              by consumers might also vary.</li>
      </ul>

      <t>These differences introduce new challenges, new opportunities and new
      requirements in the design of an ICN ping protocol. Following this communication
      model, a ping client should be able to express ping echo requests
      with some name prefix and receive responses.</t>
      <t>Our goals are the following:</t>
      <ul spacing="normal">
        <li>Test the reachability and the operational state of an ICN forwarder.</li>
        <li>Test the reachability of a producer or a data repository (in the sense of whether
	Interests for a prefix that it serves can be forwarded to it) and discover the
	forwarder with local connectivity to (an instance of) this producer or repository.</li>
        <li>Test whether a specific named object is cached in some on-path CS,
	and, if so, return the administrative name of the corresponding forwarder.</li>
        <li>Perform some simple network performance measurements.</li>
      </ul>

      <t>To this end, a ping name can represent:</t>
      <ul spacing="normal">
        <li>An administrative name that has been assigned to a forwarder.</li>
        <li>A name that includes an application's namespace as a prefix.</li>
        <li>A named object that might reside in some in-network storage.</li>
      </ul>

      <t>In order to provide stable and reliable diagnostics, it is desirable that the
      packet encoding of a ping echo request enable the forwarders to
      distinguish a ping from a normal Interest, while also allowing for
      forwarding behavior to be as similar as possible to that of an
      Interest packet. In the same way, the encoding of a ping echo reply
      should allow for forwarder processing as close as possible to that used for data
      packets.</t>

      <t>The ping protocol should also enable relatively robust round-trip time
      measurements. To this end, it is important to have a mechanism to steer
      consecutive ping echo requests for the same name towards an individual path. Such a capability was initially published in  <xref target="PATHSTEERING" format="default"/> and has been specified for CCNx in <xref target="I-D.oran-icnrg-pathsteering"/>.</t>

      <t>It is also important, in the case of ping echo requests for the same name from different sources to have a mechanism to avoid those requests being aggregated in the PIT. To this end, we need some encoding in the ping echo requests
      to make each request for a common name unique, hence avoiding PIT aggregation and
      further enabling the exact match of a response with a particular ping packet.</t>

      <t>Note that ICN ping is a protocol that estimates the perceived RTT based on a single request-reply exchange. A measurement application is needed to make proper use of this protocol to explore multiple paths and compute various statistics, such as the variance, average, maximum and minimum RTT values as well as loss rates.</t>
    </section>

    <section numbered="true" toc="default">
      <name>ICN Ping Echo CCNx Packet Formats</name>
      <t>In this section, we describe the Echo Packet Format according to the
      CCNx packet format <xref target="RFC8569" format="default"/>, where
      messages exist within outermost containments (packets).
      Specifically, we specify two types
      of ping packets, an echo request and an echo reply packet type.</t>
      <section numbered="true" toc="default">
        <name>ICN Ping Echo Request CCNx Packet Format</name>
        <t>The format of the ping echo request packet is presented below:</t>

        <figure align="center" anchor="ping-packet">
        <name>Echo Request CCNx Packet Format</name>
        <artwork align="left" name="" type="" alt=""><![CDATA[
 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

 +---------------+---------------+---------------+---------------+
 |               |               |                               |
 |    Version    |  EchoRequest  |         PacketLength          |
 |               |               |                               |
 +---------------+---------------+---------------+---------------+
 |               |               |               |               |
 |    HopLimit   |    Reserved   |     Flags     |  HeaderLength |
 |               |               |               |               |
 +---------------+---------------+---------------+---------------+
 /                                                               /
 /                   Path label TLV                              /
 /                                                               /
 +---------------+---------------+---------------+---------------+
 |                                                               |
 |                   Echo Request Message TLVs                   |
 |                                                               |
 +---------------+---------------+---------------+---------------+

            ]]></artwork>
        <postamble></postamble>
        </figure>

        <t>The existing packet header fields have the same definition as the header fields of
       a CCNx Interest packet. The value of the packet type field is <em>Echo Request</em>. The exact numeric value of this field type is to be assigned in the Packet Type IANA Registry for CCNx
       (see section 4.1 of <xref target="RFC8569" format="default"/>.</t>

        <t>Compared to the typical format of a CCNx packet header from <xref target="RFC8569" format="default"/>, in order to enable path steering of Echo Requests, there is an  optional fixed header Path label TLV as specified in <xref target="I-D.oran-icnrg-pathsteering"/> added to the packet header:</t>


        <t>The message format of an echo request is presented below:</t>

        <figure align="center" anchor="echo-request">
        <name>Echo Request Message Format</name>

        <artwork align="left" name="" type="" alt=""><![CDATA[
 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

 +---------------+---------------+---------------+---------------+
 |                               |                               |
 |        MessageType = 1        |          MessageLength        |
 |                               |                               |
 +---------------+---------------+---------------+---------------+
 |                                                               |
 |			    Name TLV                             |
 |                                                               |
 +---------------+---------------+---------------+---------------+

            ]]></artwork>
       </figure>

        <t>The echo request message is of type Interest in order to leverage
       the Interest forwarding behavior provided by the network. The Name TLV
       has the structure described in <xref target="RFC8609" format="default"/>.
       The name consists of the prefix that we would like to ping appended with
       a nonce typed name component as its last component. The exact numeric
       value of this field type is to be assigned in the Name Component Type IANA Registry for CCNx
       (see section 4.5 of <xref target="RFC8609" format="default"/>. The value of this TLV is a 64-bit nonce.
       The purpose of the nonce is to avoid Interest aggregation and allow client matching of
       replies with requests. As described below, the nonce is ignored for CS checking.</t>

       <figure align="center">
       <name>Nonce Name component TLV for Echo Request messages</name>
        <artwork align="left" name="" type="" alt=""><![CDATA[
 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

 +---------------+---------------+---------------+---------------+
 |                               |                               |
 |           Nonce_Type          |       Nonce_Length = 8        |
 |                               |                               |
 +---------------+---------------+---------------+---------------+
 |							         |
 |                                                               |
 |                                                               |
 |			    Nonce_Value  		         |
 |                                                               |
 |                                                               |
 +---------------+---------------+---------------+---------------+

            ]]></artwork>
      </figure>

      </section>
      <!-- This PI places the pagebreak correctly (before the section title) in the text output. -->

    <section anchor="CCNxReply" numbered="true" toc="default">
        <name>Ping Echo Reply CCNx Packet Format</name>
        <t>The format of a ping echo reply packet is presented below:</t>

        <figure align="center">
        <name>Echo Reply CCNx Packet Format</name>
        <artwork align="left" name="" type="" alt=""><![CDATA[
 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

 +---------------+---------------+---------------+---------------+
 |               |               |                               |
 |    Version    |   EchoReply 	 |          PacketLength         |
 |               |               |                               |
 +---------------+---------------+---------------+---------------+
 |                               |               |               |
 |            Reserved           |     Flags     | HeaderLength  |
 |                               |               |               |
 +---------------+---------------+---------------+---------------+
 |                                                               |
 |                        Path label TLV		            	 |
 |                                                               |
 +---------------+---------------+---------------+---------------+
 |                                                               |
 |                    Echo Reply Message TLVs                    |
 |                                                               |
 +---------------+---------------+---------------+---------------+


            ]]></artwork>
        </figure>

        <t>The header of an echo reply consists of the header fields of a CCNx Content
       Object and a hop-by-hop Path label TLV. The value of the packet type
       field is Echo Reply. The exact numeric value of this field type is to be assigned
       in the Packet Type IANA Registry for CCNx (see section 4.1 of <xref target="RFC8569" format="default"/>.
       The Path label header TLV from <xref target="I-D.oran-icnrg-pathsteering"/>
       is as defined for the echo request packet.</t>

        <t>A ping echo reply message is of type Content Object, contains a Name TLV
       (name of the corresponding echo request), a PayloadType TLV and an
       ExpiryTime TLV with a value of 0 to indicate that echo replies must
       not be returned from network caches.</t>

       <figure align="center">
       <name>Echo Reply Message Format</name>
        <artwork align="left" name="" type="" alt=""><![CDATA[
 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

 +---------------+---------------+---------------+---------------+
 |                               |                               |
 |        MessageType = 2        |          MessageLength        |
 |                               |                               |
 +---------------+---------------+---------------+---------------+
 |                                                               |
 |                	      Name TLV	 		         |
 |                                                               |
 +---------------+---------------+---------------+---------------+
 |                                                               |
 |			   PayloadType TLV 		         |
 |                                                               |
 +---------------+---------------+---------------+---------------+
 |                                                               |
 |			   ExpiryTime TLV 			 |
 |                                                               |
 +---------------+---------------+---------------+---------------+

            ]]></artwork>
        </figure>

        <t>The PayloadType TLV is presented below. It is of type T_PAYLOADTYPE_DATA, and
       the data schema consists of 3 TLVs: 1) the name of the sender of this reply
       (with the same structure as a CCNx Name TLV), 2) the sender's signature of
       their own name (with the same structure as a CCNx ValidationPayload TLV),
       3) a TLV with a return code to indicate what led to the generation of this reply
       (i.e., existence of a local application, a CS hit or a match with a forwarder's
       administrative name as specified in <xref target="forwarder" format="default"/>).</t>

       <figure align="center">
       <name>Echo Reply Message Format</name>
        <artwork align="left" name="" type="" alt=""><![CDATA[
 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

 +---------------+---------------+---------------+---------------+
 |                               |                               |
 |       T_PAYLOADTYPE_DATA      |             Length            |
 |                               |                               |
 +---------------+---------------+---------------+---------------+
 /                                                               /
 /	                Sender's Name TLV	 		 /
 /                                                               /
 +---------------+---------------+---------------+---------------+
 /                                                               /
 /		      Sender's Signature TLV	 	         /
 /                                                               /
 +---------------+---------------+---------------+---------------+
 /                                                               /
 /		       Echo Reply Code TLV	 	         /
 /                                                               /
 +---------------+---------------+---------------+---------------+


            ]]></artwork>
        </figure>

        <t>The goal of including the name of the sender in the echo reply is to enable the
      user to reach this entity directly to ask for further management/administrative
      information using generic Interest-Data exchanges or by employing a more comprehensive
      management tool such as <xref target="I-D.irtf-icnrg-ccninfo" format="default">CCNInfo</xref>
      after a successful verification of the sender's name.</t>
        <t>The structure of the Echo Reply Code TLV is presented below (16-bit value).
      The defined values are the following:</t>
        <ul spacing="normal">
          <li>1: Indicates that the target name matched the administrative name of a forwarder.</li>
          <li>2: Indicates that the target name matched a prefix served by an application.</li>
          <li>3: Indicates that the target name matched the name of an object in a forwarder's CS.</li>
        </ul>

        <figure align="center">
        <name>Echo Reply Code TLV</name>
        <artwork align="left" name="" type="" alt=""><![CDATA[
 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

 +---------------+---------------+---------------+---------------+
 |                               |                               |
 |     Echo_Reply_Code_Type      |  Echo_Reply_Code_Length = 2   |
 |                               |                               |
 +---------------+---------------+---------------+---------------+
 |		                           		         |
 |                      Echo_Reply_Code_Value                    |
 +---------------+---------------+---------------+---------------+

            ]]></artwork>
        </figure>
      </section>
    </section>

    <section numbered="true" toc="default">
      <name>ICN Ping Echo NDN Packet Formats</name>
      <t>In this section, we present the ICN Ping Echo Request and Reply Format according to the NDN packet specification
    <xref target="NDNTLV" format="default"/>.</t>
      <section numbered="true" toc="default">
        <name>ICN Ping Echo Request NDN Packet Format</name>
        <t>An echo request is encoded as an NDN Interest packet. Its format is the following:</t>

        <figure align="center">
        <name>Echo Request NDN Packet Format</name>
        <artwork align="left" name="" type="" alt=""><![CDATA[
	EchoRequest = INTEREST-TYPE TLV-LENGTH
	      Name
			  MustBeFresh
			  Nonce
			  ApplicationParameters?
	        ]]></artwork>
        </figure>

        <t>The name field of an echo request consists of the name prefix to be pinged, a nonce value (it can be the
      value of the Nonce field) and the suffix "ping" to denote that this Interest is a ping request (added as a KeywordNameComponent).
			When the "ApplicationParameters" element is present, a ParametersSha256DigestComponent is added as the last name component.</t>
        <t>The "ApplicationParameters" field of the Request contains a Path label TLV as specified in <xref target="I-D.oran-icnrg-pathsteering"/>.</t>
        <t>Since the NDN packet format does not provide a mechanism to prevent the network from caching specific
      data packets, we use the MustBeFresh element for echo requests (in combination with a Freshness Period
      TLV of value 1 for echo replies) to avoid fetching cached echo replies with an expired freshness period
      <xref target="REALTIME" format="default"/>.</t>
      </section>

      <section numbered="true" toc="default">
        <name>Ping Echo Reply NDN Packet Format</name>
        <t>An echo reply is encoded as an NDN Data packet. Its format is the following:</t>

        <figure align="center">
        <name>Echo Reply NDN Packet Format</name>
        <artwork align="left" name="" type="" alt=""><![CDATA[
	EchoReply = DATA-TLV TLV-LENGTH
                        Name
                        MetaInfo
                        Content
                        Signature
												Path label TLV
	        ]]></artwork>
        </figure>

        <t>Compared to the format of a regular NDN Data packet, an echo reply contains a Path label TLV field,
      which is not included in the security envelope, since it might be modified in a hop-by-hop fashion by
      the forwarders along the reverse path.</t>
        <t>The name of an echo reply is the name of the corresponding echo request, while the format of the MetaInfo field
      is the following:</t>

      <figure align="center">
      <name>MetaInfo TLV</name>
        <artwork align="left" name="" type="" alt=""><![CDATA[
      MetaInfo = META-INFO-TYPE TLV-LENGTH
                     ContentType
                     FreshnessPeriod
	             ]]></artwork>
        </figure>

        <t>The value of the ContentType TLV is 0. The value of the
      FreshnessPeriod TLV is 1, so that the replies are treated as stale data (almost instantly) as
      they are received by a forwarder.</t>
        <t>The content of an echo reply consists of the following 2 TLVs: Sender's name
      (with a structure similar as an NDN Name TLV)
      and Echo Reply Code. There is no need to have a separate TLV for the sender's
      signature in the content of the reply, since every NDN data packet carries the
      signature of the data producer.</t>
        <t>The Echo Reply Code TLV format is the following (with the values specified in
      <xref target="CCNxReply" format="default"/>):</t>

      <figure align="center">
      <name>Echo Reply Code TLV</name>
        <artwork align="left" name="" type="" alt=""><![CDATA[
	EchoReplyCode = ECHOREPLYCODE-TLV-TYPE TLV-LENGTH 2*OCTET
	]]></artwork>
        </figure>

      </section>
    </section>

    <section anchor="forwarder" numbered="true" toc="default">
      <name>Forwarder Handling</name>
      <t>We present the workflow of the forwarder's operation in <xref target="forwarder-operation"/>.
         When a forwarder receives an echo request, it first extracts the message's
	base name (i.e., the request name with the Nonce name component excluded as well as
	the suffix "ping" and the ParametersSha256DigestComponent in the case of an echo
	request with the NDN packet format).</t>
      <t>In some cases, the forwarder originates an echo reply,
	sending the reply downstream through the face on which the
	echo request was received. This echo reply includes the forwarder's
	own name and signature and the appropriate echo reply code based on the condition that
	triggered the reply generation. It also includes a Path label TLV, initially containing a
	null value (since the echo reply originator did not
	forward the request and, thus, does not make a path choice).</t>
      <t>The forwarder generates and returns an echo reply in the
	following cases:</t>
      <ul spacing="normal">
        <li>Assuming that a forwarder has been given one or more administrative names,
	   the echo request base name exactly matches any of the forwarder's
	   administrative name(s).</li>
        <li>The echo request's base name exactly matches the name of a content-object
	   residing in the forwarder's CS (unless the ping client application
	   has chosen not to receive replies due to CS hits as specified in
	   <xref target="app-additional" format="default"/>).</li>
        <li>The echo request base name matches (in a Longest Prefix Match manner) a FIB
	   entry with an outgoing face referring to a local application.</li>
      </ul>
      <t>If none of the conditions to reply to the echo request are met, the
	forwarder will attempt to forward the echo request upstream based on the path
	steering value (if present), the results of the
	FIB LPM lookup and PIT creation (based on the name including the nonce typed name component
	and the suffix "ping" in the case of an echo request with the NDN packet format).
	If no valid next-hop is found, an
	InterestReturn is sent downstream indicating "no route" (as with a failed attempt to
	forward an ordinary Interest).</t>
      <t>A received echo reply will be matched to an existing PIT entry as usual. On
	the reverse path, the path steering TLV of an echo reply will be updated
	by each forwarder to encode its next-hop choice. When included in subsequent
	echo requests, this  Path label TLV allows the forwarders to steer
	the echo requests along the same path.</t>
      <figure align="center" anchor="forwarder-operation">
      <name>Forwarder Operation</name>
            <artwork><![CDATA[

      ------------------------------------------------------------------------
                                    FORWARD PATH
      ------------------------------------------------------------------------

    Request +------+  +-----+  +-----+(path label)  +--------+ (match) Request
    ------> |Admin |->| CS  |->| PIT | ------------>| Label  |---------------->
            | Name |  +-----+  +-----+              | Lookup |
            |Lookup|     |       | \ (no path label)+--------+
            +------+     |       |  \                |\ (path label mismatch)
       Reply    |        |       |   \               | \
      <---------+        |       v    \              |  \
      (base matches      |   aggregate \             |   \
       admin name)       |              \            |    \
                         | (base         \           |     +------+ Request
                 Reply   |  matches       +----------|---->| FIB  | -------->
               <---------+  cached object)           |     +------+
                                                     |  (no   |  | (base matches
      Interest-Return (NACK)                         v  route)|  | local app
      <----------------------------------------------+<-------+  | face)
      <----------------------------------------------------------+
      Reply
      ------------------------------------------------------------------------
                                    REVERSE PATH
      ------------------------------------------------------------------------

      Interest-return(NACK) +-----+ (update path label) Interest-Return(NACK)
      <---------------------|     |<-----------------------------------------
                            |     |
      Reply  +------+       | PIT |  (update path label)                Reply
      <------|  CS  |<------|     |<-----------------------------------------
             +------+       |     |
                            +-----+
                               |
                               | (no match)
                               v
            ]]></artwork>
          </figure>
    </section>

    <section anchor="local" numbered="true" toc="default">
      <name>Protocol Operation For Locally-Scoped Namespaces</name>
      <t>In this section, we elaborate on 2 alternative design approaches in cases that
	the pinged prefix corresponds to a locally-scoped namespace not directly routable from the
	client's local network.</t>
      <t>The first approach leverages the NDN Link Object <xref target="SNAMP" format="default"/>.
	Specifically, the ping client attaches to the expressed request a LINK Object that
	contains a number of routable name prefixes, based on which the request can be forwarded
	until it reaches a network region where the request name itself is
	routable. A LINK Object is created and signed by a data producer allowed to
	publish data under a locally-scoped namespace. The way that a client retrieves a LINK Object
	depends on various network design factors and is out of the scope of the current draft.</t>
      <t>Based on the current usage of the LINK Object by the NDN team, a forwarder at the border
	of the region where an Interest name becomes routable must remove the LINK Object from
	incoming Interests. The Interest state maintained along the entire forwarding path is based on the
	Interest name regardless of whether it was forwarded based on its name or a routable prefix in the
	LINK Object.</t>
      <t>The second approach is based on prepending a routable prefix to the locally-scoped
	name. The resulting prefix will be the name of the echo requests expressed by the client.
	In this way, a request will be forwarded based on the routable
	part of its name. When it reaches the network region where the original locally-scoped
	name is routable, the border forwarder rewrites the request name and deletes
	its routable part. There are two conditions for a forwarder to perform this rewriting operation
	on a request: 1) the routable part of the request name
	matches a routable name of the network region adjacent to the forwarder (assuming that a forwarder is aware of
	those names) and 2) the remaining part of the request name is routable across the
	network region of this forwarder.</t>
      <t>The state maintained along the path, where the locally-scoped name is not routable, is based
	on the routable prefix along with the locally-scoped prefix. Within the network region that
	the locally-scoped prefix is routable, the state is based only on it. To ensure that the generated replies
	reach the ping client, the border forwarder has also to rewrite the name of a reply
	and prepend the routable prefix of the corresponding echo request.</t>
    </section>
    <section numbered="true" toc="default">
      <name>Security Considerations</name>
      <t>A reflection attack could be mounted by a compromised forwarder in the case of an echo reply with the CCNx packet format
      if that forwarder includes in the reply the name of a victim forwarder.
      This could convince a client to direct the future administrative traffic
      towards the victim. To foil such reflection attacks, the forwarder that generates a reply
      must sign the name included in the payload. In this way, the client is able to verify that the
      included name is legitimate and refers to the forwarder that generated the reply.
      Alternatively, the forwarder could include in the reply payload their routable
      prefix(es) encoded as a signed NDN Link Object <xref target="SNAMP" format="default"/>.</t>

      <t>Interest flooding attack amplification is possible in the case of the second approach to deal
      with locally-scoped namespaces described in <xref target="local" format="default"/>. To eliminate such amplification,
      a border forwarder will have to maintain extra state in order to prepend the correct routable prefix
      to the name of an outgoing reply, since the forwarder might be attached to
      multiple network regions (reachable under different prefixes) or a network region attached to this
      forwarder might be reachable under multiple routable prefixes.</t>
    </section>

    <section anchor="Acknowledgements" numbered="true" toc="default">
      <name>Acknowledgements</name>
      <t>The authors would like to thank Mark Stapp for the fruitful discussion on the objectives
       of the ICN ping protocol.</t>
    </section>
  </middle>

  <back>

    <references>
      <name>References</name>

      <references>
        <name>Normative References</name>
        <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml"/>
        <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.8569.xml"/>
        <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.8609.xml"/>
        <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.8793.xml"/>
      </references>

      <references>
        <name>Informative References</name>

		 <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml3/reference.I-D.draft-irtf-icnrg-ccninfo.xml"/>

 		 <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml3/reference.I-D.draft-oran-icnrg-pathsteering.xml"/>



        <reference anchor="NDNTLV" target="https://named-data.net/doc/NDN-packet-spec/current/">
          <front>
            <title>NDN Packet Format Specification.</title>
            <author surname="NDN Project Team">
              <organization/>
            </author>
            <date year="2021"/>
          </front>
        </reference>

        <reference anchor="SNAMP">
          <front>
            <title>SNAMP: Secure namespace mapping to scale NDN forwarding</title>
            <author initials="A" surname="Afanasyev">
              <organization/>
            </author>
            <author surname="et al">
              <organization/>
            </author>
            <date year="2015"/>
          </front>
        </reference>

        <reference anchor="PATHSTEERING">
          <front>
            <title>Path switching in content centric and named data networks</title>
            <author initials="I" surname="Moiseenko">
              <organization/>
            </author>
            <author initials="D" surname="Oran">
              <organization/>
            </author>
            <date year="2017"/>
          </front>
          <refcontent>in Proceedings of the 4th ACM Conference on Information-Centric Networking</refcontent>
        </reference>

        <reference anchor="REALTIME">
          <front>
            <title>Real-Time Data Retrieval in Named Data Networking</title>
            <author initials="S" surname="Mastorakis">
              <organization/>
            </author>
            <author initials="P" surname="Gusev">
              <organization/>
            </author>
            <author initials="A" surname="Afanasyev">
              <organization/>
            </author>
            <author initials="L" surname="Zhang">
              <organization/>
            </author>
            <date year="2017"/>
          </front>
          <refcontent>in Proceedings of the 1st IEEE International Conference on Hot Topics in Information-Centric Networking</refcontent>
        </reference>

    </references>

    </references>

    <section anchor="app-additional" numbered="true" toc="default">
      <name>Ping Client Application (Consumer) Operation</name>
      <t>This section is an informative appendix regarding the proposed ping client
      operation.</t>
      <t>The ping client application is responsible for generating echo requests for
     prefixes provided by users.</t>
      <t>When generating a series of echo requests for a specific name, the first
       echo request will typically not include a Path label TLV, since no TLV value
       is known. After an echo reply containing a Path label TLV is received, each
       subsequent echo request can include the received path steering value
       in the Path label header TLV to drive the requests towards a common path
       as part of checking network performance. To discover more paths, a client can
       omit the path steering TLV in future requests. Moreover, for each new ping echo
       request, the client has to generate a new nonce and record the time that the
       request was expressed. It will also set the lifetime of an echo request,
       which will have identical semantics to the lifetime of an Interest.</t>
      <t>Further, the client application might not wish to receive echo replies due to
      CS hits. A mechanism to achieve that in CCNx would be to use a Content Object Hash
      Restriction TLV with a value of 0 in the payload of an echo request message. In NDN,
      the exclude filter selector can be used.</t>
      <t>When it receives an echo reply, the client would typically match the reply to a sent
      request and compute the round-trip time of the request. It should parse the
      Path label value and decode the reply's payload to parse the
      the sender's name and signature. The client should verify that both
      the received message and the forwarder's name have been signed by the
      key of the forwarder, whose name is included in the payload of the reply (by
      fetching this forwarder's public key and verifying the contained signature). The client
      can also decode the Echo Reply Code TLV to understand the condition that triggered
      the generation of the reply.</t>
      <t>In the case that an echo reply is not received for a request within a certain
      time interval (lifetime of the request), the client should time-out and send a new
      request with a new nonce value up to some maximum number of requests
      to be sent specified by the user.</t>
    </section>
    <!-- Change Log
v03 2021-10-25 DRO   Update references
 -->
  </back>
</rfc>
