CLOSE_STREAM redundancies

Martin Thomson <mt@lowentropy.net> Tue, 04 July 2023 06:40 UTC

Return-Path: <mt@lowentropy.net>
X-Original-To: quic@ietfa.amsl.com
Delivered-To: quic@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 4FB05C14CF1C for <quic@ietfa.amsl.com>; Mon, 3 Jul 2023 23:40:13 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.097
X-Spam-Level:
X-Spam-Status: No, score=-2.097 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, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_PASS=-0.001, 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=lowentropy.net header.b="VUONc3Yq"; dkim=pass (2048-bit key) header.d=messagingengine.com header.b="FhumtGBk"
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 szje0K-iybO2 for <quic@ietfa.amsl.com>; Mon, 3 Jul 2023 23:40:07 -0700 (PDT)
Received: from wout2-smtp.messagingengine.com (wout2-smtp.messagingengine.com [64.147.123.25]) (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 C385DC14CF1B for <quic@ietf.org>; Mon, 3 Jul 2023 23:40:07 -0700 (PDT)
Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.west.internal (Postfix) with ESMTP id 9C49E3200A99 for <quic@ietf.org>; Tue, 4 Jul 2023 02:40:01 -0400 (EDT)
Received: from imap41 ([10.202.2.91]) by compute6.internal (MEProxy); Tue, 04 Jul 2023 02:40:01 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lowentropy.net; h=cc:content-type:content-type:date:date:from:from:in-reply-to :message-id:mime-version:reply-to:sender:subject:subject:to:to; s=fm3; t=1688452801; x=1688539201; bh=fq/RdNzjHQ0OYwgLudg1I+ebG 5hJIts2mVgtFVfXEAQ=; b=VUONc3YqxM+368+w0aA9rm1QACHt+RjYZYmWgjwzX 3CSdm+kC2n57PfIlRlK8gEt2Hkn4PUi/DfSm2W9JJKlACCwm0mJksE8MeZA3iii8 3M1jlahPysARooLro6keSuewb3bxP6XkQURWombWD0wwSKkiQ56guDs29OOVB8g0 lel95ot8WbC1+Tb1B7SfCRI99Gd1PTIoKtp353mTzZ0n2+osCfmaL04apD9Hgsw6 6cngAYMhtqQekAirSzZRsGAzUy5DrXbrh//llvxHiPekf+2yjxaxlApYhlDkOeHw 6XUZCEK8Xz7mkIPA2xGkmbGJPR8F/2JQYsBqCrM6gFSCw==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:message-id :mime-version:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t= 1688452801; x=1688539201; bh=fq/RdNzjHQ0OYwgLudg1I+ebG5hJIts2mVg tFVfXEAQ=; b=FhumtGBki6SSRCo1JtwfuFxpQ0ydjiTu8TJ8LTpU6IdQu6t1GUp rNKxK+OWqpr33jeYMwSkPwXCsB8xJVdty7Aept1OoYpdCeFJkh/9Tw4i62UViaH7 q4KFOoSgLtRowsQAA+MuiFshGIeA5LfSgHoGtkesodnxseoF/Zs9sQHIIK4zRMz8 SAtepD44dYEP5x9OFvanzO5oi+00m/cGYzpdKT4BLb9RncQ3lgOisdPZ5GxGBh3F C+AsQS25ZvIj3o9bwKJhrhB7ZceExa+3tXQVmtfGJOXek1IFEf7/m4eVsbJe+Hno Bd5aXZVOQrw0fzkQkVo522BkVovtPA1N4Tw==
X-ME-Sender: <xms:wL6jZI9Ydr40ZeHqd2j2HaHGy9kZ1ZuWAsIjRUrGZczQaK09lgnvIg> <xme:wL6jZAtLvlnqeG1WFiRwIrxGtk_Vl22kZarxv_NMMlbbA5EhqAcM8uZHqoAuKiklm s0V_8YQ83zCipEp0Uo>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrudefgddutdelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefofgggkfffhffvufgtsehttdertd erredtnecuhfhrohhmpedfofgrrhhtihhnucfvhhhomhhsohhnfdcuoehmtheslhhofigv nhhtrhhophihrdhnvghtqeenucggtffrrghtthgvrhhnpeegueehueejvdeiveffhedvke egffekgffgtdetleefkeeffedtjefhtdduvddutdenucffohhmrghinhepghhithhhuhgs rdgtohhmnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomh epmhhtsehlohifvghnthhrohhphidrnhgvth
X-ME-Proxy: <xmx:wb6jZOAt9twYd9-bHLDrLb8pVcFkp3grRRm5zpGci0_nIZnu3BrXHw> <xmx:wb6jZIc0bBFxkcBtZnwPFvqgWmunD4sgVgbyQQXUUF6jmQcrPeDBlA> <xmx:wb6jZNNr-1wbqf70n88MYo3FmCdecuJkSd-RXcsuz8VTWSnXqnVcVg> <xmx:wb6jZDamPTiwAzDHOxNmvvTD94c8amZCxCqijFmdXGLwLIkq4nLnyg>
Feedback-ID: ic129442d:Fastmail
Received: by mailuser.nyi.internal (Postfix, from userid 501) id E1B8C234007B; Tue, 4 Jul 2023 02:40:00 -0400 (EDT)
X-Mailer: MessagingEngine.com Webmail Interface
User-Agent: Cyrus-JMAP/3.9.0-alpha0-527-gee7b8d90aa-fm-20230629.001-gee7b8d90
Mime-Version: 1.0
Message-Id: <e527a444-5eb7-463e-b8b7-e260683cdbda@betaapp.fastmail.com>
Date: Tue, 04 Jul 2023 16:39:40 +1000
From: Martin Thomson <mt@lowentropy.net>
To: quic@ietf.org
Subject: CLOSE_STREAM redundancies
Content-Type: text/plain
Archived-At: <https://mailarchive.ietf.org/arch/msg/quic/s52bVK1HRS6RvWwL2HNd4j96UwA>
X-BeenThere: quic@ietf.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: Main mailing list of the IETF QUIC working group <quic.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/quic>, <mailto:quic-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/quic/>
List-Post: <mailto:quic@ietf.org>
List-Help: <mailto:quic-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/quic>, <mailto:quic-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 04 Jul 2023 06:40:13 -0000

draft-ietf-quic-reliable-stream-reset-01 includes a change to make the Application Protocol Error Code field optional.

I don't think that this is a necessary change.  There are essentially three cases for stream termination that this draft attempts to unify:

1. No data kept.  RESET_STREAM covers this.
2. Some data is kept.  This is the new functionality.
3. All data is kept.  STREAM with the FIN bit covers this already.

The draft rightly observes that the new frame with a retained limit of 0 is exactly equivalent to RESET_STREAM.  That's redundant, but I see no real harm in it other than the waste implied by sending the new frame type instead.  Changing this new frame so that a 0 could not be encoded would not save much, but it would make the frame processing more error prone.

Where things get interesting are those cases where there is no error.  The new version of the draft proposes that abandonment of a stream without delivering all of the (maybe promised) content is not necessarily an error condition.

That's a rather maximal design, covering the above options 1 and 2 in cases where there is no error (and case 3 where all data is delivered, but an error occurs anyway).  I don't see any way in which this is worth using a high-value codepoint for.  Yes, applications might consider a reduction in stream length as a useful tool, but - if they do - supplying an error code for use in signaling that is not a terrible thing.

Probably the most difficult aspect of this change is the API that would be implied by the use of non-error versions of the new frame.  An application would receive bytes up to (or maybe exceeding) the reliable length, but no error signal - no indication that the bytes were truncated.  I can easily imagine how that would lead to security problems in applications that were unprepared for the possibility.  

On the other hand, allowing the bytes to be delivered before generating an error signal is a fairly easy way to signal truncation, without losing those bytes.  In other words, the only safe option is to ensure that an error signal is always generated when anything less than an entire stream is delivered.

Cheers,
Martin

(Separately, this is the sort of change that really benefits from on-list discussion.  I couldn't find any justification for the change, even in GitHub: https://github.com/quicwg/reliable-stream-reset/pull/11 appears without much commentary.)