Re: [hybi] I-D Action:draft-ietf-hybi-thewebsocketprotocol-05.txt

John Tamplin <jat@google.com> Thu, 10 February 2011 15:58 UTC

Return-Path: <jat@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 D6AB83A69C8 for <hybi@core3.amsl.com>; Thu, 10 Feb 2011 07:58:21 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -102.976
X-Spam-Level:
X-Spam-Status: No, score=-102.976 tagged_above=-999 required=5 tests=[BAYES_00=-2.599, FM_FORGED_GMAIL=0.622, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-1, 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 fGeKhGtFvPeu for <hybi@core3.amsl.com>; Thu, 10 Feb 2011 07:58:20 -0800 (PST)
Received: from smtp-out.google.com (smtp-out.google.com [74.125.121.67]) by core3.amsl.com (Postfix) with ESMTP id 502893A69FB for <hybi@ietf.org>; Thu, 10 Feb 2011 07:58:20 -0800 (PST)
Received: from kpbe19.cbf.corp.google.com (kpbe19.cbf.corp.google.com [172.25.105.83]) by smtp-out.google.com with ESMTP id p1AFwVl3020426 for <hybi@ietf.org>; Thu, 10 Feb 2011 07:58:31 -0800
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=google.com; s=beta; t=1297353512; bh=x0cKcXnd1vDNv5LPWSgQLMcjFsE=; h=MIME-Version:In-Reply-To:References:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=b2mST7INko6vCVvu0Jpf7Zy7yh2jpvT07dTSi2VrBSudSneOpGP4aT603PZ06he9T qfEUNDnuG3+4MufZQsVlg==
Received: from gwj15 (gwj15.prod.google.com [10.200.10.15]) by kpbe19.cbf.corp.google.com with ESMTP id p1AFwTuE027571 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for <hybi@ietf.org>; Thu, 10 Feb 2011 07:58:29 -0800
Received: by gwj15 with SMTP id 15so820145gwj.7 for <hybi@ietf.org>; Thu, 10 Feb 2011 07:58:29 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=beta; h=domainkey-signature:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=YSOQVA4HUO51mziMIRplc4NHZdkoQApZA1G6MVcBdjk=; b=OptjG07bBVrlYdpztRAOvRQTHHUVadw7/vMl8K9Flr6+FQ+rrmVjznH3xk02bm973e 0FoV2Piu9a1s6ZKIeITA==
DomainKey-Signature: a=rsa-sha1; c=nofws; d=google.com; s=beta; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; b=MhPThiHtH5ESsCevS8Q081lqUtToCXdm7aba1FGXH60ZIui0d+cT6oaR9SxKFFD/n/ 7mu9BFAgQaeQuXY3ujzA==
Received: by 10.150.186.14 with SMTP id j14mr3347672ybf.149.1297353461221; Thu, 10 Feb 2011 07:57:41 -0800 (PST)
MIME-Version: 1.0
Received: by 10.150.206.19 with HTTP; Thu, 10 Feb 2011 07:57:20 -0800 (PST)
In-Reply-To: <OF44DCAB38.CFF4042C-ON88257833.0030697C-88257833.003C5A3E@playstation.sony.com>
References: <20110208231502.31262.8249.idtracker@localhost> <OF44DCAB38.CFF4042C-ON88257833.0030697C-88257833.003C5A3E@playstation.sony.com>
From: John Tamplin <jat@google.com>
Date: Thu, 10 Feb 2011 10:57:20 -0500
Message-ID: <AANLkTimdy0tQrdMHdN7bX7ty=A47qr9oag+nAcx3RtqR@mail.gmail.com>
To: Yutaka_Takeda@playstation.sony.com
Content-Type: multipart/alternative; boundary="000e0cd51b5439a251049befa4c3"
X-System-Of-Record: true
Cc: hybi@ietf.org
Subject: Re: [hybi] I-D Action:draft-ietf-hybi-thewebsocketprotocol-05.txt
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, 10 Feb 2011 15:58:21 -0000

On Thu, Feb 10, 2011 at 5:59 AM, <Yutaka_Takeda@playstation.sony.com> wrote:

> o  Section 4.3 - Continuation frame (opcode=%x0)
>
> It is not clear to me in the document how this frame (opcode=0) is used
> while there's
> FIN bit for fragmentation/defragmentation.
>

The reasonable options are:
 1) define a different frame format for continuation frames that doesn't
have opcodes
 2) use the same opcode as the original frame
 3) use a new opcode

#1 adds complexity and wastes bits for little benefit.  #3 has the benefit
of allowing you to detect the four states of a frame (single-frame message,
initial frame of fragmented message, middle frame of fragmented message,
final frame of fragmented message) if you care, and also provides
opportunity for more error checking.


> Section 4.4 says,
> "..., and terminated by a single frame with the FIN bit set and an opcode
> of 0"
>
> Considering a case where there are text and binary frames that are both
> fragmented
> and alternating over the wire, how can application tell which frame (text
> or binary) the
> last frame with FIN=1 set belongs to?
>
> For example:
> [op=txt, fin=0] [op=bin, fin=0] [op=0, fin=1] <== is this for txt or bin?
>
> Is this kind of multiplexing support intended in the protocol design? If
> the doc explains
> why and how fragmentation is used.
>

No, see 4.4.  Only control frames can be sent in the middle of a fragmented
message (I believe the "open question" line is out of date -- I think the
consensus was that control frames can be injected in the middle of a
fragmented message, otherwise the latency of responding to ping, for
example, would be very long if behind a large message), and control frames
cannot be fragmented.  Multiplexing will be defined as an extension and will
include logical channels.  Even in #2, you would have to maintain the frame
type from the original frame to avoid attacks like [BINARY "invalid UTF8"]
[TEXT/FIN "UTF8"] which could exploit bugs in UTF8 decoders.

o Overall


> As I was reading though, it took some time to find out which feature is for
> which entities
> role as in protocol layering. Ping/pong protocol for example, I am still
> not sure if
> this is done by WebSocket protocol internally or exposed to application.
> Another
> examples would be the extension data filed - who is going to parse it?


The WebSocket implementation will be the one to at least extract the
extension data from the frame, but the interpretation of that data will be
defined by the extension.  It may be processed by the WebSocket layer or the
application depending on the extension.

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