<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE rfc [
  <!ENTITY nbsp    "&#160;">
  <!ENTITY zwsp   "&#8203;">
  <!ENTITY nbhy   "&#8209;">
  <!ENTITY wj     "&#8288;">
]>
<?xml-stylesheet type="text/xsl" href="rfc2629.xslt" ?>
<!-- generated by https://github.com/cabo/kramdown-rfc version 1.7.29 (Ruby 3.2.3) -->
<?rfc comments="yes"?>
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" ipr="trust200902" docName="draft-ietf-intarea-icmp-exten-hdr-len-04" category="std" consensus="true" updates="4884" tocInclude="true" sortRefs="true" symRefs="true" version="3">
  <!-- xml2rfc v2v3 conversion 3.30.0 -->
  <front>
    <title abbrev="icmp-eh-len">ICMP Extension Structure Length Field</title>
    <seriesInfo name="Internet-Draft" value="draft-ietf-intarea-icmp-exten-hdr-len-04"/>
    <author initials="R." surname="Bonica" fullname="Ron Bonica">
      <organization>HPE</organization>
      <address>
        <postal>
          <country>USA</country>
        </postal>
        <email>rbonica@juniper.net</email>
      </address>
    </author>
    <author initials="X." surname="He" fullname="Xiaoming He">
      <organization>China Telecom</organization>
      <address>
        <postal>
          <country>China</country>
        </postal>
        <email>hexm4@chinatelecom.cn</email>
      </address>
    </author>
    <author initials="X." surname="Min" fullname="Xiao Min">
      <organization>ZTE Corporation</organization>
      <address>
        <postal>
          <country>China</country>
        </postal>
        <email>xiao.min2@zte.com.cn</email>
      </address>
    </author>
    <author initials="T." surname="Mizrahi" fullname="Tal Mizrahi">
      <organization>Huawei</organization>
      <address>
        <postal>
          <country>Israel</country>
        </postal>
        <email>tal.mizrahi.phd@gmail.com</email>
      </address>
    </author>
    <date year="2025" month="July" day="29"/>
    <area>Internet</area>
    <workgroup>INTAREA Group</workgroup>
    <keyword>ICMP</keyword>
    <abstract>
      <?line 50?>

<t>The ICMP Extension Structure (RFC4884) does not have a length field. Therefore, unless the length of the Extension Structure can be inferred from other data in the ICMP message, the Extension Structure must be the last item in the ICMP message.</t>
      <t>This document updates RFC 4884 to define a length field for the ICMP Extension Structure. When length information is provided, receivers can use it to parse ICMP messages. Specifically, receivers can use length information to determine the offset at which the item after the ICMP Extension Structure begins.</t>
    </abstract>
  </front>
  <middle>
    <?line 58?>

<section anchor="intro">
      <name>Introduction</name>
      <t>The ICMP Extension Structure <xref target="RFC4884"/> does not have a length field. This means it is
expected to be the last element of an ICMP message. However, there are cases
where additional fields need to be inserted after the ICMP Extension Structure.</t>
      <t>For example, <xref target="I-D.ietf-intarea-rfc8335bis"/>  enhances the PROBE utility by adding
a new field to ICMP Extended Echo and ICMP Extended Echo Reply messages. To
maintain compatibility with existing PROBE implementations, this new field is
placed after the ICMP Extension Structure.</t>
      <t>Because the ICMP Extension Structure does not have a length field, 
<xref target="I-D.ietf-intarea-rfc8335bis"/>  requires
implementations to determine the length of the extension structure from the
known message format and the assumption that these packets contain only a
single ICMP Extension Object.</t>
      <t>This special handling for PROBE packets is not ideal. For future use, a
mechanism to explicitly specify the extension structure length would be
beneficial.</t>
      <t>This document adds a length field to the ICMP Extension Header. It UPDATES <xref target="RFC4884"/>.</t>
    </section>
    <section anchor="conventions-and-definitions">
      <name>Conventions and Definitions</name>
      <t>The key words "<bcp14>MUST</bcp14>", "<bcp14>MUST NOT</bcp14>", "<bcp14>REQUIRED</bcp14>", "<bcp14>SHALL</bcp14>", "<bcp14>SHALL
