Re: [quicwg/base-drafts] Length-prefixes and flow control (#1432)

Martin Thomson <notifications@github.com> Tue, 12 June 2018 00:36 UTC

Return-Path: <noreply@github.com>
X-Original-To: quic-issues@ietfa.amsl.com
Delivered-To: quic-issues@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 63465130EAB for <quic-issues@ietfa.amsl.com>; Mon, 11 Jun 2018 17:36:52 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -8.009
X-Spam-Level:
X-Spam-Status: No, score=-8.009 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=0.001, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_HI=-5, SPF_PASS=-0.001, T_DKIMWL_WL_HIGH=-0.01, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=github.com
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 Xmz1PpEbO7DL for <quic-issues@ietfa.amsl.com>; Mon, 11 Jun 2018 17:36:49 -0700 (PDT)
Received: from out-5.smtp.github.com (out-5.smtp.github.com [192.30.252.196]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 75881130E99 for <quic-issues@ietf.org>; Mon, 11 Jun 2018 17:36:49 -0700 (PDT)
Date: Mon, 11 Jun 2018 17:36:48 -0700
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=github.com; s=pf2014; t=1528763808; bh=5QHTtjzKyQsOFCdr3sD66GU5Z1XqPdYiBgW73P9ZoUU=; h=Date:From:Reply-To:To:Cc:In-Reply-To:References:Subject:List-ID: List-Archive:List-Post:List-Unsubscribe:From; b=nod+RPhvYPc/jaZxEfB6ulR0n16nP7uVNn65unoeI2zWDEmcnLCYkKPTdW1STzrF+ w8uDCC1NvYUSJ5xjQfHbzizhJFvrioELXrm4tKK2YxoySDAgzvZHC3BPNZf0yFxru7 Iudk/JcmP7wnXNCiNfLLmYslfccJ4Eban+sQTPyg=
From: Martin Thomson <notifications@github.com>
Reply-To: quicwg/base-drafts <reply+0166e4ab9822418e5f99dae6e7df6bbb9345b385a3c8c4c592cf000000011736d7a092a169ce13b52edd@reply.github.com>
To: quicwg/base-drafts <base-drafts@noreply.github.com>
Cc: Subscribed <subscribed@noreply.github.com>
Message-ID: <quicwg/base-drafts/issues/1432/396429043@github.com>
In-Reply-To: <quicwg/base-drafts/issues/1432@github.com>
References: <quicwg/base-drafts/issues/1432@github.com>
Subject: Re: [quicwg/base-drafts] Length-prefixes and flow control (#1432)
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary="--==_mimepart_5b1f15a0d8a32_46c72b20988eef5c289037"; charset="UTF-8"
Content-Transfer-Encoding: 7bit
Precedence: list
X-GitHub-Sender: martinthomson
X-GitHub-Recipient: quic-issues
X-GitHub-Reason: subscribed
X-Auto-Response-Suppress: All
X-GitHub-Recipient-Address: quic-issues@ietf.org
Archived-At: <https://mailarchive.ietf.org/arch/msg/quic-issues/BzMq2vu-58TYGjGXHJxAZqurtvE>
X-BeenThere: quic-issues@ietf.org
X-Mailman-Version: 2.1.26
List-Id: Notification list for GitHub issues related to the QUIC WG <quic-issues.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/quic-issues>, <mailto:quic-issues-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/quic-issues/>
List-Post: <mailto:quic-issues@ietf.org>
List-Help: <mailto:quic-issues-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/quic-issues>, <mailto:quic-issues-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 12 Jun 2018 00:36:53 -0000

Yeah, @krasic has it right.  The entire point of this thing is to apply back pressure - if you can't read, ensure that you don't get more of stuff you can't read that consumes more of the memory you don't have.

On the other hand, it is reasonable to say that applications (and application protocols) can't rely on QUIC providing them with any concrete amount of storage.   But we can't force people to read or we undermine the entire purpose of providing flow control.  (Here I'm assuming that reading releases flow control, but the key point is that you only release flow control once you are done with the octets, and for many of these cases, the point is that you can't be done with the octets until some external condition is met, or all the octets are in, or something like that.)

I don't think that this is something we have to provide a concrete solution for.  Flow control is fundamentally hard because it is about managing access to a finite resource and contention can occur, sometimes in sub-optimal ways.  What we can do is signpost the obvious pitfalls.  Like the case where you have 10 octets of connection flow control, 10 streams and 1 octet arrives for every stream, but you need to have >1 to make progress.

Using `peek()` is just an example, and not a necessary one.  The problem is that we're creating ways for an application to learn whether it wants to read octets before it reads them.  A length-prefixed encoding does that inherently, but it's just an example of a general class of things that a reader might use to decide to defer consumption of data.  That length-prefixes are also a great way to optimize processing of data means that we won't ever avoid using them, and nor can we avoid cases where atomic units take more than one octet to express.

If I get @dtikhonov's point, it seems like a suggestion that we might avoid a length-prefix, but I think that only makes reading harder, and doesn't avoid other styles of atomic processing over multi-octet fields.  It probably drives implementation complexity up, and it (unfortunately) uses a lot more bytes than a length prefix in many cases.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/quicwg/base-drafts/issues/1432#issuecomment-396429043