[hybi] Multiplexing in WebSocket (Was: HyBi Design Space)

Ian Hickson <ian@hixie.ch> Fri, 09 October 2009 21:34 UTC

Return-Path: <ian@hixie.ch>
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 D928E3A63D3 for <hybi@core3.amsl.com>; Fri, 9 Oct 2009 14:34:53 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -3.827
X-Spam-Level:
X-Spam-Status: No, score=-3.827 tagged_above=-999 required=5 tests=[AWL=-1.228, BAYES_00=-2.599]
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 4lh2jQ7IUeIP for <hybi@core3.amsl.com>; Fri, 9 Oct 2009 14:34:52 -0700 (PDT)
Received: from looneymail-a1.g.dreamhost.com (caibbdcaaaaf.dreamhost.com [208.113.200.5]) by core3.amsl.com (Postfix) with ESMTP id CE9DD28C0FF for <hybi@ietf.org>; Fri, 9 Oct 2009 14:34:52 -0700 (PDT)
Received: from hixie.dreamhostps.com (hixie.dreamhost.com [208.113.210.27]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by looneymail-a1.g.dreamhost.com (Postfix) with ESMTP id 7A5B815D8C3; Fri, 9 Oct 2009 14:36:37 -0700 (PDT)
Date: Fri, 09 Oct 2009 21:47:10 +0000
From: Ian Hickson <ian@hixie.ch>
To: Salvatore Loreto <salvatore.loreto@ericsson.com>
In-Reply-To: <4ACF4055.6080302@ericsson.com>
Message-ID: <Pine.LNX.4.62.0910092116010.21884@hixie.dreamhostps.com>
References: <4ACE50A2.5070404@ericsson.com> <3a880e2c0910081600v3607665dp193f6df499706810@mail.gmail.com> <4ACF4055.6080302@ericsson.com>
Content-Language: en-GB-hixie
Content-Style-Type: text/css
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset="US-ASCII"
Cc: "hybi@ietf.org" <hybi@ietf.org>
Subject: [hybi] Multiplexing in WebSocket (Was: HyBi Design Space)
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: Fri, 09 Oct 2009 21:34:54 -0000

On Fri, 9 Oct 2009, Salvatore Loreto wrote:
>
> again the multipexing is something important for both server developers, 
> but as far I understood following the discussion in whatwg ml, also 
> browser developers or at least w3c people agree that WebSocket protocol 
> as proposed could be improved, also with the help of HyBi, to support 
> other features and "in-protocol multiplexing sounds like one of the most 
> valuable additional features"

FWIW, so far I've concluded (based on long discussions with a number of 
developers and implementors) that multiplexing would actually not be that 
great. It could probably only be used for multiplexing to a single 
websocket path, without making the handshake highly asymmetric or breaking 
the HTTP compatibility. If it's intended for per-client multiplexing, it 
can easily be implemented at the application layer, where a much better 
job can be done that could be done at the protocol layer. If it's intended 
for multiclient multiplexing, then it's only helping server load, not 
client performance, and server load isn't especially an issue here.

It's not analogous to keepalive and pipelining in HTTP. In HTTP, the cost 
is in setting up the connection, which happens a lot. Multiple resources 
on one origin incur multiple TCP round trips just to get the connections 
set up, and this can severely impact performance. However, WebSocket 
connections are long lived by design, and the cost of setting up a 
connection therefore is insignificant compared to the cost of the protocol 
itself. There's also something to be said for relying on TCP's built in 
congestion control -- if you were to open two connections to a server, 
one sending vast amounts of data, and one sending just the occasional 
critically important notification, it would be best if the latter could 
avoid getting throttled along with the first.

As with anything, though, there's always the option of changing this if 
strong arguments one way or the other are put forward. We can also 
introduce multiplexing as a new version of the protocol in a future 
version.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'