NOT</bcp14>", "<bcp14>SHOULD</bcp14>", "<bcp14>SHOULD NOT</bcp14>", "<bcp14>RECOMMENDED</bcp14>", "<bcp14>NOT RECOMMENDED</bcp14>",
"<bcp14>MAY</bcp14>", and "<bcp14>OPTIONAL</bcp14>" in this document are to be interpreted as
described in BCP14 <xref target="RFC2119"/> <xref target="RFC8174"/> when, and only when, they
appear in all capitals, as shown here.</t>
      <?line -18?>

</section>
    <section anchor="the-icmp-extension-structure">
      <name>The ICMP Extension Structure</name>
      <t>An ICMP Extension Structure contains exactly one Extension Header followed by one or more objects.
The Extension Header format is defined in Section 7 of <xref target="RFC4884"/>. This document
modifies the Extension Header format by allocating the lower 8 bits of the reserved field for
a new length field. <xref target="box-fig"/> depicts the updated Extension Header format.</t>
      <figure anchor="box-fig">
        <name>ICMP Extension Header As Updated By This Document</name>
        <artset>
          <artwork type="svg"><svg xmlns="http://www.w3.org/2000/svg" version="1.1" height="128" width="528" viewBox="0 0 528 128" class="diagram" text-anchor="middle" font-family="monospace" font-size="13px" stroke-linecap="round">
              <path d="M 8,64 L 8,96" fill="none" stroke="black"/>
              <path d="M 72,64 L 72,96" fill="none" stroke="black"/>
              <path d="M 136,64 L 136,96" fill="none" stroke="black"/>
              <path d="M 264,64 L 264,96" fill="none" stroke="black"/>
              <path d="M 520,64 L 520,96" fill="none" stroke="black"/>
              <path d="M 8,64 L 520,64" fill="none" stroke="black"/>
              <path d="M 8,96 L 520,96" fill="none" stroke="black"/>
              <g class="text">
                <text x="16" y="36">0</text>
                <text x="176" y="36">1</text>
                <text x="336" y="36">2</text>
                <text x="496" y="36">3</text>
                <text x="16" y="52">0</text>
                <text x="32" y="52">1</text>
                <text x="48" y="52">2</text>
                <text x="64" y="52">3</text>
                <text x="80" y="52">4</text>
                <text x="96" y="52">5</text>
                <text x="112" y="52">6</text>
                <text x="128" y="52">7</text>
                <text x="144" y="52">8</text>
                <text x="160" y="52">9</text>
                <text x="176" y="52">0</text>
                <text x="192" y="52">1</text>
                <text x="208" y="52">2</text>
                <text x="224" y="52">3</text>
                <text x="240" y="52">4</text>
                <text x="256" y="52">5</text>
                <text x="272" y="52">6</text>
                <text x="288" y="52">7</text>
                <text x="304" y="52">8</text>
                <text x="320" y="52">9</text>
                <text x="336" y="52">0</text>
                <text x="352" y="52">1</text>
                <text x="368" y="52">2</text>
                <text x="384" y="52">3</text>
                <text x="400" y="52">4</text>
                <text x="416" y="52">5</text>
                <text x="432" y="52">6</text>
                <text x="448" y="52">7</text>
                <text x="464" y="52">8</text>
                <text x="480" y="52">9</text>
                <text x="496" y="52">0</text>
                <text x="512" y="52">1</text>
                <text x="40" y="84">Version</text>
                <text x="108" y="84">Rsvd</text>
                <text x="204" y="84">Length</text>
                <text x="388" y="84">Checksum</text>
              </g>
            </svg>
          </artwork>
          <artwork type="ascii-art"><![CDATA[
       0                   1                   2                   3
       0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |Version|  Rsvd |     Length    |           Checksum            |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
]]></artwork>
        </artset>
      </figure>
      <t>Version: 4 bits.</t>
      <ul spacing="normal">
        <li>
          <t>ICMP Extension Header version number. This is version 2 as per <xref target="RFC4884"/>.</t>
        </li>
      </ul>
      <t>Reserved (Rsvd): 4 bits</t>
      <ul spacing="normal">
        <li>
          <t><bcp14>MUST</bcp14> be set to 0 by the sender and <bcp14>MUST</bcp14> be ignored by the receiver as per <xref target="RFC4884"/>.</t>
        </li>
      </ul>
      <t>Length: 8 bits</t>
      <ul spacing="normal">
        <li>
          <t>This field represents the length of the ICMP Extension Structure, including all options and optional padding, but excluding the ICMP Extension Header. The length is measured in 4-byte words. Legacy implementations set this field to 0 as per section 7 of <xref target="RFC4884"/>. Therefore, implementation <bcp14>MUST NOT</bcp14> drop packets if this field is set to 0.</t>
        </li>
      </ul>
      <t>Checksum: 16 bits</t>
      <ul spacing="normal">
        <li>
          <t>As per <xref target="RFC4884"/>, the checksum is the one's complement of the one's complement sum of the data structure, with the checksum field replaced by zero for the purpose of computing the checksum.  An all-zero value means that no checksum was transmitted.  See Section 5.2 of <xref target="RFC4884"/> for a description of how this field is used.</t>
        </li>
      </ul>
      <t>The ICMP Extension Structure <bcp14>MUST</bcp14> be zero-padded so that it ends on a 4-byte boundary. If it does not end on a 
