SlideShare a Scribd company logo
1 of 15
XMPP in Real-Time Applications



             Ben Weaver
               @bwvr
       http://benweaver.com/
INTRODUCTION


 + What is XMPP?
 + Why is it “real-time”?
 + How does it work?
 + Where can you use it?
 + Conclusion
WHAT: OVERVIEW


 + XMPP is the Extensible Messaging and Presence Protocol
 + Routes messages among clients.
 + Broadcasts presence (status) to interested contacts.
 + The “X” in extensible is XML.
 + Since XML has namespaces...
 + You can invent new message types any time.
WHAT: HISTORY


 + Back in 1998...
 + ICQ and AOL Instant Messenger were popular IM services.
 + Microsoft and Yahoo! were releasing their own.
 + Jeremie Miller started Jabber: community driven IM
 + Jabber standardization began in 1999
 + In 2002, an IETF working group formalized XMPP
WHAT: EXAMPLE


 <?xml version=“1.0”?>
 <stream to=“example.com”>               <?xml version=“1.0”?>
                                         <stream from=“example.com”>
                                          <features>
  ... negotiate features ...                <starttls />
                                            <mechanisms />
                                          </features>
  <message from=“juliet@example.com”
             to=“romeo@example.net”>
    <body>Art thou not Romeo...</body>
  </message>                              <message from=“romeo@example.net”
                                                     to=“juliet@example.com”>
                                            <body>Art thou not Romeo...</body>
 </stream>                                </message>


                                         </stream>

                  Client                                   Server
WHY: AJAX


 + I work on web sites and applications.
 + AJAX is a common technique used to improve experience.
 + Each call is a connection + HTTP request.
   - This is cumbersome when making frequent requests.
   - (Although, some browsers support Keep-Alive).
 + Communication is client-driven
   - Servers can’t push; polling adds overhead.
   - Awkward for web applications.
WHY: BI-DIRECTIONAL


 + XMPP is a bi-directional stream.
 + XML stanzas add structure.
 + IQ stanzas provide REST-like semantics.
 + XMPP is “non-blocking”: use an event-driven style.
 + BOSH extends XMPP to the web.
HOW: OVERVIEW


 + XMPP comes in two parts.
   - Core: stream-level semantics
   - Jabber: use the Core for IM
 + XEP: make your XMPP extensions official.
HOW: CORE


 + RFC 3920 defines stream semantics.
 + Clients are identified as user@host/resource
 + <stream />: root element
 + <features />: bootstrap the stream
   - TLS: secure communication
   - SASL: flexible authentication
 + <message />: send a message
 + <iq id=“unique-token” type=“get|set|...” />: info query
   - Unique token identifies responses.
   - Body can be anything.
 + <presence />: broadcast your status
HOW: INSTANT MESSAGE


 + RFC 3921 defines how IM works with the Core.
 + Each account has a roster.
   - Track clients connected through same account.
   - Store contacts and permissions.
 + Presence
   - States are defined.
   - Notification is regulated through rosters.
 + Message semantics are defined.
HOW: EXTEND


 + A stream is a sequence of XML stanzas.
 + Invent new ones!
 + Submit an XMPP Extension Proposal (XEP).
 + Some examples:
   - Ping <http://xmpp.org/extensions/xep-0199.html>
   - Jingle <http://xmpp.org/extensions/xep-0166.html>
   - BOSH <http://xmpp.org/extensions/xep-0124.html>
WHERE: WEB SERVICE


 + BOSH: Bi-directional streams over Synchronous HTTP
 + Like Comet
 + Define “HTML” semantics for XMPP stream.
 + Example: <http://github.com/thisismedium/python-xmpp-
 server/blob/master/examples/_bosh.py>
WHERE: CHAT


 + Chat example
 + <http://github.com/thisismedium/python-xmpp-server/
 blob/master/examples/chat-server.py>
CONCLUSION


 + Lot’s of people make clients; check it out!
 + Bi-directional
 + Event-driven
 + Works on the web
THE END




          Q&A

More Related Content

What's hot

Scalable Apache for Beginners
Scalable Apache for BeginnersScalable Apache for Beginners
Scalable Apache for Beginners
webhostingguy
 
โครงสร้างและระบบเครือข่ายคอมพิวเตอร์
โครงสร้างและระบบเครือข่ายคอมพิวเตอร์โครงสร้างและระบบเครือข่ายคอมพิวเตอร์
โครงสร้างและระบบเครือข่ายคอมพิวเตอร์
Kevalee Pichetpan
 

What's hot (19)

