Tuesday 10 January 2017

XMPP protocol overview with Images.

XMPP Protocol (eXtensible Messaging and Presence Protocol.):
============
Introduction
XMPP is a communications protocol for message-oriented middleware based on Extensible Markup Language (XML) & has been used for publish-subscribe systems, signaling for VoIP, video, file transfer, gaming, the Internet of Things (IoT) applications.
eXtensible:  Not limited to initial conditions & XMPP can be customized to individual needs. (Machine to machine communication)
Messaging: Primary method of communication is a transmission of short messages between “Server & Client “and “Client & Client”
Presence:  Reactive to user’s presence & status. XMPP uses Presence driven logic to trigger events.

Protocol: XMPP is not a proprietary language. XMPP is based on standardization from the XML standards Federation. XMPP is an open platform.




XMPP takes place inside a single data stream between user and server.


Communication in the XMPP server is broken into Stanzas (sections).
Stanzas are short contained XML messages sent through the server between clients and other clients”, “Servers & Clients “, and as well as Servers & Servers”,
Stanzas come in 3 types Presence, IQ, Messages.
1.      Presence Stanza: 

·         Used to indicate User Status & can be used as a trigger for events inside the server.
·         Presence is shared with all users on Roster (Ex: if you have somebody on your Roster & they Login, you will receive a Presence stanza from them)
·         Presence may be sent by components, servers, or clients.
·         5 different show tags used to indicate status along with presence” chat, away, Xa, DND, Unavailable “.
Initial Presence:
·         Presence is sent to the Server from Client once login finished. After that Server delivers presence to any interested Parties, have on the Roster.
Presence Probe:
·         Act as “Are you there?” statement” to verify that connected resources are still in ONLINE, this can be a handle for different clients. Probing typically by the server.
·         Presence probes not used If User and Server are on the same machine
Presence Broadcast:
·          Used when changing status, like Away.
<presence>
                <show>away</ show>
</presence>
This presence stanza sent to the server, that server delivers to interested parties have on the Roster.  A presence stanza MUST NOT contain more than one <show/> element.
away -- The entity or resource is temporarily away.

·         chat -- The entity or resource is actively interested in chatting.

·         dnd -- The entity or resource is busy (dnd = "Do Not Disturb").

·         xa -- The entity or resource is away for an extended period (xa =
·         "eXtended Away").

   If no <show/> element is provided, the entity is assumed to be online
   and available.

2.      IQ(Info-Query) Stanza
·         The primary method how information is obtained and sent.
·         Can be used to request/change settings.
·         Provide for a Request and response mechanism.
·         There are 4 different types of IQ stanzas (Set, Get, Result, and Error)
IQ(Info-Query)- Service discovery (disco)
·         disco can be used to find out details about Users, Servers, Features etc…
·         disco#items requests available items (MUC rooms, users, services)
·         disco#info requests information about a specific entity
requests are made like this
<iq from =’yourjid@example.com’ id=’22’to=’example.com’ type=’get’>
        <query xmlns=’http://jabber.org/protocol/disco#items’/>
</iq>
To jid may be to server, components, or users.
From jid is not always necessary.
3.      Message Stanza
·         Designed to carry person to person text.
·         Can be extended to deliver rich text or different formatting.
·         There are 5 different message types
o    Chat-one-on-one messages between two users.
o    Group chat- messages being sent to &from MUCs (Multiple user chats)
o    Headline- alert messages that do not expect a reply
o    Normal- Standalone message with no history, but the reply is expected.
o    Error- messages reserved for error delivery.
Components
·         Items of the code that can extend, or provide services to the server.
·         Typically come with a server install, however, there may be separate components that are added to the server installation after server up and running, and can be turned on or off depending upon server installation.
·         Will typically have a JID assigned to components.
·         Examples of components.
o    HTTP interface
o    MUC
o    AMP
o    Jingle

                                Request: Please provide your valuable comments

No comments:

Post a Comment