[dispatch] Fw: Re: Proposal for Per Resource Events Protocol

Rahul Gupta <cxres@protonmail.com> Wed, 09 August 2023 05:37 UTC

Return-Path: <cxres@protonmail.com>
X-Original-To: dispatch@ietfa.amsl.com
Delivered-To: dispatch@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 189C6C14CE51 for <dispatch@ietfa.amsl.com>; Tue, 8 Aug 2023 22:37:28 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.106
X-Spam-Level:
X-Spam-Status: No, score=-2.106 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, URIBL_BLOCKED=0.001, URIBL_DBL_BLOCKED_OPENDNS=0.001, URIBL_ZEN_BLOCKED_OPENDNS=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=protonmail.com
Received: from mail.ietf.org ([50.223.129.194]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id tzQ5w3BcHCYM for <dispatch@ietfa.amsl.com>; Tue, 8 Aug 2023 22:37:23 -0700 (PDT)
Received: from mail-4319.protonmail.ch (mail-4319.protonmail.ch [185.70.43.19]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 2842BC14CEFA for <dispatch@ietf.org>; Tue, 8 Aug 2023 22:37:23 -0700 (PDT)
Date: Wed, 09 Aug 2023 05:37:08 +0000
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1691559440; x=1691818640; bh=L2IlNgKj0uR8QRJz8xRtGlewalI8OCfkwBmRzHw84e8=; h=Date:To:From:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=c8900MnmcFBhfUsPV08vCY75ZCYqvbtU31dB6qqvwnhwq+6xdmYj0gu3tDiFWFx8R mYpCxAKl0mjBPDaEz9BIMqSYU3248YtyCkKbzmUUDJhmTJkvFckq9K5pW1g2eMZ3AF 4fAfOuCmL4fuSsCDQWV0yP4U3aeaLyPOdP995ksSCrMI2WRjmd3gO1U3I1ETbBmmQE h7eNSlmdemMFXEys1zTCpo3w0LIkBSuTkOYZZmA5EO/EHhN8kDbMIuKxdgJs8rBzZM XBg1nUE5RHJAZF1P18VPnMDCNpnPugC0CuIxV9KzoHLHHnQ+GpA2cg8PKDlDIHhumJ VPfJNI1q93HbA==
To: "dispatch@ietf.org" <dispatch@ietf.org>
From: Rahul Gupta <cxres@protonmail.com>
Message-ID: <u_TYoNdCrXxqLdpuUO9JYeZ-YwcsaCrsGvLwsNsyZcdnEU_Y9HSaNmX5L8MzAVp2bVzO_w4AJ_ApvClM4os3Jjk-qgWx5UXpewT_06oXqUQ=@protonmail.com>
In-Reply-To: <x3e2-5CGGB-joUNy5Ujq053jsdnYpxL4xKIndQDQU0nwsRh5gyFoIEyTeKKogm3HwmyGzJKzDHdzUF5wA7QsFGDnQFG99Ay7tCkYp6ZztXc=@protonmail.com>
References: <878ralz3o1.fsf@hobgoblin.ariadne.com> <x3e2-5CGGB-joUNy5Ujq053jsdnYpxL4xKIndQDQU0nwsRh5gyFoIEyTeKKogm3HwmyGzJKzDHdzUF5wA7QsFGDnQFG99Ay7tCkYp6ZztXc=@protonmail.com>
Feedback-ID: 919445:user:proton
MIME-Version: 1.0
Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg="pgp-sha256"; boundary="------cf006e7f954be30f7144cd9d15e36666e72f8ee3f081c65148dba4e0074d8a8d"; charset="utf-8"
Archived-At: <https://mailarchive.ietf.org/arch/msg/dispatch/CkdlZ5iwk-E1sGGCoUSx0R0STK0>
Subject: [dispatch] Fw: Re: Proposal for Per Resource Events Protocol
X-BeenThere: dispatch@ietf.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: DISPATCH Working Group Mail List <dispatch.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/dispatch>, <mailto:dispatch-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/dispatch/>
List-Post: <mailto:dispatch@ietf.org>
List-Help: <mailto:dispatch-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/dispatch>, <mailto:dispatch-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 09 Aug 2023 05:37:28 -0000

Dale,

Thank you for your interest and criticisms. Please see specific responses below.

------- Original Message -------
On Wednesday, August 9th, 2023 at 1:51 AM, worley@ariadne.com worley@ariadne.com wrote:

> 

> 

> > Some comments:
> 

> Rahul Gupta cxres=40protonmail.com@dmarc.ietf.org writes:
> 

> > I would like to propose Per Resource Events
> > https://cxres.github.io/per-resource-events/protocol as a protocol
> > for standardization at IETF.
> 

> Looking at that web page, I have to say I found it difficult to read.
> It provides endless detail, but doesn't provide a clear summary that the
> naive reader can read to grasp the big picture (and then fill in the
> details reading the rest of the text). Put something like your "How it
> works" at the top. Otherwise new readers will lose interest before
> learning enough to understand why the proposal is valuable.


I accept this criticism and will add a simple explanation of how it works somewhere near the top, soon.

While not an excuse, please bear with me as this is my first attempt. And I appreciate your comment, as I find reading standards similarly hard. It is sometimes unclear based on my how best to structure the document. I will try my best to make changes that the document is more approachable.

> > How it works
> > 

> > When using PREP, a user agent desiring notification simply sends a GET
> > request with an additional "Accept-Events" header.
> 

> Why not use a new method rather than overloading GET? For instance
> SUBSCRIBE is already used in SIP with approximately the semantics you
> want. Using a separate method would ensure that caches, etc. could
> treat subscription requests specially; by default, they wouldn't cache
> them at all.


GET is simpler as it is the default method for Fetch. There is already a precedent for changing the semantics of GET, for example, with the Range header (RFC9110, section 14.2) which already works well with caching.

I am not very aware of SIP. But I have never come across an instance of anyone implementing it for notifications of resource updates.

> > If the resource is capable of and allowed to send notifications, the
> > user agent receives these notifications as a multipart (RFC2046)
> > response on an open-ended HTTP stream (for a fixed period or until the
> > resource is deleted).
> 

> To add detail, "as an open-ended multipart response on an open-ended
> HTTP stream".
> 

> Interestingly, this ensures that the subscription is terminated if the
> subscriber fails, because the subscriber will no longer provide ACKs on
> the TCP connection.


As far as I understand, this is a limitation of any system using HTTP streaming response.

> However, it looks like you don't specify what the notifications (the
> body parts of the multipart) will look like. That may be intended or
> even necessary for this specification, but it means that every
> implementation for an object has to design what its notifications will
> look like. As Mnot says, that's a negative: "Intermediaries can't
> understand application-specific semantics, so they can't add much value
> to them without making some big assumptions."


The benefit of using multipart is that arbitrary messages formats for notifications can be used and these can be negotiated (unlike, say SSE). These formats as you righly point out cannot be to be mandated by the spec itself. Instead, these indeed need to be specified as mini-specifications (and I expect them to be standardized independently of the main spec). It is for this reason, I have indeed specified one such format for messages. Please see appendix A.

(Incidently, I used the pattern of RFC2046 itself as inspiration for this separation.)

> > Mark Nottingham correctly points out on his blog
> > https://www.mnot.net/blog/2022/02/20/websockets that HTTP based
> > pub/sub protocols have not fulfilled their potential due to
> > connections limits in HTTP/1.1 and head-of-line blocking in
> > HTTP/2.
> 

> OK, how does PREP avoid these problems? Given that is the first problem
> that Mnot lists about event subscriptions, it would seem that would be
> the key to getting PREP adopted. But my naive reading suggests that
> each active subscription occupies a single TCP connection.


Traditional mitigations (which are identical to SSE) are described in "Section 2.4 Known Limitations". However, there is no getting around these problems in that these are limitations of HTTP/1.1 and HTTP/2. In HTTP/2 the TCP connection are shared between subscriptions, but limited typically to 200-256 connections per domain. My proposal is that PREP be used with HTTP/2 and HTTP/3 but can provide backwards compatibility with HTTP/1.1 (with connections limits of 4-6 per domain as is typical for browsers today) in a pinch (with mitigations). Further, that I will propose a PREP-2 at a later time that drops this backwards compatibility in favour of taking advantage of HTTP/2 and/or HTTP/3 only features, circumnavigating these issues altogether. I believe that establishing backwards compatibility with HTTP/1.1 is unfortunately still necessary, despite the drawbacks!

> Dale


BR/Rahul