Internet of Things Communication Protocol-XMPP

Posted in 知识科普  |  Tagged , , ,

summarize

XMPP is the Extensible Messaging and Presence Protocol, a set of open technologies for instant messaging, presence, multi-party chat, voice and video calling, collaboration, lightweight middleware, content federation, and universal routing of XML data, as anIoT protocols, building reliable, secure and interoperable devices, services and IoT applications.

XMPP协议

XMPP offers several key product features:

  • Open - The XMPP protocol is free, open, public and easy to understand; moreover, multiple implementations exist in the form of clients, servers, server components and code bases.
  • Standard - Internet Engineering Task Force (IETF) The core XML Streaming Protocol has been formalized as an approved instant messaging and stateful technology. the XMPP specification was published in 2004 as the RFC 3920 respond in singing RFC 3921 releases, the XMPP Standards Foundation continues to release many XMPP Extended ProtocolIn 2011, the core RFCs were revised, resulting in an updated specification (RFC 6120,RFC 6121 respond in singing RFC 7622).
  • Proven - The first Jabber/XMPP technology was developed by Jeremie Miller in 1998 and is now quite stable; hundreds of developers are working on these technologies and today there are thousands of XMPP servers running on the Internet and millions of people using XMPP for instant messaging via public services, such as Google Talk and XMPP. Examples include Google Talk and XMPP deployments in organizations around the world.
  • Decentralized - The architecture of an XMPP network is similar to email; therefore, anyone can run their own XMPP server, allowing individuals and organizations to control their communication experience.
  • Security - any XMPP server can be isolated from the public network (e.g., on a corporate intranet), and strong security using SASL and TLS is built into theCore XMPP Specificationsin. In addition, the XMPP developer community is actively working on end-to-end encryption to further improve security standards.
  • Extensible - Using the power of XML, anyone can build custom functionality on top of the core protocol; to maintain interoperability, the XEP family releases theGeneric extensionsbut no such release is required, and organizations can maintain their own proprietary extensions as needed.
  • Flexible - XMPP applications beyond IM include network management, content syndication, collaboration tools, file sharing, gaming, remote system monitoring, web services, lightweight middleware, cloud computing, and more.
  • Versatility - A wide range of companies and open source projects use XMPP to build and deploy real-time applications and services; you are never "locked in" when you use XMPP technology.

histories

Jeremie Miller started working on Jabber technology in 1998 and on January 4, 1999 released the first version of the server. The early Jabber community focused on open source software, primarily the jabberd server.

The Internet Engineering Task Force (IETF) established an XMPP Working Group in 2002 to formalize the core protocol as the IETF instant messaging and presence technology. early Jabber protocols developed in 1999 and 2000 formed the basis for XMPP published in RFC 3920 and RFC 3921 in October 2004 (the main changes during the formalization of the IETF's XMPP Working Group were the addition of TLS for channel encryption and TLS for authentication). The early Jabber protocols, developed in 1999 and 2000, formed the basis for XMPP, which was published in RFC 3920 and RFC 3921 in October 2004 (the main changes made by the IETF's XMPP Working Group during the formalization period were the addition of TLS for channel encryption and SASL for authentication). In 2011, RFC 3920 and RFC 3921 were replaced by RFC 6120 and RFC 6121, respectively, and RFC 6122 specified the XMPP address format. in 2015, RFC 6122 was replaced by RFC 7622. In addition to these core protocols standardized by the IETF, the XMPP Standards Foundation (formerly the Jabber Software Foundation) is actively developing open XMPP extensions.

The first XMPP-based IM service was the Jabber.orgThe service has been running continuously since 1999 and offers free accounts. From 1999 until February 2006, the service used jabberd as its server software, when it migrated to ejabberd (both are free software application servers.) In January 2010, the service migrated to IIsode Ltd's proprietary M-Link server software.

In September 2008, Cisco Systems acquired Jabber, Inc, creator of the commercial product Jabber XCP

XMPP Standards Foundation (XSF) Develop and release extensions to XMPP through a standard process centered around the XMPP Extension Protocol (XEP, formerly known as the Jabber Enhancement Proposal - JEP)

XMPP Protocol Features

Client-Server Architecture

XMPP works by passing small structured blocks of XML data between endpoints (clients) through an intermediate server. In other words, if you use XMPP to send a message to a friend, the message is transmitted first to the server as part of an XML document, rather than directly to the friend's device. Each client has a unique name, similar to an e-mail address, that the server uses to identify and route messages.XMPP provides a uniform way for each client to contact the server, keeping expectations consistent from machine to machine!

Decentralized decentralization

XMPP is based on a client-server architecture, which means that clients do not communicate directly, but with the help of a server acting as an intermediary. It is decentralized, which means that there is no centralized XMPP server like email, and anyone can run their own XMPP server.

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

#JID
 {
   user,
   resource
   resource
}

Resource is used in cases where the application supports mobile as well as desktop or web applications, so it can be optional in cases where the IM application only supports a single resource

XMPP implementation

The original protocol for XMPP was the Transmission Control Protocol, which uses open XML streams over long-standing TCP connections.

In some cases where there are restricted firewalls, XMPP (port 5222) is blocked so it cannot be used behind restricted firewalls for Web applications and users, to overcome this the XMPP community has also developed the HTTP transport.
Since the client uses HTTP, most firewalls allow the client to get and post messages without any problems. Therefore, in the event that the TCP port used by XMPP is blocked, the server can listen on the normal HTTP port and traffic should pass through without any problems.

Persistent TCP Connections

Traditionally, XMPP uses the Internet's Transmission Control Protocol (TCP) to establish connections between clients and servers. These are persistent connections, so there is no need to re-establish them each time a new message is sent. In this sense, XMPP establishes an XML stream that envelopes the free exchange or XML data between the two entities. Some of the newer XMPP extensions also use network aliases and/or TLS encryption.

Asynchronous Push Messaging

XMPP allows a user's device to send messages asynchronously, which means you can send multiple messages in a row without waiting for a response, and two users don't have to be online at the same time to send messages to each other. Messages are sent as XML nodes - individual information units that contain the body of the message as well as key information such as the unique ID of the sender, the unique ID of the recipient, and other metadata.

In many other client-server systems, the client (the user's device) repeatedly pings the server, asking if there is any new information (messages) to download. This process, known as polling, occurs at regular intervals - for example, every 30 seconds - so it does not provide the "instantaneous" experience of near real-time communication. XMPP messaging works in the opposite way: instead of the client extracting data from the server, it pushes any new messages from the user to the server and then from the server to the recipient's device.

Gateways for other messaging protocols

Another powerful feature of XMPP is its ability to interact with other protocols to connect to networks other than the original source of the message. For example, an XMPP network can have a gateway to the SMS domain to relay messages to cell phones, to the SMTP domain to deliver aggregated messages via e-mail, or to a different instant messaging protocol such as Internet Relay Chat (IRC).

Open Source Flexibility

As an open protocol, XMPP decentralizes development and allows for many different types of implementations that can be easily interconnected. Anyone can build their own client, server and library setups and distribute them as free or paid solutions.

multilingual support

Widespread adoption and long lifecycles have also resulted in a wide range of XMPP libraries and supported languages, so developers may find a template that suits their environment and expertise.XMPP libraries are available for languages including C, C++, C#, Ruby, Java, Python, Perl, and a number of others.

bibliography

xmpp.org

Internet of Things (xmpp-iot.org)

Swift XMPP Client

Editor-in-chief of the website.

Content review.
en_USEnglish