Re: [Ntp] Antw: Re: Leap second

Martin Burnicki <martin.burnicki@meinberg.de> Mon, 27 January 2020 08:32 UTC

Return-Path: <martin.burnicki@meinberg.de>
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 4ABB312007C for <ntp@ietfa.amsl.com>; Mon, 27 Jan 2020 00:32:37 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -4.299
X-Spam-Level:
X-Spam-Status: No, score=-4.299 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, 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 (1024-bit key) header.d=meinberg.de
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 Oz6IYtBMwSz9 for <ntp@ietfa.amsl.com>; Mon, 27 Jan 2020 00:32:35 -0800 (PST)
Received: from server1a.meinberg.de (server1a.meinberg.de [176.9.44.212]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 6C12112001E for <ntp@ietf.org>; Mon, 27 Jan 2020 00:32:35 -0800 (PST)
Received: from srv-kerioconnect.py.meinberg.de (unknown [193.158.22.2]) (using TLSv1.1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by server1a.meinberg.de (Postfix) with ESMTPSA id 15DA371C038E; Mon, 27 Jan 2020 09:32:01 +0100 (CET)
X-DKIM: Sendmail DKIM Filter v2.8.2 server1a.meinberg.de 15DA371C038E
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=meinberg.de; s=mail201101; t=1580113954; bh=548nmoLqaF4SMaO0+grMwnwfdWuurMcgvLu5E7ZCnS4=; h=Subject:To:Cc:References:From:Message-ID:Date:MIME-Version: In-Reply-To:Content-Type:Content-Transfer-Encoding; b=CpLZMwp/k/fS0hDvFBcQyhwibzDJwSfjyuZNNO04ywX+q+Yl7OxLs9LwB/H7Zhzj2 rXN0xHnKLQTN7jtgzzvhaYg6xNt5PI5c9e/Roil5n6WE6xYbxrryP99OkMPaQVxw5j Q1JFBPph9eXVAnGfO8SRZWcq+cCG8wlyoZbHpYNw=
X-Kerio-Anti-Spam: Build: [Engines: 2.15.9.1281, Stamp: 3], Multi: [Enabled, t: (0.000006,0.006059)], BW: [Enabled, t: (0.000007)], RTDA: [Enabled, t: (0.078711), Hit: No, Details: v2.7.69; Id: 15.1i61css.1dvj220bg.68c81], total: 0(700)
X-Footer: bWVpbmJlcmcuZGU=
Received: from localhost ([127.0.0.1]) by srv-kerioconnect.py.meinberg.de with ESMTPSA (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256 bits)); Mon, 27 Jan 2020 09:31:59 +0100
To: Warner Losh <imp@bsdimp.com>, Ulrich Windl <Ulrich.Windl@rz.uni-regensburg.de>
Cc: "ntp@ietf.org" <ntp@ietf.org>, Hal Murray <hmurray@megapathdsl.net>
References: <20200123235232.BB54440605C@ip-64-139-1-69.sjc.megapath.net> <5E2AB233020000A1000367EF@gwsmtp.uni-regensburg.de> <CANCZdfqNVGiOdZncUkJD5yAR8DvCBiWRnNZei=wU4tV+WW0f-Q@mail.gmail.com>
From: Martin Burnicki <martin.burnicki@meinberg.de>
Autocrypt: addr=martin.burnicki@meinberg.de; prefer-encrypt=mutual; keydata= xsFNBFUJbhwBEADpbjlFJrR+RWZSc5WFFmRVQUFQ+XwgRBrAtTkJyu+xhu6DvD6zq2IgnXQ3 W8pz/MoMMfKWaNOJ1qCxMfd8XrCR1WaO1m98Re9RqB9948ZH2VZIR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F/hOFHuR4GQWeFRxBSW d41qArjdABIxhZrnMICSW3fMyo9yfiQ6tXoyD1cHD/i2WmOnqCKEOtFScVeQJZJhqQb54NBx +viRax9d+X066AKYiBspm7kYwBVzNsng3uHOfyQXnVmcCEawxWIPyCtxSoV6fCKYdAfJCQeE lBXE89inkdGmdb0KLmYkHDoV4L1deAsPUI/t6qZjwqF3pKcr8kdGExqHwvytL8n1KGbYPyJ6 Fn1z/idOOiTYgN+Q7FWRRX0QplyVpSBU4OnD0Gd3KkP+a0+kErokA1Lk3/YCE45VT8J88f4Y GbRsIkf0xW+Ei0fk3fl9VPOrbTD+gFv+AzbT+Gp1+kElwVKj0VzXy0OC6UIQJ3J1on0lArkc fPTIMcWxGmfGPw==
Organization: Meinberg Funkuhren, Bad Pyrmont, Germany
Message-ID: <2bce1bd7-b6b4-1839-d8a7-528cf7e82b30@meinberg.de>
Date: Mon, 27 Jan 2020 09:31:59 +0100
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1
MIME-Version: 1.0
In-Reply-To: <CANCZdfqNVGiOdZncUkJD5yAR8DvCBiWRnNZei=wU4tV+WW0f-Q@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
Content-Language: en-US
Content-Transfer-Encoding: 8bit
X-Virus-Scanned: clamav-milter 0.101.4 at server1a
X-Virus-Status: Clean
Archived-At: <https://mailarchive.ietf.org/arch/msg/ntp/pcgOJNDKVTVKjP5lzDHpVyYC6_U>
Subject: Re: [Ntp] Antw: Re: Leap second
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: Mon, 27 Jan 2020 08:32:37 -0000

Warner Losh wrote:
> On Fri, Jan 24, 2020 at 2:00 AM Ulrich Windl
> <Ulrich.Windl@rz.uni-regensburg.de
> <mailto:Ulrich.Windl@rz.uni-regensburg.de>> wrote:
> 
>     >>> Hal Murray <hmurray@megapathdsl.net
[...]
>     > I just looked at some code and found:
>     >                 if (leap_sec_in_progress) {
>     >                         /* always send "not sync" */
>     >                         xmt_leap = LEAP_NOTINSYNC;
>     >                 }
> 
>     I wonder whether this makes much sense. Probably easy to implement,
>     but maybe
>     the server just should not respond during the leap second.
>     Preferrable it
>     should just sent the "correct" response.

If the server didn't respond, the client could assume that the server if
offline. If it does respond, the client knows the server is alive, but
the result of this one packet exchange is ignored beause the server says
"don't use this one".

The original implementation of ntpd can easily cope with this and just
sends another request after the next polling interval. So this doesn't
hurt at all.

> And what, exactly, is the "correct" response? There's no unique encoding
> for the leap second as an ntp timestamp.
> 
> Maybe not responding is proper, since there will be a retry in a second
> or so.

Hm, retry after a second would be very bad. There have been
implementations which did that and were considered abusive. Just doing
another poll after the usual interval should be sufficient.

> But if there's any kind of skew between machines, a time exchange
> across a leap second is going to lead to a large error.

That's exactly the problem, and the reason why this has been implemented
quite some time  ago, as proposed by Miroslav Lichvar. IMO this is a
very good idea.

> Thankfully the
> error filter will filter that out, but still...

If the other filter entries at the client side have only small offset
values then even a single huge offset could mess up the filter output.
With this workaround the huge offset doesn't even make it into the
filter, preventing the filter output from being messed up.

Even if the server sends "unsynchronized" for about 3 seconds over a
leap second event, each well-behaved client will at most get one such
response, in case the end of his poll interval (which should be at least
64 s) falls into the 3 s interval around the leap second. Statistically,
most clients should not even notice that the server behaves this way
because the poll before the 3s interval and next time after that interval.


Martin
-- 
Martin Burnicki

Senior Software Engineer

MEINBERG Funkuhren GmbH & Co. KG
Email: martin.burnicki@meinberg.de
Phone: +49 5281 9309-414
Linkedin: https://www.linkedin.com/in/martinburnicki/

Lange Wand 9, 31812 Bad Pyrmont, Germany
Amtsgericht Hannover 17HRA 100322
Geschäftsführer/Managing Directors: Günter Meinberg, Werner Meinberg,
Andre Hartmann, Heiko Gerstung
Websites: https://www.meinberg.de  https://www.meinbergglobal.com
Training: https://www.meinberg.academy