Real life XMPP Instant Messaging
Real life XMPP Instant MessagingReal life XMPP Instant Messaging
Real life XMPP Instant Messaging
 
XMPP 101
XMPP 101XMPP 101
XMPP 101
 
Interacting with XMPP using PHP
Interacting with XMPP using PHPInteracting with XMPP using PHP
Interacting with XMPP using PHP
 
Realtime applications with EmberJS and XMPP
Realtime applications with EmberJS and XMPPRealtime applications with EmberJS and XMPP
Realtime applications with EmberJS and XMPP
 
Xmpp presentation
Xmpp presentationXmpp presentation
Xmpp presentation
 
Scalable Apache for Beginners
Scalable Apache for BeginnersScalable Apache for Beginners
Scalable Apache for Beginners
 
OTR and XMPP
OTR and XMPPOTR and XMPP
OTR and XMPP
 
RPC protocols
RPC protocolsRPC protocols
RPC protocols
 
ScavengerEXA
ScavengerEXAScavengerEXA
ScavengerEXA
 
ExaBGP at LINX 83
ExaBGP at LINX 83ExaBGP at LINX 83
ExaBGP at LINX 83
 
SPDY
SPDY SPDY
SPDY
 
NullMQ @ PDX
NullMQ @ PDXNullMQ @ PDX
NullMQ @ PDX
 
HTTP/2 Update - FOSDEM 2016
HTTP/2 Update - FOSDEM 2016HTTP/2 Update - FOSDEM 2016
HTTP/2 Update - FOSDEM 2016
 
Composite Source With Mule ESB
Composite Source With Mule ESBComposite Source With Mule ESB
Composite Source With Mule ESB
 
The Parenscript Common Lisp to JavaScript compiler
The Parenscript Common Lisp to JavaScript compilerThe Parenscript Common Lisp to JavaScript compiler
The Parenscript Common Lisp to JavaScript compiler
 
Improving performance by changing the rules from fast to SPDY
Improving performance by changing the rules   from fast to SPDYImproving performance by changing the rules   from fast to SPDY
Improving performance by changing the rules from fast to SPDY
 
Developing high-performance network servers in Lisp
Developing high-performance network servers in LispDeveloping high-performance network servers in Lisp
Developing high-performance network servers in Lisp
 
โครงสร้างและระบบเครือข่ายคอมพิวเตอร์
โครงสร้างและระบบเครือข่ายคอมพิวเตอร์โครงสร้างและระบบเครือข่ายคอมพิวเตอร์
โครงสร้างและระบบเครือข่ายคอมพิวเตอร์
 
HTTP/2 standard for video streaming
HTTP/2 standard for video streamingHTTP/2 standard for video streaming
HTTP/2 standard for video streaming
 

Viewers also liked

IPSN 2009 Contiki / uIP tutorial
IPSN 2009 Contiki / uIP tutorialIPSN 2009 Contiki / uIP tutorial
IPSN 2009 Contiki / uIP tutorial
adamdunkels
 
Screen Digest Letang Ec Study
Screen Digest  Letang  Ec StudyScreen Digest  Letang  Ec Study
Screen Digest Letang Ec Study
ccivicosz
 
Instantmessagingprotocols
InstantmessagingprotocolsInstantmessagingprotocols
Instantmessagingprotocols
sanjoysanyal
 

Viewers also liked (20)

The Real Time Web with XMPP
The Real Time Web with XMPPThe Real Time Web with XMPP
The Real Time Web with XMPP
 
Xmpp
XmppXmpp
Xmpp
 
Scaling the Web to Billions of Nodes: Towards the IPv6 “Internet of Things” b...
Scaling the Web to Billions of Nodes: Towards the IPv6 “Internet of Things” b...Scaling the Web to Billions of Nodes: Towards the IPv6 “Internet of Things” b...
Scaling the Web to Billions of Nodes: Towards the IPv6 “Internet of Things” b...
 
Open Source XMPP for Cloud Services
Open Source XMPP for Cloud ServicesOpen Source XMPP for Cloud Services
Open Source XMPP for Cloud Services
 
Switch to Python 3…now…immediately
Switch to Python 3…now…immediatelySwitch to Python 3…now…immediately
Switch to Python 3…now…immediately
 
Protocols for IoT
Protocols for IoTProtocols for IoT
Protocols for IoT
 
IoT transport protocols
IoT transport protocolsIoT transport protocols
IoT transport protocols
 
IPSN 2009 Contiki / uIP tutorial
IPSN 2009 Contiki / uIP tutorialIPSN 2009 Contiki / uIP tutorial
IPSN 2009 Contiki / uIP tutorial
 
