[Ntp] Re: ntpd-rs: RefID/LI incorrectly reported for source-less stratum-1 config (root cause + patch); also a draft-ID interop note
Danny Mayer <mayer@pdmconsulting.net> Sat, 01 August 2026 15:13 UTC
Return-Path: <mayer@pdmconsulting.net>
X-Original-To: ntp@mail2.ietf.org
Delivered-To: ntp@mail2.ietf.org
Received: from localhost (localhost [127.0.0.1]) by mail2.ietf.org (Postfix) with ESMTP id EE1E51221D5BB for <ntp@mail2.ietf.org>; Sat, 1 Aug 2026 08:13:17 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ietf.org; s=ietf1; t=1785597197; bh=xAHF5OdHdKF/EidWv2EaZXQdqh40L1RWIPwx0N/ZcVw=; h=Date:Subject:To:References:From:In-Reply-To; b=t5yTcWxJkw6ZpesQ7PAjyDNbA4FfGIa3USGd8HX57Km2djywuavnQXDbht53PPCWh OiphqmNjxIEWCNmXz69qvzL3dOC3MmJspLMX4jM0fh14W722J+0VofEGSIxfZ529UY Y96thdcl/78e3oYX3xBShZyNWLb9mTM3OK8UYf4s=
X-Virus-Scanned: amavisd-new at ietf.org
X-Spam-Flag: NO
X-Spam-Score: -1.888
X-Spam-Level:
X-Spam-Status: No, score=-1.888 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HTML_MESSAGE=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_PASS=-0.001, T_KAM_HTML_FONT_INVALID=0.01] autolearn=ham autolearn_force=no
Received: from mail2.ietf.org ([166.84.6.31]) by localhost (mail2.ietf.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ZNDN3R6oM43Q for <ntp@mail2.ietf.org>; Sat, 1 Aug 2026 08:13:16 -0700 (PDT)
Received: from tom.everett.org (tom.everett.org [66.220.13.237]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-256) server-digest SHA256) (No client certificate requested) by mail2.ietf.org (Postfix) with ESMTPS id BFFE91221D5B4 for <ntp@ietf.org>; Sat, 1 Aug 2026 08:13:16 -0700 (PDT)
Received: from [IPV6:2600:4040:579b:1800:f472:ed5b:92c7:f60f] (unknown [IPv6:2600:4040:579b:1800:f472:ed5b:92c7:f60f]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by tom.everett.org (Postfix) with ESMTPSA id 8059A3FFFC; Sat, 01 Aug 2026 08:13:04 -0700 (PDT)
Content-Type: multipart/alternative; boundary="------------OfMS3ThpkXfsk0W8v2ro0V6j"
Message-ID: <b4ef31c7-ff1f-4605-b3fc-0882c6ea7f45@pdmconsulting.net>
Date: Sat, 01 Aug 2026 11:13:01 -0400
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
To: Pranutha Sundeep <m.pranutha@gmail.com>, ntp@ietf.org
References: <CAAJYWJEPcGAjpMzbGB0RsG7hhJ4Mb8iqZGVGHr1NaoBQdVYArA@mail.gmail.com>
Content-Language: en-US
From: Danny Mayer <mayer@pdmconsulting.net>
Autocrypt: addr=mayer@pdmconsulting.net; keydata= xsFNBGRtgYUBEADKHtgchclbvG8qGinRkjaQMzqxua/+aLsvDQpLGA/mEglc+LGPOWEyDiBV tm8KtiSBSUfsdt76DNZAyVgAT6WUr3JuFhy7yOHa5KxHVtbv44L/iVZni+Ox56NFjuD4Qbsx pdi0R0Efyeb7FJMXkqwOQneMVtjyYdD5mwdvocouNAjBerpezV7xK/P6x52oz6pQsA7J8eYB dIOrVayWbSU2rBQqjOdt/Pw7pg69dRVaa0Redwdj58fDku4EDg5f+4VXJILJIIEfdwvMcJEi wik3xFmKCFHJDSGjpy629QXBlvGibk8QdYjn38eN4ig7gLDbdm7mbuAq+LHn9OUjQfjsX/lk 8xB4HS05u1yJqCP55gh8jjB9/2YIzu13jI6eGWmDiL3mMsm7EMjeRcGzLeRGc7Z46/j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DA gAESV/1jjTak2HC/02ps204k5RnLkjqwKoRwFPbRcbn8dVpJV5aQ9sXeNSPtT+X871wfcEcR Tt6b9/3eCqTlak0WebzcBJ3k4p6xMROuKKpmHXQBRvseBAOWJ2dBHANICyYPM722+xwMW1f7 NM0iw/pJw/FU242vogiLvo3IxZibhU38SFmuxsbnCe+HXFYuoXKvcRcWzh2QPM7X7izLgHV2 JUotbB6ReYuMcyZYqLxBcw1PFsS0/skl/zGy5He6HBL4gXbQCb/0h/x6j7yN4l9p3Y/lQbGC A4cdfea9HUphzAHslGgVv2tTVonxmr8do+y2+7QH2UDxUlBD2oGLd/z9QXvx3KiChC3Hkgdi NkEA1c+lA7vlcwUF6WLyBytCHkXSKaDcldIogZW8FNE/yHtICxApnN6CmXpsDZOZ+bOfAkyj mA==
In-Reply-To: <CAAJYWJEPcGAjpMzbGB0RsG7hhJ4Mb8iqZGVGHr1NaoBQdVYArA@mail.gmail.com>
Message-ID-Hash: RRAXYQN4HOPK6Q7KDVYDVDNUA4NLPDXJ
X-Message-ID-Hash: RRAXYQN4HOPK6Q7KDVYDVDNUA4NLPDXJ
X-MailFrom: mayer@pdmconsulting.net
X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-ntp.ietf.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header
X-Mailman-Version: 3.3.9rc6
Precedence: list
Subject: [Ntp] Re: ntpd-rs: RefID/LI incorrectly reported for source-less stratum-1 config (root cause + patch); also a draft-ID interop note
List-Id: Network Time Protocol <ntp.ietf.org>
Archived-At: <https://mailarchive.ietf.org/arch/msg/ntp/CNkdvCKM3FeBdNQqXffljOf1RNk>
List-Archive: <https://mailarchive.ietf.org/arch/browse/ntp>
List-Help: <mailto:ntp-request@ietf.org?subject=help>
List-Owner: <mailto:ntp-owner@ietf.org>
List-Post: <mailto:ntp@ietf.org>
List-Subscribe: <mailto:ntp-join@ietf.org>
List-Unsubscribe: <mailto:ntp-leave@ietf.org>
This is an IETF Working Group. If you have problems with an
implementation you need to contact the development team for that
implementation. They should have information on how to do that on the
site where you got the implementation and in the documenation that came
with the code.
Danny
On 8/1/26 4:44 AM, Pranutha Sundeep wrote:
>
> Hello,
>
> I'm a PhD researcher at the University of Texas at Dallas, working on
> cross-protocol time synchronization accuracy (NTPv4, NTPv5, PTP).
> Through my work managing a production network, I've had the
> opportunity to test this across a fleet of ~90 HPE Aruba AOS-CX
> switches. As part of that work I've been running ntpd-rs as an
> NTPv5-capable reference source (GMR6000 grandmaster -> ptp4l/phc2sys
> -> ntpd-rs, source-less, local-stratum=1), and identified and fixed a
> bug that seems worth sharing with the group.
>
> *Symptom: *a correctly configured source-less ntpd-rs instance
> (local-stratum=1, clock authority is phc2sys, not an upstream NTP/NTS
> source) correctly reports Stratum=1 to clients, but always emits LI=3
> (Unsynchronized) and RefID="XNON", regardless of the configured
> reference-id. This matches upstream issue #1718.
>
> *Root cause:* in ntp-proto/src/system.rs,
> |NtpSnapshot::from_used_sources()| unconditionally initializes
> |reference_id = ReferenceId::NONE|, only overwriting it if
> |used_sources.peek()| finds an active source. It never falls back to
> |synchronization_config.reference_id| when the source list is
> legitimately empty (i.e., stratum-1 with an external clock authority).
> Separately, |update_used_sources()| overwrites the entire snapshot on
> every call, clobbering any one-time fix applied at startup in
> |NtpManager::new()|. The LI bug is a related but separate path, in
> |update_time_snapshot()|.
>
> *Proposed Fix:* thread a |configured_reference_id| parameter into
> |from_used_sources()|; when |used_sources| is empty and |local_stratum
> == 1|, initialize |reference_id| from
> |synchronization_config.reference_id| instead of |ReferenceId::NONE|.
> A parallel fix gates the LI value the same way.
>
> *Verification: *patched, rebuilt, and confirmed at the wire level -- 8
> captured NTPv4 response packets to a production AOS-CX switch all show
> LI=0 (NoWarning), Stratum=1, RefID='PTP ' as expected. On the switch
> itself, the NTP association went from a permanent reach=0/.INIT. state
> to reach=7 (climbing) with REF-ID=.PTP.. -- its first successful NTP
> association in this deployment. Zero regressions observed.
>
> I'm happy to open a PR against ntpd-rs with this if useful.
>
> And on a separate note, a smaller observation regarding draft ID
> mismatch. While testing against a real ntpd-rs NTPv5 server, I found
> it identifies as "draft-ietf-ntp-ntpv5-08". A client sending a
> non-matching draft ID (e.g. -09) has its packets silently dropped,
> with the only trace being a TRACE-level log line ("Mismatched draft ID
> ignoring packet!"). From an interop-robustness standpoint this seems
> worth a note somewhere (e.g. a louder log level, or a
> response/rejection rather than a silent drop), since it's easy for an
> operator or implementer to mistake for a network issue.
>
> Happy to share more detail, packet captures, or the patch itself if
> useful.
>
> Best,
>
> Pranutha Malickal
>
> PhD Researcher, Computer Engineering, University of Texas at Dallas
>
> Network and Security Manager, Dallas Theological Seminary, Dallas
>
>
> _______________________________________________
> ntp mailing list --ntp@ietf.org
> To unsubscribe send an email tontp-leave@ietf.org
- [Ntp] ntpd-rs: RefID/LI incorrectly reported for … Pranutha Sundeep
- [Ntp] Re: ntpd-rs: RefID/LI incorrectly reported … Danny Mayer