Re: [Ntp] A simpler way to secure PTP

Daniel Franke <> Sun, 09 May 2021 01:11 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id AF4583A0BF0 for <>; Sat, 8 May 2021 18:11:16 -0700 (PDT)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -0.196
X-Spam-Status: No, score=-0.196 tagged_above=-999 required=5 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: (amavisd-new); dkim=pass (2048-bit key)
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id UprzVhWAa7_I for <>; Sat, 8 May 2021 18:11:12 -0700 (PDT)
Received: from ( [IPv6:2607:f8b0:4864:20::52e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by (Postfix) with ESMTPS id ED5593A0BEE for <>; Sat, 8 May 2021 18:11:06 -0700 (PDT)
Received: by with SMTP id m37so10781067pgb.8 for <>; Sat, 08 May 2021 18:11:06 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ol8Sh9QisSjxWf9z+mGEtpa/5fWJMkZzXH2AtIYQN44=; b=ekPs5rzsL2TgNtRmh7P8RccAlul1Cq0LLTMmdxsmzVRzTMAeIo5sRd3XdB7alTp3+E cR5IAA5YOf2CpMmkLplY3KKZ+pjQWdz03UNNIpYonZ0szb+ScMgeSSJ9LfebKoRfiMPI e/dakpp31nqEcn6rnZXn6KF3jSdi2CYL+gn/9lcF6HEDZvURIv9wOtZfufZWO2XrLO11 9dAhzkIxq/V7/wH7wGtei4Lfh4pZyiJZMpfBXJauKtmmQb/u+wfZ035vDAmfKb3FalaN FWmLCuGVUWIzaxZJxYEJmMikRLDIquRErIWHhm01BUdM8ZrkNRmt42eYjMWiActQfXlI qZZw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ol8Sh9QisSjxWf9z+mGEtpa/5fWJMkZzXH2AtIYQN44=; b=TJW2wx0dgXwLy8zWO/uD+4H4se5Ipr7l5X/BAq2L0X0qG8fleVn1zVPP98VmgWvktN WP6Zc/KexoO3tCZEJfSFbAyBBIHL4dy4kOUoJNUuz+QkGirRrFkCMFCweI+f7o5jl+pF Pu8c5jOPhCRjiS65VCEmJdFD89jVE7vOLxQoUkqN9DnOsc6BOLdUiN1fysIPFByJC92a vZXom+mo+RVforHBUl6n3+iPeoYi/eECrcVcIpzfLCiEjfMXSI2hVAUj5//XT4C4qj3H zKZOyVxqZtA0LZi1X1Su7GyPt5CqV/A8zeu9FCNHOF/fz7eH+F3VHEDmoEXq28bL3/Ss 9Ibw==
X-Gm-Message-State: AOAM531oa4OzSiRBDW+kO+JgilXZHThbBVb+4izK0BQHKuHSotm7EDe/ jWR3PJzX3bKruC0MDAnHto765K2WvEl3T7rE/M4=
X-Google-Smtp-Source: ABdhPJycNr0PMHuuqkLG+FNrekrLQ6M+2dLjXwz48brS755HrGmAczH7ianw7V5AyozWaKlOmI2BbhI5ZtTmH2uLro0=
X-Received: by 2002:aa7:82ce:0:b029:242:deb4:9442 with SMTP id f14-20020aa782ce0000b0290242deb49442mr18406695pfn.73.1620522665362; Sat, 08 May 2021 18:11:05 -0700 (PDT)
MIME-Version: 1.0
References: <> <>
In-Reply-To: <>
From: Daniel Franke <>
Date: Sat, 8 May 2021 21:10:54 -0400
Message-ID: <>
To: Martin Langer <>
Cc: NTP WG <>
Content-Type: multipart/alternative; boundary="000000000000d1ca5605c1db55f4"
Archived-At: <>
Subject: Re: [Ntp] A simpler way to secure PTP
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: <>
List-Unsubscribe: <>, <>
List-Archive: <>
List-Post: <>
List-Help: <>
List-Subscribe: <>, <>
X-List-Received-Date: Sun, 09 May 2021 01:11:17 -0000

This sort of denial-of-service attack is outside the scope of what NTS is
meant to prevent. More potent attacks are already possible at protocol
layers lower than anything we can control. You can DoS your local network
segment with ARP poisoning, and of course if you control any router on the
communication path then you can just drop the traffic altogether. If an
*off-path* adversary can DoS you just through blind packet spoofing then
that's more troubling, but on the sort of closed networks that PTP is
designed for, I think this can always be satisfactorily mitigated by the
reverse-path filtering that most routers do automatically and by default.
(If a random box on the other side of the Internet can spoof your PTP
grandmaster's IP address and that spoofed packet can make it all the way to
your endpoint systems rather than getting dropped at your firewall, fix
your network). The guarantee that my design is intended to provide is that
no attacker, not even one with a privileged network position, can
manipulate your clock outside the narrow bounds that NTS-secured NTP
establishes. I don't think the attacks you're describing violate that.

On Sat, May 8, 2021 at 7:30 PM Langer, Martin <>

> Hello Daniel,
> That's an interesting thought and reminds me of a similar approach that
> Kristof and I had
> for securing TESLA for NTP. But I think the problem goes a bit deeper.
> least for PTP
> unicast. As far as I know, connections could be "reactivated" or cancelled
> by replay attacks.
> Possibly other attacks could also be carried out by packet manipulation.
> ...but I need to
> think this through further. ;)
> have a nice day
> -martin-
> -------------------
> Martin Langer, M.Eng.
> Ostfalia Hochschule für angewandte Wissenschaften
> - Hochschule Braunschweig/Wolfenbüttel
> University of Applied Sciences
> Labor Datentechnik, Labor Design Digitaler Systeme
> Fakultät Elektrotechnik
> Salzdahlumer Straße 46/48
> 38302 Wolfenbüttel
> Germany
> Tel.: +49 5331 939 43370
> Web:
> ------------------------------
> *Von:* ntp <> im Auftrag von Daniel Franke <
> *Gesendet:* Samstag, 8. Mai 2021 22:53:06
> *An:* NTP WG
> *Betreff:* [Ntp] A simpler way to secure PTP
> As an alternative to Martin's and Heiko's drafts, I'd like to propose a
> simpler approach to securing PTP. It is compatible with all PTP features,
> supports the same threat model as NTS-secured NTP, introduces zero jitter,
> and can be implemented entirely on the client side without the knowledge or
> cooperation of the rest of the PTP infrastructure.
> The trick is: run NTS-secured NTP and regular, unauthenticated PTP
> side-by-side. Do not use the NTP responses to set the clock; instead, use
> them only to establish maximum error bounds on the current time, and then
> clamp all PTP messages to within those bounds.
> The client's on-wire interaction with the NTP server is the same as it is
> in normal NTS-secured NTP, but the way it processes the server's responses
> is different. The client maintains an estimate `theta` of the offset
> between a local, unadjusted monotonic clock `t_raw` (implemented e.g. by
> CLOCK_MONOTONIC_RAW on linux) and the server's realtime clock, along with a
> continuously-changing error term `lamdba`.
> Upon receiving an authentic response from an NTP server, let:
>   t_1 = origin timestamp captured from t_raw.
>   t_2 = packet receive timestamp
>   t_3 = packet transmit timestamp
>   t_4 = destination timestamp captured from t_raw.
>   theta = ((t_2 - t_1) + (t_3 - t_4))/2
>   DTAI = TAI - UTC offset
> giving a current estimated TAI time of
>   t_raw + theta + DTAI
> For computing error bounds, let
>   hrtt = (t_4 - t_1)/2
>   rdel = packet root delay
>   r_1 = local clock precision
>   r_2 = packet clock precision
>   PHI = some appropriate upper bound on our local clock's drift rate
> and then our error term is plus-or-minus
>   hrtt + rdel/2 + r_1 + r_2 + PHI*(t_raw - t_1)
> Only the single best clock sample, from a given NTP server, i.e. the one
> that gives the tightest error bounds, need be retained. Other things being
> equal, newer samples will be preferable to older ones because the
> PHI*(t_raw - t_1) term will be smaller, but sometimes this may be negated
> by other terms such as hrtt being larger.
> A client may gain resiliency by using multiple NTS-secured NTP servers. In
> this case for N servers it lets f=floor((N-1)/2), then discards the f
> lowest lower bounds and the f highest upper bounds, and then treats
> anything inside any of the remaining bounds as plausible.
> Any PTP message whose time (after applying the usual link-delay
> correction) is plausible according to these bounds is processed as usual.
> Any PTP message whose time is not plausible is first clamped to the nearest
> bound and then processed as usual.
> And that's all there is to it!