Sirous Kavehercy GSM 3G CeeCom Convergence
Sirous Kavehercy GSM 3G CeeCom ConvergenceSirous Kavehercy GSM 3G CeeCom Convergence
Sirous Kavehercy GSM 3G CeeCom Convergence
 
"Web Content Delivery Systems" - Gilbane Boston 2010
"Web Content Delivery Systems" - Gilbane Boston 2010"Web Content Delivery Systems" - Gilbane Boston 2010
"Web Content Delivery Systems" - Gilbane Boston 2010
 
Screen Digest Letang Ec Study
Screen Digest  Letang  Ec StudyScreen Digest  Letang  Ec Study
Screen Digest Letang Ec Study
 
Contiki introduction I.
Contiki introduction I.Contiki introduction I.
Contiki introduction I.
 
Mwlug 2016 BP108 The state of Instant Messaging Connectivity
Mwlug 2016 BP108 The state of Instant Messaging ConnectivityMwlug 2016 BP108 The state of Instant Messaging Connectivity
Mwlug 2016 BP108 The state of Instant Messaging Connectivity
 
Instantmessagingprotocols
InstantmessagingprotocolsInstantmessagingprotocols
Instantmessagingprotocols
 
LOLER Regulations 1998
LOLER Regulations 1998LOLER Regulations 1998
LOLER Regulations 1998
 
Instant SMS: Bringing SMS to the next phase and increasing service revenues
Instant SMS: Bringing SMS to the next phase and increasing service revenuesInstant SMS: Bringing SMS to the next phase and increasing service revenues
Instant SMS: Bringing SMS to the next phase and increasing service revenues
 
Secure instant messanger service
Secure instant messanger serviceSecure instant messanger service
Secure instant messanger service
 
Next-Gen Event Apps with AI Powered B2B Matchmaking
Next-Gen Event Apps with AI Powered B2B MatchmakingNext-Gen Event Apps with AI Powered B2B Matchmaking
Next-Gen Event Apps with AI Powered B2B Matchmaking
 
Protocols for IoT
Protocols for IoTProtocols for IoT
Protocols for IoT
 
Erlang White Label
Erlang White LabelErlang White Label
Erlang White Label
 

Similar to XMPP In Real Time

Intro to web services
Intro to web servicesIntro to web services
Intro to web services
Neil Ghosh
 

Similar to XMPP In Real Time (20)

Chat app case study - xmpp vs SIP
Chat app case study - xmpp vs SIPChat app case study - xmpp vs SIP
Chat app case study - xmpp vs SIP
 
WebServices introduction in Mule
WebServices introduction in MuleWebServices introduction in Mule
WebServices introduction in Mule
 
SOAP, WSDL and UDDI
SOAP, WSDL and UDDISOAP, WSDL and UDDI
SOAP, WSDL and UDDI
 
WebServices SOAP WSDL and UDDI
WebServices SOAP WSDL and UDDIWebServices SOAP WSDL and UDDI
WebServices SOAP WSDL and UDDI
 
OpenSouthCode 2018 - Integrating your applications easily with Apache Camel
OpenSouthCode 2018 - Integrating your applications easily with Apache CamelOpenSouthCode 2018 - Integrating your applications easily with Apache Camel
OpenSouthCode 2018 - Integrating your applications easily with Apache Camel
 
WebServices
WebServicesWebServices
WebServices
 
Intro to web services
Intro to web servicesIntro to web services
Intro to web services
 
From zero to almost rails in about a million slides...
From zero to almost rails in about a million slides...From zero to almost rails in about a million slides...
From zero to almost rails in about a million slides...
 
Why we choose Symfony2
Why we choose Symfony2Why we choose Symfony2
Why we choose Symfony2
 
Modern Web Technologies — Jerusalem Web Professionals, January 2011
Modern Web Technologies — Jerusalem Web Professionals, January 2011Modern Web Technologies — Jerusalem Web Professionals, January 2011
Modern Web Technologies — Jerusalem Web Professionals, January 2011
 
Modern Web technologies (and why you should care): Megacomm, Jerusalem, Febru...
Modern Web technologies (and why you should care): Megacomm, Jerusalem, Febru...Modern Web technologies (and why you should care): Megacomm, Jerusalem, Febru...
Modern Web technologies (and why you should care): Megacomm, Jerusalem, Febru...
 
Xml and webservice
Xml and webserviceXml and webservice
Xml and webservice
 
Sending mail,web services
Sending mail,web servicesSending mail,web services
Sending mail,web services
 
