On Sun, Sep 19, 2010 at 7:22 AM, Matthew Wild <mwi...@gmail.com> wrote:
> On 19 September 2010 03:11, Waqas Hussain <waqa...@gmail.com> wrote:
>> On Wed, Sep 15, 2010 at 8:44 AM, Justin Karneges
>> <justin-keyword-jabber.093...@affinix.com> wrote:
>>> In trying to reduce the number of network round trips in our plain 
>>> (non-XMPP)
>>> BOSH implementation, I wonder about putting data in the session creation
>>> request and response <body> exchanges.  In XEP-0124, there is no mention 
>>> about
>>> whether the body must be empty in either case, but all examples show it 
>>> empty.
>>> However, XEP-0206 has an example of the server replying with 
>>> <stream:features>
>>> in the response, so at least that much seems to be allowed, right?  I want 
>>> to
>>> know if putting data in the initial client request is allowed too.
>>>
>>
>> It's not disallowed, which I take to mean it's allowed.
>>
>
> I'd rather it be disallowed. It makes no sense for the client to send
> anything prior to stream features. I'm certainly in favour of the
> server being able to include data in the creation response, that's
> just natural (and I thought it was in the XEP already - we have
> discussed it before).
>

I disagree. It makes perfect sense for a client to not wait for stream
features if it expects a feature to be supported and is willing to
handle the error that would occur if the feature wasn't supported.
That's the basic idea behind pipelining (in XMPP and other protocols).

This search get us some useful past discussion for TCP, but the idea
applies just as well to BOSH:
http://jabber.markmail.org/search/?q=pipelining+-bosh
There was a long thread from some time back about saving roundtrips,
which I can't find it at the moment.

HTTP pipelining works the same way (and as discussed on the ML, HTTP
pipelining would work fine with BOSH, despite using POST requests).

TLS False Start is the same idea applied to TLS:
https://tools.ietf.org/html/draft-bmoeller-tls-falsestart-00
Taking it further (but not yet deployed?) is TLS Snap Start, which can
reduce TLS roundtrips to zero:
http://tools.ietf.org/html/draft-agl-tls-snapstart-00

Take something like Speeqe. This is what the BOSH session might look like:

<body [...]>
<auth xmlns='urn:ietf:params:xml:ns:xmpp-sasl' mechanism='ANONYMOUS'/>
</body>

<body [...] xmpp:restart='true'>
<iq type='set' id='x'><bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'/></iq>
<presence to='r...@conference.example.com/nick'><x xmlns='muc
xmlns'/></presence>
</body>

That's five roundtrips reduced to two. It could be reduced to one if
the xmpp:restart step wasn't required (I actually don't like this
useless requirement; it's pretty much a noop and reminds me of
<session xmlns='urn:ietf:params:xml:ns:xmpp-session'/>, which we
thankfully got rid of). It can also be reduced to one by using HTTP
pipelining.

While I haven't tested, I suspect this works with Prosody, and
xmpp:restart isn't required :)

--
Waqas Hussain

Reply via email to