Re: [core] ETag vs. Block Identifier

Jon Shallow <supjps-ietf@jpshallow.com> Thu, 11 June 2020 11:03 UTC

Return-Path: <supjps-ietf@jpshallow.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 008063A1804; Thu, 11 Jun 2020 04:03:20 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.899
X-Spam-Level:
X-Spam-Status: No, score=-1.899 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=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 a6bcEF_ekANf; Thu, 11 Jun 2020 04:03:17 -0700 (PDT)
Received: from mail.jpshallow.com (mail.jpshallow.com [217.40.240.153]) (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 C5B123A179E; Thu, 11 Jun 2020 04:03:16 -0700 (PDT)
Received: from mail2.jpshallow.com ([192.168.0.3] helo=N01332) by mail.jpshallow.com with esmtp (Exim 4.92.3) (envelope-from <jon.shallow@jpshallow.com>) id 1jjKzE-0002gR-DV; Thu, 11 Jun 2020 12:03:08 +0100
From: Jon Shallow <supjps-ietf@jpshallow.com>
To: 'Christian Amsüss' <christian@amsuess.com>, mohamed.boucadair@orange.com, cabo@tzi.org, core@ietf.org, draft-bosh-core-new-block@ietf.org
References: <29244_1591858421_5EE1D4F5_29244_364_1_787AE7BB302AE849A7480A190F8B9330314DC153@OPEXCAUBMA2.corporate.adroot.infra.ftgroup> <20200611073439.GA2002284@hephaistos.amsuess.com>
In-Reply-To: <20200611073439.GA2002284@hephaistos.amsuess.com>
Date: Thu, 11 Jun 2020 12:02:52 +0100
Message-ID: <125b01d63fdf$da314fd0$8e93ef70$@jpshallow.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
X-Mailer: Microsoft Outlook 14.0
Content-Language: en-gb
Thread-Index: AQIMlGpzU/YOqWJr8QIcuM8qQ0HMnAKs2Wm2qFEqbWA=
Archived-At: <https://mailarchive.ietf.org/arch/msg/core/2mcuvukl0XtUMN4z26TTbKwAahU>
Subject: Re: [core] ETag vs. Block Identifier
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: Thu, 11 Jun 2020 11:03:20 -0000

Hi Christian,

This approach (Etag: replacing BID) makes good sense to me and cannot think
of any corner case issues where it would fail. For Block4 Etag: is mandatory
(RFC7959 is a SHOULD) in the response.

I think that we need to suggest how the Etag: is generated - while a
checksum or hash should not be the same for two different versions of the
data for a resource it is possible that there may be a clash.  My
recommendation would be that for Block4, it has an initial random value and
then is incremented for each new body.  In order to prevent Etag: wraparound
happening too quickly on busy servers sending back many bodies for many
resources, the Etag: updating should be on a per resource change basis.

We will update the draft appropriately.

Regards

Jon

> -----Original Message-----
> From: Christian Amsüss [mailto: christian@amsuess.com]
> Sent: 11 June 2020 08:35
> To: mohamed.boucadair@orange.com
> Cc: Carsten Bormann (cabo@tzi.org); core@ietf.org; draft-bosh-core-new-
> block@ietf.org
> Subject: Re: ETag vs. Block Identifier
> 
> Hello Med,
> 
> On Thu, Jun 11, 2020 at 06:53:40AM +0000,
> mohamed.boucadair@orange.com wrote:
> > It was suggested during yesterday's meeting that ETag can be used to
> > achieve what BID is intended for in draft-bosh-core-new-block (block4
> > case). We still don't see how that would work given that only a 2.03
> > will be sent as per Section 5.10.6.2 of RFC7252.
> >
> > Can you please clarify how a missing block can be sent back as a
> > response to a GET+ETag?
> 
> By simply not including the ETag in the request (as that would, as you
point
> out, indicate to the server that the client just needs confirmation that
this
> block is still (2.03) Valid).
> 
> I think this is best illustrated by reusing the new-block-02 example
figure 5
> and 6 (where the B4 option is written without an MID, and the values are
> used in the ETag instead):
> 
>            CoAP        CoAP
>           Client      Server
>             |          |
>             +--------->| NON GET /path M:0x01 T:0xf0 O:0 B4:0/0/1024
>             |<---------+ NON 2.05 M:0xf1 T:0xf0 O:1234 ETag:21 B4:0/1/1024
>             |<---------+ NON 2.05 M:0xf2 T:0xf0 O:1234 ETag:21 B4:1/1/1024
>             |<---------+ NON 2.05 M:0xf3 T:0xf0 O:1234 ETag:21 B4:2/1/1024
>             |<---------+ NON 2.05 M:0xf4 T:0xf0 O:1234 ETag:21 B4:3/0/1024
>                  ...
>               [[Observe triggered]]
>             |<---------+ NON 2.05 M:0xf5 T:0xf0 O:1235 ETag:22 B4:0/1/1024
>             |<---------+ NON 2.05 M:0xf6 T:0xf0 O:1235 ETag:22 B4:1/1/1024
>             |<---------+ NON 2.05 M:0xf7 T:0xf0 O:1235 ETag:22 B4:2/1/1024
>             |<---------+ NON 2.05 M:0xf8 T:0xf0 O:1235 ETag:22 B4:3/0/1024
>                 ...
> 
> 
>            CoAP        CoAP
>           Client      Server
>             |          |
>                 ...
>                [[Observe triggered]]
>             |<---------+ NON 2.05 M:0xf9 T:0xf0 O:1236 ETag:23 B4:0/1/1024
>             |     X<---+ NON 2.05 M:0xfa T:0xf0 O:1236 ETag:23 B4:1/1/1024
>             |     X<---+ NON 2.05 M:0xfb T:0xf0 O:1236 ETag:23 B4:2/1/1024
>             |<---------+ NON 2.05 M:0xfc T:0xf0 O:1236 ETag:23 B4:3/0/1024
>             |          |
>          [[Client realises blocks are missing and asks for the missing
>               ones in one go. The client does not give any indication of
>               which "version" it is missing a block -- it will always be
>               assumed it's the latest one.]]
>             +--------->| NON GET /path M:0x02 T:0xf1 B4:1/0/1024\
>             |          |                             B4:2/0/1024
>             |     X<---+ NON 2.05 M:0xfd T:0xf1 ETag:23 B4:1/1/1024
>             |<---------+ NON 2.05 M:0xfe T:0xf1 ETag:23 B4:2/1/1024
>             |          |
>          [[Get final missing block]]
>             +--------->| NON GET /path M:0x03 T:0xf2 B4:1/0/1024
>             |<---------+ NON 2.05 M:0xff T:0xf2 ETag:23 B4:1/1/1024
>                 ...
> 
> When, during the transfer of missing blocks, the server does change the
> representation and mints a new ETag, then the blocks of the older
> representation are not accessible any more. This is consistent with the
rest
> of Observe behavior (once a new state is there, clients can only get the
new
> state and the old is lost to everyone who didn't fully get it), and allows
> constrained server implementations (as the server is under no obligation
to
> keep old representations around).
> 
> Kind regards
> Christian
> 
> --
> The detailed semantics of CoAP methods are "almost, but not entirely
> unlike" [HHGTTG] those of HTTP methods.
> [HHGTTG]: Adams, D., "The Hitchhiker's Guide to the Galaxy", October 1979.
>   -- Shelby, et al., Internet-Draft Constrained Application Protocol
(CoAP)