Re: [core] Date option in draft-shelby-core-coap-01

"Angelo P. Castellani" <angelo@castellani.net> Fri, 28 May 2010 13:51 UTC

Return-Path: <angelo.castellani@gmail.com>
X-Original-To: core@core3.amsl.com
Delivered-To: core@core3.amsl.com
Received: from localhost (localhost [127.0.0.1]) by core3.amsl.com (Postfix) with ESMTP id 3B3FC3A6959 for <core@core3.amsl.com>; Fri, 28 May 2010 06:51:39 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: 1.218
X-Spam-Level: *
X-Spam-Status: No, score=1.218 tagged_above=-999 required=5 tests=[AWL=0.595, BAYES_50=0.001, FM_FORGED_GMAIL=0.622]
Received: from mail.ietf.org ([64.170.98.32]) by localhost (core3.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id GtYbHl1R9act for <core@core3.amsl.com>; Fri, 28 May 2010 06:51:38 -0700 (PDT)
Received: from mail-gw0-f44.google.com (mail-gw0-f44.google.com [74.125.83.44]) by core3.amsl.com (Postfix) with ESMTP id D17023A68AB for <core@ietf.org>; Fri, 28 May 2010 06:51:37 -0700 (PDT)
Received: by gwj19 with SMTP id 19so948659gwj.31 for <core@ietf.org>; Fri, 28 May 2010 06:51:25 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=tkjHFovuDW8H2DmeXIv7nXpqucO1MjEA2r3jifLYOxc=; b=XzxmfQArIgaCWa+4h97JGw9XHAzqB+LnrbhgYrlqyAr2QruFvW99LJx3666hSaQVUD tlitcnItR3dL0lvz57UgATfbFW4nNS/GcJCv25r+nI5CWP95/Nm5ZVZSy9wtkf1IUvq1 PQBIIztndlMEbjw+UFV7J8w5JsdXT2Tt23Pl0=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=F7RuzlcS1qUujEvdnFFYKoZbkVg9QZnP5tDVh2CGYKLCsl5Ia6lI5unZG0JaY6BsRC rYEKLko1XkKpwHMpXjH6uHhv2oawNB7ZPFy9wBC1z59C/rVA8sVqzv3ypj3djsVx/Q55 y2eyHFtRby4ggfJ6iMXoyqtAWJE7mY4ETwDQY=
MIME-Version: 1.0
Received: by 10.91.14.8 with SMTP id r8mr763472agi.60.1275052789591; Fri, 28 May 2010 06:19:49 -0700 (PDT)
Sender: angelo.castellani@gmail.com
Received: by 10.90.26.2 with HTTP; Fri, 28 May 2010 06:19:49 -0700 (PDT)
In-Reply-To: <0924B0BC-BFA7-40E5-8ED9-1AF27533F401@cisco.com>
References: <AANLkTinkPwS1mr-0PXi_gNcnDbSDBPWqdwpR0Fg8taO2@mail.gmail.com> <0924B0BC-BFA7-40E5-8ED9-1AF27533F401@cisco.com>
Date: Fri, 28 May 2010 15:19:49 +0200
X-Google-Sender-Auth: j8J8ZFAZPrq66KhLrNHv5RVTBHE
Message-ID: <AANLkTik7W_C9jvMkpjJPwbqBuV9MLkhBsYG625QMQ46a@mail.gmail.com>
From: "Angelo P. Castellani" <angelo@castellani.net>
To: Cullen Jennings <fluffy@cisco.com>
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: quoted-printable
Cc: core <core@ietf.org>
Subject: Re: [core] Date option in draft-shelby-core-coap-01
X-BeenThere: core@ietf.org
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: "Constrained RESTful Environments \(CoRE\) Working Group list" <core.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/listinfo/core>, <mailto:core-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/core>
List-Post: <mailto:core@ietf.org>
List-Help: <mailto:core-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/core>, <mailto:core-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 28 May 2010 13:51:39 -0000

Cullen,

I agree with you about relative times in CoAP.

Under the assumption that message delay is smaller of the required
accuracy, using a flag we can distinguish between absolute time and
relative time.

In my opinion POSIX format for absolute time is good (we can also
represent events in the past, useful?), relative time can be
represented with a signed integer of a similar size.

Best,
Angelo

On Thu, May 27, 2010 at 05:05, Cullen Jennings <fluffy@cisco.com> wrote:
>
> Peter,
>
> These are all excellent points and I think I (not Zach) am partial to blame for the current text... I just pointed him towards some cut and pasted text from some other RFC - I figured we needed something in the draft as a starting point to get this conversation going. Dealing with time is always complicated and even more so in this constrained environment. If we start by looking at our constraints, I suspect we come to the conclusions you suggested below.
>
> My guess is that if we asked everyone, most people would say that we could not require a COAP node to do any of the following. Some nodes might do these but it would not be required
>
> 1) run NTP
> 2) have a table of when leap seconds were going to happened and way to keep that table up to date
> 3) have a time source was more accurate than a simple non temperature compensated crystal
> 4) have any clue about timezones
>
> I really have no idea how some of these devices are even going to set their time when they first get turned on other than perhaps looking at the time of some other node.
>
> All this leads me to wonder if we could get away with only having relative times in CoAP.
>
> On May 13, 2010, at 8:35 AM, Peter Bigot wrote:
>
>> Section 3.3.6 introduces a Date option that can be used to timestamp a measurement.  The description specifies that leap seconds are excluded.  It's not crystal clear to me what "excluded" means in this situation.  I don't see any discussion in the list archive.
>>
>> Pretending leap seconds don't exist (one sense of exclude) makes sense as it trivializes the translation between POSIX- time representations (seconds since 1970-01-01T00:00:00Z) and UTC-aligned wall clock times that people normally deal with: this becomes simple division and modulus operations with a little hassle imposed by leap years.  On the other hand, the representation can express times that do not exist (23:59:59 when a negative leap second takes effect), and can be ambiguous (23:59:60 or a repeated 23:59:59 when a positive leap second takes effect).  More importantly, simple subtraction of two event times does not necessarily result in the duration of the event.
>>
>> For an in-development system to which CoAP could apply, my recommendation was to use times expressed as atomic seconds since the POSIX epoch (thereby excluding leap second adjustments from the value).  This does mean that translation to civil time requires knowledge of the number of leap seconds in effect at that time (currently UTC is 24 seconds behind TAI relative to the POSIX epoch).  In return, devices that maintain an internal clock used to timestamp events do not need to be updated to take into account leap second adjustments, which can take a fair amount of code and support infrastructure to handle a very rare event.  It also trivializes calculation of event durations, even when the duration spans application of a leap second.
>>
>> My feeling is that any software component that needs to translate between between device time and civil time can be expected to account for leap seconds, while those that are operating in a constrained environment would best be isolated from their effects.  Note that GPS time is similarly measured in atomic seconds since an epoch (1980-01-06T00:00:00Z).
>>
>> So, do Date values in the proposed COAP match what you get from running "date +%s" on a Linux system synchronized to UTC, or are they that value plus 24?  I read the draft as specifying the latter, which is my preference, but anticipate great confusion from people who haven't had to deal with leap seconds before.
>>
>> Recommend changing "number of seconds, excluding leap seconds, after" to "number of (atomic) seconds since".
>
> I suspect that using a EPOCH of 2010 instead of 1970 would reduce the bits we need and also, more importantly, encourage people not to confuse these times with "date +%s"  times.
>
>>
>> Peter
>> _______________________________________________
>> core mailing list
>> core@ietf.org
>> https://www.ietf.org/mailman/listinfo/core
>
>
> Cullen Jennings
> For corporate legal information go to:
> http://www.cisco.com/web/about/doing_business/legal/cri/index.html
>
>
>
> _______________________________________________
> core mailing list
> core@ietf.org
> https://www.ietf.org/mailman/listinfo/core
>