XMPP RFC reading notes (1)

xiaoxiao2021-03-06  14

All of the following is based on your own memory and understanding, if there is an incorrect or even fallacy, please forgive me.

1, what is XMPP?

The predecessor of XMPP is a network instant communication protocol generated by Jabber, an open source form. XMPP is currently organized by IETF International Standards. Standardized core results are divided into two parts;

Core XML Flow Transportation Agreement

Instant messaging extension application based on XML stream

The definition of XMPP's core XML streaming protocol enables XMPP to be more specific to past network communication protocols. With the characteristics of XML easy to analyze and read, the XMPP protocol can be very beautiful.

XMPP's instant messaging extension application part is an abstract definition of instant messaging based on IETF, and other instant messaging protocols, such as AIM, QQ, etc., which have been widely used, such as AIM, QQ, etc. according to IETF.

2, what is the basic network structure of XMPP?

Three characters, clients, servers, gateways are defined in XMPP. Communication can happen between any two of these three. The server also undertakes the routing function of client information record, connection management, and information. The gateway assumes the interconnection of the heterogeneous instant communication system, and the heterogeneous system can include SMS (SMS), MSN, ICQ, etc. The basic network form is a single client to connect to a single server via TCP / IP and then transmit XML over.

3, what is the XMPP passing through TCP?

Transferring instructions related to instant messaging. In the previous command, (for example, qq) is sent in the form of 2, either to send (such as MSN) with a plain text instruction to add a line-in. The logic of the instant messaging instruction transmitted by XMPP transmission is similar to the previous protocol, which has become plain text in the XML format. This is not only easy to analyze, but people are easy to read, which is convenient for development and check. The core part of XMPP is a stream protocol that sends an XML on the network. This stream protocol is the basis of the XMPP's instant messaging command, is also a very important network base protocol that can be further utilized. Therefore, it can be said that XMPP is transmitted by TCP is an XML stream.

4. For example, see what the so-called XML stream looks like.

Client:

TO = 'example.com'

XMLns = 'Jabber: Client'

XMLns: stream = 'http: //etherx.jabber.org/streams'

Version = '1.0'>

Server:

From = 'example.com'

ID = 'someID'

XMLns = 'Jabber: Client'

XMLns: stream = 'http: //etherx.jabber.org/streams'

Version = '1.0'>

... other communication ...

Client:

To='Romeo@example.net '

XML: lang = 'en'>

Client: Art THOU NOT Romeo, And A Montague?

Client: server:

To='juliet@example.com '

XML: lang = 'en'>

Server: neither, fair saint, if Either Thee dispike.

Server:

Client:

Server:

From the point of view of the document, all XML text sent by the client or server conforms together from to to form a complete XML document. The Stream tag is the so-called XML stream. Those XML elements such as ... in and are called XML Stanza (XML). The basic mode of the XMPP core protocol communication is to build a stream first, and then negotiate something such as a bunch of security, the intermediate communication process is the client sends XML Stanza, one pick one. The server sends XML Stanza to the client based on the information sent by the client and the logic of the program. But this process is not an answer, and it is possible to send a letter from one party at any time. The final stage of communication is to close the flow, close the TCP / IP connection.

转载请注明原文地址:https://www.9cbs.com/read-67688.html

New Post(0)