Re: [secdir] Secdir review of draft-ietf-ippm-6man-pdm-option-05 : TimeBase

Tero Kivinen <kivinen@iki.fi> Tue, 18 October 2016 13:07 UTC

Return-Path: <kivinen@iki.fi>
X-Original-To: secdir@ietfa.amsl.com
Delivered-To: secdir@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id ECA5612963A; Tue, 18 Oct 2016 06:07:25 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.121
X-Spam-Level:
X-Spam-Status: No, score=-1.121 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, SPF_NEUTRAL=0.779] autolearn=no autolearn_force=no
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 UmE_9oL-oo7O; Tue, 18 Oct 2016 06:07:20 -0700 (PDT)
Received: from mail.kivinen.iki.fi (fireball.acr.fi [83.145.195.1]) (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 7CE54127076; Tue, 18 Oct 2016 06:07:20 -0700 (PDT)
Received: from fireball.acr.fi (localhost [127.0.0.1]) by mail.kivinen.iki.fi (8.15.2/8.15.2) with ESMTPS id u9ID7HlB019333 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 18 Oct 2016 16:07:17 +0300 (EEST)
Received: (from kivinen@localhost) by fireball.acr.fi (8.15.2/8.14.8/Submit) id u9ID7GvM020990; Tue, 18 Oct 2016 16:07:16 +0300 (EEST)
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
Message-ID: <22534.7812.168714.893576@fireball.acr.fi>
Date: Tue, 18 Oct 2016 16:07:16 +0300
From: Tero Kivinen <kivinen@iki.fi>
To: <nalini.elkins@insidethestack.com>
In-Reply-To: <1393336949.1646912.1476748706209@mail.yahoo.com>
References: <22495.62038.771947.984586@fireball.acr.fi> <1264225155.363685.1474644268281@mail.yahoo.com> <22507.60901.665544.878052@fireball.acr.fi> <1130739157.4563724.1475509147203@mail.yahoo.com> <22523.36827.869306.70163@fireball.acr.fi> <1393336949.1646912.1476748706209@mail.yahoo.com>
X-Mailer: VM 8.2.0b under 24.5.1 (x86_64--netbsd)
X-Edit-Time: 27 min
X-Total-Time: 108 min
Archived-At: <https://mailarchive.ietf.org/arch/msg/secdir/UEyfv1uspGoIad10xfqYr_G0fOs>
Cc: "iesg@ietf.org" <iesg@ietf.org>, "draft-ietf-ippm-6man-pdm-option.all@tools.ietf.org" <draft-ietf-ippm-6man-pdm-option.all@tools.ietf.org>, "secdir@ietf.org" <secdir@ietf.org>
Subject: Re: [secdir] Secdir review of draft-ietf-ippm-6man-pdm-option-05 : TimeBase
X-BeenThere: secdir@ietf.org
X-Mailman-Version: 2.1.17
Precedence: list
List-Id: Security Area Directorate <secdir.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/secdir>, <mailto:secdir-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/secdir/>
List-Post: <mailto:secdir@ietf.org>
List-Help: <mailto:secdir-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/secdir>, <mailto:secdir-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 18 Oct 2016 13:07:26 -0000

nalini.elkins@insidethestack.com writes:
> >The time base is so that one does not have to be committed to picoseconds / 
> >milliseconds, etc.    Even in your example, I believe you used "unit" or time 
> >base.  Our thinking was that we wanted future proof so as to be able to 
> >handle very small values and very large (as may be needed for DTN, for 
> >example).   We can see if we can express years in picoseconds and see 
> >what happens.   Then, the unit would always be picoseconds 
> 
> The issue is with the hardware. When we were first researching the
> "proper" or "best" time unit in which the PDM time differentials
> should be measured, we found that different CPU hardware measure
> time very differently. Some CPUs are still measuring time in
> milliseconds and using multiple clocks to do it.

Yep, but the problem is that if the implementation still need to be
able to cope with other devices using different time bases, this does
not help. 

> Our plan was to have a CPU specify the time differential in its
> native time units, to reduce its processing time when communicating
> with another device that is at the same level. One could say that
> the most logical solution is to use the time signature of the
> slowest device, so that all the time-adjustment calculations are
> performed on the device most capable of handling them quickly, and
> similarly, requiring the slowest device to adjust to the timing used
> by the fastest device would be forcing those calculations onto the
> device least capable of handling them quickly. Further, why make two
> devices that use the same clock unit to change to a different time
> scale on both ends of the conversation? If both use microseconds,
> why not let them specify their time differential in microseconds?

The problem is that some implementations measure time in 0.01 seconds
(10 ms), some implementations have timers which go up 60 times per
second, then there are implementations which have free running counter
running that full clock speed (or some fraction of clock speed or some
other very fast value, but not necessarely ms, µs, ns or ps).

So even if you have 4 time bases, there are lots of implementations
which need to convert their clock to something that is suitable for
the wireformat.

If we do not have time base, i.e. everything uses some common timebase
then you always need to do it, but on the other hand it is simple, as
there is no selection whether you should be using ms, µs, ns or ps are
your time base.

Having the 2^scale factor to the numbers will take care of being able
to represent any time value there, having two different ways of doing
scaling (both 2^scale factor and the time base) will just complicate
things. 

> That's the reasoning that we had about the timebase.
> 
> Of course, we are open to discussion. 

I think it would be simplier to just have one fixed timebase, and it
might even be better to take the timebase so it is so small, that we
do not need negative exponents for scale, like attoseconds.

Attoseconds (10^-18) is so short that light can travel only 0.3 nm in
one attosecond, so that should be enough for PDM (until we get new way
of making transistors, and start measure latencies between
transistors).

If your clock is running milliseconds, you need to multiply the time
in ms with 0.88818 ((1000/1024)^5) to get time in attoseconds with
scale of 50. For microseconds the multiplier is 0.90949 with scale of
40, nanoseconds 0.93132 with scale of 30, picoseconds 0.95367 with
scale of 20, and femtoseconds 0.97656 with scale of 10.
-- 
kivinen@iki.fi