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

Andy Green <andy@warmcat.com> Thu, 10 February 2011 11:35 UTC

Return-Path: <andy.warmcat.com@googlemail.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 792C73A697B for <hybi@core3.amsl.com>; Thu, 10 Feb 2011 03:35:20 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -3.599
X-Spam-Level:
X-Spam-Status: No, score=-3.599 tagged_above=-999 required=5 tests=[BAYES_00=-2.599, RCVD_IN_DNSWL_LOW=-1]
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 AQ4lE0TnCm5I for <hybi@core3.amsl.com>; Thu, 10 Feb 2011 03:35:19 -0800 (PST)
Received: from mail-wy0-f172.google.com (mail-wy0-f172.google.com [74.125.82.172]) by core3.amsl.com (Postfix) with ESMTP id AEC9D3A698E for <hybi@ietf.org>; Thu, 10 Feb 2011 03:35:18 -0800 (PST)
Received: by wyf23 with SMTP id 23so1292918wyf.31 for <hybi@ietf.org>; Thu, 10 Feb 2011 03:35:29 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:sender:message-id:date:from:user-agent :mime-version:to:cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=rEFuh/gwW3vjvFMhBKPSQ18jxyuPnAz7M9aqFJ+hpJ0=; b=k0kkHc2M8kMq1mtuVXQjwcRMkiMveb1TmvjuaHLJ3mH22oEeqNLyLGiq3QOiqYVaGT /DG5AnkALsyeEbeAvXSf92YHRWucSFTy0d3z7aivixoBqsXfw3iKYxUGnggX0y4xEFdI Q93ftOPuMRdn1TF9/oZwoLrjQLwi2pTZ0mA1E=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; b=D6HBAmmzbL5vm9yJCbeySS8/lawXEUur/vKt5D1XmUxa4SgQtn65qYbj/BO92Tu3RQ nEn1+ZTUD+Y6K/gLyy5rRfs6DHMezQr6QLdu0UzFYQrGqVY8ZrHKg1LXyAmNRyCHSMN9 9WyoztSBQiAaIKWgcqqwn9JKzgnrt4YMWefCw=
Received: by 10.227.133.11 with SMTP id d11mr7452941wbt.193.1297337729114; Thu, 10 Feb 2011 03:35:29 -0800 (PST)
Received: from [192.168.1.4] (cpc1-nrte21-2-0-cust677.8-4.cable.virginmedia.com [81.111.78.166]) by mx.google.com with ESMTPS id f27sm1151501wbf.19.2011.02.10.03.35.27 (version=SSLv3 cipher=RC4-MD5); Thu, 10 Feb 2011 03:35:28 -0800 (PST)
Sender: Andy Green <andy.warmcat.com@googlemail.com>
Message-ID: <4D53CD80.5040708@warmcat.com>
Date: Thu, 10 Feb 2011 11:35:28 +0000
From: Andy Green <andy@warmcat.com>
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101217 Fedora/3.1.7-0.39.b3pre.fc15 Thunderbird/3.1.7
MIME-Version: 1.0
To: Yutaka_Takeda@PlayStation.Sony.Com
References: <OF44DCAB38.CFF4042C-ON88257833.0030697C-88257833.003C5A3E@playstation.sony.com>
In-Reply-To: <OF44DCAB38.CFF4042C-ON88257833.0030697C-88257833.003C5A3E@playstation.sony.com>
Content-Type: text/plain; charset="UTF-8"; format="flowed"
Content-Transfer-Encoding: 8bit
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 11:35:20 -0000

On 02/10/11 10:59, Somebody in the thread at some point said:

こんばんわ、ゆたかさん

> It would be better if the document describes expected behavior of server
> and client
> when Sec-Websocket-Protocol header is not present.

I guess it's just the degenerate case that the server only supports one 
protocol.

> o Section 2.1 - typo?
>
> What is IRI? You mean, "URL"?

It's "internationalized"

http://www.w3.org/International/O-URL-and-ident.html

> e.g.)
> 0x0: continuation frame
> 0x1: connection close (A control frame)
> 0x2: ping (A control frame)
> 0x3: pong (A control frame)
> 0x4: text frame
> 0x5: binary frame
> 0x6-F: reserved

Yes it's a nice idea.

> 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.

Right it wasn't clear to me either.

> 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.

It's not defined yet that muxing is allowed, it'll be an extension it 
seems.  When muxing is allowed, there will be a stream index in each 
fragment to allow deterministic reassembly.

> It is no clear to me what 0x43 and 0x53 are trying to achieve. In TCP,
> there is FIN with no
> details of why/who is closing for graceful shutdown.

I guess it at least is documentation if you are looking in tcpdump.

> It would be better if there is some description for why we have ping and
> pong frames,
> especially for implementers. For example, ping/pong can be used to keep TCP
> connection alive at application level which can be transparent to
> application. But it can
> also be used for app to detect 'presence' of a client for the use in the
> app.
> (# I myself can not tell what the original intention is by just reading
> -05.)

Yeah.

> 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.

In libwesockets

http://git.warmcat.com/cgi-bin/cgit/libwebsockets/

the library takes care of all control frames.  It passes a message to 
the user callback to notify PONG receipt but it just returns by default. 
  The actual CONTINUATION, CLOSE, PING, PONG service is done in the 
library without bothering user code.

BTW libwebsockets is C, LGPL2, maybe it can help you.

> Another
> examples would be the extension data filed - who is going to parse it?

For extensions that are transparent, like gzip or mux, then the 
websocket library can hide it from the user.  Anything more complicated 
will have to be a co-operation between library and user handling.

> Most of this ambiguity may be clear in the use of JS under WebSocket
> API. But I am
> coming from non-browser perspectives and I would probably need to figure
> out
> how to implement *protocol API* for non-application developers for example.

Yeah that is my situation too.

> If there's a layer structure with interfaces defined in the document,
> that would be a
> great help - something like:

I think that is probably out of scope, the protocol stands alone and 
it's best to restrict what it tries to define to what goes on the wire.

-Andy