[dispatch] Proposal for Per Resource Events Protocol

Rahul Gupta <cxres@protonmail.com> Mon, 07 August 2023 02:33 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 7CC22C14CE53 for <dispatch@ietfa.amsl.com>; Sun, 6 Aug 2023 19:33:43 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.104
X-Spam-Level:
X-Spam-Status: No, score=-2.104 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, HTML_MESSAGE=0.001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, 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 mCH-PQmWFogK for <dispatch@ietfa.amsl.com>; Sun, 6 Aug 2023 19:33:39 -0700 (PDT)
Received: from mail-4324.protonmail.ch (mail-4324.protonmail.ch [185.70.43.24]) (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 113A9C14CE38 for <dispatch@ietf.org>; Sun, 6 Aug 2023 19:33:39 -0700 (PDT)
Date: Mon, 07 Aug 2023 02:33:31 +0000
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1691375616; x=1691634816; bh=8+l19F5dPZr79uykZiTWkp04g/vCEjxytjycqQrNpF8=; h=Date:To:From:Subject:Message-ID:Feedback-ID:From:To:Cc:Date: Subject:Reply-To:Feedback-ID:Message-ID:BIMI-Selector; b=bFOurNNicvRVWwELBMLIQ3KGSCIfF+GbIcPFvOORujWsDCQF6TTTVNf1OSNmT2Cwf VwrIA/Pshi87DydS1azIvtiXq+DNPKYv01Duyp1V7KB5G2ftAMe9oecpMgKuhDDtY+ DMg/YdMbhpgcseIoAX0qf0NrhoHRga3z0Cc10TXR7+Zv3cejbqhLcw30S2/9FXg0a8 2kBws5y/OCmNj/cuNi5rMhGRnomvlQhtct7l3zvWbQYyX0+Jd9tWnKuaIB7f6k/SFX qRjZT1cISP3Qyn3DErydj+tyqzMh3wbIqoJu6wwO05IK1IT7NsVvvMp1NoCYJGIKmD pr/vAa4xC8eAQ==
To: "dispatch@ietf.org" <dispatch@ietf.org>
From: Rahul Gupta <cxres@protonmail.com>
Message-ID: <XtZDvT7rzZOaluCfsSU0Zi0wA6cu_bmORZds9PMYOdE8Z9MRq7ViNpQzgyaOsQkjPd5nOOEvtWHlkG9wv3n4rjXcTX9BKqRHtTCqTUB_nO4=@protonmail.com>
Feedback-ID: 919445:user:proton
MIME-Version: 1.0
Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg="pgp-sha256"; boundary="------6b857d6cf1480fe60915049be3da0f018cbb649e368f64c9ee42f0068020c3b3"; charset="utf-8"
Archived-At: <https://mailarchive.ietf.org/arch/msg/dispatch/NEwWX2WtKqhHfE9nmrJMlCdBD8k>
Subject: [dispatch] 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: Mon, 07 Aug 2023 02:33:43 -0000

To the IETF Dispatch WG,
I would like to propose Per Resource Events <https://cxres.github.io/per-resource-events/protocol> as a protocol for standardization at IETF. The Per Resource Events Protocol (PREP), as the names suggests, allows a server to add notification capability to any resource to provide updates about its own representation changes.

Caveats

+ Since this work arose from my work at a W3C Community Group, the specification currently is a W3C format. I shall convert it to an RFC format if IETF will consider this proposal.

+ While I have motivated the design of the protocol in the specification document, I shall repeat some of it here to keep this message self-contained.

+ Also, this is my first proposal at IETF and first time I am officially proposing a specification to any standards body, so I apologize in advance if I have not addressed the expected considerations.


Background

This specification has come about as an offshoot of my contribution as a co-author on the Solid Notification Protocol (SNP) <https:/github.com/solid/notifications> which is part of the Solid Project.

The Solid (Social Linked Data) is a web decentralization project led by Tim Berners-Lee which aims to allow users to keep control over their own data by (amongst other things) storing data in Personal Online Data Store (PODS). Solid Notification Protocol (SNP) is intended to add notification capabilities to Solid PODS over multiple messaging protocols (WebSockets, WebHooks, HTTP Streaming etc), though SNP is universal in that it can be used by any HTTP server to provide notifications.

Per Resource Events, similarly, is intended to add Notification capabilities to Solid PODS though again can be used by any HTTP server. PREP is a much simpler protocol built only using HTTP intended to make notifications significantly easier to implement and scale in most common scenarios.


Motivation

The Per Resource Event Protocol is predicated on a HTTP resource being the most intuitive source for notifications about its own updates.

This is unlike other notification protocols (e.g. WebSockets, WebSub, HTTP Push, SSE etc) that require additional resources to be specifically dedicated as endpoints for delivering notifications. Servers that provide updates are forced to maintain these additional endpoints and process changes to subject resources to dispatch as events. Clients that consume these updates have to discover these end points and then co-ordinate changes between the endpoint and (typically multiple) resources of interest.

By instead giving every resource the ability to send notifications when it updates, the Per Resource Event Protocol aims to reduce the complexity of both servers and clients implementing notifications; thus, making it easier for developers to build and maintain real-time applications.



How it works

When using PREP, a user agent desiring notification simply sends a GET request with an additional "Accept-Events" header.
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).



Interest

While there are no implementations of PREP yet, there has already been a publicly expressed interest in implementing it by a commercial Solid PODS vendor (I have uploaded the first draft on GitHub only in late June). There have also been a couple of private queries for implementing for client applications, including one by a Solid “Creator”.



Limitations

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. The current proposal is intended to establish backwards compatibility for notifications sent per resource. It is my intention to subsequently introduce PREP-2 (maybe PREP-3) that that advantage of HTTP/2 and HTTP/3 (but are not backwards compatible with HTTP/1.1) to provide more efficient notifications sans the aforementioned limitations. This consideration is already reflected in the current proposal; for example, the "Accept-Events" header is designed to be generic and can be used to negotiate the protocol used for notifications.




Thank you for your kind consideration,


Yours truly,
Rahul