4-byte boundary, the receiving node will parse the ICMP message incorrectly and may discard it.</t>
    </section>
    <section anchor="backwards-compatibility">
      <name>Backwards Compatibility</name>
      <t>Legacy implementations that do not support the mechanism defined in this
document set the length field to zero when sending a
packet and ignore the length field in received ICMP messages.</t>
      <t>Such implementations require one of the following:</t>
      <ul spacing="normal">
        <li>
          <t>The ICMP Extension Structure <bcp14>MUST</bcp14> be the final item in the ICMP packet.</t>
        </li>
        <li>
          <t>The length of the ICMP Extension Structure can be inferred from other fields in
the packet (e.g., <xref target="I-D.ietf-intarea-rfc8335bis"/>.</t>
        </li>
      </ul>
      <t>Currently, no mechanisms rely on the ICMP extension structure length field.
Should such mechanisms be defined in the future, backward compatibility with
legacy implementations should be discussed for each case.</t>
    </section>
    <section anchor="iana-considerations">
      <name>IANA Considerations</name>
      <t>This document requires no IANA actions.</t>
    </section>
    <section anchor="security-considerations">
      <name>Security Considerations</name>
      <t>This document introduces no security vulnerabilities. However, it does inherit
security considerations from <xref target="RFC4884"/>.</t>
    </section>
    <section anchor="acknowledgements">
      <name>Acknowledgements</name>
      <t>Thanks to Tom Herbert, Jen Linkova, Erik Vynke and Michael Welzl for their review and helpful suggestions.</t>
    </section>
  </middle>
  <back>
    <references anchor="sec-combined-references">
      <name>References</name>
      <references anchor="sec-normative-references">
        <name>Normative References</name>
        <reference anchor="RFC4884">
          <front>
            <title>Extended ICMP to Support Multi-Part Messages</title>
            <author fullname="R. Bonica" initials="R." surname="Bonica"/>
            <author fullname="D. Gan" initials="D." surname="Gan"/>
            <author fullname="D. Tappan" initials="D." surname="Tappan"/>
            <author fullname="C. Pignataro" initials="C." surname="Pignataro"/>
            <date month="April" year="2007"/>
            <abstract>
              <t>This document redefines selected ICMP messages to support multi-part operation. A multi-part ICMP message carries all of the information that ICMP messages carried previously, as well as additional information that applications may require.</t>
              <t>Multi-part messages are supported by an ICMP extension structure. The extension structure is situated at the end of the ICMP message. It includes an extension header followed by one or more extension objects. Each extension object contains an object header and object payload. All object headers share a common format.</t>
              <t>This document further redefines the above mentioned ICMP messages by specifying a length attribute. All of the currently defined ICMP messages to which an extension structure can be appended include an "original datagram" field. The "original datagram" field contains the initial octets of the datagram that elicited the ICMP error message. Although the original datagram field is of variable length, the ICMP message does not include a field that specifies its length. Therefore, in order to facilitate message parsing, this document allocates eight previously reserved bits to reflect the length of the "original datagram" field.</t>
              <t>The proposed modifications change the requirements for ICMP compliance. The impact of these changes on compliant implementations is discussed, and new requirements for future implementations are presented.</t>
              <t>This memo updates RFC 792 and RFC 4443. [STANDARDS-TRACK]</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="4884"/>
          <seriesInfo name="DOI" value="10.17487/RFC4884"/>
        </reference>
        <reference anchor="RFC2119">
          <front>
            <title>Key words for use in RFCs to Indicate Requirement Levels</title>
            <author fullname="S. Bradner" initials="S." surname="Bradner"/>
            <date month="March" year="1997"/>
            <abstract>
              <t>In many standards track documents several words are used to signify the requirements in the specification. These words are often capitalized. This document defines these words as they should be interpreted in IETF documents. This document specifies an Internet Best Current Practices for the Internet Community, and requests discussion and suggestions for improvements.</t>
            </abstract>
          </front>
          <seriesInfo name="BCP" value="14"/>
          <seriesInfo name="RFC" value="2119"/>
          <seriesInfo name="DOI" value="10.17487/RFC2119"/>
        </reference>
        <reference anchor="RFC8174">
          <front>
            <title>Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words</title>
            <author fullname="B. Leiba" initials="B." surname="Leiba"/>
            <date month="May" year="2017"/>
            <abstract>
              <t>RFC 2119 specifies common key words that may be used in protocol specifications. This document aims to reduce the ambiguity by clarifying that only UPPERCASE usage of the key words have the defined special meanings.</t>
            </abstract>
          </front>
          <seriesInfo name="BCP" value="14"/>
          <seriesInfo name="RFC" value="8174"/>
          <seriesInfo name="DOI" value="10.17487/RFC8174"/>
        </reference>
      </references>
      <references anchor="sec-informative-references">
        <name>Informative References</name>
        <reference anchor="I-D.ietf-intarea-rfc8335bis">
          <front>
            <title>PROBE: A Utility for Probing Interfaces</title>
            <author fullname="Bill Fenner" initials="B." surname="Fenner">
              <organization>Arista Networks</organization>
            </author>
            <author fullname="Ron Bonica" initials="R." surname="Bonica">
              <organization>Juniper Networks</organization>
            </author>
            <author fullname="Reji Thomas" initials="R." surname="Thomas">
              <organization>Arista Networks</organization>
            </author>
            <author fullname="Jen Linkova" initials="J." surname="Linkova">
              <organization>Google</organization>
            </author>
            <author fullname="Chris Lenart" initials="C." surname="Lenart">
              <organization>Verizon</organization>
            </author>
            <author fullname="Mohamed Boucadair" initials="M." surname="Boucadair">
              <organization>Orange</organization>
            </author>
            <date day="21" month="July" year="2025"/>
            <abstract>
              <t>   This document describes a network diagnostic tool called PROBE.
   PROBE is similar to PING in that it can be used to query the status
   of a probed interface, but it differs from PING in that it does not
   require bidirectional connectivity between the probing and probed
   interfaces.  Instead, PROBE requires bidirectional connectivity
   between the probing interface and a proxy interface.  The proxy
   interface can reside on the same node as the probed interface, or it
   can reside on a node to which the probed interface is directly
   connected.  This document updates RFC 4884 and obsoletes RFC 8335.

              </t>
            </abstract>
          </front>
          <seriesInfo name="Internet-Draft" value="draft-ietf-intarea-rfc8335bis-01"/>
        </reference>
      </references>
    </references>
  </back>
  <!-- ##markdown-source:
H4sIAAAAAAAAA61Y7XLbNhb9j6fA2j823ZU0tuO0jqbbRraV2jt27NpyP7bT
2YFISERNAlyAlKw4ybP0WfpkPRcgJVGS5ezsJumUhID7ce69B/ey3W6zyMRK
j7u8LEbto8WbawsXKcVYoYpUdvn5yeU17z8UUjtlNL8tbBkVpZX8QupxkfC3
SqYxE8OhlZMuV1GWt2XSTqVmsYm0yCAitmJUtJWEIqULYaVoh30ktZ3Elra3
9w5ZJAo5NnbW5a6IWZnHeHddfnh0dMiYK4SO/y1SoyFyJh3LVZf/UpioxZ2x
hZUjh6dZFh4ik2VSF+5XxlRuuxxmu+Jgb+/13gEjC+CYLqTVsmBTuH3+btC7
6ff4d9aUObufBr8ZE2WRGNtlnLfxH+dKw56bDj82WkXCLwUfb4DN0qKxEHp2
3fcvkSl1QV7d3fb8gsyESrvcDv2BN7+VWuXS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