Re: [Ntp] Drafts on interleaved modes and correction field

Tal Mizrahi <tal.mizrahi.phd@gmail.com> Thu, 09 November 2017 13:11 UTC

Return-Path: <tal.mizrahi.phd@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 91FE01242F5 for <ntp@ietfa.amsl.com>; Thu, 9 Nov 2017 05:11:55 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.699
X-Spam-Level:
X-Spam-Status: No, score=-2.699 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-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 6Eo_WujxyDLh for <ntp@ietfa.amsl.com>; Thu, 9 Nov 2017 05:11:48 -0800 (PST)
Received: from mail-oi0-x232.google.com (mail-oi0-x232.google.com [IPv6:2607:f8b0:4003:c06::232]) (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 2CFF6124234 for <ntp@ietf.org>; Thu, 9 Nov 2017 05:11:48 -0800 (PST)
Received: by mail-oi0-x232.google.com with SMTP id g125so4339915oib.12 for <ntp@ietf.org>; Thu, 09 Nov 2017 05:11:48 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=xwBKTcuB96De7HU/XvMmrHg1fYG/r6+/JGLbk/CRQZ4=; b=juzVG6nWmNFzvva5fvk5TnpqvVjw2vk0CJw4Ocy6Z7maKX/sGwWtprfSHajzjR0cWN SbQHSrq/sqcKA9wIjpaBoAl9V4DacjoNalI/rOhcKns67J+6Vq9YFLe48Pz4+sLrW2Vt kVkxpn1VvR6wbm75YG54OQzMgzpxLK5opolbPQlMWazVQ59m1WDPBsSAGV/RfIecQIaG LeOR3f4StWxvlSjKjAWPMQvuoRjLsZmIGEpgUI1G/B0xiRdFYcC1BrvQ5xNvP86/mFzl K9BLOKpLn/O9ZF0BDH71b9sNzkretvJ46+VyFNhSv5lAmj4MpXxHYanz5fpqqsHtNbiK H9KA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=xwBKTcuB96De7HU/XvMmrHg1fYG/r6+/JGLbk/CRQZ4=; b=RqAMgv+GbU3G8gWz9QASgoih7gU+CLR38hqZySNe6x0F9dFfyK8Avl6MYwQcABHEv+ /SSIQgRkI+W+COBgyJTfEO/ilI4Qr5SINwALhqMMv3N9O66I0inO5tj7qUpjr/MLIR0+ 5uajF6kFJlakIflRAcCtY+An4lvHbrgvBhPjt+NXBrnyxmX4wMEAST1eqK5JYSoKVUkX aj5sjpJfgMDCDP+hLluUGB5HRb6andu2wJYnogSGZ645pcQanhZpJoFISKNJjygilA7b wUIKWQ8oT+3qFFGv7IhwM7wTRUx3FeiYTr/D1ogl4r+aox65eSiQHmm8Gs9bAf2DCdpR ZA5w==
X-Gm-Message-State: AJaThX6y/FX8TKDbk+JgMI0GfMz/QVtb5SAwJBJH16BvGW4idfZRoV73 nbxYEk1nNmqnrtUlG9I5cJy+ftYvI3frwh36URM=
X-Google-Smtp-Source: AGs4zMbW8B6qzc2y8UVLzPaNDXUZfL78yB8mUejZGc7hYO8otu4RL6q/SvXpycFb7Qfxbr8sNFitY+y5eVBtK7A3Pb0=
X-Received: by 10.202.232.8 with SMTP id f8mr259777oih.186.1510233107345; Thu, 09 Nov 2017 05:11:47 -0800 (PST)
MIME-Version: 1.0
Received: by 10.168.25.194 with HTTP; Thu, 9 Nov 2017 05:11:46 -0800 (PST)
In-Reply-To: <20171109093851.GA17365@localhost>
References: <20171031090139.GD15597@localhost> <CABUE3XmV1sUvq0KAJVrQv1sZ8vK6R8GwR+qeO1huTUgnOdujfQ@mail.gmail.com> <20171031135247.GB7648@localhost> <CABUE3X=pDEL9mcfoTGJw3PbwzHKnDTddr7Aqk71PyEBY77kzSw@mail.gmail.com> <20171031155717.GC7648@localhost> <CABUE3Xmz0YQ4OoDtE2SB-zimsA5yY32M1j3qotv_si4_OiqyHw@mail.gmail.com> <CABUE3XmHAgdowNV7ibfCMA0QGc6L6H=zA4=DZjgXaY8f04Cz5w@mail.gmail.com> <20171106123644.GA16738@localhost> <CABUE3XkCkWoDyJ8cWHJCCjbpoEnt5bJ1JnmuQKseg++oz0BkhQ@mail.gmail.com> <20171109093851.GA17365@localhost>
From: Tal Mizrahi <tal.mizrahi.phd@gmail.com>
Date: Thu, 09 Nov 2017 15:11:46 +0200
Message-ID: <CABUE3X=rPPHeSS7EG9S8Ls26X1RkdOmPwTnmrO9YA+57uVkzKA@mail.gmail.com>
To: Miroslav Lichvar <mlichvar@redhat.com>
Cc: ntp@ietf.org, Aanchal Malhotra <aanchal4@bu.edu>
Content-Type: multipart/alternative; boundary="001a1140828ee435be055d8c8b2f"
Archived-At: <https://mailarchive.ietf.org/arch/msg/ntp/YwwibI3vomuAgP0JZp1SYpf1unE>
Subject: Re: [Ntp] Drafts on interleaved modes and correction field
X-BeenThere: ntp@ietf.org
X-Mailman-Version: 2.1.22
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: Thu, 09 Nov 2017 13:11:55 -0000

Hi Miroslav,

Very nice example.
It clarifies your point.

I believe the inconsistency you raised here could be resolved if both the
client and server would measure all timestamps as the time-of-the-first-bit
(both reception and transmission).
If that would be the case, then (using your example):

Client TX timestamp = X
Switch (client->server) correction field = 1500
Server RX timestamp = X+1700

Server TX timestamp = Y
Switch (server->client) correction field = 11000
Client RX timestamp = Y+11200

In this case the client would compute the delay on both directions to be
200 nanoseconds, as desired.
Again this all works only if the client / server use the first bit as the
reference for both TX and RX timestamps.

Cheers,
Tal.


On Thu, Nov 9, 2017 at 11:38 AM, Miroslav Lichvar <mlichvar@redhat.com>
wrote:

> On Wed, Nov 08, 2017 at 07:32:07PM +0200, Tal Mizrahi wrote:
> > >If a switch cut through from a faster link to a slower link, it would
> > >know the length of the packet and could calculate the (negative)
> > >correction before the correction field was transmitted, right?
> >
> > Hmmm... So the switch would have to evaluate the packet length based on
> the
> > Length field in the UDP header, and use that in the correction field
> > computation.
>
> Good point. Using the UDP length field should be simpler and give the
> switch more time to calculate the correction than waiting for the
> end of the received frame.
>
> > It would be significantly easier to implement a correction field
> > computation based on first-bit-in-to-first-bit-out.
>
> I understand that. The question is if it's worth the incompatibility
> that it would create.
>
> > I may be missing something here, but I would argue that if we
> consistently
> > compute the correction based on first-bit-in-to-first-bit-out, the packet
> > transmission times on both directions would cancel out, and would not
> > affect the symmetry of the computation.
>
> Yes, but only if the client, server and all switches with different
> link speeds between them used the beginning of the reception too.
>
> The clients and servers would have to switch between two modes of
> timestamping. One for networks where the correction fields is not
> supported and one for networks where all switches (with different link
> speeds) support it. It's all or nothing.
>
> On the other hand, a correction field based on the end of the
> reception is compatible with timestamping used by existing clients and
> servers, and a gradual replacement of switches in the network does not
> create an asymmetry.
>
> > Can you provide an example in which this hypothesis is wrong?
>
> Ok, let's say there is a server on 100 Mbit link, a client on a 1000
> Mbit link, and a single switch (store-and-forward) between them. The
> propagation delay is 100 nanoseconds on both links and the switch has
> a constant asymmetric delay of 500/1000 nanoseconds. The client sends
> a 1000 bit frame at time X and the server responds with a frame of the
> same length at Y. All timestamping is perfectly accurate.
>
> The intervals of the receptions and transmissions are:
>
> client TX: [X, X+1000]
> switch RX: [X+100, X+1100]
> switch TX: [X+1600, X+11600]
> server RX: [X+1700, X+11700]
> server TX: [Y, Y+10000]
> switch RX: [Y+100, Y+10100]
> switch TX: [Y+11100, Y+12100]
> client RX: [Y+11200, Y+12200]
>
> If the correction field was ignored, the delays of the request and
> response would be 11700 and 12200 nanoseconds respectively. The
> calculated offset would have an error of 250 nanoseconds.
>
> If the switch calculated the corrections from the beginning of the
> receptions, the delays would be 10200 and 1200 nanoseconds. The error
> in the offset would be 4500 nanoseconds.
>
> If the switch calculated the corrections from the end of the
> reception, the delays would be 11200 and 11200 nanoseconds. The offset
> would have no error.
>
> This shows that the switch has to timestamp the same point of the
> frame as the server and client. Otherwise, the correction field may
> actually increase the error in the measured offset.
>
> --
> Miroslav Lichvar
>