Re: [hybi] hum #3: Message

Greg Wilkins <gregw@webtide.com> Mon, 09 August 2010 00:49 UTC

Return-Path: <gregw@webtide.com>
X-Original-To: hybi@core3.amsl.com
Delivered-To: hybi@core3.amsl.com
Received: from localhost (localhost [127.0.0.1]) by core3.amsl.com (Postfix) with ESMTP id C53B13A69D4 for <hybi@core3.amsl.com>; Sun, 8 Aug 2010 17:49:58 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.758
X-Spam-Level:
X-Spam-Status: No, score=-1.758 tagged_above=-999 required=5 tests=[AWL=0.219, BAYES_00=-2.599, FM_FORGED_GMAIL=0.622]
Received: from mail.ietf.org ([64.170.98.32]) by localhost (core3.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id mzP88VWTSgRL for <hybi@core3.amsl.com>; Sun, 8 Aug 2010 17:49:58 -0700 (PDT)
Received: from mail-fx0-f44.google.com (mail-fx0-f44.google.com [209.85.161.44]) by core3.amsl.com (Postfix) with ESMTP id B2CE43A6818 for <hybi@ietf.org>; Sun, 8 Aug 2010 17:49:57 -0700 (PDT)
Received: by fxm16 with SMTP id 16so4481110fxm.31 for <hybi@ietf.org>; Sun, 08 Aug 2010 17:50:30 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.223.115.73 with SMTP id h9mr15937259faq.46.1281315029064; Sun, 08 Aug 2010 17:50:29 -0700 (PDT)
Received: by 10.223.57.12 with HTTP; Sun, 8 Aug 2010 17:50:28 -0700 (PDT)
In-Reply-To: <AANLkTimj9RvzL8E+FmH=vT_TeECVNmDPXY0ymPnvBHSZ@mail.gmail.com>
References: <4C5AE93D.4040803@ericsson.com> <Pine.LNX.4.64.1008051758290.5947@ps20323.dreamhostps.com> <AANLkTik0kbh14s2JZARY2MFh0iNGV7H+B4Px4yG+wX44@mail.gmail.com> <71BCE4BF-D3F6-4F94-BE76-306BDF6A2E67@apple.com> <Pine.LNX.4.64.1008051930160.5947@ps20323.dreamhostps.com> <4C5B1695.6070704@gmx.de> <F8E2F702-9F74-4316-B3B2-D5A731409ABF@apple.com> <AANLkTin=gO9D8K5NVhqCRKki-jrDmTYqF-gBjp9X41GN@mail.gmail.com> <4C5BF15E.1090608@noemax.com> <AANLkTinXLPmBACd3ji0V9wkAWmxOR7qBMED19KKMvJrd@mail.gmail.com> <AANLkTi=RWdqDDgy24C6qtUSr+5R5p=P15B=+aUZuE16Q@mail.gmail.com> <4C5C07D6.1030208@noemax.com> <AANLkTimj9RvzL8E+FmH=vT_TeECVNmDPXY0ymPnvBHSZ@mail.gmail.com>
Date: Mon, 09 Aug 2010 10:50:28 +1000
Message-ID: <AANLkTikmhNjm1kfuiyom=2zDrdyc4nsJBWC64Huhk4Ow@mail.gmail.com>
From: Greg Wilkins <gregw@webtide.com>
To: John Tamplin <jat@google.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Cc: "hybi@ietf.org" <hybi@ietf.org>
Subject: Re: [hybi] hum #3: Message
X-BeenThere: hybi@ietf.org
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: Server-Initiated HTTP <hybi.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/listinfo/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: Mon, 09 Aug 2010 00:49:58 -0000

All,

I do not disagree that message length (as opposed to frame length),
will often be a useful bit of meta-data for the receiver.

However, I think there is plenty of other meta-data that is related to
the total message that could be useful for the receiver: content-type,
content-encoding, expiry, etc are all things that a smart receiving to
potentially use to process/discard fragments on the fly without
waiting for the full message.

So I think it far better to support message length with a generic meta
data mechanism rather than give it a special spot in the first frame.
  Defining a mime-message op-code would be sufficient to allow us to
send a message with length and other meta data, that the framing layer
could then fragment into multiple chunks.

However, I do like having a very small minimal frame size for short
messages, so I would modify Johns proposal to:

 1 bit - fragment
 2 bits - reserved
 5 bits - opcode
 8 bits - short length
 [if length = 255: 6 bytes length]
 length bytes of payload

With opcodes defined for text, binary, mime and ping/pong frames

I've proposed a 48 bit length to make the total header 64bits, but I'm
ok with it being 64 bit length as well.


cheers





On 7 August 2010 00:17, John Tamplin <jat@google.com> wrote:
> Ok, does this summarize the various positions regarding chunking and
> lengths?
>
> We want to have a length of the complete message when it is available to
> make buffer management simpler for the receiver
> We want to be able to fragment messages to avoid extra buffering when the
> length of the entire message is not known up front, such as when sending
> dynamic content, compressing frames, etc.
> We want to keep small frames having small overhead (though there is a limit
> on how much this matters given TCP/IP overhead)
> We want to be able to send very large files in a single fragment so we can
> just hand it off to sendfile or equivalent
>
> What about the following:
>
> 1 bit - Initial fragment
> 1 bit - Final fragment
> 1 bit - reserved
> 5 bits - opcode
> 8 bits - short length
> [if length = 255: 8 bytes - length]
> [if Initial = 1 and Final = 0: 8 bytes - overall message length, with 0
> meaning "unknown"]
> length bytes of payload
>
> This could be extended with any of the extension or padding proposals out
> there, just trying to get the basic idea of having initial/fragment bits
> with an optional overall message length up for discussion.  The length could
> be a variable-length integer as in v76 if you prefer, likewise for the
> message length.
> --
> John A. Tamplin
> Software Engineer (GWT), Google
>
> _______________________________________________
> hybi mailing list
> hybi@ietf.org
> https://www.ietf.org/mailman/listinfo/hybi
>
>