Re: [hybi] how do we move forward on agreeing on framing?

Roberto Peon <fenix@google.com> Thu, 19 August 2010 16:15 UTC

Return-Path: <fenix@google.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 023873A695E for <hybi@core3.amsl.com>; Thu, 19 Aug 2010 09:15:52 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -105.695
X-Spam-Level:
X-Spam-Status: No, score=-105.695 tagged_above=-999 required=5 tests=[AWL=0.282, BAYES_00=-2.599, FM_FORGED_GMAIL=0.622, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_MED=-4, USER_IN_WHITELIST=-100]
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 KHUUjmK3KUkM for <hybi@core3.amsl.com>; Thu, 19 Aug 2010 09:15:28 -0700 (PDT)
Received: from smtp-out.google.com (smtp-out.google.com [216.239.44.51]) by core3.amsl.com (Postfix) with ESMTP id AFA5F3A6926 for <hybi@ietf.org>; Thu, 19 Aug 2010 09:15:22 -0700 (PDT)
Received: from kpbe15.cbf.corp.google.com (kpbe15.cbf.corp.google.com [172.25.105.79]) by smtp-out.google.com with ESMTP id o7JGFt6W030633 for <hybi@ietf.org>; Thu, 19 Aug 2010 09:15:55 -0700
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=google.com; s=beta; t=1282234556; bh=Zhg3OvEGn92vOUgBJMv0DW5m4JA=; h=MIME-Version:In-Reply-To:References:Date:Message-ID:Subject:From: To:Cc:Content-Type; b=GqBJWju216muuE3X/novODWmUyHuD3brZxq12ueoO+zz2S5qtdphbSbU5kusr5vqJ 4nOZ5J9WoR1ois/KPicXQ==
DomainKey-Signature: a=rsa-sha1; s=beta; d=google.com; c=nofws; q=dns; h=mime-version:in-reply-to:references:date:message-id:subject:from:to: cc:content-type:x-system-of-record; b=H2vJTsxH3eWhuEYPY0Db7x7k4jNIXrTJd9mZTBCo7l0OqKpwnaZclo5FO8PyWMppd IPS0/vhFb+iqcwGHZ2o6Q==
Received: from gyh4 (gyh4.prod.google.com [10.243.50.196]) by kpbe15.cbf.corp.google.com with ESMTP id o7JGFs5T019123 for <hybi@ietf.org>; Thu, 19 Aug 2010 09:15:54 -0700
Received: by gyh4 with SMTP id 4so850106gyh.4 for <hybi@ietf.org>; Thu, 19 Aug 2010 09:15:54 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.150.13.10 with SMTP id 10mr127102ybm.416.1282234552735; Thu, 19 Aug 2010 09:15:52 -0700 (PDT)
Received: by 10.150.95.11 with HTTP; Thu, 19 Aug 2010 09:15:52 -0700 (PDT)
In-Reply-To: <1282231803.22142.649.camel@vulcan.aspl.local>
References: <AANLkTineuhvGsC_vca6AiAX8OmHdkE-7s7rA1DQtjtMm@mail.gmail.com> <1282231803.22142.649.camel@vulcan.aspl.local>
Date: Thu, 19 Aug 2010 09:15:52 -0700
Message-ID: <AANLkTim44=x0BRpF3BYMqS9GNzHA+icG818JgfRRaFPT@mail.gmail.com>
From: Roberto Peon <fenix@google.com>
To: Francis Brosnan Blazquez <francis@aspl.es>
Content-Type: multipart/alternative; boundary="000e0cdf1a3208d70b048e2f7f90"
X-System-Of-Record: true
Cc: Hybi <hybi@ietf.org>
Subject: Re: [hybi] how do we move forward on agreeing on framing?
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: Thu, 19 Aug 2010 16:15:52 -0000

On Thu, Aug 19, 2010 at 8:30 AM, Francis Brosnan Blazquez
<francis@aspl.es>wrote:

> Hi John,
>
> Some thoughts...
>
> > There have been various discussions about various proposals, and to be
> > sure there will be no proposal that everyone is happy with.  What can
> > we do to come to some consensus on something that is acceptable for
> > the base protocol so we can move forward?
>
> My impression is that the base protocol should by simple, as close as
> possible to TCP. For example, your proposal, which is length limited
> looks good.
>
> > To me, I think the following things are critical:
> >       * fragmentation support - this has been accepted as a
> >         requirement without much dissension when it was declared that
> >         we achieved consensus on it, and if we don't have support for
> >         it in the base protocol it will greatly complicate efforts for
> >         certain extensions a number of people think will be important
> >         in the future, such as multiplexing
>
> I think it is taking to much attention to include advanced features in
> the base protocol, or to define extensions that allow them, especially
> when those features can be implemented by protocols already defined like
> BEEP [1].
>
> I'm sure many people is expecting to access to a simple protocol that
> allows direct connection and bidirectional content transfer from the
> browser. Nothing else.
>

That is true for the API users. The people who have to implement this
en-masse and at scale have additional requirements.

