Re: [Ntp] Antwort: Re: The bump, or why NTP v5 must specify impulse response

Daniel Franke <dfoxfranke@gmail.com> Fri, 17 April 2020 16:08 UTC

Return-Path: <dfoxfranke@gmail.com>
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 9238E3A101C for <ntp@ietfa.amsl.com>; Fri, 17 Apr 2020 09:08:29 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.098
X-Spam-Level:
X-Spam-Status: No, score=-2.098 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id SEcx_970JUP7 for <ntp@ietfa.amsl.com>; Fri, 17 Apr 2020 09:08:27 -0700 (PDT)
Received: from mail-il1-x12f.google.com (mail-il1-x12f.google.com [IPv6:2607:f8b0:4864:20::12f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id A64E33A101A for <ntp@ietf.org>; Fri, 17 Apr 2020 09:08:27 -0700 (PDT)
Received: by mail-il1-x12f.google.com with SMTP id q10so1263153ile.0 for <ntp@ietf.org>; Fri, 17 Apr 2020 09:08:27 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=3PHCLWYm2q7W1ofoWma/JmzL6S4lKxyZzQHzj9osHqY=; b=CvFo6OY2tM4cULbX074LDXiST1w8sLpbvYCaamG1A5ORp+rZHFGRjZhB6W6HuHoA4U 2fLI2pJPZz6Devu1PpOf/eZU+6DuU4qiOpbeBzCrHzfZXySrLIDs9Z16V6R6oCFb+TAw QyZ+6mc8AHqi1n6FKkeAbHvn44jJnIlEQDO1xL+uD2XzVbT74VxuY0En5zfbFxHFGKxH 6OJ6f/pOshcpwRPp0V2nYkGtfjy7XGYVcBaOS0EKLKE6F8+qms2fVbT1+DT3RTY2HeTs EBdOeEkYS/N2KvCO5jK6WtRcEkJY1dyxzUBy+6lGFh6r4R/zh8Vu7pGpEkgnwaziYcWK HeQw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=3PHCLWYm2q7W1ofoWma/JmzL6S4lKxyZzQHzj9osHqY=; b=kwymKeAoahoThFblz0lIn5Oq8RS+LM9OFrXcNyP6ep40bcCX2+j3/u4sK/ubZODVca YhXlMS98etUzPCjdlXskuqPH4mHbAEh96S2J0JHL+41JB8xQIMyLGDI3e+Txq/ZKZvl7 raVqM76pfeiTQhAWv2V0ZV/yZiTRRtE8QHgstofy5r5b0m/MR/Xe6CcShrJimlBcJZ4m 6p9E5iQSRFYtg66J1Yqw0on6wMzLp6FizbM569i6SdwY/4haYwKht0xJTJnJXkz8Rezy fkATg3HnYwgnNa0qFd//WSfDrYnllBO6ozehQfToTwcfMWtb+s9M31pUbJMweOKwpOAr Qtuw==
X-Gm-Message-State: AGi0PuYeIxC258XlGD5PwJJ1SUQYTCW5nJxXUte0xbzvIDpTPkNbuS41 b+IkkfidWglA7cccvBO/0wRSLPNcAsr8q1GDSCs=
X-Google-Smtp-Source: APiQypLBj6T+4d3UzdZn1+lNKl/SqO7x8n7Pb68bXlBNPoAjt+YqadPjJZep0X2G7MnxRD+NjBhwtjtwKjJK+oh9YrI=
X-Received: by 2002:a92:dccf:: with SMTP id b15mr3594936ilr.246.1587139706809; Fri, 17 Apr 2020 09:08:26 -0700 (PDT)
MIME-Version: 1.0
References: <CACsn0c=zzDKP6iBjPJWGF0rkqSaY3AY738ynGwDZO14sdBJ-Bg@mail.gmail.com> <CAJm83bB2A3VUxXX47Y0ubmS9Xne7PRSyV_xHY_D9YvHjqE-vFA@mail.gmail.com> <CACsn0cm3jpKZTUQ=novTgVaFhc1xCJgmUF3oOgdrzQa-HgOCUQ@mail.gmail.com> <CAJm83bAqbMMs2W3SyH+3c17wcC85paY4-_jk2SxczgsxBLyYyA@mail.gmail.com> <CAJm83bAQeR_6U3jgmbWzdus3pu+OO2_KP+M9RtbCFYOfDQy4dw@mail.gmail.com> <DB8PR02MB56111CCA23CDCF97A3C9F3E8CFDD0@DB8PR02MB5611.eurprd02.prod.outlook.com> <F7E5836A-4C7A-4A1A-B769-65EADE2C8F5C@gmail.com> <7d909ae3-a830-1270-6920-fa088a56525e@nwtime.org> <6C9832A9-E18B-4DE2-934F-9E471FC22F7B@akamai.com> <bc7920e2-dc81-ba7f-ec24-7926cda8589d@nwtime.org> <E591F38A-A303-4077-BC4C-A61AB7867F83@gmail.com> <OFF6FE7A91.279129DD-ONC125854D.00379455-C125854D.0038D979@ptb.de> <CAJm83bAUqCyy6iKVkGNyHN9hoaEbchuR4bx+kmc=Z-iOrZ3Bgg@mail.gmail.com> <CANCZdfr1Ku6c-LMD5pTaY1yohEO229ppAqbwxQX2Qz3r+tG0bQ@mail.gmail.com>
In-Reply-To: <CANCZdfr1Ku6c-LMD5pTaY1yohEO229ppAqbwxQX2Qz3r+tG0bQ@mail.gmail.com>
From: Daniel Franke <dfoxfranke@gmail.com>
Date: Fri, 17 Apr 2020 12:08:15 -0400
Message-ID: <CAJm83bDS92mPGaZ9xTOwfZWB10t+Br08Y-ZH5EqKvGs1MDC_4w@mail.gmail.com>
To: Warner Losh <imp@bsdimp.com>
Cc: kristof.teichel@ptb.de, NTP WG <ntp@ietf.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Archived-At: <https://mailarchive.ietf.org/arch/msg/ntp/nSmriESgsw2ZGbHXsY0yzCZGipQ>
Subject: Re: [Ntp] Antwort: Re: The bump, or why NTP v5 must specify impulse response
X-BeenThere: ntp@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: <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: Fri, 17 Apr 2020 16:08:30 -0000

On Fri, Apr 17, 2020 at 11:35 AM Warner Losh <imp@bsdimp.com> wrote:
> Counters of sufficient resolution wrap. There's often a software counter too. And getting either the raw software or raw hardware counters and/or their notion of a relationship to the local system time can be tricky as well. Some OSes allow access to the raw counters (since CPUs allow turning that access on/off), and some even publish what's basically a 'phase at count' testimate and a frequency estimate that the applications can then use to compute time w/o a round trip into the kernel (this is often hidden inside of libc's clock_gettime or similar).
>
> Also, how does NTPd get access to this pure counter when it timestamps the packets? It would need to know that in order to measure the evolution of that counter over time to make estimates about it.
>
> And I'd maintain that the NTP daemon needs to provide both the phase estimate of the counter vs the TAI and a shorter-term frequency estimate for the counter's evolution. Since the counter is likely to be lousy over time and the frequency will wander all over the place (relative to a high precision time keeping xtal or clock), the most useful information is that counter X is TAI time Y and the short-term frequency is Z (maybe with a Z' estimate as well). The OS will need to read the counter and produce a TAI/UTC time quite often, and doing more than a simple computation will show up in benchmarks. But that thinking may be a legacy of NTP steering the OS's notion of time that it gets from a pure counter under the covers. This is why we have ntp_adjtime providing a time delta and frequency error and a bunch of other stuff that talk about ntpd's notion of how good those are which are on a spectrum from generally useful, to totally NTPd specific. I have a hard time seeing a way to not push the error in time / frequency measurements down.
>
> Second, the OS needs to keep a smooth time to its clients w/o time jumps (but small changes in frequency are OK). So there will likely need to be some coordination between the OS and the ntp daemon to communicate how much of the 'steers' or 'tyler series' information it could ingest and what it's notion of a future counter's time will be so NTP can help steer the OS's use of the counter so it will be on time in the future and not overshoot as the frequency wanders around.

I don't think we're disagreeing about anything here. Where I say
"first few Taylor series coefficients" and you say "time delta and
frequency error", we're talking about the same thing — time delta and
frequency error are the first and second coefficients respectively.
I'm considering the kernel and libc all part of the OS, so questions
about how to deal with hardware counters that wrap and what should
happen in kernel versus user space all lives on the "OS" side of
abstraction barrier.