Not logged in. · Lost password · Register
Forum: MatriX and XmppDotNet RSS
Avatar
dave-v #1
Member since Feb 2011 · 8 posts
Group memberships: Members
Show profile · Link to this post
Subject: Difference in behaviour between Matrix and agsXMPP connection
Hi there.

I've been investigating agsXMPP for a while, but am now looking at MatriX.  One feature of particular interest is the performance of the compression algorithms. 

Using the Matrix MiniClient I connected to an ejabberd server but could not get compression to work at all (ejabberd compression works fine with agsXMPP).  The Matrix Miniclient sucessfully configured compression when connecting to an MLink server.

Looking at the traces I can see that ejabberd does not offer the compression option once the user challenge is complete.  agsXMPP starts compression prior to the challenge, so I had no problem with this.

I'd be greatful if you can explain why I see this difference in behaviour.

Many thanks

Dave

Attached are the traces for the MatriX MLink, Matrix ejabberd and agsXMPP ejabberd.


Matrix - MLink trace
RECV: <stream:features xmlns:stream="http://etherx.jabber.org/streams">
  <mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl">
    <mechanism>SCRAM-SHA-1</mechanism>
    <mechanism>PLAIN</mechanism>
    <mechanism>NTLM</mechanism>
    <mechanism>GSSAPI</mechanism>
    <mechanism>GSS-SPNEGO</mechanism>
    <mechanism>DIGEST-MD5</mechanism>
    <mechanism>CRAM-MD5</mechanism>
  </mechanisms>
  <compression xmlns="http://jabber.org/features/compress">
    <method>zlib</method>
  </compression>
  <ver xmlns="urn:xmpp:features:rosterver">
    <optional />
  </ver>
</stream:features>
SEND: <auth mechanism="SCRAM-SHA-1" xmlns="urn:ietf:params:xml:ns:xmpp-sasl">...........</auth>
RECV: <challenge xmlns="urn:ietf:params:xml:ns:xmpp-sasl">...............</challenge>
SEND: <response xmlns="urn:ietf:params:xml:ns:xmpp-sasl">................</response>
RECV: <success xmlns="urn:ietf:params:xml:ns:xmpp-sasl">.............</success>
SEND: <stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" to="nowiresemail.com" version="1.0" >
RECV: <stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" from="nowiresemail.com" id="21af7187d8bc6d60" version="1.0" >
RECV: <stream:features xmlns:stream="http://etherx.jabber.org/streams">
  <bind xmlns="urn:ietf:params:xml:ns:xmpp-bind">
    <required />
  </bind>
  <session xmlns="urn:ietf:params:xml:ns:xmpp-session" />
  <compression xmlns="http://jabber.org/features/compress">
    <method>zlib</method>
  </compression>
  <ver xmlns="urn:xmpp:features:rosterver">
    <optional />
  </ver>
</stream:features>
SEND: <compress xmlns="http://jabber.org/protocol/compress">
  <method>zlib</method>
</compress>
RECV: <compressed xmlns="http://jabber.org/protocol/compress" />
SEND: <stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" to="nowiresemail.com" version="1.0" >
RECV: <stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" from="nowiresemail.com" id="a14a74612b7e1b15" version="1.0" >
RECV: <stream:features xmlns:stream="http://etherx.jabber.org/streams">
  <bind xmlns="urn:ietf:params:xml:ns:xmpp-bind">
    <required />
  </bind>
  <session xmlns="urn:ietf:params:xml:ns:xmpp-session" />
  <ver xmlns="urn:xmpp:features:rosterver">
    <optional />
  </ver>
</stream:features>
SEND: <iq id="MX_7" type="set" xmlns="jabber:client">
  <bind xmlns="urn:ietf:params:xml:ns:xmpp-bind">
    <resource>MatriX</resource>
  </bind>
</iq>


Matrix - ejabberd trace
RECV: <stream:features xmlns:stream="http://etherx.jabber.org/streams">
  <starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls" />
  <compression xmlns="http://jabber.org/features/compress">
    <method>zlib</method>
  </compression>
  <mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl">
    <mechanism>DIGEST-MD5</mechanism>
    <mechanism>PLAIN</mechanism>
  </mechanisms>
  <c xmlns="http://jabber.org/protocol/caps" hash="sha-1" node="http://www.process-one.net/en/ejabberd/" ver="ZxRgq/J2r/kR9P8I10GDWCwgGEQ=" />
  <register xmlns="http://jabber.org/features/iq-register" />
