Re: [hybi] Call for interest: multiplexing dedicated for WebSocket

Tobias Oberstein <tobias.oberstein@tavendo.de> Tue, 11 June 2013 09:08 UTC

Return-Path: <tobias.oberstein@tavendo.de>
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 4188121F8618 for <hybi@ietfa.amsl.com>; Tue, 11 Jun 2013 02:08:58 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.599
X-Spam-Level:
X-Spam-Status: No, score=-2.599 tagged_above=-999 required=5 tests=[BAYES_00=-2.599]
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 nvctEtTag2Eq for <hybi@ietfa.amsl.com>; Tue, 11 Jun 2013 02:08:53 -0700 (PDT)
Received: from EXHUB020-2.exch020.serverdata.net (exhub020-2.exch020.serverdata.net [206.225.164.29]) by ietfa.amsl.com (Postfix) with ESMTP id C254F21F8476 for <hybi@ietf.org>; Tue, 11 Jun 2013 02:08:52 -0700 (PDT)
Received: from EXVMBX020-12.exch020.serverdata.net ([169.254.3.90]) by EXHUB020-2.exch020.serverdata.net ([206.225.164.29]) with mapi; Tue, 11 Jun 2013 02:08:34 -0700
From: Tobias Oberstein <tobias.oberstein@tavendo.de>
To: Adam Rice <ricea@google.com>
Date: Tue, 11 Jun 2013 02:08:30 -0700
Thread-Topic: [hybi] Call for interest: multiplexing dedicated for WebSocket
Thread-Index: Ac5lqdMzGEOxHqpIRDmKKb1rUan8QQAx4Jbw
Message-ID: <634914A010D0B943A035D226786325D4422DDFCBCA@EXVMBX020-12.exch020.serverdata.net>
References: <CAH9hSJZxr+aG7GZa4f-dUOTGj4bnJ+3XxivUX4jei5CMyqN4LQ@mail.gmail.com> <CAH9hSJZUG1f+3Uk=t2=A5i4O9=wPvAisspM=pgmGEH9emTL9-Q@mail.gmail.com> <CAH9hSJZai_UuxW4O6mZcEJT2DJoURtLo16XNci1qkYVWv4HVdg@mail.gmail.com> <007501ce56f0$67f74080$37e5c180$@noemax.com> <519CD6A1.7080708@ericsson.com> <519CE075.4000106@tavendo.de> <CAM5k6X9WmO80hiQZ6_GqK66PAd3of=2ZRi9=VrWj52apA1+=5g@mail.gmail.com> <CAFWmRJ2Hbe0x5FeV2T7Gkp3WEsxQHe2=YPBTgvHYLcus3A4rBQ@mail.gmail.com> <CAH9hSJYOPvsFPDXLOa29ASd8xavLdvfRK_cVd=Uc=Vaydz1O=w@mail.gmail.com> <CAFWmRJ2M0Gtoz80+6v+=0Ldm9+xE2brqD2shVcBPuNz+QGiKHg@mail.gmail.com> <634914A010D0B943A035D226786325D4422DC20DAA@EXVMBX020-12.exch020.serverdata.net> <CAH9hSJY_f4jS1ks1xzNmJSX5c+BxJv=-cNs5iS4mP2rZvtsvTQ@mail.gmail.com> <634914A010D0B943A035D226786325D4422DC213B9@EXVMBX020-12.exch020.serverdata.net> <CAHixhFr39Ymm6wCeMaF_y+VpC7DVDMFKWDaz_WOixQu=HQEsOw@mail.gmail.com>
In-Reply-To: <CAHixhFr39Ymm6wCeMaF_y+VpC7DVDMFKWDaz_WOixQu=HQEsOw@mail.gmail.com>
Accept-Language: de-DE, en-US
Content-Language: de-DE
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
acceptlanguage: de-DE, en-US
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
Cc: Simone Bordet <sbordet@intalio.com>, "hybi@ietf.org" <hybi@ietf.org>
Subject: Re: [hybi] Call for interest: multiplexing dedicated for WebSocket
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, 11 Jun 2013 09:08:58 -0000

