wtf is xmpp?

38
WTF is XMPP Pedro Melo <{xmpp,mailto}:[email protected] >

Upload: pedro-melo

Post on 25-Jun-2015

4.556 views

Category:

Technology


3 download

DESCRIPTION

An small introduction to XMPP focusing on non-instant messaging uses

TRANSCRIPT

Page 1: WTF is XMPP?

WTF is XMPPPedro Melo <{xmpp,mailto}:[email protected]>

Page 2: WTF is XMPP?

XMPP

• Almost 10 years old

• IETF standard (RFC 3920 & RFC 3921)

• More than 100 extensions

• Started as Jabber: XMPP is the protocol powering Jabber Instant Messaging Network

Page 3: WTF is XMPP?

Who uses it?

• SAPO

• GTalk

• Jabber.TLD

• Yahoo! (the Video conference site)

• AIM (private interconnects)

• US DoD (big BIG users), UK Armed Forces

Page 4: WTF is XMPP?

So really, WTF is XMPP?

• XML Streams: send small XML stanzas

• Simple building blocks

• Extensible: add your stuff, no need to ask permission

• Secure (TLS security is mandatory, CA available with free certificates)

• Federated

Page 5: WTF is XMPP?

Building Blocks

• <presence>, <message>, <iq>

• update your own state on the network

• chat, notify others

• query/response interface - almost REST

• More advanced: capability discovery, publish/subscribe, negotiate out-of-band channels (VoIP, E2E encryption)

Page 6: WTF is XMPP?

Extensible

• Any building block can be extended

• Just add a new child XML element with your own XML namespace

• No need to ask anyone

• But be polite and only send them to people who will understand it

Page 7: WTF is XMPP?

Federated

• Each user has unique JID (Jabber ID)

• local_name@domain

• Each active connection gets a resource

• local_name@domain/resource

• Domains find to each other using DNS SRV records, connect using secure TLS

Page 8: WTF is XMPP?

A XMPP NetworkZee Big Picture

Page 9: WTF is XMPP?

But this is IM...

Page 10: WTF is XMPP?

XMPP = IM . C2

Page 11: WTF is XMPP?

XMPP = IM . C2

Because bots talks at light-speed :)

Page 12: WTF is XMPP?

Bots

• Bots are the initial first step to build a XMPP presence

• Notifications

• Include Atom alternative payload

• Interaction with a service

• Text-based command line-style

Page 13: WTF is XMPP?

So how do I start?

Page 14: WTF is XMPP?

First, pick a Server

• Install your own server

• Allows you to use your own domain/brand

• Two choices:

• ejabberd

• OpenFire

• Personally I use ejabberd and djabberd

Page 15: WTF is XMPP?

Second, pick a library

• Do not try to build one yourself :)

• Python: use Twisted XMPP (Worlds)

• Perl: Net::XMPP2 (soon AnyEvent::XMPP)

• Ruby: I don’t like any of them :)

Page 16: WTF is XMPP?

Third, start coding

Page 17: WTF is XMPP?

But how do I connect to the XMPP network?

We got some great opportunities for you today

Page 18: WTF is XMPP?

C2S vs Components

• C2S bots are simple to start and play

• Components are the only way to fly long term

• Zero protocol limitations if you use a Component

• With ejabberd you have component load-balancing built-in (plus clustering bonus)

Page 19: WTF is XMPP?

That’s it

Page 20: WTF is XMPP?

But lets talk about the Myths

Page 21: WTF is XMPP?

Myth 1: XMPP is complex

• XMPP is Async, and you have to think Async to keep your sanity

• Frameworks that hide the Async nature of XMPP are doing more harm than good

• XMPP has lots of specs but they are very well written (thx to our personal Saint)

• The basics are really pretty simple

Page 22: WTF is XMPP?

Myth 2: XML is too verbose

• Yes it is. So what?

• Compression helps a lot

• But you don’t have to use XML

• Really!

Page 23: WTF is XMPP?

XMPP without XML?(the speaker is on drugs...)

Page 24: WTF is XMPP?

Can we build it?

• The protocol for C2S components is not standard

• Each server implements his own (OpenFire has the best specs, DJabberd is hackable, Jabberd2 and ejabberd have the possibility)

• Mobile clients are taking this route

Page 25: WTF is XMPP?

Myth 3: XMPP is replacing the Web

Page 26: WTF is XMPP?

Myth 3: XMPP is replacing the Web

Who ever tells you this, has a better dealer than mine...

Page 27: WTF is XMPP?

Myth 3: XMPP is replacing the Web

• No, its not

• XMPP is a nice complement to your web applications

• Gives you a real-time feedback channel

• something happened to your data

• something happened to your friends data

Page 28: WTF is XMPP?

Enough myths, onto Ideas

Page 29: WTF is XMPP?

Enhance your bots

• With C2S, you have one <presence> to rule them all (*)

• With components you can have a <presence> per buddy

• adjust the bot status to something meaningful

• change the Avatar image

• Accept/initiate file transfers

Page 30: WTF is XMPP?

Add PubSub nodes

• You can have all the user events available on the XMPP network using PubSub

• Payload is a classical Atom item

• OAuth-based access has working draft

• This is actually an economic/political problem, not technical

Page 31: WTF is XMPP?

Add AdHoc commands

• Discoverable actions you can perform on a JID

• You GET a form, and then SET the data

• Also available standard search protocol

• Support is still immature on clients

Page 32: WTF is XMPP?

Use virtual chat-rooms

• Chat-rooms provide many-to-many chat

• Each HTTP resource can have a associated chat-room

• Click to chat just join people looking at the same page into the same chat-room

• You can even do it in the page (Sameplace.cc)

Page 33: WTF is XMPP?

Negative Priority

• Here be dragons...

• If IM is the known planets, negative priority is all the space in between

• Personal agents: connect with your own personal JID, and perform/accept actions on your behalf

Page 34: WTF is XMPP?

Negative Priority

• Calendar: XMPP bot built-in: negotiate/accept/reject meeting requests

• File Server: runs on each PC you own, and allow you to browse, fetch, upload files

• Browser: share tabs between two running instances - synchronized browsing

Page 35: WTF is XMPP?

Usual suspects

• Control a cluster: Vertebra

• Monitor stuff: embed a bot on all your scripts/long-running processes

• Your own personal secretary: remind me to pick up the kids

Page 36: WTF is XMPP?

Think of a Real-Time feedback channel in

your own app...

Page 37: WTF is XMPP?

... one that knows when the users are online

Page 38: WTF is XMPP?

That’s all, folks!