<?xml version='1.0' encoding='utf-8'?>
<rfc xmlns:xi="http://www.w3.org/2001/XInclude"
     version="3" xml:lang="en" ipr="trust200902"
     submissionType="independent" category="exp"
     docName="draft-maurette-hmtftp-05">

  <front>
    <title abbrev="HMTFTP">
      HMTFTP: HKDF-Derived TFTP with Optional AEAD Protection
    </title>

    <author fullname="A. Maurette" initials="A." surname="Maurette">
      <organization>IUT R&amp;T Béthune</organization>
      <address>
        <postal>
          <country>France</country>
        </postal>
        <email>contact@c4tz.fr</email>
      </address>
    </author>

    <date year="2026" month="March" day="2"/>
    <area>Applications</area>
    <keyword>hmtftp</keyword>
    <keyword>tftp</keyword>
    <keyword>aead</keyword>
    <keyword>hkdf</keyword>

    <abstract>
      <t>
        HMTFTP is a lightweight UDP file transfer protocol derived from
        TFTP that adds TLV-based negotiation and an optional AEAD
        protection mode for DATA payloads. This document requests IANA
        actions: assignment of a service name and UDP port, and creation
        of registries for TLV Types, OpCodes, and Ciphersuites.
      </t>
    </abstract>
  </front>

  <middle>

    <section title="Introduction">
      <t>
        HMTFTP extends TFTP (<xref target="RFC1350"/>) with TLV-based
        negotiation and optional AEAD protection.
      </t>
      <t>
        Cryptographic keys are derived using HKDF
        (<xref target="RFC5869"/>).
      </t>
    </section>

    <section title="Relationship to TFTP">
      <t>
        HMTFTP reuses TFTP message types and semantics
        (<xref target="RFC1350"/>) and OACK
        (<xref target="RFC2347"/>).
      </t>
      <ul>
        <li><t>Dedicated UDP port assigned by IANA</t></li>
        <li><t>TLV negotiation in RRQ/WRQ/OACK</t></li>
        <li><t>Optional AEAD protection</t></li>
      </ul>
    </section>

    <section title="Transport">
      <t>
        HMTFTP runs over UDP. The port number is assigned by IANA.
        Implementations MUST allow configuration.
      </t>
      <t>
        Servers MAY respond from a different UDP port for the transfer.
      </t>
    </section>

    <section title="TLV Processing Rules">
      <t>
        TLVs MAY appear only in RRQ, WRQ, and OACK.
        TLVs MUST NOT appear in DATA, ACK, or ERROR.
      </t>
      <t>
        TLVs MUST be processed in the order received.
        Duplicate TLVs MUST cause rejection unless explicitly allowed.
      </t>
      <t>
        Unknown TLVs with Critical=1 MUST cause rejection.
        Unknown TLVs with Critical=0 MUST be ignored.
      </t>
      <t>
        TLVs MUST NOT influence cryptographic processing unless
        explicitly defined as such.
      </t>
    </section>

    <section anchor="security-mode" title="Optional AEAD Security Mode">
      <section title="Key Derivation">
      <t>
  The AEAD algorithm used by this specification is AES-256-GCM, as
  defined in <xref target="RFC5116"/>.
</t>
        <t>
          IKM = PSK.
          salt = CNONCE || SNONCE.
          info = "hmtftp keys v1".
          OKM length = 44 octets.
        </t>
      </section>

      <section title="Nonce Construction">
        <t>
          nonce = iv_base[0..7] || uint32(n).
        </t>
        <t>
          The 64-bit prefix is derived via HKDF and unique per session.
          The 32-bit counter guarantees uniqueness within session,
          provided wrap is prevented.
        </t>
        <t>
          This construction ensures nonce uniqueness across sessions
          and within a session.
        </t>
        <t>
          Retransmissions MUST reuse identical nonce and ciphertext.
        </t>
      </section>

      <section title="BLKSIZE Constraints">
        <t>
          In AEAD mode, total UDP payload =
          4-byte header + BLKSIZE + 16-byte tag.
        </t>
        <t>
          Implementations MUST ensure the datagram does not exceed path MTU.
          When unknown, total payload SHOULD NOT exceed 1200 bytes.
        </t>
      </section>

      <section title="Limits">
        <t>
          Block number wrap MUST NOT occur.
          Transfers MUST terminate before 65535 blocks.
        </t>
      </section>

    </section>

    <section anchor="iana" title="IANA Considerations">
      <section title="Service Name and UDP Port">
        <t>
          IANA is requested to assign:
        </t>
        <t>
  This request follows the procedures in <xref target="RFC6335"/>.
</t>
        <ul>
          <li><t>Service Name: hmtftp</t></li>
          <li><t>Transport: udp</t></li>
          <li><t>Port: TBD</t></li>
        </ul>
      </section>
      <section title="Registries">
        <t>
          IANA is requested to create registries for TLV Types,
          OpCodes, and Ciphersuites (Expert Review,
          <xref target="RFC8126"/>).
        </t>
      </section>
    </section>

    <section title="Security Considerations">

      <t>
        Without security mode, HMTFTP is vulnerable to spoofing
        and modification.
      </t>

      <t>
        Implementations SHOULD follow UDP usage guidance
        (<xref target="RFC8085"/>).
      </t>

      <t>
        Downgrade attacks are possible if ENC_REQ is not marked
        Critical. Clients requiring AEAD MUST set Critical=1.
      </t>

      <t>
        Reflection and amplification attacks are possible.
        Implementations SHOULD limit response size prior to
        completing negotiation and SHOULD apply rate limiting.
      </t>

      <t>
        Nonce reuse in AES-GCM is catastrophic.
        Implementations MUST enforce uniqueness and block limits.
      </t>

    </section>

    <section title="Implementation Status">
      <t>
        No interoperable public implementations are known.
      </t>
      <t>
        Provided in accordance with
        <xref target="RFC7942"/>.
      </t>
    </section>

  </middle>

  <back>

    <references title="Normative References">
      <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.1350.xml"/>
      <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.2347.xml"/>
      <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.5116.xml"/>
      <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.5869.xml"/>
      <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.6335.xml"/>
      <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.8126.xml"/>
      <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.8085.xml"/>
    </references>

    <references title="Informative References">
      <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.7942.xml"/>
    </references>

  </back>

</rfc>