Web services Concepts
Web services ConceptsWeb services Concepts
Web services Concepts
 
soap toolkit
soap toolkitsoap toolkit
soap toolkit
 
Micro on NATS - Microservices with Messaging
Micro on NATS - Microservices with MessagingMicro on NATS - Microservices with Messaging
Micro on NATS - Microservices with Messaging
 
Xke - Introduction to Apache Camel
Xke - Introduction to Apache CamelXke - Introduction to Apache Camel
Xke - Introduction to Apache Camel
 
XML-RPC and SOAP (April 2003)
XML-RPC and SOAP (April 2003)XML-RPC and SOAP (April 2003)
XML-RPC and SOAP (April 2003)
 
SOAP Service in Mule Esb
SOAP Service in Mule EsbSOAP Service in Mule Esb
SOAP Service in Mule Esb
 
Code is art
Code is artCode is art
Code is art
 

Recently uploaded

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 

Recently uploaded (20)

Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 

XMPP In Real Time

  • 1. XMPP in Real-Time Applications Ben Weaver @bwvr http://benweaver.com/
  • 2. INTRODUCTION + What is XMPP? + Why is it “real-time”? + How does it work? + Where can you use it? + Conclusion
  • 3. WHAT: OVERVIEW + XMPP is the Extensible Messaging and Presence Protocol + Routes messages among clients. + Broadcasts presence (status) to interested contacts. + The “X” in extensible is XML. + Since XML has namespaces... + You can invent new message types any time.
  • 4. WHAT: HISTORY + Back in 1998... + ICQ and AOL Instant Messenger were popular IM services. + Microsoft and Yahoo! were releasing their own. + Jeremie Miller started Jabber: community driven IM + Jabber standardization began in 1999 + In 2002, an IETF working group formalized XMPP
  • 5. WHAT: EXAMPLE <?xml version=“1.0”?> <stream to=“example.com”> <?xml version=“1.0”?> <stream from=“example.com”> <features> ... negotiate features ... <starttls /> <mechanisms /> </features> <message from=“juliet@example.com” to=“romeo@example.net”> <body>Art thou not Romeo...</body> </message> <message from=“romeo@example.net” to=“juliet@example.com”> <body>Art thou not Romeo...</body> </stream> </message> </stream> Client Server
  • 6. WHY: AJAX + I work on web sites and applications. + AJAX is a common technique used to improve experience. + Each call is a connection + HTTP request. - This is cumbersome when making frequent requests. - (Although, some browsers support Keep-Alive). + Communication is client-driven - Servers can’t push; polling adds overhead. - Awkward for web applications.
  • 7. WHY: BI-DIRECTIONAL + XMPP is a bi-directional stream. + XML stanzas add structure. + IQ stanzas provide REST-like semantics. + XMPP is “non-blocking”: use an event-driven style. + BOSH extends XMPP to the web.
  • 8. HOW: OVERVIEW + XMPP comes in two parts. - Core: stream-level semantics - Jabber: use the Core for IM + XEP: make your XMPP extensions official.
  • 9. HOW: CORE + RFC 3920 defines stream semantics. + Clients are identified as user@host/resource + <stream />: root element + <features />: bootstrap the stream - TLS: secure communication - SASL: flexible authentication + <message />: send a message + <iq id=“unique-token” type=“get|set|...” />: info query - Unique token identifies responses. - Body can be anything. + <presence />: broadcast your status
  • 10. HOW: INSTANT MESSAGE + RFC 3921 defines how IM works with the Core. + Each account has a roster. - Track clients connected through same account. - Store contacts and permissions. + Presence - States are defined. - Notification is regulated through rosters. + Message semantics are defined.
  • 11. HOW: EXTEND + A stream is a sequence of XML stanzas. + Invent new ones! + Submit an XMPP Extension Proposal (XEP). + Some examples: - Ping <http://xmpp.org/extensions/xep-0199.html> - Jingle <http://xmpp.org/extensions/xep-0166.html> - BOSH <http://xmpp.org/extensions/xep-0124.html>
  • 12. WHERE: WEB SERVICE + BOSH: Bi-directional streams over Synchronous HTTP + Like Comet + Define “HTML” semantics for XMPP stream. + Example: <http://github.com/thisismedium/python-xmpp- server/blob/master/examples/_bosh.py>
  • 13. WHERE: CHAT + Chat example + <http://github.com/thisismedium/python-xmpp-server/ blob/master/examples/chat-server.py>
  • 14. CONCLUSION + Lot’s of people make clients; check it out! + Bi-directional + Event-driven + Works on the web
  • 15. THE END Q&A

Editor's Notes