Re: [hybi] frame length encoding

gustav <gustav.trede@gmail.com> Sun, 22 August 2010 11:52 UTC

Return-Path: <gustav.trede@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 80E463A681A for <hybi@core3.amsl.com>; Sun, 22 Aug 2010 04:52:35 -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 eC8RhECLVYVE for <hybi@core3.amsl.com>; Sun, 22 Aug 2010 04:52:34 -0700 (PDT)
Received: from mail-ww0-f44.google.com (mail-ww0-f44.google.com [74.125.82.44]) by core3.amsl.com (Postfix) with ESMTP id ADBAB3A67F2 for <hybi@ietf.org>; Sun, 22 Aug 2010 04:52:33 -0700 (PDT)
Received: by wwb24 with SMTP id 24so196133wwb.13 for <hybi@ietf.org>; Sun, 22 Aug 2010 04:53:07 -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:cc:content-type; bh=fwMtCSSaBJ6dzMWMNZNv0hkQosL36wa1MkbgdJW1ZEk=; b=TsEQEHGKUIrBjMwoO23Zvk3x+wdhTpc7MScBDB/fin9IwnhE2dCAiiAo1DvbvlZIo5 fRruESteeYPgDy88YlWiNkW+KW2zPLgfkhKqex+O2X1AYHqF/iaeA4o1YMFE2CuAfM9t L/ZEPc2yHuuF6n6zFCuIe5dKMep3ZK+zapWG4=
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 :cc:content-type; b=Mso7YXMOA/YbWN7YQuG/I5icd3CwCfrqcy2o+5HHoOCbnaJwFzh3KwDVDBuZ9XquQQ uTiA1vemy7FSgcbti2X8TYVaKjJGPb23YCV10mCgC2DIDDKPdjnHWGsPrKiprwdA9GmS v/KtAru1cYGuXiYe2xUiFv7lelmFx1uPbCf+4=
MIME-Version: 1.0
Received: by 10.216.48.146 with SMTP id v18mr3346713web.56.1282477987098; Sun, 22 Aug 2010 04:53:07 -0700 (PDT)
Received: by 10.216.172.139 with HTTP; Sun, 22 Aug 2010 04:53:06 -0700 (PDT)
In-Reply-To: <df4ec71d2b12d9ea3b9d8baead548c27.squirrel@sm.webmail.pair.com>
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> <AANLkTimo0MwZEMn1t1vrASfwC1bx82Q9Z_Ls3wVb-zUS@mail.gmail.com> <b95f074b65875865802f532bb5668ff2.squirrel@sm.webmail.pair.com> <AANLkTi=AXLFPSASV2zkBiUU=1StO=YSrKq_9AZ2ZnVHy@mail.gmail.com> <8cd6ecfebb4a073ecf94c8e1aa56e642.squirrel@sm.webmail.pair.com> <77aecf89c6c8673f1b999f80fa04e005.squirrel@sm.webmail.pair.com> <df4ec71d2b12d9ea3b9d8baead548c27.squirrel@sm.webmail.pair.com>
Date: Sun, 22 Aug 2010 13:53:06 +0200
Message-ID: <AANLkTims5LYudzQzw5QxDpU3q1NGb3GQe_MG=SNQvg-Z@mail.gmail.com>
From: gustav <gustav.trede@gmail.com>
To: shelby@coolpage.com
Content-Type: multipart/alternative; boundary="001485f6c762da7496048e682c3c"
Cc: Hybi <hybi@ietf.org>
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 11:52:35 -0000

On 22 August 2010 13:31, Shelby Moore <shelby@coolpage.com> wrote:

> Just got back from 2-mile jog, nice way to process and focus thoughts...
> (due the fact that the brain solves the N-dimension space via annealing,
> so doing something entirely different can jolt your Newton gradient over a
> hill into a deeper N-space global minima)
>
> below for the key point...
>
> >>>  The only thing that truly matters are what kinds of messages we want
> >>> to
> >>> handle with the protocol.  My point is that there's no reason for a
> >>> websocket client or server to handle a single message >4GB.
> >>
> >>
> >> You won't have to.  You will tell the other end your maximum frame size
> >> on
> >> the connection handshake, then the other end will re-fragment if
> >> necessary.
> >>
> >>
> >>>  For my chat
> >>> server that I'm building, any incoming message larger than 64KB is
> >>> likely
> >>> to
> >>> be ill-intended, and that's a very generous threshold.  Clearly the
> >>> threshold would be different for someone else's application.
> >>
> >> Apologies I forgot to make the above point in my prior reply. I could
> >> have
> >> been more concensus driven with that.
> >
> > [snip]
> >
> >>
> >> I do agree that I should not have made the point that you need to
> >> process
> >> 64-bit frames.  That would not be a free market. Rather we must have
> >> re-fragmentation, so that no WS server has to be forced into any maximum
> >> size.
> >
> > Given the above point, those who are arguing against the CPU load to test
> > for value 126 and 127 to fork to 16-bit and 63-bit frame size of Option
> 2,
> > we instead could consider adding a byte to the header and give 1 to 32766
> > sizes without any test.  The end could set its maximum frame size to
> 32766
> > on connection handshake, and then it never needs to perform that logic in
> > CPU.  They just load 2 byte size field and use it.
> >
> > That eliminates the 16-bit size field of Option 2.  It is extends the
> size
> > field of Option 1.
> >
> > That would cost us an extra byte on every frame, but the minimum frame
> > size is 3 already, and those who were arguing that point, said that
> > network speed will increase faster than CPU because there is no way to
> > parallelize (use multi-cores) for a serial channel that has no rewind
> > feature (unless you buffer and use pipelining perhaps?).
>
>
> This could be referred to as Option 1/15-bit.
>
> Note that although the re-fragmentation will still incur CPU overhead for
> large frames, the point was that this new option eliminates the CPU
> overhead when there wasn't going to be re-fragmentation (most frames' byte
> size smaller than 15-bit).  And we must have the re-fragmentation any way,
> because some servers simply won't be able to handle large frame sizes for
> any number of possible reasons.
>
> So if we place important priority on the possibility that network speeds
> will outpace CPU speeds (due to multi-core point), then our choice boils
> down to either Option 1/15-bit or Option 1/7-bit.  But 7-bits seems aweful
> small as a useful maximum size.  So I think Option 1/15-bit is our only
> choice that will bring concensus?
>
> And the Option 1/15-bit is actually more efficient than Option 2, for
> frame size between 126 to 32767.  It is equally efficient for > 32767.
> And it only costs 1 extra byte below 126 in size.
>
> And what happens if we don't do Option 1/15-bit and indeed network speed
> has a radical burst upward relative to single-core CPU speed?  See my
> point about a possible radical shift in the realized market speed soon due
> to global financial rebalancing via hyper-inflation (networks here may
> have fast enough CPUs but overloaded pipes due to fact that pipes are not
> regulatory subsidized here like they are in the socialized "rich"
> countries):
>
> Where is the _proof_ of network speed is outgrowing cpu speed on the long
term ?.
Its imo more about some people having a hard time to design efficient
scalable code and hence even modern multi core CPUs becomes a rock wall  for
their throughput.

Should doomsday theories, or the presumed but unquantified incompetence of
the general programmer be the basis for a new protocol ?. I don't think so,
but its just me.

regards
 gustav trede