<?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-02" category="std" consensus="true" updates="4884" tocInclude="true" sortRefs="true" symRefs="true" version="3">
  <!-- xml2rfc v2v3 conversion 3.29.0 -->
  <front>
    <title abbrev="icmp-eh-len">ICMP Extension Header Length Field</title>
    <seriesInfo name="Internet-Draft" value="draft-ietf-intarea-icmp-exten-hdr-len-02"/>
    <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="07"/>
    <area>Internet</area>
    <workgroup>INTAREA Group</workgroup>
    <keyword>ICMP</keyword>
    <abstract>
      <?line 48?>

<t>The ICMP Extension Structure 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 defines 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>
      <t>This document UPDATES RFC 4884.</t>
    </abstract>
  </front>
  <middle>
    <?line 57?>

<section anchor="intro">
      <name>Introduction</name>
      <t>The ICMP Extension Structure <xref target="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 defines 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>
      <t>New implementations <bcp14>SHOULD</bcp14> always include the length field, even though it is not needed when the ICMP message ends with an ICMP Extension Structure.</t>
      <t>This document 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><xref target="box-fig"/>  depicts the ICMP Extension Header as updated by this document.</t>
      <figure anchor="box-fig">
        <name>ICMP Extension Header As Updated By This Document</name>
        <artwork><![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>
      </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"/>.</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 set the length field to 0 as per section 7 of <xref target="RFC4884"/>. When the length 
field is set to 0, it conveys no information and cannot be used to parse the ICMP packet.</t>
      <t>In these cases, one of the following statements <bcp14>MUST</bcp14> be true:</t>
      <ul spacing="normal">
        <li>
          <t>The ICMP Extension Structure is 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.</t>
        </li>
      </ul>
      <t>Legacy implementation do not recognize messages that rely on the ICMP Extension 
Header length field. This is because when the document was published, the IETF had not yet standardized
any messages that rely on ICMP Extension Header length field.</t>
      <t>An ICMP implementation <bcp14>MUST</bcp14> be capable of processing the ICMP Extension Header length field before recognizing any message that relies on it.</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, Erik Vynke and Michael Welzl for their review and helpful suggestion.</t>
    </section>
  </middle>
  <back>
    <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>
  </back>
  <!-- ##markdown-source:
H4sIAAAAAAAAA+1YbXPbuBH+jl+xdT60TUWN7fNdHM31Loqt1J7xW235Xnpz
04HIlYQzBbAAKFl28l/ut9wv6y5AUqIlO+2039oknpAg9u3ZZxcLJ0kiUpMp
PelB6cfJ4erNJdKlSgnhlc+xB6dH51cwuPeonTIaTlBmaOEM9cRP4YPCPBNy
NLI474FKZ0WC0yRHLTKTajkj+czKsU8UkhWlvbQok7iPVSbTzPL2ZHdfpNLj
xNhlD5zPRFlk9O56cHB4eCCE81Jnf5e50aRyiU4Uqgc/eZN2wBnrLY4dPS1n
8SE1sxlq734WQhW2B96Wzu/v7r4lM+wBRaU9Wo1eLCjm04th/3rQh79YUxbi
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