Re: [hybi] Is it important to know frame length at the start of frame? (was: Re: Discontinuation of mux ...)

Zhong Yu <zhong.j.yu@gmail.com> Wed, 12 February 2014 16:31 UTC

Return-Path: <zhong.j.yu@gmail.com>
X-Original-To: hybi@ietfa.amsl.com
Delivered-To: hybi@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 9E6281A03B4 for <hybi@ietfa.amsl.com>; Wed, 12 Feb 2014 08:31:17 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2
X-Spam-Level:
X-Spam-Status: No, score=-2 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, SPF_PASS=-0.001] autolearn=ham
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 jmGQZudMW883 for <hybi@ietfa.amsl.com>; Wed, 12 Feb 2014 08:31:15 -0800 (PST)
Received: from mail-oa0-x232.google.com (mail-oa0-x232.google.com [IPv6:2607:f8b0:4003:c02::232]) by ietfa.amsl.com (Postfix) with ESMTP id 7B3A91A0325 for <hybi@ietf.org>; Wed, 12 Feb 2014 08:31:15 -0800 (PST)
Received: by mail-oa0-f50.google.com with SMTP id n16so11132949oag.23 for <hybi@ietf.org>; Wed, 12 Feb 2014 08:31:14 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=uEZkqqqaOEOg485otGMXqy1rEgUv9Gby4VIq4kLQhs4=; b=ljEJdxYkrHdfCS18wrDTtoEOUVSFCdZXRnd2Dgw+7qBfph4JghG7NLURXsN40SMSaL CDj+nQjPzmJECBXg5zO/phs7G6rhNCXcWlZ6I/ppbv0EpYlgruh0AALRaUOEEqOBWT+J y6adZKzzL2ZZ092Lssz6IQjvMQKvhpwSRwmkC4XFeBwey52946X5pkw48t8gPEQCEL2E ZmUizCgsrc8sxrG/9mq3x84os2jDynk0IWPX3m5D/pPvAuoWZ627iLyG1nTEUO1GuFmp ve7Ux8BF8+/8KCgEcmE/4Q99WKAyDDUw2UnYLNxZ9KURdCWAkyGWW2xY6bRvrgB/QIYB Iitg==
MIME-Version: 1.0
X-Received: by 10.182.142.229 with SMTP id rz5mr37925328obb.12.1392222674457; Wed, 12 Feb 2014 08:31:14 -0800 (PST)
Received: by 10.76.21.132 with HTTP; Wed, 12 Feb 2014 08:31:14 -0800 (PST)
In-Reply-To: <C5F162C5-D2FF-4140-B80B-5BF2DEE80AB1@zaphoyd.com>
References: <CAH9hSJbf_ABT7ECL9eS=_ADrncX8qBtxZv=uLcdu9_6GUv23Uw@mail.gmail.com> <CACuKZqEcA1Pv8RpWfmThMjTzi2BbVMMKXqujs6BxVfxRPZJ9NQ@mail.gmail.com> <C5F162C5-D2FF-4140-B80B-5BF2DEE80AB1@zaphoyd.com>
Date: Wed, 12 Feb 2014 10:31:14 -0600
Message-ID: <CACuKZqGMUs5nOEQZvhMrnqTtnPyTTRMG1TvVqQ8O95P_ecnNQw@mail.gmail.com>
From: Zhong Yu <zhong.j.yu@gmail.com>
To: Peter Thorson <webmaster@zaphoyd.com>
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: quoted-printable
Cc: "hybi@ietf.org" <hybi@ietf.org>
Subject: Re: [hybi] Is it important to know frame length at the start of frame? (was: Re: Discontinuation of mux ...)
X-BeenThere: hybi@ietf.org
X-Mailman-Version: 2.1.15
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, 12 Feb 2014 16:31:17 -0000

On Wed, Feb 12, 2014 at 10:25 AM, Peter Thorson <webmaster@zaphoyd.com> wrote:
>
> On Feb 12, 2014, at 10:00, Zhong Yu <zhong.j.yu@gmail.com> wrote:
>
>> Why not send the message in one frame? The frame length is then the
>> message length.
>
> The message length might not be known or might not be fully buffer-able by the sending endpoint.
>
>> One argument for fragmentation is to insert control frames while
>> transmitting a long message. However that reasoning is not very
>> convincing:
>>
>> PONG - as long as we are writing data, any data, the peer should see
>> that the connection is alive. It's unreasonable for the peer to think
>> that our end is unresponsive while it is receiving data from us.
>>
>> PING - not necessary while we are writing data. If peer is
>> unresponsive, we'll learn that from TCP layer.
>
> It does provide some separation of concerns and the ability to do things like measure RTT during a long message.
>
>> CLOSE - closing the connection in the middle of a message is abnormal
>> anyway, it's probably not important to do the close handshake.
>
> It can be used to cleanly close a connection after a message has been sent but before it is completed. Say a client initiates a transfer then decides to leave halfway through (browser tab closes, etc). The client can indicate that it wants to close and that the in flight message should be discarded. Otherwise the client would have to either truncate the message (which might result in bogus data getting processed by the server) or just close the TCP connection (which can leave the connection in a bad state on the server and causes the server to have to report an unclean close to its application, which isn't entirely accurate).

I don't quite buy this argument. Browsers initial TCP FIN all the
time, to shutdown persistent HTTP connections for example.