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

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

Return-Path: <bounces+848413-a050-quic-issues=ietf.org@sgmail.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 DE4E3130EA1 for <quic-issues@ietfa.amsl.com>; Fri, 8 Jun 2018 05:36:26 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -3.01
X-Spam-Level:
X-Spam-Status: No, score=-3.01 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, SPF_PASS=-0.001, T_DKIMWL_WL_HIGH=-0.01] 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 EBnyfbuBP1BU for <quic-issues@ietfa.amsl.com>; Fri, 8 Jun 2018 05:36:24 -0700 (PDT)
Received: from o7.sgmail.github.com (o7.sgmail.github.com [167.89.101.198]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id B0943130E9B for <quic-issues@ietf.org>; Fri, 8 Jun 2018 05:36:24 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=github.com; h=from:reply-to:to:cc:subject:mime-version:content-type:content-transfer-encoding:list-id:list-archive:list-post:list-unsubscribe; s=s20150108; bh=rgXMuy5Pps2Y8LEH1+Mi6AYhNZA=; b=Sh6lLGJE19Q2/v9d 5HV91+3acy/8FjAkEA1U8gxZzYdt4k2Cj5bUkg5izx2JNs/4XNlj1ty7GZ4nSspr vfOI6G8viHxtye28RogY7X3hKoX4wfpks5uc+JOiXEt0CTF7EZ+0fDHz+FX7NB4a sqOSo596Ohkrd9OevJOaLJwqvdU=
Received: by filter0410p1iad2.sendgrid.net with SMTP id filter0410p1iad2-7245-5B1A7845-1B 2018-06-08 12:36:21.547021817 +0000 UTC
Received: from github-lowworker-56a5eb2.cp1-iad.github.net (unknown [192.30.252.33]) by ismtpd0007p1iad1.sendgrid.net (SG) with ESMTP id xNxc1CZsTemdmGCTB8qmGg for <quic-issues@ietf.org>; Fri, 08 Jun 2018 12:36:21.525 +0000 (UTC)
Received: from github.com (localhost [127.0.0.1]) by github-lowworker-56a5eb2.cp1-iad.github.net (Postfix) with ESMTP id 7BCB0C0073 for <quic-issues@ietf.org>; Fri, 8 Jun 2018 05:36:21 -0700 (PDT)
Date: Fri, 08 Jun 2018 12:36:22 +0000
From: Martin Thomson <notifications@github.com>
Reply-To: quicwg/base-drafts <reply+0166e4ab9e2b3c3ef2315ea6dcb4a1738e8f6b7a0830209f92cf0000000117323a4592a169ce13b52edd@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@github.com>
Subject: [quicwg/base-drafts] Length-prefixes and flow control (#1432)
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary="--==_mimepart_5b1a7845797e0_18c12ae46514ef5077776"; 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
X-SG-EID: l64QuQ2uJCcEyUykJbxN122A6QRmEpucztpreh3Pak38yAT9zZHymQctXJpF+BbsUr1cpXjcrN/KWh nB7FzMzVsmRAEYbS6E0Y2hkJtUgwRmDiboBoAMC3HDouA3CS2QBCmhXuZmGTGqpqZ+DI2eh5JVWj1H SCDkcchTSilQRJcYEhyAP+B5Hpwfx5U798aWSUaDLW8m5t+AQViTZQViUj/WB/+BUvaM9XHGwFmNWu o=
Archived-At: <https://mailarchive.ietf.org/arch/msg/quic-issues/hO0pPVzA8cU9RTp9RzvAw2VDl3s>
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: Fri, 08 Jun 2018 12:36:27 -0000

HTTP/QUIC has a particular example of a pattern that seems likely to be usable in many other contexts.  A block of data is preceded by a length field.  The receiver of that block might read the length field then await the arrival of the entire block before processing the block.  During that time, the block is left unread so that the data can sit in the receive buffer of the transport.  This ensures that the data counts towards the flow control limits of the receiver.  This can prevent the sender from adding more messages that would only consume additional memory at the receiver.

In an extreme case, this leads to a deadlock.  The receiver is waiting for the end of a block.  The sender cannot send the remainder of the block because it does not have enough flow control credit.

This impasse doesn't naturally resolve in this case.  Worse, even if flow control might allow a single stream to make progress because the receiver ensures that it provides credit for the largest possible message or more, multiple concurrent streams could each consume a small part of the available flow control credit without allowing any single one to make progress.

Ultimately, there isn't an easy fix for this.  We could recommend a new input for prioritization: favour the sending of data for streams that are in the middle of sending a chunk, but that requires the transport be informed of message boundaries.  Relying on RST_STREAM to cancel streams until the logjam clears might work in some cases, but we have some examples already of streams that cannot be safely cancelled.  So this will always be a danger.  We gain some insight into what is going on with BLOCKED and friends, but ultimately this is just *hard*.

Not sure how much advice we can give here, or whether saying anything is even needed.

-- 
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