Title: Jabber and Extensible Messaging and Presence Protocol (XMPP)
1Jabber and Extensible Messaging and Presence
Protocol (XMPP)
- Presenter Michael Smith
- Cisc 856
- Dec. 6, 2005
2What are they?
- Jabber
- Open XML protocol for near-real-time messaging,
presence and request-response services - Developed in the open source community
- Extensible Messaging and Presence Protocol (XMPP)
- IETF proposed standard based on Jabber
- Often still referred to as Jabber
3(No Transcript)
4(No Transcript)
5Motivation
- Jeremie Miller became tired of having multiple
instant messaging clients open - Industry continues the push
- Companies want
- IM/presence service for employees
- control over the communication
- Companies dont want
- traffic leaving company network
6History
- Early 1998 Jeremie Miller starts jabberd server
project. - Jan 4 1999 First announcement on Slashdot.
- May 2000 jabberd 1.0 released.
- August 2001 Jabber Software Foundation (JSF)
formed to manage protocols. - January 2002 JSF submits core protocols to IETF
as XMPP. - October 2002 IETF forms XMPP Working Group.
- February 2004 IESG approves XMPP specs as
Proposed Standards. - October 2004 IETF publishes XMPP RFCs
(3920-3923).
7Jabber example
Jabber server
Jabber server
Jabber client
Jabber client
AOL IM client
AOL IM network
Jabber client
Gateway
Jabber protocol communication AOL Instant
Messaging communication
8Addressing
- Entities
- Anything that can be a network end-point
- Entity address is called a JID (Jabber ID)
- JID Contains
- Domain identifier
- Node identifier
- Resource identifier
9Addressing
Jabber server
Heather_at_Ollie/laptop
Ollie
Heather_at_Ollie/homePC
domain
node
resource
Heather_at_Ollie/workPC
10Generic XMPP Message Routing
Initial setup
Heather
Frank_at_Ollie.org sends message to Heather_at_Ollie.org
Negotiate connection between Ollie.org and
Sifl.org
Frank
Mike
Sifl.org
Ollie.org
Frank_at_Ollie.org sends message to Mike_at_Sifl.org
Frank_at_Ollie.org sends message to Jane_at_Jabber.org
Jabber.org
Jane
11Extensible Markup Language (XML)
- Structured markup language related to HTML, but
more general - The semantics of data are defined by tags and
attributes - Elements have opening and closing tags
- Elements can have attributes and child elements
- ltRecipe name"bread" prep_time"5 mins"
cook_time"3 hours"gt - lttitlegtBasic breadlt/titlegt
- ltingredient amount"3" unit"cups"gtFlourlt/ingredi
entgt - ltingredient amount"0.25" unit"ounce"gtYeastlt/ing
redientgt ltingredient amount"1.5"
unit"cups"gtWarm Waterlt/ingredientgt ltingredient
amount"1" unit"teaspoon"gtSaltlt/ingredientgt
ltInstructionsgt - ltstepgtMix all ingredients togetherlt/stepgt
- ltstepgtCover with a cloth, and leave for one
hourlt/stepgt - ltstepgtKnead again, and then bake in the
oven.lt/stepgt lt/Instructionsgt - lt/Recipegt
- Recipe root element
- Name attribute
- Title child element
12XMPP mechanics
- XML-Stanzas
- An element of communication
- 3 types
- message
- IQ (Information Query)
- presence
- XML-Streams
- Entire communication between client and server
- Contains unbounded number of XML-Stanzas
13Common Attributes
- Attributes common to Message, Presence, and IQ
stanzas - to
- from
- id
- type
14Message Elements
- Used when one client talks to another
- Push mechanism similar to email
- Should have to attribute
- Possible types (defined by type attribute)
- Chat
- Groupchat
- Error
- Headline
- Normal
- Child elements
- Subject
- Body
- Thread
15Presence Elements
- Used to inform users of who is online
- Pub-Sub mechanism
- Types
- unavailable
- subscribe
- unsubscribe
- probe
- Child elements
- show
- status
16Information Query (IQ) Elements
- Request-Response mechanism similar to HTTP
- Interactions tracked by id
- Type (required)
- get
- set
- result
- error
- Semantics defined very broadly by RFC
- Example use is to retrieve rosters
17XMPP and TCP
Heather
Mike
Ollie.org
Mike wants to sign on
1. Establish TCP connection
XML stream
2. Establish XML streams
One TCP connection per stream One stream from
client to server, one from server to client TCP
connection stays active for entire length of
stream
18XML stream establishment
Mike
Ollie.org
Start stream to server
Start stream to client
TLS Transport Layer Security. Used for data
encryption (optional)
Negotiate TLS use
Start new encrypted stream to server
Start new encrypted stream to client
SASL Simple Authentication and Security Layer.
Used for authentication (required)
Negotiate SASL use
Start final stream to server
Start final stream to client
19XMPP-IM conversation
Mike
Ollie.org
Start stream
Start stream
Start IM session
ACK IM session
Request roster
Send roster
Send initial presence
Send all presence info
Send message to Heather
Forward Message from Heather
Heather sends message
Heather logged out
Heather logs out
Log out
Close stream
Close stream
20Simple Client-to-Server Stream (document view)
ltstreamstream to'192.168.1.101'gt ltiq
type'set' id'gaim758e356f'gt ltsession/gt
lt/iqgt ltiq type'get' id'gaim758e3570'gt
ltquery xmlns'jabberiqroster'/gt lt/iqgt
ltpresence/gt ltmessage type'chat'
to'heather_at_192.168.1.101'gt ltbodygtLets meet at
the mall laterlt/bodygt lt/messagegt ltprese
nce type'unavailable'gt ltstatusgtLogged
outlt/statusgt lt/presencegt lt/streamstreamgt
Open stream
XML Stanza (A-PDU)
Start session
Get roster
XML Stream
Send initial presence
Send message
Log out
Close stream
21Simple Client-to-Server Stream (document view)
ltstreamstreamgt ltstreamfeaturesgt ltbind
xmlns"xmpp-bind"/gt ltsession xmlns"xmpp-session
"/gt lt/streamfeaturesgt ltiq type"result"
to"mike"gt ltsession xmlns"xmpp-session"/gt lt/iq
gt ltiq type"result" to"mike"gt ltquery
xmlns"jabberiqroster"gt ltitem jid"heather"
subscription"both"/gt lt/querygt lt/iqgt ltpresence
type"unavailable" from"heather"
to"mike"gt ltstatusgtLogged outlt/statusgt lt/presen
cegt ltpresence from"heather" to"mike"/gt ltmessag
e type"chat" to"mike" from"heather"gt ltbodygtOk
. See you at 8lt/bodygt lt/messagegt ltpresence
type"unavailable" from"heather"
to"mike"gt ltstatusgtLogged outlt/statusgt lt/presen
cegt lt/streamstreamgt
Open stream
Offer services
Start session
Send roster
Send contacts presence
Send presence update
Send message
Send presence update
Close stream
22Extensions to Jabber
- Jabber Enhancement Proposals
- Similar to RFCs
- Final, Draft, Informational, Historical,
Procedural, Humorous - Examples
- Service discovery
- Non-SASL registration
- User Avatar
23Beyond IM
- XMPP has been called Web-services lite
- Generic XML routing platform
- XMPP used by major Wall Street firms for trading
systems