[core] Relative times in responses, Age and Max-Age

Christian Amsüss <christian@amsuess.com> Mon, 09 August 2021 15:05 UTC

Return-Path: <christian@amsuess.com>
X-Original-To: core@ietfa.amsl.com
Delivered-To: core@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 48FC33A1713 for <core@ietfa.amsl.com>; Mon, 9 Aug 2021 08:05:23 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.9
X-Spam-Level:
X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham 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 1taWnb5H-YiT for <core@ietfa.amsl.com>; Mon, 9 Aug 2021 08:05:19 -0700 (PDT)
Received: from prometheus.amsuess.com (alt.prometheus.amsuess.com [IPv6:2a01:4f8:190:3064::3]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 653613A170D for <core@ietf.org>; Mon, 9 Aug 2021 08:05:18 -0700 (PDT)
Received: from poseidon-mailhub.amsuess.com (unknown [IPv6:2a02:b18:c13b:8010:a800:ff:fede:b1bd]) by prometheus.amsuess.com (Postfix) with ESMTPS id B8E5040108; Mon, 9 Aug 2021 17:05:12 +0200 (CEST)
Received: from poseidon-mailbox.amsuess.com (poseidon-mailbox.amsuess.com [IPv6:2a02:b18:c13b:8010:a800:ff:fede:b1bf]) by poseidon-mailhub.amsuess.com (Postfix) with ESMTP id 44FDBD0; Mon, 9 Aug 2021 17:05:11 +0200 (CEST)
Received: from hephaistos.amsuess.com (unknown [IPv6:2a02:b18:c13b:8010:2902:9110:3a00:3a1b]) by poseidon-mailbox.amsuess.com (Postfix) with ESMTPSA id F31E446; Mon, 9 Aug 2021 17:05:10 +0200 (CEST)
Received: (nullmailer pid 3892858 invoked by uid 1000); Mon, 09 Aug 2021 15:05:10 -0000
Date: Mon, 9 Aug 2021 17:05:10 +0200
From: Christian =?iso-8859-1?Q?Ams=FCss?= <christian@amsuess.com>
To: core@ietf.org
Message-ID: <YRFEJhUPuCa4uV/q@hephaistos.amsuess.com>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="6GV/ptg5pu1XCC1i"
Content-Disposition: inline
Archived-At: <https://mailarchive.ietf.org/arch/msg/core/CzRQTARwPgIwJN0s_kmlLRCNMKY>
Subject: [core] Relative times in responses, Age and Max-Age
X-BeenThere: core@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: "Constrained RESTful Environments \(CoRE\) Working Group list" <core.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/core>, <mailto:core-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/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: Mon, 09 Aug 2021 15:05:23 -0000

Hi,

discussing an upcoming draft Martine is composing on DNS-over-CoAP,
questions on relative times in CoAP responses came up.

Root of the issue is that on the application level, different parts of a
response can have different life times. At the same time, we want to use
CoAP proxy caches (ie. as long as *all* parts of the response are still
valid). Consequently, the client does not have the time of its request
as a reliable reference point for the times indicated in the response.
(Keeping in mind that we don't want to rely on some consensus time frame
-- there's no indication devices will know UNIX time).

We're currently floating two (largely equivalent) ideas:

* Transport all times relative to the first request. Set the Max-Age
  option to the smallest of the times involved. If the client sees a
  Max-Age less than the smallest payload time, it will subtract the
  difference from all times.

* Transport all times relative to the end of Max-Age. The client can add
  Max-Age to all times.

HTTP is using an Age header to be subtracted from all values, but a) I'd
rather not introduce a new option that all proxies would need to
support, and b) using Max-Age gives a compatible unilateral estimation
of the true value (a proxy reducing Max-Age doesn't hurt), whereas the
lack of an Age value could just as well mean that it was produced by a
proxy that doesn't know Age.

Is there any experience implementing things like this in CoRE? Best I
found was SenML's 'roughly "now"', which doesn't talk about
representation lifetimes.

Thanks
Christian

-- 
Yesterday is history, tomorrow is a mystery, and today is a gift. That
is why it is called the present.
  -- ancient saying