Re: [hybi] Flow control quota

Takeshi Yoshino <tyoshino@google.com> Wed, 13 June 2012 06:51 UTC

Return-Path: <tyoshino@google.com>
X-Original-To: hybi@ietfa.amsl.com
Delivered-To: hybi@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id CA4A821F865C for <hybi@ietfa.amsl.com>; Tue, 12 Jun 2012 23:51:09 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -102.976
X-Spam-Level:
X-Spam-Status: No, score=-102.976 tagged_above=-999 required=5 tests=[BAYES_00=-2.599, FM_FORGED_GMAIL=0.622, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-1, USER_IN_WHITELIST=-100]
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 AudnXFQQn0Vx for <hybi@ietfa.amsl.com>; Tue, 12 Jun 2012 23:51:09 -0700 (PDT)
Received: from mail-lb0-f172.google.com (mail-lb0-f172.google.com [209.85.217.172]) by ietfa.amsl.com (Postfix) with ESMTP id 859A521F85CF for <hybi@ietf.org>; Tue, 12 Jun 2012 23:51:07 -0700 (PDT)
Received: by lbbgo11 with SMTP id go11so1203278lbb.31 for <hybi@ietf.org>; Tue, 12 Jun 2012 23:51:06 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:x-system-of-record; bh=7aL4vZxhLwnLlWWCO4RqbT7kvt7C7SdZ2EEw0m5iMos=; b=YbcpGpKC6RUeXkg1ozOIVoY+XLWr5eaf4QlGL7DS0lRFfsd70IqR2zVephGuNMHgJe SPQSCkm0roNDuI0ZONfMGWEsUYq0Bb6o8BfzcTmXZ0SehTetZjWBQ6Na+33qzZTX5RZ3 BD8DvWr54JtVJEeSSYVVejcsYFtEu43ZW2Y/7JnhKfrSY7Tbmr4vp3iUG9aRpg+fsDAT 0n8qmIasCRvr1pwUw76cqqLtuZMAJKhf/q8SvfMo1QAyLVeEoKvGUopQTc4iqEFVsNHE udrcUdPJCk+JnV9ytYIiFJZhT6Z0SLhIc0B7fIVV9Vqf/X0uziMr4ZioqcOLo/tjnboh sogg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:x-system-of-record:x-gm-message-state; bh=7aL4vZxhLwnLlWWCO4RqbT7kvt7C7SdZ2EEw0m5iMos=; b=GV0NqMrguv6uemEGcZZLcHEtS7PVNoGVG2XJz0Ooo53CRQxBdJedMAv9N8cOCGYRmf WCSmJ/dZf4UGtrqglpJCYSrouafN1tj6mnuF0D2ODLx0QbLHqE9me7agWBC6OiQgpCRa 3qzZF4hGLWFWR1KAGh/baO1osITYF4RzUIYQgRHOSrG+8eJUdHUSoGt5OrtM6bQbteGT bQL58R0pH5M2eMW/EkzmHX9seilIM7KkTx4rOt4iwD4YBwXt7V9PoSw51gA8Vqz0icIm Ge1RHJH8d555bz+bnUbMnlzgzabneCIMCd7ZAMAb3we/1/Yh0q2IEA5v9oNJ7ONiw6Ch YZwg==
Received: by 10.152.122.9 with SMTP id lo9mr23297970lab.41.1339570266663; Tue, 12 Jun 2012 23:51:06 -0700 (PDT)
Received: by 10.152.122.9 with SMTP id lo9mr23297956lab.41.1339570266435; Tue, 12 Jun 2012 23:51:06 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.112.7.105 with HTTP; Tue, 12 Jun 2012 23:50:46 -0700 (PDT)
In-Reply-To: <000401cd4566$d5f6bb70$81e43250$@noemax.com>
References: <001a01cd3e69$4a221c10$de665430$@noemax.com> <4FC732DC.3000308@250bpm.com> <000e01cd3f1c$af15ad40$0d4107c0$@noemax.com> <4FC880A7.9070007@250bpm.com> <CAH9hSJaWrUX6gFNLT4xkXLYKHSUH5+Y7AvqN9cD_CwekvsNu3A@mail.gmail.com> <001001cd4000$fe2c82c0$fa858840$@noemax.com> <4FCCAE6B.1010306@250bpm.com> <002d01cd4262$747957b0$5d6c0710$@noemax.com> <20120607022312.GA26406@jl-vm1.vm.bytemark.co.uk> <000e01cd449d$1c0ed220$542c7660$@noemax.com> <CAH_y2NE6+3r_9pkYXhMOiRWfGJXGauEYCqg-8GvtOoCT9Ch0mA@mail.gmail.com> <000401cd4566$d5f6bb70$81e43250$@noemax.com>
From: Takeshi Yoshino <tyoshino@google.com>
Date: Wed, 13 Jun 2012 15:50:46 +0900
Message-ID: <CAH9hSJY9d3dS_2vTZ-AXwuX0WnJuwZXrFyJtWik5SoKnQ3kWmw@mail.gmail.com>
To: Arman Djusupov <arman@noemax.com>
Content-Type: multipart/alternative; boundary="f46d043bd6fae1efdb04c2550110"
X-System-Of-Record: true
X-Gm-Message-State: ALoCoQl1zDGwmFDOBPhE/1dzB18amsAin22tRtOFMKDo8kdNtdNrwGTif26p/PL+OyekN1iHGHEJDcZ2OYxHCKo0H/DRq7KocH+8H2aIIafu3QZczmyswtqUu5P1MeOY7LdEloYuSvhO
Cc: hybi@ietf.org
Subject: Re: [hybi] Flow control quota
X-BeenThere: hybi@ietf.org
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: Server-Initiated HTTP <hybi.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/hybi>, <mailto:hybi-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/hybi>
List-Post: <mailto:hybi@ietf.org>
List-Help: <mailto:hybi-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/hybi>, <mailto:hybi-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 13 Jun 2012 06:51:09 -0000

