[Ntp] NTPv5 draft suggestion to move timescale offset into extension fields.

David Venhoek <david@venhoek.nl> Sun, 06 November 2022 14:25 UTC

Return-Path: <david@venhoek.nl>
X-Original-To: ntp@ietfa.amsl.com
Delivered-To: ntp@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id D99E1C14F746 for <ntp@ietfa.amsl.com>; Sun, 6 Nov 2022 06:25:27 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.909
X-Spam-Level:
X-Spam-Status: No, score=-1.909 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=venhoek-nl.20210112.gappssmtp.com
Received: from mail.ietf.org ([50.223.129.194]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id RG-Cz67JtAPZ for <ntp@ietfa.amsl.com>; Sun, 6 Nov 2022 06:25:26 -0800 (PST)
Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com [IPv6:2a00:1450:4864:20::62d]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 112E8C14F72B for <ntp@ietf.org>; Sun, 6 Nov 2022 06:25:25 -0800 (PST)
Received: by mail-ej1-x62d.google.com with SMTP id sc25so24007631ejc.12 for <ntp@ietf.org>; Sun, 06 Nov 2022 06:25:25 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=venhoek-nl.20210112.gappssmtp.com; s=20210112; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=B1tjey0L/VBRWoRPjBG+I3vdMaojxCeF/ZY/rWbBfio=; b=PvhYDalSa4lSxmW8EtUffMFSXT+uA/cDwCWyRJwkM6I1c5/rV3E47j0n+Jh3GckF4a t9BH5YEG4yibmS0ivFrV8OzOGtpWE1ADInXKPqGjfCghdmNUH6ELCnShH/GLEIpM3MGY t7U6/lJSTLhShrdAirzOs5rprrtKRL6N+YE0DwXoO1eLVFH4vyQ3/qa4JiSnbUb7gGti MvtpXXdzhK55YRxc3Uc6uAIpY7q8keb7pN7Rn4aiH/o5zkMCFFaU/bXmN5fgWy8hPjPs 4jCUd43lc9uxscULPFGVwioAl3LcvXQ4WWw7QnTg6XyKLxFiE/nKDzlcr2b0vdPQxD6z itIw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=B1tjey0L/VBRWoRPjBG+I3vdMaojxCeF/ZY/rWbBfio=; b=uBx25gL1+uc9HulvllFlPzOt6QkrrZT48faF8Bd/9iXlgUEA9BbsQNBjoJKlGy4CAe 4+/sK0lGSJW0PgebFQbTucZFweG1GN5nsJ2XZMXikBnTPhPLPYVyk8edkBCy/PYqEff0 0/DQmlacMV2gyQhhGsVDkD33zMCFPX9qG/hcdCgF+x7DhyEkjsUl0tbq5hIUk7awRbFo RgookaGNvVwI2vamMvdZJBGlBLBsak2cTQwih8SZ594o8bH8EETmBvcpRbjckmW/a0X7 sgPHQjfAUXOnfkgytxDnLxy/UwmAknsAfhkobllBpCdfayv5sS6CdylRsfSLrer/nC9B 79wg==
X-Gm-Message-State: ACrzQf3MniYwpqxDbnvxngrAYCp8eB5yLGdtwBEs7NrzpJ9+EtvO0C9C +8TgEskYm/A/OFRTftomjwJPHrU8FI2yY1SmT5gV4bT8oipEvFLp
X-Google-Smtp-Source: AA0mqf79KphXx+ZTvZv2bX5HtnAtd+fZSysUYeNwmimYMBHO0+eLT1zOPZKOeEjnlDo+B7uEKK/vPtlQXvBAreGwxYI=
X-Received: by 2002:a17:906:99c1:b0:6fe:b01d:134 with SMTP id s1-20020a17090699c100b006feb01d0134mr7745948ejn.598.1667744723102; Sun, 06 Nov 2022 06:25:23 -0800 (PST)
MIME-Version: 1.0
From: David Venhoek <david@venhoek.nl>
Date: Sun, 06 Nov 2022 14:25:11 +0000
Message-ID: <CAPz_-SU7rctchBVvm59YAoEA7p8Or9aqdGovJ2E98Tp85jVsWQ@mail.gmail.com>
To: ntp@ietf.org
Content-Type: text/plain; charset="UTF-8"
Archived-At: <https://mailarchive.ietf.org/arch/msg/ntp/NhfmSDAIlCdP2Ew4rOdIzewMsCc>
Subject: [Ntp] NTPv5 draft suggestion to move timescale offset into extension fields.
X-BeenThere: ntp@ietf.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: Network Time Protocol <ntp.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/ntp>, <mailto:ntp-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/ntp/>
List-Post: <mailto:ntp@ietf.org>
List-Help: <mailto:ntp-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/ntp>, <mailto:ntp-request@ietf.org?subject=subscribe>
X-List-Received-Date: Sun, 06 Nov 2022 14:25:27 -0000

Below attached is the diff of a PR on Miroslav's draft for NTPv5 for
moving the timescale offset field into a separate extension field.

In my view, doing so has several advantes:
 - We can use larger datatypes for offset, which makes it trivial to
allow larger than 1 second offsets for UT1 which might become
necessary if UTC stops doing leap seconds.
 - We gain more bits for both the flag and timescale fields, giving
additional flexibility for these fields.

Please let me know if you have any feedback on this.

Kind regards,
David Venhoek

--- a/ntp-ntpv5.xml
+++ b/ntp-ntpv5.xml
@@ -163,6 +163,12 @@
             describing the fractional part. The maximum value is
             16 seconds and the resolution is about 3.7 nanoseconds. Note that
             this is different from the 32-bit time format in NTPv4.</t>
+
+          <t hangText="time64"><vspace/>
+            A 64 bit signed fixed-point type containg values in
seconds. It has 32
+            signed integer bits, and 32 fractional bits. The sign
uses 2-complements
+            representation for negative numbers.
+          </t>

           <t hangText="timestamp64"><vspace/>
             A 64-bit unsigned fixed-point type containing a timestamp describes
@@ -199,9 +205,9 @@
  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
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-|LI | VN  |Mode | Scale |Stratum|     Poll      |  Precision    |
+|LI | VN  |Mode |    Stratum    |     Poll      |  Precision    |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-|     Flags     |      Era      |        Timescale Offset       |
+|              Flags            |      Era      |   Timescale   |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                           Root Delay                          |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
@@ -258,8 +264,8 @@
           <t hangText="Mode"><vspace/>
             A 3-bit field containing the value 3 (request) or 4 (response).</t>

-          <t hangText="Scale"><vspace/>
-            A 4-bit identifier of the timescale. In requests it is the
+          <t hangText="Timescale"><vspace/>
+            An 8-bit identifier of the timescale. In requests it is the
             requested timescale. In responses it is the timescale of the
             receive and transmit timestamps. Defined values are:

@@ -272,10 +278,12 @@
           </t>

           <t hangText="Stratum"><vspace/>
-            A 4-bit field containing the stratum of the server. Primary time
+            An 8-bit field containing the stratum of the server. Primary time
             servers have a stratum of 1, their clients have a stratum of 2, and
             so on. The value of 0 indicates an unknown or infinite stratum. In
-            requests it is always 0.</t>
+            requests it is always 0. Servers advertising a stratum above 16
+            should not be synchronized to except when the client is explicitly
+            configured to do so by the end-user.</t>

           <t hangText="Poll"><vspace/>
             An 8-bit signed integer containing the polling interval as a
@@ -289,7 +297,7 @@
             requests, which don't contain any timestamps, it is always 0.</t>

           <t hangText="Flags"><vspace/>
-            An 8-bit integer that can contain the following flags:
+            A 16-bit integer that can contain the following flags:

             <list style="hanging">
               <t hangText="0x1: Unknown leap"><vspace/>
@@ -773,6 +781,81 @@

       </section>

+      <section title="Timescale offset request">
+        <t>A clients request for the offset between two indicated
timescales.</t>
+
+        <t>The reference field MUST contain the timescale identifier of
+          the timescale with respect to which the client wants to know
+          the offset.</t>
+
+        <t>The target field MUST contain the timescale identifier of the
+          timescale for which the client wants to know an offset.</t>
+
+        <t>The reserved and placeholder fields MUST be set to 0
+          by the client, and MUST be ignored by a server</t>
+
+        <t>A server which does not know either the reference or target
+          timescale, or which does not know the offset between them, MUST
+          ignore the timescale request.</t>
+
+        <figure align="center" anchor="timescale-offset-request-ext-field"
+            title="Format of Timescale Offset Request Extension Field">
+          <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 = [[TBD]] (draft 0xF509) |           Length = 16         |
++-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+|   Reference   |    Target     |           Reserved            |
++-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+|                                                               |
+|                  Offset placeholder (64 bits)                 |
+|                                                               |
++-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+          ]]></artwork>
+        </figure>
+      </section>
+
+      <section title="Timescale offset response">
+        <t> The offset between two given timescales.</t>
+
+        <t>The reference field MUST contain the timescale identifier of
+          the timescale with respect to which the client wants to know
+          the offset.</t>
+
+        <t>The target field MUST contain the timescale identifier of the
+          timescale for which the client wants to know an offset.</t>
+
+        <t>The offset is given such that for a given timestamp in the
+          reference timescale, the timestamp in the target timescale
+          is the reference scale timestamp plus the offset. (i.e.
+          target = reference + offset)</t>
+
+        <t>The reserved bits MUST be set to 0 by the server, and MUST
+          be ignored by the client.</t>
+
+        <t>When the offset between the target and reference timescales
+          varies over time, the provided offset MUST be the servers
+          best approximation of this offset at the time exactly halfway
+          between the receive and transmit timestamps.</t>
+
+<figure align="center" anchor="timescale-offset-response-ext-field"
+            title="Format of Timescale Offset Response Extension Field">
+          <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 = [[TBD]] (draft 0xF50A) |           Length = 16         |
++-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+|   Reference   |    Target     |           Reserved            |
++-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+|                                                               |
+|                  Offset (time64)                              |
+|                                                               |
++-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+          ]]></artwork>
+        </figure>
+      </section>
     </section>

     <section title="Measurement Modes" anchor="measurement-modes">