<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE rfc [
  <!ENTITY nbsp    "&#160;">
  <!ENTITY zwsp   "&#8203;">
  <!ENTITY nbhy   "&#8209;">
  <!ENTITY wj     "&#8288;">
]>
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" submissionType="independent" category="exp" ipr="trust200902" docName="draft-kumarvarigonda-ptp-auth-extension-00" xml:lang="en" version="3">
  <!-- xml2rfc v2v3 conversion 3.28.1 -->
  <front>
    <title abbrev="PTP AUTH">Precision Time Protocol (PTP) Authentication Extension</title>
    <seriesInfo name="Internet-Draft" value="draft-kumarvarigonda-ptp-auth-extension-00"/>
    <author fullname="Srinivasa Mohan Kumar Varigonda" surname="Varigonda">
      <organization>Samsung R&amp;D Bangalore</organization>
      <address>
        <email>sri.mohan@samsung.com</email>
      </address>
    </author>
    <author fullname="Rama Subba Reddy Sige"  surname="Sige">
      <organization>Spirent</organization>
      <address>
        <email>rama.subbareddy@spirent.com</email>
      </address>
    </author>
    <date year="2025" month="May" day="13"/>
    <abstract>
      <t>Precision Time Protocol (PTP), as defined in IEEE 1588-2019, lacks
      cryptographic security mechanisms, exposing deployments to message spoofing,
      delay attacks, and timestamp manipulation. This document defines an optional
      Authentication TLV (AUTH_TLV) using modern Authenticated Encryption with
      Associated Data (AEAD) algorithms to ensure message integrity,authenticity,
      and replay protection. It also provides example configurations, implementation
      approaches, and test strategies.</t>
    </abstract>
  </front>
  <middle>
    <section numbered="true" toc="include">
      <name>Introduction</name>
      <t>
        The PTP protocol is widely used for time synchronization in telecom, industrial automation, and financial systems. However, the protocol lacks built-in security. This draft proposes a lightweight extension for cryptographic message authentication and integrity without impacting compatibility.
      </t>
    </section>
    <section numbered="true" toc="include">
      <name>Problem Statement</name>
      <t>PTP messages are susceptible to:</t>
      <ul>
        <li>Spoofing of SYNC or ANNOUNCE messages</li>
        <li>Timestamp alteration during transit</li>
        <li>Replay or delay injection attacks</li>
      </ul>
      <t>
        These vulnerabilities can compromise distributed systems relying on synchronized time for control, logs, or access control.
      </t>
    </section>
    <section numbered="true" toc="include">
      <name>AUTH TLV Format</name>
      <t>A new TLV is introduced as follows:</t>
      <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
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |     Type = 0xFE00 (TEMP)      |           Length              |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |       AEAD Algorithm ID       |     Tag Length (bytes)        |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |                        Nonce (96 bits)                        |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |                   Authentication Tag (variable)              |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      ]]></artwork>
      <t>The nonce is derived from the message sequence ID and clock ID.</t>
      <t>Supported AEAD algorithms:</t>
      <ul>
        <li>AES-GCM-128/256 (ID 0x0001)</li>
        <li>ChaCha20-Poly1305 (ID 0x0002)</li>
      </ul>
    </section>
    <section numbered="true" toc="include">
      <name>AEAD Algorithm Support</name>
      <t>
        The AUTH TLV uses AEAD for combined encryption and authentication, though only authentication is used in this extension. The message body is used as AAD, and only the tag is appended in the TLV.
      </t>
    </section>
    <section numbered="true" toc="include">
      <name>Key Management</name>
      <t>
        Keys may be provisioned using:
      </t>
      <ul>
        <li>Manual configuration (secure local access)</li>
        <li>Enrollment via PKI (e.g., EST, SCEP)</li>
        <li>TPM-based secure provisioning (future work)</li>
      </ul>
    </section>
    <section numbered="true" toc="include">
      <name>Backward Compatibility</name>
      <t>
        As per IEEE 1588 TLV rules, unknown TLVs are ignored by legacy systems. Authentication failures are not enforced unless explicitly configured.
      </t>
    </section>
    <section numbered="true" toc="include">
      <name>Example Implementations</name>
      <section title="Software (ptp4l)" anchor="ptp4l">
        <t>
          Modify ptp4l to:
        </t>
        <ul>
          <li>Enable <tt>auth_tlv_enable = 1</tt> in configuration</li>
          <li>Parse and verify AUTH TLV using OpenSSL or libsodium</li>
          <li>Generate tag for outgoing messages with unique nonce</li>
        </ul>
      </section>
      <section title="Hardware" anchor="hardware">
        <t>
          Suggested flow for hardware timestamping with AUTH:
        </t>
        <ul>
          <li>Timestamp before encryption</li>
          <li>Use on-NIC AEAD (if supported) or offload via driver extensions</li>
          <li>Expose configuration via ethtool or netlink extensions</li>
        </ul>
      </section>
      <section title="Wireshark Filters" anchor="wireshark">
        <t>
          Use the following filter:
        </t>
        <artwork><![CDATA[
ptp.messageType && frame contains 0xfe00
        ]]></artwork>
        <t>
          Custom dissector patches can be developed to interpret the AUTH_TLV fields.
        </t>
      </section>
    </section>
    <section numbered="true" toc="include">
      <name>Security Considerations</name>
      <t>
        - Nonce reuse must be avoided; use a deterministic counter with a unique base per node.
        - Replay attacks are mitigated by validating sequence IDs and time windows.
        - Integrity is ensured only for messages using AUTH TLV.
      </t>
    </section>
    <section numbered="true" toc="include">
      <name>IANA Considerations</name>
      <t>
        Request registration of:
      </t>
      <ul>
        <li>AUTH_TLV type code (tentatively 0xFE00 for testing)</li>
        <li>AEAD Algorithm ID registry for PTP</li>
      </ul>
    </section>
    <section numbered="true" toc="include">
      <name>Appendix A. Sample ptp4l.conf</name>
      <artwork><![CDATA[
[global]
auth_tlv_enable 1
auth_algorithm 2
auth_key 00112233445566778899aabbccddeeff00112233445566778899aabbccddeeff
auth_nonce_base 112233445566778899aabb
auth_tag_len 16
auth_debug 1
      ]]></artwork>
    </section>
    <section numbered="true" toc="include">
      <name>Appendix B. Example AUTH TLV</name>
      <artwork><![CDATA[
TLV Type: 0xFE00
Length:   32
AEAD ID:  0x0002
Tag Len:  16
Nonce:    00 11 22 33 44 55 66 77 88 99 aa bb
Tag:      c0 ff ee 12 34 56 78 90 de ad be ef 12 34 56 78
      ]]></artwork>
    </section>
    <section numbered="true" toc="include">
      <name>Appendix C: Change Log</name>
      <t>draft-kumarvarigonda-ospf-precomputed-frr-00</t>
      <t>- Initial version including use case, diagram, and examples.</t>
    </section>
  </middle>
  <back>
    <!-- references remain unchanged -->
  </back>
</rfc>
