Re: [Ntp] NTP over PTP

Miroslav Lichvar <mlichvar@redhat.com> Tue, 29 June 2021 09:39 UTC

Return-Path: <mlichvar@redhat.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 9402B3A2D21 for <ntp@ietfa.amsl.com>; Tue, 29 Jun 2021 02:39:47 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.996
X-Spam-Level:
X-Spam-Status: No, score=-2.996 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.198, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=redhat.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 XMNLtIK5cHKn for <ntp@ietfa.amsl.com>; Tue, 29 Jun 2021 02:39:45 -0700 (PDT)
Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id DC6DC3A2D1E for <ntp@ietf.org>; Tue, 29 Jun 2021 02:39:44 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1624959583; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=LBwoiISz6FCuvpqslPkBRzygWHj9SwXEh4/gzcVTsVY=; b=ilgD2e0VDDiBTrlKOnriX497DNmvyD6ZqMDnyHphq4U3PlDoYf0W7olV7gMFTpv5shnMVP /i4jjfCZq81ExpQ3piG76BI6lUPnQWqA+i9Bs1x6mI8FbnipDsjyxBVOi+xPvuJu1Ap5Sn cjyOm7fY1FZZWuzMRdQ+YfPfBtuNhT0=
Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-327-YzaPe-FuNUSttZGo_5DxLw-1; Tue, 29 Jun 2021 05:39:42 -0400
X-MC-Unique: YzaPe-FuNUSttZGo_5DxLw-1
Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 07FC11019983; Tue, 29 Jun 2021 09:39:41 +0000 (UTC)
Received: from localhost (holly.tpb.lab.eng.brq.redhat.com [10.43.134.11]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 50D025C1D1; Tue, 29 Jun 2021 09:39:40 +0000 (UTC)
Date: Tue, 29 Jun 2021 11:39:38 +0200
From: Miroslav Lichvar <mlichvar@redhat.com>
To: Heiko Gerstung <heiko.gerstung@meinberg.de>
Cc: "ntp@ietf.org" <ntp@ietf.org>
Message-ID: <YNrqWjHPtC7ToAL8@localhost>
References: <YNRtXhduDjU4/0T9@localhost> <36AAC858-BFED-40CE-A7F7-8C49C7E6782C@meinberg.de> <YNnSj8eXSyJ89Hwv@localhost> <D32FAF20-F529-496C-B673-354C0D60A5AF@meinberg.de> <YNrDGy2M2hpLz9zc@localhost> <C5D99A22-84B8-4D27-BE74-D8267FB1DCB0@meinberg.de>
MIME-Version: 1.0
In-Reply-To: <C5D99A22-84B8-4D27-BE74-D8267FB1DCB0@meinberg.de>
X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16
Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=mlichvar@redhat.com
X-Mimecast-Spam-Score: 0
X-Mimecast-Originator: redhat.com
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
Archived-At: <https://mailarchive.ietf.org/arch/msg/ntp/PlFLs7pbyzOTgAY6ZQxoCO4aE8o>
Subject: Re: [Ntp] NTP over PTP
X-BeenThere: ntp@ietf.org
X-Mailman-Version: 2.1.29
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: Tue, 29 Jun 2021 09:39:48 -0000

On Tue, Jun 29, 2021 at 09:15:22AM +0200, Heiko Gerstung wrote:
> > On Mon, Jun 28, 2021 at 05:02:43PM +0200, Heiko Gerstung wrote:
> >> > The unicast mode seems to be intended for networks with partial
> >> > on-path hardware support, where requirements on accuracy are less
> >> > strict, and I think this might already be better supported by NTP.
> >> They might be less strict but that does not mean they are worse/equal
> >> compared to NTP.
> > 
> > How so?
> Because of the removal of jitter/delay variation in the network stack and OS layer (kernel) of the server and the client. 

That jitter/delay has no impact on PTP or NTP measurements when using
hardware timestamping. Even with software timestamps they can be
eliminated if the timestamp can be captured in the network driver
right before passing the packet to hardware, as most drivers on Linux
can do.

> > You said unicast transparent clocks don't really exist. That would be
> > the only advantage of unicast PTP. Boundary clocks could fully support
> > hardware-timestamped NTP if someone was actually interested in
> > implementing that.
> I was wrong, or better: my knowledge was outdated. Arista for example supports unicast in their switches now.

Ok, I could extend the NTP-over-PTP draft to take advantage of that
if the support is expected to spread.

> > Without full on-path support NTP should generally perform better than
> > PTP as it doesn't assume network has a constant delay.
> Why do you think PTP assumes a constant network delay? PTP is measuring the delay constantly in both directions and calculates the round trip.

Yes, it does, but it is separate from the offset calculation.

The calculation is described in section 11.2 of 1588-2019. It uses
<meanDelay> and there is only the TX and RX timestamp of the sync
message like in the NTP broadcast mode. If the distribution of the
actual delay is not symmetric, as is common without full on-path
support, the average error of the measurements will not even get close
to zero. PTP relies on full hardware support. Without that, it
generally cannot perform as well as NTP.

Another issue with using PTP in network without PTP support is RX
timestamping fixed to the beginning of the message. If the server is
on a 1Gb/s link and the PTP client is on a faster link, there will be
an asymmetry of hundreds of nanoseconds due to the asymmetric delay
in forwarding of messages between different link speeds.

> > In the context of the drafts we are discussing here, I think it might
> > be easier for an existing PTP implementation to add support for
> > NTP+NTS than add NTS4UPTP.
> 
> We are maintaining three different PTP implementations here at Meinberg and I can tell you that this is not true. 

I don't know what implementations are those, but at least for the
well-known open-source implementations I think it would be.

> I did not say that hardware is not timestamping PTP event messages that carry a TLV. I just pointed out that some of the hardware timestampers might look at the length of a packet and do not timestamp anything that is longer then X bytes. A sync message is 44 bytes plus maybe 26 bytes for the AUTENTICATION_TLV.  If you remove the requirement for the AUTHENTICATION_TLV because you want to run NTS over PTP, your PTP "header" is 44 bytes + 48 bytes for the NTP header + anything that NTS adds (Unique Identifier EF, NTS Authentication and Encrypted Extension Fields EF, at least one NTS Cookie EF). It is a bit complicated (for me) to calculate the total maximum size of such an NTS over PTP packet, but I am guessing that you will end up with more than 128 bytes, which might be a limit packet matching algorithms have for quickly identifying if this can be a PTP event message. 

Ok, so it's not about the message having a fixed length, but a maximum
length. That looks like a very odd quirk. Do you have a specific
example of such a hardware?

-- 
Miroslav Lichvar