Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

XMPP Protocol

  • Difficulty Level : Medium
  • Last Updated : 21 Mar, 2018

XMPP is a short form for Extensible Messaging Presence Protocol. It’s protocol for streaming XML elements over a network in order to exchange messages and presence information in close to real time. This protocol is mostly used by instant messaging applications like WhatsApp.

Let’s dive into each character of word XMPP:

  • X : It means eXtensible. XMPP is a open source project which can be changed or extended according to the need.
  • M : XMPP is designed for sending messages in real time. It has very efficient push mechanism compared to other protocols.
  • P : It determines whether you are online/offline/busy. It indicates the state.
  • P : XMPP is a protocol, that is, a set of standards that allow systems to communicate with each other.

These are the basic requirements of any Instant Messenger which are fulfilled by XMPP:

  1. Send and receive messages with other users.
  2. Check and share presence status
  3. Manage subscriptions to and from other users.
  4. Manage contact list
  5. Block communications(receive message, sharing presence status, etc) to specific users.

Other XMPP features:

Decentralised –
XMPP is based on client-server architecture, i.e. clients don’t communicate directly, they do it with the help of server as intermediary. It is decentralised means there is no centralised XMPP server just like email, anyone can run their own XMPP server.

Each XMPP client is identified by JID (Jabber ID).


For example, I’m a whatsApp user and I’m identified by my mobile number, so

   user = "8767898790"
   server = ""
   resource = "mobile"

   JID : ""

resource is used in case the application support mobile as well as desktop or web application, so it can be optional in case a Instant Messenger Application support only single kind of resource.

XMPP implementation –

The original protocol for XMPP is Transmission Control Protocol, using open ended XML streams over long lived TCP connections.

In some cases, there are restricted firewalls, XMPP(port 5222) is blocked, so it can’t be used for web applications and users behind restricted firewalls, to overcome this, XMPP community also developed a HTTP transport.
And as the client uses HTTP, most firewalls allow clients to fetch and post messages without any problem. Thus, in scenarios where the TCP port used by XMPP is blocked, a server can listen on the normal HTTP port and the traffic should pass without problems.

XMPP wiki

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!