Re: [hybi] Frame size

"Thomson, Martin" <Martin.Thomson@andrew.com> Sun, 18 April 2010 22:59 UTC

Return-Path: <Martin.Thomson@andrew.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 3A5DB3A6A08 for <hybi@core3.amsl.com>; Sun, 18 Apr 2010 15:59:52 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -0.922
X-Spam-Level:
X-Spam-Status: No, score=-0.922 tagged_above=-999 required=5 tests=[AWL=-0.182, BAYES_20=-0.74]
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 w51LwE460rfD for <hybi@core3.amsl.com>; Sun, 18 Apr 2010 15:59:51 -0700 (PDT)
Received: from csmailgw2.commscope.com (csmailgw2.commscope.com [198.135.207.242]) by core3.amsl.com (Postfix) with ESMTP id 6689A3A676A for <hybi@ietf.org>; Sun, 18 Apr 2010 15:59:51 -0700 (PDT)
Received: from [10.86.20.102] ([10.86.20.102]:39508 "EHLO ACDCE7HC1.commscope.com") by csmailgw2.commscope.com with ESMTP id S68119Ab0DRW7l (ORCPT <rfc822; hybi@ietf.org>); Sun, 18 Apr 2010 17:59:41 -0500
Received: from SISPE7HC1.commscope.com (10.97.4.12) by ACDCE7HC1.commscope.com (10.86.20.102) with Microsoft SMTP Server (TLS) id 8.1.436.0; Sun, 18 Apr 2010 17:59:40 -0500
Received: from SISPE7MB1.commscope.com ([fe80::9d82:a492:85e3:a293]) by SISPE7HC1.commscope.com ([fe80::8a9:4724:f6bb:3cdf%10]) with mapi; Mon, 19 Apr 2010 06:59:38 +0800
From: "Thomson, Martin" <Martin.Thomson@andrew.com>
To: Ian Hickson <ian@hixie.ch>
Date: Mon, 19 Apr 2010 07:01:06 +0800
Thread-Topic: [hybi] Frame size
Thread-Index: AcrdnmIElWWjCv7FQiaZotRyQr60aABq51ww
Message-ID: <8B0A9FCBB9832F43971E38010638454F03E7D0678C@SISPE7MB1.commscope.com>
References: <8B0A9FCBB9832F43971E38010638454F03E3F313ED@SISPE7MB1.commscope.com> <Pine.LNX.4.64.1004161940180.751@ps20323.dreamhostps.com>
In-Reply-To: <Pine.LNX.4.64.1004161940180.751@ps20323.dreamhostps.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
acceptlanguage: en-US
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-BCN: Meridius 1000 Version 3.4 on csmailgw2.commscope.com
X-BCN-Sender: Martin.Thomson@andrew.com
Cc: Hybi <hybi@ietf.org>
Subject: Re: [hybi] Frame size
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, 18 Apr 2010 22:59:52 -0000

> > IF used for UTF-8 AND implementer counts characters instead of octets
> > THEN framing doesn't work. [...] One solution to this problem is to
> > start a frame with a known sequence of octets, so that this can be
> > detected.
> 
> That's an interesting approach, but I worry that anything hardcoded
> like
> this would be handled in ways that defeat the purpose. This is why, for
> instance, the proposed handshake uses unpredictable keys to force the
> server to prove it read the handshake -- otherwise, servers written by
> amateurs might not actually read the handshake but just send back the
> right response, simply assuming the handshake came from a Web Socket
> server. 

You could complicate this if you like.  Perhaps each "fixed" sequence is based on the output of a pseudorandom sequence, the seed to which is assigned in the handshake.  I'd like to better understand what this is buying though.*

--Martin

* ...just as I would like to understand the same for the handshake.