(Brief) Introduction to XMPP
What is XMPP?
eXtensible Messaging and Presence Protocol
(aka Jabber)
Started around 1998
Became part of IETF in 2002
Lets go on a journey from 'P' back to 'X'...
Protocol
XMPP is a protocol
Set of standards so systems can talk to each other
Used all over the web but often unadvertised
XSF
The protocol (or standards) are looked after by the XSF
Extensions and changes are debated, discussed, + modified over before becoming standards
As a group we prefer "implementations"
Architecture
Server
Handles connections
(C2S, S2S, Component connections)
Federaton
Authentication
Clients
Thin clients, leave the work to the server
Connect over TCP/BOSH (Long polling)/WebSockets
Data is pushed to clients, clients push data
Components
Add features to XMPP server without modifying it
Run as a subdomin, e.g. component.example.org
Perform more advanced business logic in a component
Presence
Determine the state of an XMPP entity
Am I offline/online/busy ?
Tell the server I'm ready/done receiving messages
Addressing another entity... the JID
[user@] example.org [/mobile-phone]
- local: The user/device (i.e. client)
- domain: Server you are addressing
- resource: Multiple connections?
Priorities / Features
Give the server an idea of where you'd like data to go
Send additional data with your presence
What features your client supports
A status message
Can be overloaded with additional data (not recommended, we have PEP)
Stanza
<presence to="surevine.com"
from="lloyd@surevine.com/laptop">
<show>chat</show>
<priority>-1</priority>
<status>Giving a talk</status>
</presence>
Messaging
Second of the three stanza types
(other being <iq/>)
Used to send messages between clients
Different types of chat messages + different payloads
Stanza
<message type="chat"
to="matthew@jabber.org/laptop">
<body>Hello Matt</body>
</message>
Messages sent to bare JID are routed by server (remember the priority "-1"?)
Messages sent to full JID go directly to that client
Different types, e.g. 'headline' broadcast to all connected clients
Stanza Extended
<message type="chat"
to="logger.server.org">
<data xmlns="MY-FORMAT-NS">
vgreg%G% B%$t54T%$gqfg4fgAEAE
F$£T B£%$BYQAgregOK OKo ===
</data>
</message>
Can perform discovery (DISCO) on receiver to see if they support required features
Extensibility
XML-based
Gives us extensibility
One of few systems which properly makes use of XMLNS
Ewww XML?!
Don't panic!
Big moves in the past 12 months to make XMPP more web-developer friendly
IQ
Third type of stanza
Equivalent to GET/POST in HTTP (GET/SET)
Always get a response (RESULT/ERROR)
<iq type="get"
to="logger.server.org">
<data xmlns="MY-FORMAT-NS"/>
</iq>
Extensions
In XMPP-land™ we call these XEPs
Over 300 in existence and more being added
Cover everything from including JSON payloads...
to compressing payloads for IoT usage
Which in a few minutes leads us on to...
Summary
XMPP is a powerful, proven, open, secure, standards-based protocol
Lots of servers/clients/libraries
(many open source)
Great helpful community, who are actively helping to push the web forward:
XMPP security days, WebRTC signalling over XMPP,
New IoT extensions,
Extensions to help accessibility
What next?
Plenty of XMPP people in the room from server developers to client builders, deploying in all kinds of environments
Questions
There's lots of XMPP people in the room so no rush!