Re: [core] Sketch of "Keep it simple" / "Never reified union types"

Jim Schaad <ietf@augustcellars.com> Mon, 11 March 2019 15:52 UTC

Return-Path: <ietf@augustcellars.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 A56041310ED for <core@ietfa.amsl.com>; Mon, 11 Mar 2019 08:52: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, RCVD_IN_DNSWL_NONE=-0.0001, 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 OwGErdKow9m6 for <core@ietfa.amsl.com>; Mon, 11 Mar 2019 08:52:19 -0700 (PDT)
Received: from mail2.augustcellars.com (augustcellars.com [50.45.239.150]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 0E27E13110E for <core@ietf.org>; Mon, 11 Mar 2019 08:51:56 -0700 (PDT)
Received: from Jude (73.180.8.170) by mail2.augustcellars.com (192.168.0.56) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Mon, 11 Mar 2019 08:51:48 -0700
From: Jim Schaad <ietf@augustcellars.com>
To: 'Michael Koster' <michaeljohnkoster@gmail.com>, 'Christian Amsüss' <christian@amsuess.com>
CC: 'core WG' <core@ietf.org>, 'Jaime Jiménez' <jaimejim@gmail.com>
References: <20190308134459.GA7720@hephaistos.amsuess.com> <162F3D30-6DF8-4A73-A018-94CD511EB2F1@gmail.com>
In-Reply-To: <162F3D30-6DF8-4A73-A018-94CD511EB2F1@gmail.com>
Date: Mon, 11 Mar 2019 08:51:46 -0700
Message-ID: <03ce01d4d822$56cb9fe0$0462dfa0$@augustcellars.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
X-Mailer: Microsoft Outlook 16.0
Thread-Index: AQKtCI43Gmbmyv63u6747dLwvrof5gHGbCZBpEf/oTA=
Content-Language: en-us
X-Originating-IP: [73.180.8.170]
Archived-At: <https://mailarchive.ietf.org/arch/msg/core/F7OudvIO6VOBXlUcFopECMmb5LA>
Subject: Re: [core] Sketch of "Keep it simple" / "Never reified union types"
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, 11 Mar 2019 15:52:24 -0000

Michael,

It is not clear to me below if a published data item is going to have an age value or not.  I would expect that they should but the minimum age would be 0.  At that point the age on the data item stays at 0, but the item is not removed from the subscription.

Jim


> -----Original Message-----
> From: core <core-bounces@ietf.org> On Behalf Of Michael Koster
> Sent: Monday, March 11, 2019 8:23 AM
> To: Christian Amsüss <christian@amsuess.com>
> Cc: core WG <core@ietf.org>; Jaime Jiménez <jaimejim@gmail.com>
> Subject: Re: [core] Sketch of "Keep it simple" / "Never reified union types"
> 
> Hi Christian (and CoRE),
> 
> In the spirit of handling "empty topic" case in the application layer, as we
> discussed, I propose to have the publisher be responsible to publish
> "nothing-here-to-see" as a topic's initial value if it has no initial value in the
> more meaningful content format.
> 
> (Keeping in mind that, as defined, CoAP pub/sub only handles
> representations, and is not strictly a proxy for resource state, therefore
> should not be responsible for generating default representations in any
> particular content format, except the required link-format in the case of
> create-on-publish).
> 
> The pub-sub behavior would be to reply to READ/SUBSCRIBE only when
> something has been published. The topic creator is thus responsible to
> "promptly" publish nothing-here-to-see upon topic creation. Otherwise the
> broker simply acks any READ/SUBSCRIBE request and waits to send a
> response until something is published.
> 
> The broker might be allowed to ack and queue subscribe (observe) requests
> that come in before something is published.
> 
> When a topic's max-age expires, the broker returns 4.xx; there would be no
> separate data lifetime. Publish operations reset the topic lifetime and could
> change the topic's lifetime by including max-age in the PUBLISH request.
> 
> This way, the Accept-Any option and the nothing-here-to-see content
> formats may be defined in separate independent drafts, and the multipart
> format may be used with its potential accept-subformat options.
> 
> This is how I interpreted the result of the discussion on Thursday where we
> decided to keep the pub/sub draft simple. WIll this work?
> 
> Best regards,
> 
> MIchael
> 
> > On Mar 8, 2019, at 5:45 AM, Christian Amsüss <christian@amsuess.com>
> wrote:
> >
> > (interim follow-up)
> > Reply-To:
> >
> > Hello CoRE,
> >
> > following up on the last interim, I've sketched up what I understood
> > the keep-it-simple solution to the pubsum problem of allowing empty
> > topics could look like.
> >
> > Most of the text below deals with how proxies would handle it, the
> > actual client and server behaviors should be indeed simple and
> > straightforward.
> >
> > Best regards
> > Christian
> >
> >
> > The Accept-Any-Of option
> > ========================
> >
> > A new option Accept-Any-Of is defined. It is critical (I don't fully
> > see why but follow Accept here), safe-to-foward and part of the cache key.
> > Its format is uint up to 2 long (indicating content types), it is
> > Class E in OSCORE, usable in requests only, and repeatable
> >
> > (Repeatability is the only aspect in which it differs from Accept in
> > terms of option properties).
> >
> > Its values indicate a list of acceptable representations in order of
> > decreasing preference. A server MUST answer with the first format it
> > can represent the requested state in, or 4.06 (Not Acceptable) if it
> > could answer successfully but the response would not match any of the
> > option values.
> >
> > Proxy behavior
> > --------------
> >
> > A proxy MAY serve a cached representation to a request with a
> > different sequence of Accept-Any-Of options, provided the second
> > request has an Accept value of the cached representation, or all the
> > content formats that precede the available content format in the
> > second request's Accept-Any-Of options also preceded the available
> > representation in an earlier (fresh) request's list.
> >
> > When a request that carries Accept-Any-Of is answered 4.06 (or with
> > any but the first format requested by Accept-Any-Of), a proxy SHOULD [
> > we can't have a MUST here w/o making it non-safe-to-forward, but I
> > think it's sufficient ] invalidate all known representations in any of
> > the requested formats (or the formats preceeding the returned one,
> > respectively).
> >
> >
> > Update to RFC7641
> > =================
> >
> > The requirement that subsequent notifications carry the same
> > Content-Format option as the original response is lifted.
> >
> > Impact
> > ------
> >
> > Changes to the returned media type can either happen when
> >
> > * Accept-Any-Of was sent in the request -- in which case both server
> > and  client know the updated rules, or
> > * no Accept header was sent -- in which case the server whose
> > representation changes to require a new content format has no clear
> > way of indicating that under RFC7641 (ending with 4.06 Not Acceptable
> > would be close but isn't the expected response to a repeated request);
> > if the server changes the content format in a notification to an
> > unaware client, the client would catch it as a bad response (probably
> > similar to a response with a Content-Format not matching the sent
> > Accept). The client might consider the observation over while the
> > server does not, and will terminate the observation with a RST on the
> > next notification (or close the connection in TCP).
> >
> > Impact on proxies: A proxy that enforces the previous rule on
> > Content-Format staying constant would close observations (probably
> > with something like 5.02 Bad Gateway), and the client would need to
> > re-establish. No proxy implementations are known that implement that
> > behavior. [ But I know only one so this would definitely need to be
> > confirmed on the mailing list ].
> >
> > [ I don't think that this has any actual interactions with the caching
> > model, as the caching considerations are independent of the content
> > format. ]
> >
> >
> > Usage in pubsub
> > ===============
> >
> > Topics that were created but do not have any publication are
> > represented in the application/nothing-here-to-see (or
> > application/null? either TBD) type.
> >
> > The PUBLISH operation would probably not need to accept
> > nothing-here-to-see, at leat create-on-publish can't do that as there
> > is no type to set on the topic with such an initial publication.
> >
> > Requests to the topic with an Accept option of the topic's type will
> > return 4.06 Not Acceptable both in observations (subscription) and
> > plain get requests (read). The subscribe (and possibly read) operation
> > therefore will not use the Accept header, but Accept-Any-Of with
> > nothing-here-to-see and the topic's designate type, in that sequence.
> > Thus, a proxy may serve a nothing-here-to-see as long as it is fresh
> > (as it always could), but it sees a notification carrying the actual
> > type, that evicts the nothing-here-to-see from its cache.
> > (Conversely, if a topic goes to nothing-here-to-see, that will not
> > clear out any cached-but-still-fresh value from the cache. As long as
> > publishers are not allowed to explicitly send nothing-here-to-see,
> > this will not happen, because topics only enter nothing-here-to-see
> > when their content expires, at which time all its caches expire as
> > well. The broker might not even send the nothing-here-to-see in a
> > notification [ ? ].)
> >
> >
> > --
> > This may seem a bit weird, but that's okay, because it is weird.
> >  -- perldata(1) about perl variables
> > _______________________________________________
> > core mailing list
> > core@ietf.org
> > https://www.ietf.org/mailman/listinfo/core
> 
> _______________________________________________
> core mailing list
> core@ietf.org
> https://www.ietf.org/mailman/listinfo/core