Re: [hybi] [whatwg] WebSockets: UDP

Mark Frohnmayer <mark.frohnmayer@gmail.com> Tue, 01 June 2010 23:08 UTC

Return-Path: <mark.frohnmayer@gmail.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 58FC13A67CF for <hybi@core3.amsl.com>; Tue, 1 Jun 2010 16:08:25 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: 0.301
X-Spam-Level:
X-Spam-Status: No, score=0.301 tagged_above=-999 required=5 tests=[BAYES_50=0.001, MIME_8BIT_HEADER=0.3]
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 PGz3gGc-dWWq for <hybi@core3.amsl.com>; Tue, 1 Jun 2010 16:08:24 -0700 (PDT)
Received: from mail-gw0-f44.google.com (mail-gw0-f44.google.com [74.125.83.44]) by core3.amsl.com (Postfix) with ESMTP id B4A3D3A68C2 for <hybi@ietf.org>; Tue, 1 Jun 2010 16:08:23 -0700 (PDT)
Received: by gwj19 with SMTP id 19so4232732gwj.31 for <hybi@ietf.org>; Tue, 01 Jun 2010 16:08:08 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:in-reply-to :references:from:date:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=UuPuEYl9zieDn6HdLtDZwBqOWeVeHck1rPmxK34qUD8=; b=brG0yHuR4fzr0gkQJpU6nVU6ad2pWkpceoz0mGY+sLjLjowWw9EGWEA6c49XCl5bXE AhS0sg8yaDCGgtJOcrPgpx+jbFKxg1YMrmH1wfJxaaxaDKyz0AYzleIh41j1e1MF9TwV OH2gLPvbLBtryiEIbsN8MA4UepqcUzA65LxOc=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=tw9dYu3UqfJMABxXz8Q5sd6DvKwVibUdJjdUjE8EjR4YCljqfc2Ledq/4eT6GiEFqM dg0SpWzNLf9tBuhdmAwq46J1dSu+zGzN0mjn6KBhHZTGEAyYFngS0mWkMWJsLICqsCEh lGso+eH1a6Fc0Cwg8PTXtM8CYbq7SKcpmGVsk=
Received: by 10.100.74.34 with SMTP id w34mr7852398ana.194.1275433688082; Tue, 01 Jun 2010 16:08:08 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.100.123.18 with HTTP; Tue, 1 Jun 2010 16:07:48 -0700 (PDT)
In-Reply-To: <op.vdm0lrqmr4mipi@emoller-pc.gothenburg.osa>
References: <op.vdl9bszhr4mipi@emoller-pc.gothenburg.osa> <AANLkTin8TYLeOdZmKbs6IqklsS5P24Qd4kqtTV_UXp-l@mail.gmail.com> <op.vdmg3ov6r4mipi@emoller-pc.gothenburg.osa> <AANLkTim2j9xbgW4fnKYy69uZ9KwBaDvs1ypu92pG1Hxo@mail.gmail.com> <op.vdm0lrqmr4mipi@emoller-pc.gothenburg.osa>
From: Mark Frohnmayer <mark.frohnmayer@gmail.com>
Date: Tue, 01 Jun 2010 16:07:48 -0700
Message-ID: <AANLkTilAy-494wt5UebjRsdDkhTVS3LXp-toxRsuBs2Q@mail.gmail.com>
To: Erik Möller <emoller@opera.com>
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: quoted-printable
Cc: "whatwg@whatwg.org" <whatwg@whatwg.org>, Hybi <hybi@ietf.org>, Philip Taylor <excors+whatwg@gmail.com>
Subject: Re: [hybi] [whatwg] WebSockets: UDP
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: Tue, 01 Jun 2010 23:22:29 -0000

On Tue, Jun 1, 2010 at 1:02 PM, Erik Möller <emoller@opera.com> wrote:
>
> I was hoping to be able to avoid looking at what the interfaces of a high vs
> low level option would look like this early on in the discussions, but
> perhaps we need to do just that; look at Torque, RakNet etc and find a least
> common denominator and see what the reactions would be to such an interface.
> Game companies are pretty restrictive about what they discuss, but I think I
> know enough game devs to at least get some good feedback on what would be
> required to make it work well with their engine/game.

Glad to see this discussion rolling!  For what it's worth, the Torque
Sockets design effort was to take a stab at answering this question --
what is the least-common-denominator "webby" API/protocol that's
sufficiently useful to be a common foundation for real time games.  I
did the first stab at porting OpenTNL (now tnl2) atop it; from my
reading of the RTP protocol that should easily layer as well, but it
would be worth getting the perspective of some other high-level
network stack folks (RakNet, etc).

>
>>> I suspect they prefer to be "empowered with UDP" rather than "boxed into
>>> a
>>> high level protocol that doesn't fit their needs" but I may be wrong.
>>
>> If you put it like that, I don't see why anybody would not want to be
>> empowered :-)
>
> Yeah I wouldn't put it like that when asking :) I'm really not trying to
> sell my view, I just like to see real browser gaming in a not too distant
> future.

Hmm... given the number of different approaches to higher-level game
networking I'd hate to see a high-level straightjacket where a
well-conceived low level API could easily support all of the existing
solutions out there.  The more complex the API the larger the attack
surface at the trusted level and the more difficulty in getting
existing stakeholders (game and browser makers) on board.

>
> So, what would the minimal set of limitations be to make a "UDP WebSocket"
> browser-safe?
>
> -No listen sockets

Only feedback here would be I think p2p should be looked at in this
pass -- many client/server game instances are peers from the
perspective of the hosting service (XBox Live, Quake, Half-Life,
Battle.net) -- forcing all game traffic to pass through the hosting
domain is a severe constraint.  My question -- what does a "webby" p2p
solution look like regarding Origin restrictions, etc?

> -No multicast

> -Reliable handshake with origin info
> -Automatic keep-alives
> -Reliable close handshake

While we're at it, I'd add key exchange, encryption and client puzzles
to reduce connection depletion/CPU depletion attacks to the handshake.
 The protocol you seem to be aiming for isn't UDP -- rather it's more
like an connected, unreliable packet stream between hosts.

> -Socket is bound to one address for the duration of its lifetime
> -Sockets open sequentially (like current DOS protection in WebSockets)
> -Cap on number of open sockets per server and total per user agent

A single UDP socket can host multiple connections (indexed by packet
source address), so even a modest limit on actual number of sockets
wouldn't be a big impediment.

I'd also advocate for packet delivery notification to be a part of the
API -- with a known success or failure status on packet delivery many
of the higher level data transmission policies become trivial, and
should be essentially zero overhead at the protocol level.  Without
notification the higher level code has to do manual packet
acknowledgement as Phil mentioned.

Regards,
Mark