Re: [hybi] Subprotocol and Control Frames

John Tamplin <jat@google.com> Tue, 04 October 2011 20:30 UTC

Return-Path: <jat@google.com>
X-Original-To: hybi@ietfa.amsl.com
Delivered-To: hybi@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 79FA121F8F76 for <hybi@ietfa.amsl.com>; Tue, 4 Oct 2011 13:30:50 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -105.901
X-Spam-Level:
X-Spam-Status: No, score=-105.901 tagged_above=-999 required=5 tests=[AWL=0.075, 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 ([12.22.58.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id fRO8gaT7yYlE for <hybi@ietfa.amsl.com>; Tue, 4 Oct 2011 13:30:49 -0700 (PDT)
Received: from smtp-out.google.com (smtp-out.google.com [216.239.44.51]) by ietfa.amsl.com (Postfix) with ESMTP id 9D35621F8F75 for <hybi@ietf.org>; Tue, 4 Oct 2011 13:30:49 -0700 (PDT)
Received: from hpaq13.eem.corp.google.com (hpaq13.eem.corp.google.com [172.25.149.13]) by smtp-out.google.com with ESMTP id p94KXspo000602 for <hybi@ietf.org>; Tue, 4 Oct 2011 13:33:55 -0700
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=google.com; s=beta; t=1317760435; bh=7/5PXVGLvYhEcje/YCMpholV2nk=; h=MIME-Version:In-Reply-To:References:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=mI0FFXCyvDPviu34OU6ujzWEraxkUYObMylfR++UZ9fVfwt7H+g1zSWxb7jMAHNFr d2Ahi0LXSqvw3FsbcuiLw==
DomainKey-Signature: a=rsa-sha1; s=beta; d=google.com; c=nofws; q=dns; h=dkim-signature:mime-version:in-reply-to:references:from:date: message-id:subject:to:cc:content-type:x-system-of-record; b=iWeGw2v/yrP+chyhwcxA3qx4sJg5cpYBRuax7Nxuoq4XF40F4c5MXMoIVxcjIALWr 6zu3ORWjTo0acIqjLXBJQ==
Received: from yxi11 (yxi11.prod.google.com [10.190.3.11]) by hpaq13.eem.corp.google.com with ESMTP id p94KXVhA016846 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NOT) for <hybi@ietf.org>; Tue, 4 Oct 2011 13:33:53 -0700
Received: by yxi11 with SMTP id 11so1290286yxi.22 for <hybi@ietf.org>; Tue, 04 Oct 2011 13:33:53 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=beta; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=2AxiI+E38fCNZy/ViqjkGVV2tSJsSPFE11WgiLTN7ag=; b=gwgVUG/Avg4NG9X2PJVSaQ62DLgZepzkBpHTd5YI6zZFoyl5RrWwdXYl8XV3yFTgoh 6eDdzWbqaiqOXWw/n8SQ==
Received: by 10.150.73.41 with SMTP id v41mr1610635yba.230.1317760433313; Tue, 04 Oct 2011 13:33:53 -0700 (PDT)
Received: by 10.150.73.41 with SMTP id v41mr1610631yba.230.1317760433141; Tue, 04 Oct 2011 13:33:53 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.150.96.7 with HTTP; Tue, 4 Oct 2011 13:33:33 -0700 (PDT)
In-Reply-To: <92457F4F764A5C4785FCDBDDDD76477A123C6E12@dfweml506-mbx>
References: <92457F4F764A5C4785FCDBDDDD76477A123C6E12@dfweml506-mbx>
From: John Tamplin <jat@google.com>
Date: Tue, 04 Oct 2011 16:33:33 -0400
Message-ID: <CABLsOLDsJw7Eh0xa3VvRikO8KORYodrsXtLDt-XzCE-8h6PU6w@mail.gmail.com>
To: Hapner mark <hapner.mark@huawei.com>
Content-Type: multipart/alternative; boundary="000e0cd5914684388604ae7f02eb"
X-System-Of-Record: true
Cc: "hybi@ietf.org" <hybi@ietf.org>
Subject: Re: [hybi] Subprotocol and Control Frames
X-BeenThere: hybi@ietf.org
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: Server-Initiated HTTP <hybi.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/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: Tue, 04 Oct 2011 20:30:50 -0000

On Tue, Oct 4, 2011 at 4:23 PM, Hapner mark <hapner.mark@huawei.com> wrote:
>
>  In my reading of draft 17, I do not find a definition of subprotocol that
> puts any restrictions on the WebSocket extensibility features a subprotocol
> may use. If the sense of the WG is that subprotocols are restricted to use
> only extension data and message format/schema restrictions, this is not
> apparent in the content of this draft.
>

So where do you see that a subprotocol may define new opcodes or change the
framing?  There are an infinite number of things the spec doesn't say can't
be done.


>  It is my observation that there will be a number of WebSocket usecases
> that could benefit from the ability to define usecase-specific control
> frames to mediate message flow. Telling developers to stuff this mediation
> protocol into extension data rather than in control frames does not appear
> to increase security; rather, it likely decreases security because it
> intermixes control with data which is a fundamentally bad thing for a
> protocol design to do.
>

WS control frames are there for WS implementations, not for higher-level
protocols.  Similarly, you can't directly control ICMP frames from your UDP
connection.  If you want your own control frames, you layer them on top of
the lower level protocols.


>  The two control frames defined by MBWS are fairly simple and are likely
> representative of what other subprotocols would need. It would be far better
> to allow MBWS to properly factor its control and data than force it to put
> control in its data.
>

There are very few available opcodes.  If every subprotocol allocates a
couple that it needs, there won't be many subprotocols.


>  It is true that TCP does not support application control extension;
> however, HTTP clearly does support this with a very open-ended extension of
> the HTTP header. The WG needs to think carefully about this. I hope there is
> room to resolve this issue in this version of WebSocket.
>

HTTP doesn't send a separate control frame, it is sent as a prefix to the
higher-level payload, exactly as we are suggesting you do.


>  It is up to the W3C WebSocket API to insure it provides the functionality
> that both native users of WebSocket and implementors of WebSocket
> subprotocols require. In looking over what is currently defined, this API
> does not yet provide an API sufficient for the later. Possibly later it
> will. I don't believe that the design of WebSocket needs to be restricted by
> the current limitations of this API.
>

There are many examples where the protocol is not restricted by the API --
for example, the JS API did not even support binary frames when they were
present in the wire protocol.

-- 
John A. Tamplin
Software Engineer (GWT), Google