Re: [hybi] frame length encoding

Brian <theturtle32@gmail.com> Sun, 22 August 2010 07:57 UTC

Return-Path: <theturtle32@gmail.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 9022F3A6781 for <hybi@core3.amsl.com>; Sun, 22 Aug 2010 00:57:18 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.598
X-Spam-Level:
X-Spam-Status: No, score=-2.598 tagged_above=-999 required=5 tests=[BAYES_00=-2.599, HTML_MESSAGE=0.001]
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 I9c229VJlhKA for <hybi@core3.amsl.com>; Sun, 22 Aug 2010 00:57:17 -0700 (PDT)
Received: from mail-iw0-f172.google.com (mail-iw0-f172.google.com [209.85.214.172]) by core3.amsl.com (Postfix) with ESMTP id 276DE3A67BE for <hybi@ietf.org>; Sun, 22 Aug 2010 00:57:16 -0700 (PDT)
Received: by iwn3 with SMTP id 3so5049883iwn.31 for <hybi@ietf.org>; Sun, 22 Aug 2010 00:57:51 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type; bh=uIIK6cB1uKiW9nLL3PLaWzG3t/9ebl5II636UbiE1Fg=; b=BXf7WwOIzZGzvtNvGV54cyt31LDxA4odKWzltiWrgxLhWyFUdgcGooZ3T4SWYTAmwb MQNAsay2Ac1HeCrhpA1REBtVOuDkHj0vDub/hzvdTE7GqeCxlTf37Qr5Bg/9FSEO9KbP nML2u/hojOMVQgdS6JvcCNoWGpE9pyUiwD1TA=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=DuJJPHmI9ahZ10RkvjdAkB/sC5ioP1ZChtZFt2XXql0QKP9s5mVNWoCuCpV8kYzceu JVvubGrOSRi/Ls1dcCTGiCEqA/A2gYL8LThmpcm7t3Uh9wV+e0iFWlvEjozPBgACWJaG 6F8fiYdaNWSGzxdNI1tqoSVyYj03s0Ft4WY6w=
MIME-Version: 1.0
Received: by 10.231.161.73 with SMTP id q9mr4670185ibx.70.1282463870917; Sun, 22 Aug 2010 00:57:50 -0700 (PDT)
Received: by 10.231.158.82 with HTTP; Sun, 22 Aug 2010 00:57:50 -0700 (PDT)
In-Reply-To: <1282435214.2014.14.camel@tng>
References: <AANLkTimKbmcpgx8k0uXUWvCO=8w9pPrtV=3y4qh6363k@mail.gmail.com> <alpine.DEB.2.00.1008212037190.27211@tvnag.unkk.fr> <AANLkTinrsT+wV48nHvVW_1ChGYffkq7jisU2-PZnMyKg@mail.gmail.com> <alpine.DEB.2.00.1008212123460.27211@tvnag.unkk.fr> <20ef7ed5e135c57c1ee5a741658b9d98.squirrel@sm.webmail.pair.com> <1282423311.2014.6.camel@tng> <224b9ed365bd78fd5e316b8cb5f3f837.squirrel@sm.webmail.pair.com> <1282435214.2014.14.camel@tng>
Date: Sun, 22 Aug 2010 00:57:50 -0700
Message-ID: <AANLkTimo0MwZEMn1t1vrASfwC1bx82Q9Z_Ls3wVb-zUS@mail.gmail.com>
From: Brian <theturtle32@gmail.com>
To: Hybi <hybi@ietf.org>
Content-Type: multipart/alternative; boundary="001636e90310769ba8048e64e37f"
Subject: Re: [hybi] frame length encoding
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: Sun, 22 Aug 2010 07:57:18 -0000

Hey all!  I've been watching this list for two or three weeks now, and
decided to finally chime in.

As much as I feel that 63-bits is ridiculously large for the frame length,
I'd be happy to accept it and just move on to the next item of discussion --
though the WS server I'm writing right now will consider any frame with a
non-zero bit in the high 31-bits of the long long length field to be an
error condition, and immediately drop the rogue/attacking/misbehaving
client.  I don't want to be bound to treat absurdly large frames as
potentially legitimate by an overzealous specification.  Furthermore, I'm
writing my server with Node.js, which, being a JavaScript-based environment
itself, doesn't even have a 64-bit integer type of any sort.  I *can't*
correctly handle a 63-bit frame.  Ah, the irony of a protocol meant for
JavaScript applications that's impossible to fully implemented in JavaScript
(at least efficiently -- no bignum libraries allowed.)  And who knows what
would happen with the actual frame data in, say, a JavaScript String, with a
frame of a few terabytes?  Assuming anyone had that much RAM?   We're
talking about JavaScript clients here, so no streaming to disk, etc....

In my not-so-humble opinion, trying to accommodate sending large files
through WebSockets is a complete and utter misdirection.  The protocol
exists to provide real-time interactivity support to browsers.  That's what
it's meant for.  If someone wants to send large chunks of data (>4GB) in one
frame, they should find another protocol, because they're clearly not
planning to process it in JavaScript in a web-browser client.  And if
they're not running in the browser, there's no reason they have to use WS.
 Making abusers of the protocol chunk at 4GB boundaries is more than
reasonable when you consider that the vast majority of users won't begin to
consider sending fragments anywhere near even a fraction of that size.  This
is not and should not be an all-things to all-people protocol.  We shouldn't
be designing for these edge cases just because the protocol could
theoretically enable any number of diverse applications.

Lets get back to basics!  WebSockets was conceived to provide super-simple
bi-directional persistent communications on a platform -- the browser --
that had no such pre-existing canonical ability.  It's meant exclusively for
communicating with JavaScript-based applications running in a web browser.
 WebSockets may end up being used or abused for other things, but that is
not the intended purpose and, in my opinion, such uses shouldn't be the
concern of this working group.


Pedantic discussion of details and attempting to figure out how to
accomodate theoretical (ab)uses of this protocol has become a very real
distraction to the group.  The volume of mail generated by this list has
skyrocketed in the last week or so and most of the content can really be
summed up as quibbling over minutia.  Let's pick a reasonable solution and
move forward, even if a tiny subset of people who want to abuse WS for
something outside the browser don't like it.


For the record, my vote for frame size encoding goes to John's
original option #2.  It's simple, clean, easy, and efficient.  The only
change I'd make is to go to a 32-bit maximum, but I'm happy to accept a
63-bit field in the spec if it means we can move on.  Also, thank you, John,
for taking the time to attempt to steer this issue to consensus!  It's hard
to keep up with the current theoretical consensus of where the spec is going
with all the pedantry on the list at the moment.

As for the concern about keeping a sufficient number of reserved bits...
throw in a whole reserved byte and put a bow on it. :-)


Cheers,
Brian McKelvey




On Sat, Aug 21, 2010 at 5:00 PM, Patrick McManus <mcmanus@ducksong.com>wrote:

> On Sat, 2010-08-21 at 17:25 -0400, Shelby Moore wrote:
> > [snip]
> >
> > > 32 bits with chunking would be fine to accommodate zero copy.
> > >
> > > there are some folks that want to be able to send any message in one
> > > chunk for unrelated reasons.
> >
> > How can they send in one chunk if their file size is greater than 32 bit
> > length, if you limit the size to 32bit?
>
> I did not say they could fit 33 bits of stuff in a 32 bit bucket.
>
> I said that some folks want a >32 bit chunk size for reasons unrelated
> to zero copying performance.
>
>
>
>
> _______________________________________________
> hybi mailing list
> hybi@ietf.org
> https://www.ietf.org/mailman/listinfo/hybi
>