Re: [Ntp] comments on draft-mlichvar-ntp-ntpv5-03 / Message Format

Miroslav Lichvar <mlichvar@redhat.com> Thu, 25 November 2021 10:24 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 8B9ED3A0490 for <ntp@ietfa.amsl.com>; Thu, 25 Nov 2021 02:24:00 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.802
X-Spam-Level:
X-Spam-Status: No, score=-2.802 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.701, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_MSPIKE_H2=-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 ky_wfewHXOqE for <ntp@ietfa.amsl.com>; Thu, 25 Nov 2021 02:23:59 -0800 (PST)
Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.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 5BFA93A048D for <ntp@ietf.org>; Thu, 25 Nov 2021 02:23:59 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1637835837; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=dZMnk5/7qGsm2AFW7Xpr6W/sV2qKOP9YlIRScNuMQqQ=; b=Ad7aNEdwiyXzfeJAc3x2ZDrAq28uwP5JtpIRP65m2vYHmZhkHSTrzlCe3f0nmVS0xMOCkG BgjzvmLZaM7owtL/SFfC700jwRaGCx/Iiug14FOUrd5PedKGWFo9TjlscwyIlGeRNFZ05x FxxxOxp4MkSMhBdHVoNaM1C+ufPVJKk=
Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-272-5ENNUbZiMwCxGGSn_H8HhQ-1; Thu, 25 Nov 2021 05:23:56 -0500
X-MC-Unique: 5ENNUbZiMwCxGGSn_H8HhQ-1
Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id ABF0A1927802 for <ntp@ietf.org>; Thu, 25 Nov 2021 10:23:54 +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 321195D9C0 for <ntp@ietf.org>; Thu, 25 Nov 2021 10:23:53 +0000 (UTC)
Date: Thu, 25 Nov 2021 11:23:52 +0100
From: Miroslav Lichvar <mlichvar@redhat.com>
To: ntp@ietf.org
Message-ID: <YZ9kOFozQAauHNKG@localhost>
References: <20211124223810.Horde.KKjrsykVQUMJgW4WVO5ZZmt@mail.drown.org> <f423daea-93f4-4dd8-9ee6-d654e8e566db@nwtime.org>
MIME-Version: 1.0
In-Reply-To: <f423daea-93f4-4dd8-9ee6-d654e8e566db@nwtime.org>
X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14
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/9KfRZ2Gk2Sy9freUPcVw5_Rkv8I>
Subject: Re: [Ntp] comments on draft-mlichvar-ntp-ntpv5-03 / Message Format
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: Thu, 25 Nov 2021 10:24:01 -0000

On Wed, Nov 24, 2021 at 09:33:07PM -0800, Harlan Stenn wrote:
> This is what happens when the choice is made to ignore the design of NTP
> packet version "evolution".
> 
> The original design is that the packet format to the length of a version N
> packet is ALWAYS the same.  This is why ntpd will respond to a "higher"
> version number packet with the requested newer version but with a packet
> length of the responding ntpd's version.

If NTP was intended to evolve in such a way, why wasn't the expected
server behavior specified in the NTP RFCs? RFC 5905 makes it quite clear
that packets using higher version number should be ignored.

>From 9.2:
  Format checks require correct field length and alignment, acceptable
  version number (1-4), and correct extension field syntax, if present.

>From A.5.1:
	if (r->version > VERSION /* or format error */)
		return;                 /* format error */

> If a v4 NTP packet is 48 bytes, the design and expectation has been that if
> v5 wants any different data then the packet is made longer and the new data
> lives AFTER the v4 data.

That might make sense if NTP packets had a constant length. But with
extension fields and MACs I don't see how could it work. The NTPv4
server wouldn't know how long is the NTPv5 header and where an
extension field starts.

> Assume, for purposes of this thread, that an NTPv5 packet format is now 64
> bytes.
> 
> Should a v5 client send a request to a v4 server, the v5 client sends a
> 64-byte v5 request, and assuming the v4 server responds, it will do so with
> a 48-byte v5 response that is effectively a v4 response packet. The client
> will see this, note that the packet is short, and be in a position to
> understand that the target server is a v4 server, not a v5 server.

The vast majority of existing servers doesn't respond with a 48-octet
packet to a 64-octet v5 request.

> Should a v4 client send a request to a v5 server, the v5 server should
> respond with a 48-byte v4 response.

If the server supported NTPv4, that would be expected. If it supported
NTPv5 only, it shouldn't respond.

-- 
Miroslav Lichvar