We've torpedoed multiplexing for now (and multiplexing is the one thing that
can help scalability here). Ok, so then we need an extension mechanism in
order to implement and experiment with enabling multiplexing.



>
> >       * low overhead for small frames - as previously indicated,
> >         real-world WebSocket apps do make use of a substantial
> >         percentage of small messages, and when compression is added
> >         the percentage grows to an overwhelming majority.  Sure, there
> >         will be some WebSocket apps which won't get any benefit from
> >         small frames, but that shouldn't remove the capability from
> >         those that do.
> >       * we can't afford to decide on the extension format now - given
> >         the rate of building consensus, we won't ever finish the base
> >         protocol if we have to define that now.  That means anything
> >         that is critical to support in the base protocol, such as
> >         fragmentation or (if we decide it is important for
> >         implementations of the base protocol) the total message
> >         length, cannot be defined in an extension.
>
> +1


> >       * we need to leave our options open for extensibility - since we
> >         don't yet agree on exactly how the protocol should be extended
> >         or exactly what facilities such extensions may need, we need
> >         to have some flexibility for how those extensions can be
> >         represented
> > Does anyone disagree with these points?
>
> +1
>
> It would be great to define base protocol as something simple, a common
> base factor, where consensus is more easy. A protocol that allow to
> build on instead of including features that you may not use.
>
> > So here is another attempt at incorporating feedback to try and get
> > something which could gain consensus as the framing protocol:
> >       * MORE - 1 bit - if set, this is not the final frame of the
> >         message
> >       * TML - 1 bit - if set, the total message length is included
> >         (which is not required to be on the first frame, and if
> >         repeated overrides earlier values so it may be used as an
> >         estimate for dynamic content)
> >       * Reserved - 2 bits - must be 0 except for private use
> >       * Opcode - 4 bits - 0=Continuation, 1=Control, 2=Text, 3=Binary,
> >         4-11=Reserved for future assignment, 12-15=Reserved for
> >         private use
> >       * Reserved - 1 bit - must be 0
> >       * Length - 7 bits - payload length in octets; if 127, then there
> >         is an extended length
> >       * Extended length - 8 bytes - payload length in octets (high bit
> >         must be 0 for ease of use with languages without an unsigned
> >         data type), present only if Length=127
> >       * Total Message Length - 8 bytes - total message length in
> >         octets (high bit must be 0 as above), present only if TML=1
> >       * Payload - (Extended) Length bytes - payload, interpreted as
> >         defined by the Opcode
> > This addresses the concern about requiring the total message length to
> > be in the first frame or to be present at all if it is unknown.  It
> > allows us to use a bit to indicate extension data is present, or to
> > define extensions by new opcodes (and to grow the opcode field if
> > necessary by using adjacent reserve bits).  Some bits are available
> > for direct assignment, such as if we find frame-by-frame compression a
> > useful future extension. It also cleans up room for confusion in the
> > previous proposal where you could change opcodes between fragments.
> >
> >
>

This is pretty similar to IanF's proposal and is also workable.



> > Example messages:
> >       * MORE=0,TML=0,Opcode=Text, Length=12, Payload="Hello world!" -
> >         single-frame text message
> >
> >
> >       * MORE=1,TML=1,Opcode=Text, Length=5, MsgLength = 12,
> >         Payload="Hello" - first frame of fragmented message
> >       * MORE=0,TML=0,Opcode=Continuation, Length=7, Payload=" world!"
> >         - final frame of fragmented message
> >
> >
> >       * MORE=1,TML=1,Opcode=Text, Length=127, ExtLength=4096,
> >         MsgLength=16000, Payload=... - first frame of dynamically
> >         generated message, with estimated message length
> >       * MORE=1,TML=0,Opcode=Continuation, Length=127,
> >         ExtLength=4096,Payload=... - several frames delivering dynamic
> >         content
> >       * MORE=1,TML=1,Opcode=Continuation, Length=127, ExtLength=4096,
> >         MsgLength=14781, Payload=... - sender now knows length of
> >         dynamic content and sends it
> >       * MORE=0,TML=0,Opcode=Continuation, Length=127, ExtLength=2493,
> >         Payload=... - final frame of message
> > Extension Possibilities:
> >       * if we decide creating new opcodes for extensions, which then
> >         nest the next layer of extension within their payload data, we
> >         have room to allocate additional opcodes, and we can grow the
> >         opcode space if we need to
> >       * if we decide to include per-frame extension data, we can
> >         allocate a reserved bit to indicate the presence of an
> >         extension length which describes the length of extension data
> >       * if we decide to include per-frame compression, we can allocate
> >         a reserved bit to indicate that this frame is compressed
> >       * we can allocate new control frame types
> > Is this something we can all get behind, even if it doesn't do
> > everything we want, in the interest of getting something useful done
> > soon?  If not, what specific changes would be necessary for you to
> > agree?
>
> Your proposal looks good to me. Cheers!
>
>
> [1] http://www.beepcore.org
> --
> Francis Brosnan Blazquez <francis@aspl.es>
> ASPL
>
> _______________________________________________
> hybi mailing list
> hybi@ietf.org
> https://www.ietf.org/mailman/listinfo/hybi
>