Re: Proposal: New Frame Size Text (was: Re: Design Issue: Frame Size Items)

James M Snell <jasnell@gmail.com> Sat, 11 May 2013 17:24 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 1F80021F89EB for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Sat, 11 May 2013 10:24:01 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -7.924
X-Spam-Level:
X-Spam-Status: No, score=-7.924 tagged_above=-999 required=5 tests=[AWL=-2.325, BAYES_00=-2.599, GB_SUMOF=5, 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 BcYMmEljQUPa for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Sat, 11 May 2013 10:23:54 -0700 (PDT)
Received: from frink.w3.org (frink.w3.org [128.30.52.56]) by ietfa.amsl.com (Postfix) with ESMTP id B7E5C21F89CF for <httpbisa-archive-bis2Juki@lists.ietf.org>; Sat, 11 May 2013 10:23:54 -0700 (PDT)
Received: from lists by frink.w3.org with local (Exim 4.72) (envelope-from <ietf-http-wg-request@listhub.w3.org>) id 1UbDVD-00029Y-IW for ietf-http-wg-dist@listhub.w3.org; Sat, 11 May 2013 17:22:35 +0000
Resent-Date: Sat, 11 May 2013 17:22:35 +0000
Resent-Message-Id: <E1UbDVD-00029Y-IW@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 1UbDV1-00027X-L8 for ietf-http-wg@listhub.w3.org; Sat, 11 May 2013 17:22:23 +0000
Received: from mail-ob0-f177.google.com ([209.85.214.177]) by maggie.w3.org with esmtps (TLS1.0:RSA_ARCFOUR_SHA1:16) (Exim 4.72) (envelope-from <jasnell@gmail.com>) id 1UbDV0-0005rW-VO for ietf-http-wg@w3.org; Sat, 11 May 2013 17:22:23 +0000
Received: by mail-ob0-f177.google.com with SMTP id uz6so337280obc.8 for <ietf-http-wg@w3.org>; Sat, 11 May 2013 10:21:56 -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; bh=61HuuUbeEnl8D/zCff7lNB/2UcZPC3gs0oHeowGC31s=; b=TXlK6Fcp39QiX8AkTU/ez+WALfh6QwSRyTfoRbyvUzUnWdEw+hHr+FVvbgiwvrlS0c Y+p7+U/r/ceknCNogT2sBKUGxSzg8I/D5pleEzyKP3P4uRIqtN829ftbDqb7qbgQ3jba i8PWG8dfAWPt+a/w6rBYT/ycNa1yz89KTnUfEdgjlq76tpb+0sglE6aXZJf0mIiSFBxf INYmQzoOU2qkcgHRpWr3xnMm8CUp2Sve/30aUEL4yn7GEKx+uQK9ojhP86U0pQ9GuOmE YTOx5bR7BmjatOum03hS2fEXgZ7DVwPHcd1YT8GrLBJT5o07vGVKwLirvjPvouG2zbt+ mQ3g==
X-Received: by 10.60.92.41 with SMTP id cj9mr9378402oeb.31.1368292916516; Sat, 11 May 2013 10:21:56 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.60.3.137 with HTTP; Sat, 11 May 2013 10:21:36 -0700 (PDT)
In-Reply-To: <CAP+FsNda_dzPqe1+e3DJsAtvi=xRH=dtdr0tnOJvCoWdF6MCjg@mail.gmail.com>
References: <CABP7RbcfTjN5QFFuGm-P-rQMpAR3FGSC58WCy3qKn+29YCjn+w@mail.gmail.com> <CAA4WUYiwNSzvrY1LF_Sex_82TSDwMbTvYqo7LyKfBAOu0j4pfQ@mail.gmail.com> <CABP7RbdqnH0JK-UaMiaR5rLvZo8txywEcXXSUXa_y95hrLC5yA@mail.gmail.com> <CABP7Rbd-VfTFYurZ-JEKjHKOeKvZCKoYLGMXf+0mi-_wbdKYqA@mail.gmail.com> <CAA4WUYgfu=rcji-bdxNPsE9KCE4T67+vN9b0iojnvycx5R-StA@mail.gmail.com> <CABkgnnX=AemYGrBzWGX1VEUgKKrk+hR6YV0jg9qVMSdPiimBAA@mail.gmail.com> <CAFA1p16FHaSf7b1=mhe_Cb=ZqV1m0HVwkQNdW+pkJ0OkA9L-5A@mail.gmail.com> <CAP+FsNdifoF3aqQLB-EZjYqL3O2_uNEmNJ_+zAktu9zapKmT7w@mail.gmail.com> <CABP7RbcF3VXuhvP5StN9hHVj4K-2WMvBr37ur3iHmH-=2WAbHw@mail.gmail.com> <CAA4WUYgFccqU5-65mFPF_3i4OOROZQCdS+tEUeDMk4HP4JJX5Q@mail.gmail.com> <CABP7RbcQMEhu9ciuTQoR1dRw3UiUB=E_AeMjaNrhFgMPmmi+EQ@mail.gmail.com> <CAA4WUYjFgJ28O5Jb58a5eodJMWe+CSe18Ow1wpETWJcjmedXRQ@mail.gmail.com> <CABP7RbdnnCiDSDt5CwPfRYx-BGgz8eoMUDa2J4xaWztHkCbe+w@mail.gmail.com> <CAP+FsNfHEUsdqQaAg8-g6vLb=AikHQG4Y5BywJ2w1FQEon+LrQ@mail.gmail.com> <CABkgnnXVMnL=i2p_mDzcWLP0TNpV_wp7XhsuOTA+Tayv1aBv3Q@mail.gmail.com> <CAP+FsNda_dzPqe1+e3DJsAtvi=xRH=dtdr0tnOJvCoWdF6MCjg@mail.gmail.com>
From: James M Snell <jasnell@gmail.com>
Date: Sat, 11 May 2013 10:21:36 -0700
Message-ID: <CABP7RbcYMzGEWG3yL-sRA+HHsO+7JcMmRkHU=tvQW62k72XeCQ@mail.gmail.com>
To: Roberto Peon <grmocg@gmail.com>
Cc: Martin Thomson <martin.thomson@gmail.com>, =?UTF-8?B?V2lsbGlhbSBDaGFuICjpmYjmmbrmmIwp?= <willchan@chromium.org>, Poul-Henning Kamp <phk@phk.freebsd.dk>, "ietf-http-wg@w3.org" <ietf-http-wg@w3.org>, Hasan Khalil <hkhalil@google.com>
Content-Type: text/plain; charset=UTF-8
Received-SPF: pass client-ip=209.85.214.177; envelope-from=jasnell@gmail.com; helo=mail-ob0-f177.google.com
X-W3C-Hub-Spam-Status: No, score=-3.5
X-W3C-Hub-Spam-Report: AWL=-2.681, 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 1UbDV0-0005rW-VO 2c3b056b610b9b6919eecf8e3390abf7
X-Original-To: ietf-http-wg@w3.org
Subject: Re: Proposal: New Frame Size Text (was: Re: Design Issue: Frame Size Items)
Archived-At: <http://www.w3.org/mid/CABP7RbcYMzGEWG3yL-sRA+HHsO+7JcMmRkHU=tvQW62k72XeCQ@mail.gmail.com>
Resent-From: ietf-http-wg@w3.org
X-Mailing-List: <ietf-http-wg@w3.org> archive/latest/17951
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>

I generally find it safer not to make any assumptions here about what
any given random implementation will or will not do. The best we can
do is provide some degree of protection against abuse in the protocol
definition itself. It doesn't have to be perfect, by any means, but it
does have to be somewhat reasonable. I'm perfectly fine with not
including HEADERS/PUSH_PROMISE in flow control but we ought to at
least place limits on exactly how much data is being passed in those
frames at any given time -- precisely because we don't know exactly
how those are going to end up being used long term and we do not want
to inadvertently encourage abuse.

If you want a sender to still be able to send HEADERS frames even if
the window size is 0 (or lower than we can reasonably encode a minimal
header block), then a compromise here is pretty simple:

For data frames, max frame size is min(WINDOW_SIZE, 65k) ...
For control frames (including HEADERS), max frame size is max(4k,
min(WINDOW_SIZE, 65k)) ...

This ought to give us a reasonable range to work within. It basically
just states that while control frames are not subject to flow control,
when constructing headers frames, the sender needs to take into
consideration whatever load the recipient may currently be
experiencing as expressed through flow control.



On Fri, May 10, 2013 at 8:15 PM, Roberto Peon <grmocg@gmail.com> wrote:
> For implementations that don't care about memory efficiency, you're right
> that they'll unencode the huffman-encoded strings. :)
>
> The majority of non-efficiency-oriented APIs I've used treated the overhead
> of HTTP and IO as insignificant, and likely just wouldn't care about this at
> all.
> -=R
>
>
> On Fri, May 10, 2013 at 8:01 PM, Martin Thomson <martin.thomson@gmail.com>
> wrote:
>>
>> On 10 May 2013 18:30, Roberto Peon <grmocg@gmail.com> wrote:
>> > The memory needed for header interpretation will, for a decent
>> > implementation, be at worst the sum of the size of the compression
>> > context
>> > and the size of the receive buffer-- it will not expand once
>> > decompressed
>> > unless a lot of useless copying is being done.
>>
>> I was going to say the same thing until I realized that most APIs will
>> be forced to decode Huffman-encoded strings to present.  Some
>> implementations might avoid this entirely, others might defer
>> decompression, or something along those lines, but there is probably
>> going to be at least some exposure to the decompressed data.
>
>