</stream:features>
SEND: <auth mechanism="DIGEST-MD5" xmlns="urn:ietf:params:xml:ns:xmpp-sasl" />
RECV: <challenge xmlns="urn:ietf:params:xml:ns:xmpp-sasl">..............</challenge>
SEND: <response xmlns="urn:ietf:params:xml:ns:xmpp-sasl">.............</response>
RECV: <challenge xmlns="urn:ietf:params:xml:ns:xmpp-sasl">...........</challenge>
SEND: <response xmlns="urn:ietf:params:xml:ns:xmpp-sasl" />
RECV: <success xmlns="urn:ietf:params:xml:ns:xmpp-sasl" />
SEND: <stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" to="bubble.im" version="1.0" >
RECV: <stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" id="3081550908" from="bubble.im" version="1.0" lang="en" >
RECV: <stream:features xmlns:stream="http://etherx.jabber.org/streams">
  <bind xmlns="urn:ietf:params:xml:ns:xmpp-bind" />
  <session xmlns="urn:ietf:params:xml:ns:xmpp-session" />
  <c xmlns="http://jabber.org/protocol/caps" hash="sha-1" node="http://www.process-one.net/en/ejabberd/" ver="ZxRgq/J2r/kR9P8I10GDWCwgGEQ=" />
  <register xmlns="http://jabber.org/features/iq-register" />
</stream:features>
SEND: <iq id="MX_10" type="set" xmlns="jabber:client">
  <bind xmlns="urn:ietf:params:xml:ns:xmpp-bind">
    <resource>MatriX</resource>
  </bind>
</iq>


agsXMPP - ejabberd trace
RECV: <stream:features xmlns:stream="http://etherx.jabber.org/streams">
    <starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls" />
    <compression xmlns="http://jabber.org/features/compress">
    <method>zlib</method></compression>
    <mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl">
    <mechanism>DIGEST-MD5</mechanism>
    <mechanism>PLAIN</mechanism></mechanisms>
    <c xmlns="http://jabber.org/protocol/caps" hash="sha-1" ver="ZxRgq/J2r/kR9P8I10GDWCwgGEQ=" node="http://www.process-one.net/en/ejabberd/" />
    <register xmlns="http://jabber.org/features/iq-register" /></stream:features>
SEND: <compress xmlns="http://jabber.org/protocol/compress">
    <method>zlib</method></compress>
RECV: <compressed xmlns="http://jabber.org/protocol/compress" />
SEND: <stream:stream to='bubble.im' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' version='1.0' xml:lang='en'>
RECV: <stream:stream xmlns:stream="http://etherx.jabber.org/streams" from="bubble.im" version="1.0" xml:lang="en" id="3284626828" >
RECV: <stream:features xmlns:stream="http://etherx.jabber.org/streams">
    <mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl">
    <mechanism>DIGEST-MD5</mechanism>
    <mechanism>PLAIN</mechanism></mechanisms>
    <c xmlns="http://jabber.org/protocol/caps" hash="sha-1" ver="ZxRgq/J2r/kR9P8I10GDWCwgGEQ=" node="http://www.process-one.net/en/ejabberd/" />
    <register xmlns="http://jabber.org/features/iq-register" /></stream:features>
SEND: <auth xmlns="urn:ietf:params:xml:ns:xmpp-sasl" mechanism="DIGEST-MD5" />
RECV: <challenge xmlns="urn:ietf:params:xml:ns:xmpp-sasl">............</challenge>
SEND: <response xmlns="urn:ietf:params:xml:ns:xmpp-sasl">......................</response>
RECV: <challenge xmlns="urn:ietf:params:xml:ns:xmpp-sasl">....................</challenge>
SEND: <response xmlns="urn:ietf:params:xml:ns:xmpp-sasl" />
RECV: <success xmlns="urn:ietf:params:xml:ns:xmpp-sasl" />
SEND: <stream:stream to='bubble.im' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' version='1.0' xml:lang='en'>
RECV: <stream:stream xmlns:stream="http://etherx.jabber.org/streams" from="bubble.im" version="1.0" xml:lang="en" id="3894236482" >
RECV: <stream:features xmlns:stream="http://etherx.jabber.org/streams">
    <bind xmlns="urn:ietf:params:xml:ns:xmpp-bind" />
    <session xmlns="urn:ietf:params:xml:ns:xmpp-session" />
    <c xmlns="http://jabber.org/protocol/caps" hash="sha-1" ver="ZxRgq/J2r/kR9P8I10GDWCwgGEQ=" node="http://www.process-one.net/en/ejabberd/" />
    <register xmlns="http://jabber.org/features/iq-register" /></stream:features>
SEND: <iq id="agsXMPP_1" type="set" to="bubble.im"><bind xmlns="urn:ietf:params:xml:ns:xmpp-bind">
    <resource>B0IMSERVER</resource></bind></iq>
Avatar
Alex #2
Member since Feb 2003 · 4449 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
In MatriX the complete stream feature stuff was rewritten.
The recommended order of stream feature negotiation is defined here:
http://xmpp.org/extensions/xep-0170.html

MatriX and MLink follows this guidlines. Ejabberd doesn't. So I consider this as an ejabberd bug.

Before XEP-0170 was published is was common practice to compress before SASL, which also agsXMPP does but is wrong according to the latest specs. IIRC correctly I also fixed this in the latest SVN code if agsXMPP.

Alex
Avatar
dave-v #3
Member since Feb 2011 · 8 posts
Group memberships: Members
Show profile · Link to this post
Thanks for that. I Knew the negotiation order was specified somewhere, but I just couldn't find where!

Dave
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters: