[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[JDEV] Protocol Notes: A play in 7 acts



Ok, so I got tired of ASCII art. Here's some notes I made on the protocol
as the modules talk back and forth. Really helped me figure out what's
going on. Apologies to the MIME and HTML impaired.

-=Dan=-
Title: Jabber Jabber
Here's some conversations using snapshot 915778725 grabbed on 1/8/99.

List of characters:

T jabber.transport
JB    jabberbox
C client

Scene 1: Transport startup
 

T-JB <r handshake='jabber'>
</r>
T connects to JB and announces itself (should JB announce itself first?) as a jabber transport.
JB-T <j type='config'>
        <name>localhost</name>
        <alias>JABBER</alias>
        <alias>localhost</alias>
        <!>
           <listen>198.45.23.4</listen>
        </!>
        <modules>
           <basic>
                <cache>/var/tmp/jabber.basic.cache</cache>
                <user>username@password</user>
                <user>test@test</user>
                <user>someone@asdf</user>
           </basic>
           <mysql>
                <host>localhost</host>
                <db>jabbers</db>
                <user>jab</user>
                <pass>P0wCheez</pass>
           </mysql>
        </modules>
</j>
JB sends config packet that was originally in <jabber> tags. [ perl announces itself as 'perl' and gets the stuff in <perl> tags. ]
T-JB <r handshake='jabber'>
    <alias>localhost</alias>
    <alias>localhost</alias>
    <alias>JABBER</alias>
 </r>
T re-announces itself (?)
JB-T <j type='config'>
   [ Same as above ]
</j>
get config packet. Again?

Scene 2: Client connects to jabberbox
 

T-C JB sez nothing. Usually, when you connect to a server, they announce themselves. Well, except HTTP.
C-T <j type='connection'>
    <ver>Jabber CLI Client 0.5 Dev</ver>
    <protocol>19990101</protocol>
</j>
C announces (registers?) itself
JB-T <j type='connection'>
   <name>localhost</name>
   <ver>JabberBox 0.5 Dev</ver>
   <protocol>19990101</protocol>
</j>
T announces itself

Scene 3: Client logs in
 

C-T <j type='login'>
      <user>dmag</user>
      <pass>xxxx</pass>
      <nick>fork</nick>
     </j>
Is the nick the place where we're supposed to put "work" or "home"? And how do we send a message to a particular nick?
T-C I think T should ack the login. On a slow link/server, C might assume that T is happy when it's not.

Scene 4: Client sends a simple message
 

C-T <j type='message'>
   <to>dmag</to>
   <say>to dmag</say>
</j>
note that jabberbox is not involved. Cool.
T-C <j type='message'>
   <from name='fork'>dmag</from>
   <say>to dmag</say>
</j>
Shouldn't that be "nick=fork"?

Scene 5: client sends a message thru localhost
 

C-T <j type='message'>
     <to>dmag@localhost</to>
     <say>zool is coming</say>
    </j>
T-JB <r from='localhost' to='localhost'>
    <j type='message' from='dmag@localhost' nick='fork'>
      <to>dmag</to>
      <say>zool is coming</say>
   </j>
</r>
T forwards it to JB to send it to localhost
JB-T <j type='message' from='dmag@localhost' nick='fork'>
   <to>dmag</to>
   <say>zool is coming</say>
</j>
JB send it to back to T without the localhost..
T-C <j type='message'>
   <from name='fork'>dmag@localhost</from>
   <say>zool is coming</say>
</j>
Shouldn't that be nick=fork?

Scene 6: Client sends message to his own nick@localhost
 

C-T <j type='message'>
   <to>fork@localhost</to>
   <say>fork message here</say>
</j>
T-JB <r from='localhost' to='localhost'>
   <j type='message' from='dmag@localhost' nick='fork'>
      <to>fork</to>
      <say>fork message here</say>
   </j>
</r>
T forwards it to JB because it sez localhost
JB-T <j type='message' from='dmag@localhost' nick='fork'>
  <to>fork</to>
  <say>fork message here</say>
</j>
JB strips the localhost and sends it back to T
T-JB <r from='localhost' to='localhost'>
   <j type='message' from='system@localhost'>
      <to name='fork'>dmag</to>
      <ext>error</ext>
      <subject>Message Rejected</subject><say>Your message to fork could not be delivered, either the recipient doesn&apos;t exist, or it couldn&apos;t be stored until they return online.
Message:
fork message here</say>
   </j>
</r>
I guess T doesn't deliver to nicks.

Note the XML apostrophe.

If T knows it's for dmag, why does he send it to JB?

JB-T <j type='message' from='system@localhost'>
   <to name='fork'>dmag</to>
   <ext>error</ext>
   <subject>Message Rejected</subject>
   <say>Your message to fork could not be delivered, either the recipient doesn&apos;t exist, or it couldn&apos;t be stored until they return online.
Message:
fork message here</say>
</j>
JB just returns the exact same message... I'm getting Deja Vu ;)
T-C <j type='message'>
   <from>system@localhost</from>
   <ext>error</ext>
   <subject>Message Rejected</subject>
   <say>Your message to fork could not be delivered, either the recipient doesn&apos;t exist, or it couldn&apos;t
 be stored until they return online.
Message:
fork message here</say>
</j>
Whew. It finally gets back to the client.

Scene 7: Message to nowhere
 

C-T <j type='message'>
   <to>dmag@nowhere</to>
   <say>nothing</say>
</j>
T-JB <r from='localhost' to='nowhere'>
   <j type='message' from='dmag@localhost' nick='fork'>
      <to>dmag</to>
      <say>nothing</say>
   </j>
</r>
nowhere's not here, so forward to JB.
JB-T <j nick='fork' from='dmag@localhost' type='error' error_type='message' error='Server Name Resolution Failed'>
   <to>dmag</to>
   <say>nothing</say>
</j>
JB doesn't know where it is
T-C Oops, T  doesn't return anyting, and C mistakenly prints "message delivered".  Maybe we need some acks here? Hint hint.