On Fri, Jun 8, 2012 at 8:06 PM, Arman Djusupov <arman@noemax.com> wrote:

> By ignoring the RSV bits we don't resolve the problem of compressed frames
> being unfragmentable. Even if the compression flag was in the payload it
> would still not allow us to reassemble a compressed frame once it was
> fragmented. Since a compressed frame has its final 4 bytes stripped off,
> the
> receiver needs to know the frame boundary prior to its fragmentation in
> order to append the final 4 bytes at the proper place.
>

Yes. Current per-frame compression extensions is using both frame boundary
information and RSV1 bit.

I took this way to make it easy to flush a part of a message with 4 byte
optimization on most platforms. Thinking again, this optimization is very
useful only for small messages. To flush a part of a big message, this
optimization would be negligible.

IIRC, there's nothing so important that prevents us from changing it from
per-frame to per-message. Per-message spec would allow users to concatenate
SYNC_FLUSH-ed chunks, remove the 4 byte at the end of the message, split
the resulting string at arbitrary point to generate fragments and send
them. We may use only the RSV1 on the first fragment of the message.


> We could perform a compression flush at the end of the message boundary
> rather than on each frame. In this case the final frame of the message
> would
> indicate the end of the self-contained compressed chunk and every frame
> would be fragmentable. This is actually more in tune with the WS spec where
> each frame is not required to  contain interpretable data. But as far as
> the
> mux extension is concerned this would still be just a workaround since
> there
> might be other frame-level extensions that require the frame to be
> preserved.
>

It's also an option that we give up frame-level extensions other than mux.


> At the same time Jamie's solution to allow mux to envelope and fragment all
> frames on the wire also pushes the problem to the next layer. When
> compression would be used with mux, the receiving side would have to buffer
> and assemble the fragments of the frame prior to decompressing it. So, on
> one side, the mux flow control algorithm would consider the data as
> received
> and would send the quota to the remote side. At the same time,  the frame
> being received would have to be buffered while its final chunk is still on
>

At least, deflate can be processed progressively as each frame arrives even
if the spec is modified to be per-message as described above. Let's just
give up use of the core WebSocket frame boundary to pass the unit of
compression (or any other feature). Let's use some compression-specific
framing inside message body if necessary. RSV bits are still available but
would be message-wise feature. What do you think?

Compression after mux still need to be per-frame basis.


> the wire. So an intermediary or server performing decompression would have
> to be smart enough to decompress and forward whatever possible, buffering
> only the final part of frame that it is still impossible to decompress.
>