Re: Design Issue: Max Concurrent Streams Limit and Unidirectional Streams

James M Snell <jasnell@gmail.com> Fri, 03 May 2013 17:41 UTC

Return-Path: <ietf-http-wg-request@listhub.w3.org>
X-Original-To: ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com
Delivered-To: ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 2798C21F96B6 for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Fri, 3 May 2013 10:41:52 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -8
X-Spam-Level:
X-Spam-Status: No, score=-8 tagged_above=-999 required=5 tests=[RCVD_IN_DNSWL_HI=-8]
Received: from mail.ietf.org ([12.22.58.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id D+jKpF4JCB8H for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Fri, 3 May 2013 10:41:45 -0700 (PDT)
Received: from frink.w3.org (frink.w3.org [128.30.52.56]) by ietfa.amsl.com (Postfix) with ESMTP id 824F721F8FE3 for <httpbisa-archive-bis2Juki@lists.ietf.org>; Fri, 3 May 2013 10:36:41 -0700 (PDT)
Received: from lists by frink.w3.org with local (Exim 4.72) (envelope-from <ietf-http-wg-request@listhub.w3.org>) id 1UYJuI-00078a-Vb for ietf-http-wg-dist@listhub.w3.org; Fri, 03 May 2013 17:36:31 +0000
Resent-Date: Fri, 03 May 2013 17:36:30 +0000
Resent-Message-Id: <E1UYJuI-00078a-Vb@frink.w3.org>
Received: from maggie.w3.org ([128.30.52.39]) by frink.w3.org with esmtp (Exim 4.72) (envelope-from <jasnell@gmail.com>) id 1UYJu9-00077l-1C for ietf-http-wg@listhub.w3.org; Fri, 03 May 2013 17:36:21 +0000
Received: from mail-oa0-f54.google.com ([209.85.219.54]) by maggie.w3.org with esmtps (TLS1.0:RSA_ARCFOUR_SHA1:16) (Exim 4.72) (envelope-from <jasnell@gmail.com>) id 1UYJu8-00042g-6D for ietf-http-wg@w3.org; Fri, 03 May 2013 17:36:20 +0000
Received: by mail-oa0-f54.google.com with SMTP id j1so1868522oag.41 for <ietf-http-wg@w3.org>; Fri, 03 May 2013 10:35:54 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:mime-version:in-reply-to:references:from:date:message-id :subject:to:cc:content-type:content-transfer-encoding; bh=yAZ0Tw3Yob0MJlwYy8jsVVRkRpmCAp3DjDMhhM1xSLE=; b=lQEbIbTG1MDUqEE0iyeEprlmRR0vhKVKY2sVa/boCyqYQsTkx798UHzjbChA90eOMy 76PKdtoL2/IrNyNthKMmTHVRAHhE9yPnZtlE+fzxuASa3sSP/NNKHo/T21kcGWvG9vQt W6D+FpZolJJe4GDio1C3fHF61sCFJpEsYnGtMQxXdj8B5uHoHzj6vxC075QWCubvqUlD Cd87+RWKayp56/itNCtN0PtYdUshU2gR1l9emxOj50YlOyo8pkNJgse7P0EkhgRO42ed ufay7MgVSD2EWbQrZZwXHAudFei0DcWLH2263RtG+QXiNDqOPSuOQhCaFBZr3eXrjkKg VMeQ==
X-Received: by 10.60.16.69 with SMTP id e5mr484353oed.46.1367602554161; Fri, 03 May 2013 10:35:54 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.60.3.137 with HTTP; Fri, 3 May 2013 10:35:34 -0700 (PDT)
In-Reply-To: <CABkgnnVEy7LPU2sUrKVFTLpEVP4RcWnbdgs1oRvmNFujZGQBOg@mail.gmail.com>
References: <CABP7RbdBe-Xkx+CMvpN=_oNAqm6SyLyL+XNHRUKSqn8mjSDw1Q@mail.gmail.com> <CAA4WUYgCiyWerT0tUUVKcbNPqdTGuXHd_MG59DjcUsEWst5t7g@mail.gmail.com> <CABkgnnVdU=cZ53Bqg5Un=E80NMpcgYO37DVmwUFW0O-i7SNf8w@mail.gmail.com> <CAA4WUYhz64FsEGgGhx91RfWwuPPxWdAkesOV-bmqWVWE7ZxdjA@mail.gmail.com> <CABP7RbcKQkn1o4WZscwNmSmm6YzqE_TKxPr4jnozNdaVqpZ7=A@mail.gmail.com> <CAA4WUYhF6rAZoYEaz4aJO6xawaJxzxGt=Bkg4H9eBOP-LBSRmQ@mail.gmail.com> <CAP+FsNezQzxdZEJY_2_0h_TR2pBbVsGyGBhQhKcm-65pt6S8rQ@mail.gmail.com> <CABP7RbevS8M0q9OxzPncqY_gE34q5-ymdg2hOX2SQgSUNkhzsw@mail.gmail.com> <CAA4WUYjAbuUqz9RdO+-p3a4EsyuS=Gv0rS-U-Vh+ZCjtDjFy6w@mail.gmail.com> <CAP+FsNec2LLZMjtGhSX-1q8qg66WtBoM5K0yMrs5m4VKXb5OVg@mail.gmail.com> <CAA4WUYgAT64jj=Am06MsA02A+eAcDrVbbgb4opO37bnMkWTPfg@mail.gmail.com> <CABP7Rbdgz=kRZPfjHK5UUfieq8uz=ToQZjFt1-+s9scj1CogmA@mail.gmail.com> <CAA4WUYjSjFKSdbj=QBLn0T4ufhzF1hUY=O=Qa2dfnkTzMXF0bg@mail.gmail.com> <CABP7RbejssYWH+nEumVX__+4TnE1ec8e1YXeY8kqWF+AgszTrg@mail.gmail.com> <CAA4WUYiRVxM78Dr+eh9ksVvW_9=S01mHxt_Wr+SyaVECmc0e-g@mail.gmail.com> <CABP7RbexX0T=yYKPeKFeGEnzMAcO7fAifZh6LfLCOngLDNQHUA@mail.gmail.com> <CABkgnnUeicCNUa70GW7Vv9-bbwLPiPM=2-_t28Qz5o6DT0jF8Q@mail.gmail.com> <CABP7RbfbmTqFHPkRvj2K6iZ=Oo7MsT3hD9Y33fmtU9HOLoDmUA@mail.gmail.com> <CAA4WUYj81k1dK-LV+=h-yto4WEpVWFaRnCQZ+h55mipYCnQeYw@mail.gmail.com> <CABkgnnVEy7LPU2sUrKVFTLpEVP4RcWnbdgs1oRvmNFujZGQBOg@mail.gmail.com>
From: James M Snell <jasnell@gmail.com>
Date: Fri, 03 May 2013 10:35:34 -0700
Message-ID: <CABP7Rbf9_J=Ow58yN2XNoUvJGNQ48cAy5LdbJB4RL5kUpPswPg@mail.gmail.com>
To: Martin Thomson <martin.thomson@gmail.com>
Cc: "William Chan (陈智昌)" <willchan@chromium.org>, Roberto Peon <grmocg@gmail.com>, HTTP Working Group <ietf-http-wg@w3.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Received-SPF: pass client-ip=209.85.219.54; envelope-from=jasnell@gmail.com; helo=mail-oa0-f54.google.com
X-W3C-Hub-Spam-Status: No, score=-3.5
X-W3C-Hub-Spam-Report: AWL=-2.701, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001
X-W3C-Scan-Sig: maggie.w3.org 1UYJu8-00042g-6D 811a275436325fb70451c6e2e07c0cbc
X-Original-To: ietf-http-wg@w3.org
Subject: Re: Design Issue: Max Concurrent Streams Limit and Unidirectional Streams
Archived-At: <http://www.w3.org/mid/CABP7Rbf9_J=Ow58yN2XNoUvJGNQ48cAy5LdbJB4RL5kUpPswPg@mail.gmail.com>
Resent-From: ietf-http-wg@w3.org
X-Mailing-List: <ietf-http-wg@w3.org> archive/latest/17802
X-Loop: ietf-http-wg@w3.org
Resent-Sender: ietf-http-wg-request@w3.org
Precedence: list
List-Id: <ietf-http-wg.w3.org>
List-Help: <http://www.w3.org/Mail/>
List-Post: <mailto:ietf-http-wg@w3.org>
List-Unsubscribe: <mailto:ietf-http-wg-request@w3.org?subject=unsubscribe>

On Fri, May 3, 2013 at 9:52 AM, Martin Thomson <martin.thomson@gmail.com> wrote:
> On 3 May 2013 09:44, William Chan (陈智昌) <willchan@chromium.org> wrote:
>> I'd like server folks to chime in, but doing this makes me feel a bit
>> nervous. I feel this effectively disables the directional concurrent streams
>> limit. The bidirectional full-close essentially acts like an ACK, so
>> removing it might result in an unbounded number of streams.
>
> I think that I know what you mean here, but can you try to expand a
> little?  Do you refer to the possible gap between close on the
> initiating direction and the first frame on the responding direction;
> a gap that might cause the stream to escape accounting?  I think that
> is a tractable problem - any unbounded-ness is under the control of
> the initiating peer.

Well, there are really several issues here...

1. The server endpoint would be allowed to initiate an unbounded
number of push streams, up to MAX_CONCURRENT_STREAMS at any given
time, but with no reasonable upper limit on the overall total number
of streams. For instance, given a MAX_CONCURRENT_STREAMS of 10, it
could initiate 10 streams and close them, initiate 10 more and close
those, initiate 10 more.. ad infinitum. Generally speaking, I don't
believe this is really a serious issue, however. The receiving end can
simply opt to reject pushed streams from misbehaving servers once a
particular threshold was reached (which is where I was going with the
credit limit proposal before).

2. There may be (as you suggest) a gap of time between when the server
sends it's FINAL frame on a pushed stream and the time when a client
might send it's FINAL (if any FINAL frame comes at all). Here, again,
however, the MAX_CONCURRENT_STREAMS bounds the total number of open
streams the server can push at any given time and the client can opt
to reject additional streams if the flow becomes unmanageable.

Modeling this out, I believe that clients will definitely have to
implement some protections against abuse but those protections do not
need to be standardized. Clients would simply implement whatever
algorithm they wish to determine whether or not to accept new pushed
streams. MAX_CONCURRENT_STREAMS would cover only streams that are
initiated by and opened for the sending peer. If a peer closes it's
side, it decrements the counter for that peer. Half-open streams in
the other direction would not count. A receiving peer that is dealing
with a misbehaving endpoint can use RST_STREAM to refuse new pushes or
send a SETTINGS with a new, more restrictive MAX_CONCURRENT_STREAMS
value.

Btw... Another possible dimension we could consider is a new
RST_STREAM error code indicating that a stream is being rejected
because too many streams are being opened too quickly.

- James