Re: [hybi] Random Responses

Jamie Lokier <jamie@shareable.org> Sun, 12 April 2009 20:08 UTC

Return-Path: <jamie@shareable.org>
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 3111F3A6C62 for <hybi@core3.amsl.com>; Sun, 12 Apr 2009 13:08:52 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -5.456
X-Spam-Level:
X-Spam-Status: No, score=-5.456 tagged_above=-999 required=5 tests=[AWL=-2.857, 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 8T5uM48VPBCF for <hybi@core3.amsl.com>; Sun, 12 Apr 2009 13:08:51 -0700 (PDT)
Received: from mail2.shareable.org (mail2.shareable.org [80.68.89.115]) by core3.amsl.com (Postfix) with ESMTP id 268A03A6C00 for <hybi@ietf.org>; Sun, 12 Apr 2009 13:08:50 -0700 (PDT)
Received: from jamie by mail2.shareable.org with local (Exim 4.63) (envelope-from <jamie@shareable.org>) id 1Lt601-0001kS-8c; Sun, 12 Apr 2009 21:09:53 +0100
Date: Sun, 12 Apr 2009 21:09:53 +0100
From: Jamie Lokier <jamie@shareable.org>
To: Mridul Muralidharan <mridulm80@yahoo.com>
Message-ID: <20090412200953.GG4394@shareable.org>
References: <605442.82172.qm@web95416.mail.in2.yahoo.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <605442.82172.qm@web95416.mail.in2.yahoo.com>
User-Agent: Mutt/1.5.13 (2006-08-11)
Cc: hybi@ietf.org
Subject: Re: [hybi] Random Responses
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: Sun, 12 Apr 2009 20:08:52 -0000

Mridul Muralidharan wrote:
> > Also BEEP's per-channel setup latency is rather large: one
> > redundant
> > round trip.  Using BEEP for a simple HTTP request
> > would take noticably
> > longer than HTTP itself on high latency networks.
> 
> The usecases discussed are not one request/response per socket case,
> but a significantly longer (in time) channel - so the setup overhead
> mentioned would not be that significant.

No, it's the latency per BEEP channel, not socket.  BEEP channel setup
involves a requests "give me a channel please [+XML profile]", and
response "here's your channel [+XML profile]".  Then you're allowed to
send your real request over the channel.

The trouble is you need a separate BEEP channel for every potentially
overlapping message.

> I think you are assuming a request/response modal - where in server does not 'read' next request until previous one has been processed and response sent ?

No, I'm not.  I'm firmly in the asynchronous messaging (interleaved
without arbitrary size limits and ACKs optional) camp :-)

> Consider the following needs :
> 
> a) Multiple widgets talking to server and vice versa - so,
hopefully, sharing connection. (else the cost if really high in terms
of number of connections, etc)
>
> b) Not limit to just request/response based modal, but also
including event/notifications which dont require an ack..

Yes, I'm talking about those sort of things, over a single socket.

With BEEP you need separate channels (not sockets) for every message
which may be multiplexed with other messages, whether there's a
response or not.  You can't start those BEEP channels just by using
them: first you have to request them all.  To multiplex messages
independently, ou don't know how many channels you need in advance, so
you request them on demand and that's the extra delay from BEEP.

Multiplexed HTTP proposals are much better: to start a new channel,
you just pick a new channel number and send a message using it.

> Not to mention corner case handling like error detection/recovery
> due to abrupt connection loss, etc.

I'm deeply familiar with such things.

> > If you imagine a bi-directional HTTP (easy because requests and
> > responses are easily distinguished), it does not need any
> > BEEP-style flow control.  (I have implemented this).
> 
> Please see above.

Agreed.  The point is interleaving (multiple in-flight independent
messages) is what makes per channel flow control needed.
Bi-directionality by itself doesn't, but bi-directionality by itself
is much less useful (like the RHTTP proposal).

> > BEEP-style per channel flow control is needed because of its
> > ability to multiplex multiple channels in the _same_ direction on
> > a single TCP/IP stream.  Without per-channel flow control you get
> > deadlocks or infinite buffering needed in some practical uses.
> 
> See above on why this might be needed in HTTP case too.

Yes it is, when we let messages be interleaved with each other.  It's
interleaving which makes the requirement for per channel flow control.

Interleaving, by the way, is important to support large messages (like
video files, say) which don't block small messages.  Without
interleaving we'd force each application developer to produce their
own splitting and sliding window protocol whenever they _might_ have a
large message, which is silly when we can do it in the protocol nearly
for free.

> > Unfortunately BEEPs per channel flow control is sensible,
> > but it's per
> > channel setup is expensive both in needing XML and in
> > network round
> > trip time.  It would be good to keep the flow control
> > but use smarter
> > channel setup.
>
> Use of XML, though sensible, is just part of BEEP framing.

BEEP framing is simple, a short bit of text, I like that.  I'm quite
surprised they followed tidy, sensible IETF text protocol traditions
in the framing and then used an XML envelope in one of the essential
protocol elements.

> Not sure why XML parsing is an issue,

Many devices which parse HTTP right now don't have XML parsers.  Think
HTTP proxies, HTTP firewalls, and client devices with 16kB of memory.
XML parsing is not hard, but it's not trivial either.  Having to skip
the optional DTD whose syntax is not precisely defined in the XML spec
does not help.  Having to accept multiple charsets in a basic ASCII
protocol does not help either.

It would be nice if new messaging protocol were understandable by such
devices too, and it's probably quite important that the basic framing
is understandable to proxies and firewalls.

> but we can always replace it in other means to carry metadata - for
example, the meta-data getting exchanged is representable in HTTP
header form too

I agree that HTTP header form or similar is better than an XML
envelope, for the basic protocol anyway.  Of course specific
applications are welcome to use XML, JSON etc. inside the protocol
envelope.
 
-- Jamie