Você está na página 1de 3

2/24/10

What is XMPP?

  Extensible Messaging & Presence


Extensible Messaging & Protocol
Presence Protocol (XMPP)   A protocol for streaming XML over a network
  Originally an IM technology developed by
open-source Jabber community
  Adopted as draft specification by IETF in
2004 under the name XMPP

Features What is XMPP used for?


  Open standard
  Main use:
  based on freely-available protocols
  instant messaging
  core protocols formalized as draft specification by IETF
  Extensions:
  Extensible
  VOIP
  additional functionality can be implemented over core
protocol   network management
  many extensions maintained by XMPP foundation   content syndication
  collaboration tools
  Secure
  file sharing
  servers can be isolated from network
  gaming
  Interfaces with other (IM) networks   remote systems monitoring

Network architecture Network architecture


  Hybrid architecture
  centralised – clients connect via servers
  decentralised – no central authoritative server DaveBowman@
discovery.nasa. hal@discovery1.nasaguv
discovery.nasa.guv discovery1.nasa.guv
  Similar to email system guv

  a network of distributed servers XMPP Client XMPP Server XMPP Server XMPP Client

  user connects to host server


  server transfers message to a destination server
  destination server delivers message to recipient
user
  Every user on the network has a unique
Jabber ID

1
2/24/10

Addressing Transports
juliet@capulet.com/mobile
juliet@capulet.com SMS XMPP
SMS Client XMPP
Client

montague.net
XMPP XMPP XMPP
SMS Server
Gateway Server Client
romeo@montague.net

capulet.com

XMPP Internet XMPP


SMTP Server Server
Gateway

  JID (Jabber ID):


  romeo@montague.net, juliet@capulet.com SMTP Client
XMPP
Client
  Optional resource name SMTP

  juliet@capulet.com/mobile

Transports Protocol
  The above figure shows an XMPP   Essentially
consists of open-ended XML
network with gateways to a Short documents:
Message Service (SMS) domain and an
SMTP domain. <stream> ... </stream>

  Gateways are most often used in this


  Streams consist of one or more XML
context to translate between IM stanzas
Protocols for example XMPP to Internet
  a discrete semantic unit of structured
Relay Chat IRC] information that is sent from one entity to
another over an XML stream

Presence stanza Message stanza


  Used to signal client availability   Used for sending messages between
  e.g. available, unavailable, away clients
  Users can to subscribe to other users’ statuses
(rosters)
<message from=‘...’ to=‘...’>
<presence type=‘...’> <subject> ... </subject>
<show> ... </show> <body>
<status> ... </status> ...
<priority> ... </priority> ...
</presence> </body>
<thread> ... </thread>
</message>
  Also possible to send directed presence information

2
2/24/10

Query stanzas A simple IM example


client server
  Used to query a client or server <?xml version=‘1.0’?>
<stream to=‘capulet.com’>
  e.g. server features, searching for users <?xml version=‘1.0’?>
<stream from=‘capulet.com’
  Also for sending error messages to id=‘someid’>
<presence/>
client <message from=‘juliet@capulet.com’
to=‘romeo@montague.net’>
<body>Art thou not Romeo, and a Montague?</
body>
<iq id=‘...’ type=‘...’/> </message>
<message from=‘romeo@montague.net’
to=`juliet@capulet.com’>
<body>Neither, fair saint, if either thee
dislike.</body>
</message>
<presence from=`juliet@capulet.com’
type=`unavailable’/>
</stream>
</stream>

XML namespaces Extensions


  XML namespaces allow new tags to accommodate   multi-user chat   service discovery
extended functionality, e.g. search   voice/video chat   search
<stream:stream xmlns=‘jabber:client’   pub-sub   vcard
xmlns:stream='etherx.jabber.org—streams'>   microblogging   data forms
...
<iq type=‘set’ from=‘romeo@montague.net’   events   geolocation
to=‘capulet.com’
id='search'>
<query xmlns='jabber:iq:search'>   many, many more
<last>Capulet</last>
<first>Juliet</first>
</query>
</iq>
...

Advantages/disadvantages Useful resources


Strengths Weaknesses   XMPP Foundation :
  http://xmpp.org/
Decentralised Centralised
  Specifications
  http://xmpp.org/rfcs/rfc3920.html (core technologies)
Open standards Presence data overhead   http://xmpp.org/rfcs/rfc3921.html (IM & presence)
  Jabber User Guide
In-band binary data transfer is   http://archive.jabber.org/userguide/
Security
inefficient   Extensions
Flexibility   http://xmpp.org/extensions/
  Case studies
  http://wiki.xmpp.org/web/XMPP_Case_Studies/

Você também pode gostar