XMPP - Distributed Communication

Notifications, updates, and aggregation in realtime.

Anders Conbere

XMPP?

extensible MESSAGING and PRESENCE protocol

Open

Standard

Standard

RFC 3920 and RFC 3921

Defined by the IETF as RFC 3920 and RFC 3921

Distributed

Like email servers, xmpp servers will route and send messages to other servers.

How Does It Work?

Client Auth

TCP Connection

XML Stream

XML Stanzas

Message


        <message from='juliet@example.com'
            to='romeo@example.net'
            xml:lang='en'>
            <body>Art thou not Romeo, and a Montague?</body>
        </message>
    

Message

Not Just Chat

Message

Any xml payload

Presence

Not away messages

Info/Query: Iq


        <iq from='juliet@example.com/balcony' type='get' id='roster_1'>
              <query xmlns='jabber:iq:roster'/>
            </iq>
    

Who's using it?

google

Google uses xmpp to power GTalk.

twitter

Twitters sports IM integration on their server which allows users to post to their twitter feed via XMPP messages, but to also receive notification when changes occur to their tweets list.

tivo

Tivo has begun to use xmpp to send updates to television schedules to it's set-top boxes.

jaiku

Similar to twitter jaiku users can update their streams via xmpp.

What tools does XMPP bring us?

Rosters

Rosters

Store relationships between clients

Rosters

Directional arcs between nodes

Rosters


        <iq to='juliet@example.com/balcony' type='result' id='roster_1'>
              <query xmlns='jabber:iq:roster'>
                <item jid='romeo@example.net'
                      name='Romeo'
                      subscription='both'>
                  <group>Friends</group>
                </item>
                <item jid='mercutio@example.org'
                      name='Mercutio'
                      subscription='from'>
                  <group>Friends</group>
                </item>
                <item jid='benvolio@example.org'
                      name='Benvolio'
                      subscription='both'>
                  <group>Friends</group>
                </item>
              </query>
    

Rosters

Groups / Communities

Rosters

Vcard / User Profile

Rosters

Rich api

PubSub

PubSub

Publish Subscribe - a multi-client push model

PubSub

Push > Poll

Presence

Presence


        if user.status == "online":
            send(message)
        else:
            wait(10)
    

Presence

anywhere anytime

Getting Started

Servers

Client Libraries

  • Python - SleekXMPP
  • Ruby - xmpp4r
  • Perl - Net:XMPP
  • Java - Smack
  • C# - Jabber-Net