Am 10.06.2013 09:12, schrieb Adam Rice:> I believe our priority is to finalise a multiplexing specification 
> quickly. So we should focus on what is essential for multiplexing to be 
> useful.

I agree.

I'd like to note however that "useful" from my POV depends on use-case. 

Reducing the number of physical TCPs in scenarios like

1. multiple web apps of a single vendor open in multiple browser tabs
2. web widget from a vendor embedded into pages of many sites

might already be well addressed with MUX+flow-control and don't necessarily need priorization.

Scenarios like e.g.

3. single app with multiple communication requirements with different  TOS (low-latency/mass..)

might need MUX+flow-control+priorization.

> I think we have general consensus that flow control is essential.

Yep, seems nobody stepped up for multiplexing _without_ flow control.

> I have not been convinced that prioritisation is essential. In the event 

It's not essential for use case 1. + 2. above, I agree. But it is for use case 3.

> for different traffic types. To make this easier to deploy, I am leaning 
> towards the idea that wss://a.example.com/ <http://a.example.com/> and 
> wss://b.example.com/ <http://b.example.com/> should be considered 
> distinct endpoints, even if the IP address is the same.

+1 for making those "different" (cannot be mux'ed over same physical WS).

> I am not saying that prioritisation is not desirable, just that I don't 
> think the complexity versus benefit tradeoff makes sense right now.

Ok. I agree that specifying different scheduling schemes etc in detail now
would delay the draft.

However, even the current draft contains text

"""
13. Fairness

Sender side

   o  The sender MUST use a fair mechanism for selecting which logical
      channel's data to send in the next WebSocket message.  Simple
      implementations may choose a round-robin scheduler, while more
      advanced implementations may adjust priority based on the amount
      or frequency of data sent by each logical channel.
"""

Here is an idea: could we just include minimal additions which would allow
describing specific scheduling algorithms later or in separate documents?

Like e.g. the "permessage-compression" draft does: it provides a _framework_
for compression schemes, and only specs 1 algo: deflate.


Here is a proposal that only adds to the opening handshake on physical and logical WS:

************************

1) Handshake on physical WS

Example 1.1

client-to-server: "mux; scheduler=roundrobin"

=> client announces MUX, and states that it implements only "roundrobin" scheduler.

server-to-client: "mux; scheduler=roundrobin"

=> server agrees to speak MUX and round-robin scheduling

Only "roundrobin" would be described in the current draft.

Example 1.2

client-to-server: "mux; scheduler=priority, mux; scheduler=roundrobin"

=> client annouces MUX, preferring "priority" based scheduler, but may fallback to roundrobin

server-to-client: "mux; scheduler=priority"

=> server agrees to speak MUX and select priority-based scheduling

Detailing "priority" scheduling would be postponed.


2) Handshake on logical WS

For a future priority scheduler, a client should be able to _hint_ which priority
a new (logical) WS connections should have.

The only way to do that without changing the WS (browser) API would be
to include the "hint" within the WS URL opened by the client:

Example 2.1

URL 1 : ws://example.com/chat
URL 2 : ws://example.com/file

Example 2.2

URL 1 : ws://example.com?priority=7
URL 2 : ws://example.com?priority=1

A server receiving such a new logical WS connection may then respect the hint,
and send back header in logical handshake:

Sec-WebSocket-Extensions: mux; scheduler=priority; priority=7

if the scheduler is "priority" on the physical WS. Otherwise it ignores the hint.

The client then applies the parameters sent by the server in the logical handshake to
the scheduler for the physical WS.

************************

In effect, the scheduling scheme in use is negotiated during the opening handshake on 
the physical WS, while the per-channel scheduler parameters can be hinted by the client,
but are always (finally) decided by server (for both client and server side) and determined
during the opening handshake on the logical WS for the channel.

Pros:

+ only uses WS extensions headers of physical and logical WS
+ no additional MUX control frame opcodes
+ no use of MUX control frame RSV bits
+ no browser API change

Cons:

- scheduler parameters for logical WS cannot be changed dynamically
- TOS parameters cannot be chosen "per WS message"


I think with a little more work we could prepare for more advanced scheduling
schemes in the future and allow implementations to experiment today without
breaking interoperability.

/Tobias