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

Tobias Oberstein <tobias.oberstein@tavendo.de> Tue, 04 June 2013 11:12 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 BBA6321F9B42 for <hybi@ietfa.amsl.com>; Tue, 4 Jun 2013 04:12:39 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.899
X-Spam-Level:
X-Spam-Status: No, score=-1.899 tagged_above=-999 required=5 tests=[AWL=-0.500, BAYES_00=-2.599, J_CHICKENPOX_12=0.6, J_CHICKENPOX_44=0.6]
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 Y+By8xlTNVjz for <hybi@ietfa.amsl.com>; Tue, 4 Jun 2013 04:12:23 -0700 (PDT)
Received: from EXHUB020-5.exch020.serverdata.net (exhub020-5.exch020.serverdata.net [206.225.164.32]) by ietfa.amsl.com (Postfix) with ESMTP id 4E06021F9B7E for <hybi@ietf.org>; Tue, 4 Jun 2013 03:04:34 -0700 (PDT)
Received: from EXVMBX020-12.exch020.serverdata.net ([169.254.3.90]) by EXHUB020-5.exch020.serverdata.net ([206.225.164.32]) with mapi; Tue, 4 Jun 2013 03:04:33 -0700
From: Tobias Oberstein <tobias.oberstein@tavendo.de>
To: Takeshi Yoshino <tyoshino@google.com>
Date: Tue, 04 Jun 2013 03:04:31 -0700
Thread-Topic: [hybi] Call for interest: multiplexing dedicated for WebSocket
Thread-Index: Ac5hBlATZ073JABoSNOC4CQ+WWItZQAAWhlw
Message-ID: <634914A010D0B943A035D226786325D4422DC213B9@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>
In-Reply-To: <CAH9hSJY_f4jS1ks1xzNmJSX5c+BxJv=-cNs5iS4mP2rZvtsvTQ@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, 04 Jun 2013 11:12:39 -0000

>     Another issue: implementing s.th <http://s.th>. like priority based
>     scheduling at app level would might require to reinvent some kind of
>     fragmentation at the app level to be able to schedule according to
>     priority (otherwise once a very large message on a low prio channel
>     is started to be sent, it'll block everything else).
> 
> 
> Yes. The app must be able to send a fragment.
> 
> But it's a matter of WebSocket API. A server can do that, but if a 
> client want to, it can't for now due to limitation of the API. Hence, it 
> needs application level fragmentation.

The WS client implementation could do auto-fragmentation. The fragment size
could be chosen by upstream bandwidth and latency target. A WS server could do
the same. Auto-fragment based on downstream bandwidth and latency target.

The app isn't bothered with fragmentation then.

>     Hence I'd like to propose to
> 
>     1) add an (optional) extension parameter "scheduler" as above
>     2) use the 3 currently unassigned RSV bits in AddChannelRequest for
>     channel prio (when scheduler="priority")
>     3) define appropriate MUST semantics (scheduling should not follow
>     advisory semantics .. apps should be able to rely on it)
>     4) probably add a new PriorityControl message to change prio of
>     existing channels
> 
>     ===
> 
> 
> WebSocket API is not ready for such a sophisticated ToS mechanism.

Yes.

Apart from extending the JS WS browser API (which currently only has
WS URL and protocol for open) with ToS:

var sock = new WebSocket("ws://example.com ", [], {scheduler: "priority", priority: 7});

This would assume that logical WS channels eligible to be shared over 1 physical WS
not only share same host:port, but also scheduler.

[this API does not provide for 4) - dynamically changing channel prio]

Another option would be to let the server choose based on URL requested

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

If the client connects and speaks MUX, the server can answer (in opening handshake)

mux; scheduler=priority; priority=7

for URL 1 e.g.. For the first connection, that would happen on the physical WS. For subsequent
connections, it would happen on logical WS (scheduler needs to be the same): MUX is not nested,
but only the "priority" parameter used by the client WS implementation.

Yet another option would be to "use" URL parameters to hint

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

and let the server make final decision.

>     Example:
>     An app creates an empty file on some cloud service. Subsequently the
>     app wants to append to that file.
> 
>     The first could be a high-prio message, the latter messages low-prio.
> 
>     The app does not care whether those messages travel over 1 physical,
>     or multiple different logical WS channels.
> 
>     However, the app does care that the first "create file" message
>     arrives before any subsequent "append to file" messages.
> 
>     So a different design involving per-message prios on a single WS
>     channel (physical or logical) might allow higher-prio messages to
>     overtake lower prio-messages, but not otherwise round.
> 
> 
> I see.

This would definitely require API change

sock.send("foobar", 7); // send message with priority 7

It would provide even richer semantics to an app though ..