+ All Categories
Home > Documents > Jabber and Extensible Messaging and Presence Protocol (XMPP)

Jabber and Extensible Messaging and Presence Protocol (XMPP)

Date post: 15-Jan-2016
Category:
Upload: kaida
View: 40 times
Download: 0 times
Share this document with a friend
Description:
Jabber and Extensible Messaging and Presence Protocol (XMPP). Presenter: Michael Smith Cisc 856 Dec. 6, 2005. What are they?. Jabber Open XML protocol for near-real-time messaging, presence and request-response services Developed in the open source community - PowerPoint PPT Presentation
Popular Tags:
23
Jabber and Extensible Messaging and Presence Protocol (XMPP) Presenter: Michael Smith Cisc 856 Dec. 6, 2005
Transcript
Page 1: Jabber and Extensible Messaging and Presence Protocol (XMPP)

Jabber and Extensible Messaging and Presence

Protocol (XMPP)

Presenter: Michael Smith

Cisc 856

Dec. 6, 2005

Page 2: Jabber and Extensible Messaging and Presence Protocol (XMPP)

What 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

Page 3: Jabber and Extensible Messaging and Presence Protocol (XMPP)
Page 4: Jabber and Extensible Messaging and Presence Protocol (XMPP)
Page 5: Jabber and Extensible Messaging and Presence Protocol (XMPP)

Motivation

• 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 don’t want• traffic leaving company network

Page 6: Jabber and Extensible Messaging and Presence Protocol (XMPP)

History

• 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).

Page 7: Jabber and Extensible Messaging and Presence Protocol (XMPP)

Jabber client Jabber client

Jabber client

Jabber server Jabber server

GatewayAOL IM network

AOL IM client

Jabber protocol communication

AOL Instant Messaging communication

Jabber example

Page 8: Jabber and Extensible Messaging and Presence Protocol (XMPP)

Addressing

• 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

Page 9: Jabber and Extensible Messaging and Presence Protocol (XMPP)

Addressing

OllieHeather@Ollie/homePC

Heather@Ollie/workPC

Heather@Ollie/laptop

domainnode resource

Jabber server

Page 10: Jabber and Extensible Messaging and Presence Protocol (XMPP)

Ollie.org

Jabber.org

Sifl.org

Frank

Heather

Jane

Mike

Initial setup

[email protected] sends message to [email protected]

[email protected] sends message to [email protected]

[email protected] sends message to [email protected]

Negotiate connection between Ollie.org and Sifl.org

Generic XMPP Message Routing

Page 11: Jabber and Extensible Messaging and Presence Protocol (XMPP)

Extensible 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

<Recipe name="bread" prep_time="5 mins" cook_time="3 hours"> <title>Basic bread</title> <ingredient amount="3" unit="cups">Flour</ingredient> <ingredient amount="0.25" unit="ounce">Yeast</ingredient> <ingredient amount="1.5" unit="cups">Warm Water</ingredient> <ingredient amount="1" unit="teaspoon">Salt</ingredient> <Instructions>

<step>Mix all ingredients together</step> <step>Cover with a cloth, and leave for one hour</step> <step>Knead again, and then bake in the oven.</step> </Instructions>

</Recipe> • Recipe = root element• Name = attribute• Title = child element

Page 12: Jabber and Extensible Messaging and Presence Protocol (XMPP)

XMPP 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

Page 13: Jabber and Extensible Messaging and Presence Protocol (XMPP)

Common Attributes

• Attributes common to Message, Presence, and IQ stanzas– to– from– id– type

Page 14: Jabber and Extensible Messaging and Presence Protocol (XMPP)

Message 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

Page 15: Jabber and Extensible Messaging and Presence Protocol (XMPP)

Presence Elements

• Used to inform users of who is online• Pub-Sub mechanism• Types

– unavailable– subscribe– unsubscribe– probe

• Child elements– show– status

Page 16: Jabber and Extensible Messaging and Presence Protocol (XMPP)

Information 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

Page 17: Jabber and Extensible Messaging and Presence Protocol (XMPP)

XMPP and TCP

Ollie.org

Mike Heather

Mike wants to sign on:1. Establish TCP connection2. Establish XML streams

One TCP connection per streamOne stream from client to server, one from server to clientTCP connection stays active for entire length of stream

XML stream

Page 18: Jabber and Extensible Messaging and Presence Protocol (XMPP)

XML stream establishment

Mike Ollie.orgStart stream to server

Start stream to client

Negotiate TLS use TLS – Transport Layer Security. Used for data encryption (optional)

Start new encrypted stream to server

Start new encrypted stream to client

Negotiate SASL use SASL– Simple Authentication and Security Layer. Used for authentication (required)

Start final stream to server

Start final stream to client

Page 19: Jabber and Extensible Messaging and Presence Protocol (XMPP)

XMPP-IM conversation

Mike Ollie.orgStart 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 logged out

Log out

Heather sends message

Heather logs out

Close stream

Close stream

Page 20: Jabber and Extensible Messaging and Presence Protocol (XMPP)

<stream:stream to='192.168.1.101'><iq type='set' id='gaim758e356f'>

<session/> </iq> <iq type='get' id='gaim758e3570'> <query xmlns='jabber:iq:roster'/> </iq> <presence/> <message type='chat' to='[email protected]'>

<body>Let’s meet at the mall later</body> </message>

<presence type='unavailable'> <status>Logged out</status> </presence></stream:stream>

Simple Client-to-Server Stream (document view)

XML Stanza(A-PDU)

XML Stream

Start session

Get roster

Send initial presence

Send message

Log out

Close stream

Open stream

Page 21: Jabber and Extensible Messaging and Presence Protocol (XMPP)

<stream:stream><stream:features>

<bind xmlns="xmpp-bind"/><session xmlns="xmpp-session"/>

</stream:features><iq type="result" to="mike">

<session xmlns="xmpp-session"/></iq><iq type="result" to="mike">

<query xmlns="jabber:iq:roster"><item jid="heather" subscription="both"/>

</query></iq><presence type="unavailable" from="heather" to="mike">

<status>Logged out</status></presence><presence from="heather" to="mike"/><message type="chat" to="mike" from="heather">

<body>Ok. See you at 8</body></message><presence type="unavailable" from="heather" to="mike">

<status>Logged out</status></presence>

</stream:stream>

Simple Client-to-Server Stream (document view)

Offer services

Start session

Send roster

Send contact’s presence

Send presence update

Send message

Open stream

Send presence update

Close stream

Page 22: Jabber and Extensible Messaging and Presence Protocol (XMPP)

Extensions to Jabber

• Jabber Enhancement Proposals– Similar to RFCs– Final, Draft, Informational, Historical,

Procedural, Humorous

• Examples– Service discovery– Non-SASL registration– User Avatar

Page 23: Jabber and Extensible Messaging and Presence Protocol (XMPP)

Beyond IM

• XMPP has been called “Web-services lite”

• Generic XML routing platform

• XMPP used by major Wall Street firms for trading systems


Recommended