Extensible Messaging and Presence Protocol (XMPP) is a messaging protocol that supports the instant transmission of data between distributed systems in real-time. It’s an open-source and extensible protocol based on XML (Extensible Markup Language) for message-oriented middleware, making the exchange of XML fragments possible between any two network endpoints.
As an open-source protocol, XMPP utilizes an open systems approach of development and application, by which anyone may implement an XMPP service and interoperate with other implementations. The open protocol systems permit any developer to develop multiple implementations using many clients, servers, server components, and code libraries under a variety of software licenses.
As an extensible middleware protocol, XMPP supports asynchronous messaging, pub/sub systems, signalling for VoIP, video, file transfer, gaming, and Internet of Things (IoT) applications including the smart grid and social networking services.
How did XMPP come about?
XMPP was released on January 4, 1999 by Jeremie Miller as an instant communication protocol. The earliest version of XMPP was developed by the JSF open-source community and was originally named ‘’Jabber Protocol’’. During Jabber’s early development period, attention was focused on developing an open-source, decentralized alternative to the closed instant-messaging services. However, XMPP ultimately became a protocol for message-oriented middleware that supports the real-time transmission of structured yet extensible data between distributed systems.
Over the years, XMPP has undergone various improvements and extensions. Its base protocols have been formalized by the Internet Engineering Task Force (IETF) – the international standards organization. Click through to read more about the history of XMPP.
Today, XMPP is used by General, Mendix, Vidyo, Contus Fly, GIST, Topical Core, and Zangi, among others.
How does XMPP work?
XMPP is based on a decentralized client-server architecture. In this architecture, clients don’t communicate directly with each other; instead, there’s a decentralized server acting as the intermediary between them. XMPP network shares a similar architectural design with email servers — there’s no central master server, and anyone can run their own XMPP server.
XMPP allocates an XMPP address (JabberID) to every client on the XMPP network. This address works just like a standard email address with an IP address/domain name, an optional node, and a username for the resident server.
In a simple XMPP architecture consisting of a server and two clients, a client with a unique name communicates through an associated XMPP server with another client using a unique name. Each client on the XMPP network implements the client form of the protocol with the XMPP server providing routing capability. The architecture may include XMPP gateways which are often used to translate between foreign messaging domains and IM protocols. The XMPP gateways permit the termination of a given client-to-server session as well as the initiation of a new client-to-server session to the target endpoint protocol, along with the necessary protocol translation.
In a more complex XMPP architecture, there can be several domains (servers and clients) and an XMPP internet with XMPP gateways acting as a link among different endpoint protocols. For instance, in the figure below, an XMPP network with gateways is used to provide universal connectivity between a Short Message Service (SMS) domain and a Simple Mail Transfer Protocol (SMTP). In this context, XMPP gateways are also used to translate between IM protocols.
Technical Overview of XMPP
Multiple levels of security are built into the core XMPP specifications. It uses Simple Authentication and Security Layer (SASL) for secure connection authentication and data security in Internet protocols. XMPP also utilizes two types of encryption: point-to-point encryption (TLS) and multi-end-to-end encryption (OMEMO).
XMPP is based on XML and developers can thus build custom functionality on top of the XMPP core protocols. Due to XML’s extensibility, developers can build up applications beyond instant messaging (IM) such as group chat, voice over IP, identity service (like OpenID & OAuth), online gaming, file sharing, network management, geolocation, content syndication, and more.
The XMPP technologies are defined in a series of Request for Comments (RFCs) documents published by the IEFT XMPP working group:
Out of these specifications, RFC 6120, RFC 6126,RFC 5122, and RFC 7622 are the most important and most widely implemented.
XMPP uses the Transmission Control Protocol (TCP) as its original and ‘’native’’ transport protocol for web applications and firewalls. However, in some cases there are restricted firewalls and the XMPP’s TCP port is blocked. Clients can then use an HTTP transport also developed by the XMPP community to overcome this issue.
XMPP Pros:
✔ Open standard instant messaging protocols
✔ Utilizes a decentralized client-server architecture
✔ Secure protocols via SASL, TLS, and OMEMO
✔ Supports HTTP transport protocol
✔ Supports multiple implementations with non-XMPP protocols
XMPP Cons:
Read more…
A friendly introduction to XMPP
XMPP: A Communication Protocol for the IoT
Meet the Extensible Messaging and Presence Protocol (XMPP)
Recommended Articles
The history of WebSockets
Learn how WebSocket came to be, and how it's an improvement on earlier HTTP-based techniques for delivering realtime apps.
WebSockets and macOS clients: Hard engineering challenges
Learn about the many challenges of implementing a dependable client-side WebSocket solution for macOS to enable the delivery of realtime data.
How to stream Kafka messages to Internet-facing clients over WebSockets
Kafka is used by a plethora of companies to power their realtime data streaming pipelines. Here, we explore how it can be used with WebSockets to stream data over the Internet.