SlideShare a Scribd company logo
1 of 17
Download to read offline
https://www.javavogue.com/
XMPP – Extensible Messaging
and Presence Protocol
Type your text
Type your text
Type your text
Type your text
Type your text
2
XMPP
XMPP
The base protocol used for XMPP is RFC 2779 (Instant
Messaging /Presence Protocol Requirements).
There are 2 drafts namely XMPP Core and XMPP Instant
Messaging currently on XMPP.
Presence and Instant Messaging
Presence and Instant Messaging
• Presence – Presence is a means for finding, retrieving, and
subscribing to changes in the presence information (e.g. "online" or
"offline") of other users.
• Instant Messaging – It is a means for sending small,
simple messages that are delivered immediately to online users.
3
Requirements of RFC 2779
Requirements of RFC 2779
1.
1. Scalability
Scalability
2.
2. Access Control
Access Control
3.
3. Message Encryption & Authentication
Message Encryption & Authentication
4.
4. Presence Lookup & Notification
Presence Lookup & Notification
5.
5. Presence Caching & Replication
Presence Caching & Replication
6.
6. Reliability
Reliability
7.
7. Performance
Performance
4
XMPP Core Overview
XMPP Core Overview
• XMPP is an open protocol for streaming XML elements in
order to exchange messages and presence information in close to
real time.
• XMPP has been implemented via a typical client-server
architecture, wherein a client utilizing XMPP accesses a server
over a TCP socket.
Openfire Xmpp Server Tutorials
5
Addressing Scheme
Addressing Scheme
JID – Jabber Identifier.
format: [node@]domain[/resource]
E.g. <room@service>
<room@service>
(where "room" is the name of the chat room and "service" is
the hostname of the multi-user chat service)
<room@service/nick>
<room@service/nick>
(where "nick" is the occupant's room nickname)
<domain/resource>
<domain/resource>
(could be a server-side script or service )
6
• Domain Identifier –
Domain Identifier –
– Only Required identifier of JID.
– Represents the n/w gateway or primary server to
which entities connect.
– Not always a server, can be service that is addressed
as a sub domain of a server.
• Node Identifier –
Node Identifier –
– optional secondary identifier.
– represents a client or a chat room associated with a
multi-user chat service etc.
– is called a "bare JID" and is of the form
<node@domain>.
7
• Resource Identifier –
Resource Identifier –
– optional tertiary identifier.
– represents a specific session, connection (e.g., a device
or location), or object (e.g., a participant in a multi-user
chat room).
– typically defined by a client implementation.
8
XML Streams and Stanzas
XML Streams and Stanzas
 XML Streams
 container for the exchange of XML elements between
any two entities over a network.
 The start and end of the XML stream is denoted by
<stream> tag and </ stream> tag.
 An XML stream is unidirectional.
 XML Stanza
 is a discrete semantic unit of structured information.
 is at a depth=1 of the XML stream.
9
XML Stanzas
XML Stanzas
• Message Stanza
– include single messages,
– Types of messages are chat, error, group chat,
headline, normal.
– Child elements are <subject/> and <body/>.
<message
to='romeo@montague.net'
from='juliet@capulet.com/balcony'
xml:lang='en'>
<subject>I implore you!</subject>
<subject xml:lang=‘en'>
</subject>
<body>Where are you, Romeo?</body>
<body xml:lang=‘en'>
</body>
</message>
<stream>
<presence>
<show/>
</presence>
<message to='foo'>
<body/>
</message>
<iq to='bar'>
<query/>
</iq>
</stream>
10
•Presence Stanza
– to express an entity's current availability status.
– Types of Presence are unavailable, subscribe etc.
– Child elements are <show/>, <status/>, <priority/>.
<presence>
<show>dnd</show>
</presence>
•IQ Stanza
– is a request-response mechanism
– Types of IQ are get(request roaster), set(add item on roaster), result, error.
– Client requests current roster from server:
<iq type='get' id='roster_1'>
<query xmlns='jabber:iq:roster'/>
</iq>
11
A Basic Session:
A Basic Session:
C: <?xml version='1.0'?>
<stream:stream
to='shakespeare.lit'
xmlns='jabber:client'
xmlns:stream='http://etherx.jabber.org/streams'
version='1.0'>
S: <?xml version='1.0'?>
<stream:stream
from='shakespeare.lit'
id='id_123456789'
xmlns='jabber:client'
xmlns:stream='http://etherx.jabber.org/streams‘
version='1.0'>
….authentication ...
C: <message from='juliet@shakespeare.lit'
to='romeo@shakespeare.lit'
xml:lang='en'>
C: <body>Hi Romeo</body>
C: </message>
S: <message from='romeo@shakespeare.lit'
to='juliet@shakespeare.lit'
xml:lang='en'>
S: <body>Hi Juliet.</body>
S: </message>
C: </stream:stream>
S: </stream:stream>
:
:
12
Stream Encryption & Authentication
Stream Encryption & Authentication
XMPP includes a method for securing the stream from tampering and
eavesdropping. This channel encryption method makes use of the
Transport Layer Security (TLS) protocol, along with a "STARTTLS“.
Example
Step 1: Client initiates stream to server:
<stream:stream
xmlns='jabber:client'
xmlns:stream='http://etherx.jabber.org/streams'
to='capulet.com'
version='1.0'>
Step 2: Server responds by sending a stream tag to client:
<stream:stream
xmlns='jabber:client'
xmlns:stream='http://etherx.jabber.org/streams'
id='12345678'
from='capulet.com'
version='1.0'>
13
Step 3: Server sends the STARTTLS extension to client along with
authentication mechanisms and any other stream features:
<stream:features>
<starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'>
<required/>
</starttls>
<mechanisms xmlns='urn:ietf:params:xml:ns:xmpp-sasl'>
<mechanism>DIGEST-MD5</mechanism>
<mechanism>PLAIN</mechanism>
</mechanisms> </stream:features>
Step 4: Client sends the STARTTLS command to server:
<starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'/>
Step 5: Server informs client to proceed:
<proceed xmlns='urn:ietf:params:xml:ns:xmpp-tls'/>
Step 6: Client and server attempt to complete TLS negotiation over the
existing TCP connection.
Step 7: If TLS negotiation is successful, client initiates a new stream to
server: <stream:stream
xmlns='jabber:client'
xmlns:stream='http://etherx.jabber.org/streams'
to='capulet.com'
version='1.0'>
14
Step 8: Server responds by sending a stream header to client along with
any remaining negotiable stream features:
<stream:stream
xmlns='jabber:client'
xmlns:stream='http://etherx.jabber.org/streams'
from='capulet.com'
id='12345678'
version='1.0'>
<stream:features>
<mechanisms xmlns='urn:ietf:params:xml:ns:xmpp-sasl'>
<mechanism>DIGEST-MD5</mechanism>
<mechanism>PLAIN</mechanism>
<mechanism>EXTERNAL</mechanism>
</mechanisms>
</stream:features>
Step 9: Client selects an authentication mechanism:
<auth
xmlns='urn:ietf:params:xml:ns:xmpp-sasl‘
mechanism='DIGEST-MD5'/>
Step 10: Server sends a base64-encoded challenge to client: The decoded challenge
is:
nonce="gx0P01RRVoOfJVrIJ6aNkFlinh9nM/Up9dazVTFTq1c=",
realm="capulet.com",qop="auth,auth-int,auth-conf",
cipher="rc4-40,rc4-56,rc4,des,3des",maxbuf=2048,
charset=utf-8,algorithm=md5-sess
15
Step 11: Client responds to the challenge: The decoded response is:
username="juliet",realm="capulet.com", authzid="juliet@capulet.com/balcony",
nonce="gx0P01RRVoOfJVrIJ6aNkFlinh9nM/Up9dazVTFTq1c=",
cnonce="bdi7U/Duhd97ffXpS9mNhhK3ciY0FGO9xuqIlapBK4o=",
nc=00000001,qop=auth-conf,cipher="rc4",maxbuf=2048,
digest-uri="xmpp/capulet.com", response=8e0ac6010833b1224fcc4742afbdb352
Step 12: Server informs client of successful authentication:
<success xmlns='urn:ietf:params:xml:ns:xmpp-sasl'/>
Step 13: Client initiates a new stream to server and the rest of the message
passing happens.
16
Order of Layers
Order of Layers
The order of layers in which protocols MUST be stacked is as follows:
1. TCP
2. TLS
3. SASL
4. XMPP
The rationale for this order is that TCP is the base connection layer used
by all of the protocols. Stacked on top of TCP is TLS and is often provided at the
operating system layer, SASL is often provided at the application layer, and
XMPP is the application itself.
17
Summary of XMPP- IM
• Establishing a Session
• Exchanging Messages
• Exchanging Presence Information
• Managing One's Roster

More Related Content

What's hot

The constrained application protocol (CoAP)
The constrained application protocol (CoAP)The constrained application protocol (CoAP)
The constrained application protocol (CoAP)Hamdamboy (함담보이)
 
Message passing ( in computer science)
Message   passing  ( in   computer  science)Message   passing  ( in   computer  science)
Message passing ( in computer science)Computer_ at_home
 
ARM CoAP Tutorial
ARM CoAP TutorialARM CoAP Tutorial
ARM CoAP Tutorialzdshelby
 
Remote procedure calls
Remote procedure callsRemote procedure calls
Remote procedure callsimnomus
 
Rpc Case Studies (Distributed computing)
Rpc Case Studies (Distributed computing)Rpc Case Studies (Distributed computing)
Rpc Case Studies (Distributed computing)Sri Prasanna
 
The constrained application protocol (co ap) implementation-part5
The constrained application protocol (co ap) implementation-part5The constrained application protocol (co ap) implementation-part5
The constrained application protocol (co ap) implementation-part5Hamdamboy (함담보이)
 
Computer network (10)
Computer network (10)Computer network (10)
Computer network (10)NYversity
 
The constrained application protocol (coap) part 3
The constrained application protocol (coap)  part 3The constrained application protocol (coap)  part 3
The constrained application protocol (coap) part 3Hamdamboy
 
M2M Protocols for Constrained Environments in the Context of IoT: A Compariso...
M2M Protocols for Constrained Environments in the Context of IoT: A Compariso...M2M Protocols for Constrained Environments in the Context of IoT: A Compariso...
M2M Protocols for Constrained Environments in the Context of IoT: A Compariso...Edielson P. Frigieri
 
Remote procedure call on client server computing
Remote procedure call on client server computingRemote procedure call on client server computing
Remote procedure call on client server computingSatya P. Joshi
 
The constrained application protocol (co ap) part 2
The constrained application protocol (co ap)  part 2The constrained application protocol (co ap)  part 2
The constrained application protocol (co ap) part 2Hamdamboy (함담보이)
 
What is the difference between udp and tcp internet protocols
What is the difference between udp and tcp internet protocols What is the difference between udp and tcp internet protocols
What is the difference between udp and tcp internet protocols krupalipandya29
 
file transfer and access utilities
file transfer and access utilitiesfile transfer and access utilities
file transfer and access utilitiestumetr1
 
Sun RPC (Remote Procedure Call)
Sun RPC (Remote Procedure Call)Sun RPC (Remote Procedure Call)
Sun RPC (Remote Procedure Call)Peter R. Egli
 
Distributed System by Pratik Tambekar
Distributed System by Pratik TambekarDistributed System by Pratik Tambekar
Distributed System by Pratik TambekarPratik Tambekar
 

What's hot (20)

The constrained application protocol (CoAP)
The constrained application protocol (CoAP)The constrained application protocol (CoAP)
The constrained application protocol (CoAP)
 
Message passing ( in computer science)
Message   passing  ( in   computer  science)Message   passing  ( in   computer  science)
Message passing ( in computer science)
 
What is SPDY
What is SPDYWhat is SPDY
What is SPDY
 
ARM CoAP Tutorial
ARM CoAP TutorialARM CoAP Tutorial
ARM CoAP Tutorial
 
SOAP WEB TECHNOLOGIES
SOAP WEB TECHNOLOGIESSOAP WEB TECHNOLOGIES
SOAP WEB TECHNOLOGIES
 
Remote procedure calls
Remote procedure callsRemote procedure calls
Remote procedure calls
 
Rpc Case Studies (Distributed computing)
Rpc Case Studies (Distributed computing)Rpc Case Studies (Distributed computing)
Rpc Case Studies (Distributed computing)
 
The constrained application protocol (co ap) implementation-part5
The constrained application protocol (co ap) implementation-part5The constrained application protocol (co ap) implementation-part5
The constrained application protocol (co ap) implementation-part5
 
Computer network (10)
Computer network (10)Computer network (10)
Computer network (10)
 
CCNA 1 Chapter 10 v5.0 2014
CCNA 1 Chapter 10 v5.0 2014CCNA 1 Chapter 10 v5.0 2014
CCNA 1 Chapter 10 v5.0 2014
 
The constrained application protocol (coap) part 3
The constrained application protocol (coap)  part 3The constrained application protocol (coap)  part 3
The constrained application protocol (coap) part 3
 
M2M Protocols for Constrained Environments in the Context of IoT: A Compariso...
M2M Protocols for Constrained Environments in the Context of IoT: A Compariso...M2M Protocols for Constrained Environments in the Context of IoT: A Compariso...
M2M Protocols for Constrained Environments in the Context of IoT: A Compariso...
 
Remote procedure call on client server computing
Remote procedure call on client server computingRemote procedure call on client server computing
Remote procedure call on client server computing
 
Application layer
Application layerApplication layer
Application layer
 
The constrained application protocol (co ap) part 2
The constrained application protocol (co ap)  part 2The constrained application protocol (co ap)  part 2
The constrained application protocol (co ap) part 2
 
What is the difference between udp and tcp internet protocols
What is the difference between udp and tcp internet protocols What is the difference between udp and tcp internet protocols
What is the difference between udp and tcp internet protocols
 
file transfer and access utilities
file transfer and access utilitiesfile transfer and access utilities
file transfer and access utilities
 
Sun RPC (Remote Procedure Call)
Sun RPC (Remote Procedure Call)Sun RPC (Remote Procedure Call)
Sun RPC (Remote Procedure Call)
 
Distributed System by Pratik Tambekar
Distributed System by Pratik TambekarDistributed System by Pratik Tambekar
Distributed System by Pratik Tambekar
 
Email HTTP And FTP
Email HTTP And FTP Email HTTP And FTP
Email HTTP And FTP
 

Similar to Xmpp presentation

Similar to Xmpp presentation (20)

Xmpp presentation
Xmpp   presentationXmpp   presentation
Xmpp presentation
 
XMPP-IoT Protocol designed mainly to send mesages
XMPP-IoT Protocol designed mainly to send mesagesXMPP-IoT Protocol designed mainly to send mesages
XMPP-IoT Protocol designed mainly to send mesages
 
Web Service
Web ServiceWeb Service
Web Service
 
SSL Secure socket layer
SSL Secure socket layerSSL Secure socket layer
SSL Secure socket layer
 
Transport Layer Security
Transport Layer Security Transport Layer Security
Transport Layer Security
 
XML-RPC and SOAP (April 2003)
XML-RPC and SOAP (April 2003)XML-RPC and SOAP (April 2003)
XML-RPC and SOAP (April 2003)
 
Messaging With Erlang And Jabber
Messaging With  Erlang And  JabberMessaging With  Erlang And  Jabber
Messaging With Erlang And Jabber
 
Web Services
Web ServicesWeb Services
Web Services
 
Web Services
Web ServicesWeb Services
Web Services
 
application layer
application layerapplication layer
application layer
 
Intro to web services
Intro to web servicesIntro to web services
Intro to web services
 
SNMP/SMTP/MIME
SNMP/SMTP/MIMESNMP/SMTP/MIME
SNMP/SMTP/MIME
 
Jetty TLS troubleshooting
Jetty TLS troubleshootingJetty TLS troubleshooting
Jetty TLS troubleshooting
 
Ead pertemuan-7
Ead pertemuan-7Ead pertemuan-7
Ead pertemuan-7
 
complete web service1.ppt
complete web service1.pptcomplete web service1.ppt
complete web service1.ppt
 
Ejabberd Session
Ejabberd SessionEjabberd Session
Ejabberd Session
 
SIP over TLS
SIP over TLSSIP over TLS
SIP over TLS
 
CRYPTOGRAPHY AND NETWORK SECURITY- Transport-level Security
CRYPTOGRAPHY AND NETWORK SECURITY- Transport-level SecurityCRYPTOGRAPHY AND NETWORK SECURITY- Transport-level Security
CRYPTOGRAPHY AND NETWORK SECURITY- Transport-level Security
 
8023.ppt
8023.ppt8023.ppt
8023.ppt
 
Web security
Web securityWeb security
Web security
 

Recently uploaded

Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 

Recently uploaded (20)

Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 

Xmpp presentation

  • 1. https://www.javavogue.com/ XMPP – Extensible Messaging and Presence Protocol Type your text Type your text Type your text Type your text Type your text
  • 2. 2 XMPP XMPP The base protocol used for XMPP is RFC 2779 (Instant Messaging /Presence Protocol Requirements). There are 2 drafts namely XMPP Core and XMPP Instant Messaging currently on XMPP. Presence and Instant Messaging Presence and Instant Messaging • Presence – Presence is a means for finding, retrieving, and subscribing to changes in the presence information (e.g. "online" or "offline") of other users. • Instant Messaging – It is a means for sending small, simple messages that are delivered immediately to online users.
  • 3. 3 Requirements of RFC 2779 Requirements of RFC 2779 1. 1. Scalability Scalability 2. 2. Access Control Access Control 3. 3. Message Encryption & Authentication Message Encryption & Authentication 4. 4. Presence Lookup & Notification Presence Lookup & Notification 5. 5. Presence Caching & Replication Presence Caching & Replication 6. 6. Reliability Reliability 7. 7. Performance Performance
  • 4. 4 XMPP Core Overview XMPP Core Overview • XMPP is an open protocol for streaming XML elements in order to exchange messages and presence information in close to real time. • XMPP has been implemented via a typical client-server architecture, wherein a client utilizing XMPP accesses a server over a TCP socket. Openfire Xmpp Server Tutorials
  • 5. 5 Addressing Scheme Addressing Scheme JID – Jabber Identifier. format: [node@]domain[/resource] E.g. <room@service> <room@service> (where "room" is the name of the chat room and "service" is the hostname of the multi-user chat service) <room@service/nick> <room@service/nick> (where "nick" is the occupant's room nickname) <domain/resource> <domain/resource> (could be a server-side script or service )
  • 6. 6 • Domain Identifier – Domain Identifier – – Only Required identifier of JID. – Represents the n/w gateway or primary server to which entities connect. – Not always a server, can be service that is addressed as a sub domain of a server. • Node Identifier – Node Identifier – – optional secondary identifier. – represents a client or a chat room associated with a multi-user chat service etc. – is called a "bare JID" and is of the form <node@domain>.
  • 7. 7 • Resource Identifier – Resource Identifier – – optional tertiary identifier. – represents a specific session, connection (e.g., a device or location), or object (e.g., a participant in a multi-user chat room). – typically defined by a client implementation.
  • 8. 8 XML Streams and Stanzas XML Streams and Stanzas  XML Streams  container for the exchange of XML elements between any two entities over a network.  The start and end of the XML stream is denoted by <stream> tag and </ stream> tag.  An XML stream is unidirectional.  XML Stanza  is a discrete semantic unit of structured information.  is at a depth=1 of the XML stream.
  • 9. 9 XML Stanzas XML Stanzas • Message Stanza – include single messages, – Types of messages are chat, error, group chat, headline, normal. – Child elements are <subject/> and <body/>. <message to='romeo@montague.net' from='juliet@capulet.com/balcony' xml:lang='en'> <subject>I implore you!</subject> <subject xml:lang=‘en'> </subject> <body>Where are you, Romeo?</body> <body xml:lang=‘en'> </body> </message> <stream> <presence> <show/> </presence> <message to='foo'> <body/> </message> <iq to='bar'> <query/> </iq> </stream>
  • 10. 10 •Presence Stanza – to express an entity's current availability status. – Types of Presence are unavailable, subscribe etc. – Child elements are <show/>, <status/>, <priority/>. <presence> <show>dnd</show> </presence> •IQ Stanza – is a request-response mechanism – Types of IQ are get(request roaster), set(add item on roaster), result, error. – Client requests current roster from server: <iq type='get' id='roster_1'> <query xmlns='jabber:iq:roster'/> </iq>
  • 11. 11 A Basic Session: A Basic Session: C: <?xml version='1.0'?> <stream:stream to='shakespeare.lit' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' version='1.0'> S: <?xml version='1.0'?> <stream:stream from='shakespeare.lit' id='id_123456789' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams‘ version='1.0'> ….authentication ... C: <message from='juliet@shakespeare.lit' to='romeo@shakespeare.lit' xml:lang='en'> C: <body>Hi Romeo</body> C: </message> S: <message from='romeo@shakespeare.lit' to='juliet@shakespeare.lit' xml:lang='en'> S: <body>Hi Juliet.</body> S: </message> C: </stream:stream> S: </stream:stream> : :
  • 12. 12 Stream Encryption & Authentication Stream Encryption & Authentication XMPP includes a method for securing the stream from tampering and eavesdropping. This channel encryption method makes use of the Transport Layer Security (TLS) protocol, along with a "STARTTLS“. Example Step 1: Client initiates stream to server: <stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' to='capulet.com' version='1.0'> Step 2: Server responds by sending a stream tag to client: <stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='12345678' from='capulet.com' version='1.0'>
  • 13. 13 Step 3: Server sends the STARTTLS extension to client along with authentication mechanisms and any other stream features: <stream:features> <starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'> <required/> </starttls> <mechanisms xmlns='urn:ietf:params:xml:ns:xmpp-sasl'> <mechanism>DIGEST-MD5</mechanism> <mechanism>PLAIN</mechanism> </mechanisms> </stream:features> Step 4: Client sends the STARTTLS command to server: <starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'/> Step 5: Server informs client to proceed: <proceed xmlns='urn:ietf:params:xml:ns:xmpp-tls'/> Step 6: Client and server attempt to complete TLS negotiation over the existing TCP connection. Step 7: If TLS negotiation is successful, client initiates a new stream to server: <stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' to='capulet.com' version='1.0'>
  • 14. 14 Step 8: Server responds by sending a stream header to client along with any remaining negotiable stream features: <stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' from='capulet.com' id='12345678' version='1.0'> <stream:features> <mechanisms xmlns='urn:ietf:params:xml:ns:xmpp-sasl'> <mechanism>DIGEST-MD5</mechanism> <mechanism>PLAIN</mechanism> <mechanism>EXTERNAL</mechanism> </mechanisms> </stream:features> Step 9: Client selects an authentication mechanism: <auth xmlns='urn:ietf:params:xml:ns:xmpp-sasl‘ mechanism='DIGEST-MD5'/> Step 10: Server sends a base64-encoded challenge to client: The decoded challenge is: nonce="gx0P01RRVoOfJVrIJ6aNkFlinh9nM/Up9dazVTFTq1c=", realm="capulet.com",qop="auth,auth-int,auth-conf", cipher="rc4-40,rc4-56,rc4,des,3des",maxbuf=2048, charset=utf-8,algorithm=md5-sess
  • 15. 15 Step 11: Client responds to the challenge: The decoded response is: username="juliet",realm="capulet.com", authzid="juliet@capulet.com/balcony", nonce="gx0P01RRVoOfJVrIJ6aNkFlinh9nM/Up9dazVTFTq1c=", cnonce="bdi7U/Duhd97ffXpS9mNhhK3ciY0FGO9xuqIlapBK4o=", nc=00000001,qop=auth-conf,cipher="rc4",maxbuf=2048, digest-uri="xmpp/capulet.com", response=8e0ac6010833b1224fcc4742afbdb352 Step 12: Server informs client of successful authentication: <success xmlns='urn:ietf:params:xml:ns:xmpp-sasl'/> Step 13: Client initiates a new stream to server and the rest of the message passing happens.
  • 16. 16 Order of Layers Order of Layers The order of layers in which protocols MUST be stacked is as follows: 1. TCP 2. TLS 3. SASL 4. XMPP The rationale for this order is that TCP is the base connection layer used by all of the protocols. Stacked on top of TCP is TLS and is often provided at the operating system layer, SASL is often provided at the application layer, and XMPP is the application itself.
  • 17. 17 Summary of XMPP- IM • Establishing a Session • Exchanging Messages • Exchanging Presence Information • Managing One's Roster