XMPP.md (2948B)
1 # XMPP 2 3 **Source:** RFC 6120 4 5 **Definition:** XMPP is a protocol for the distribution of XML stanzas (small bits of XML) over a network between two or more entities. 6 7 ## Important Info 8 9 - Federated 10 - Runs over TLS 11 - Clients may choose to support E2E encryption 12 - OMEMO is the main way of doing this 13 - 14 15 ## Specifics 16 17 - Presence stanzas are used to inform other entities about the precsence of a given entity 18 - Persistent streams 19 - Point-to-point hops use persistent XML streams over long-lived TCP connections\* to enable parties to push data to each other for immediate routing or delivery 20 - There are implementations over HTTP, but the standard specifies TCP 21 - XML stanzas are sent over an XML-stream for communication 22 - The root of these stanzas includes the from and to addresses, which are JIDs (Jabber IDs for historical reasons), that have the same format as email where the domain name is the domain name for the server. 23 - One nuance is the resource part of the domain is for multi-client support per account. 24 - Possible examples 25 - andrew@smt.example.com/phone 26 - andrew@smt.example.com/desktop 27 - This is a client-to-server server-to-client protocol for messaging. There are no P2P elements, even though there are some XMPP-like systems that use P2P with XML streams and stanzas 28 - A client establishes a stream with a server after performing a SASL negotiation for authentication 29 - Once done, the client can send stanzas to the server which will then be routed to the local client on the same server or the home server of the remote client 30 - Core server responsibilities 31 - Manage XML streams with clients and deliver XML stanzas 32 - Manage XML streams with remote servers and route XML stanzas 33 - Some possible secondary responsibilities of servers are 34 - Store data used by clients 35 - Contact lists, presence applications, etc 36 - These are to be handled by the server on behalf of the client and are not to be routed to remote servers 37 - Add-on services 38 - Additional services that are beyond the scope of RFC 6120 39 - Examples being multi-user conferencing and pub-sub services 40 - These are frequently accessible via subdomains 41 - Standard client port is 5222 42 - Standard server port is 5269 43 44 ## Message Types 45 46 - Presence 47 - Notify entities of your existence 48 - IQ 49 - Info / query 50 - Message 51 - contains to parameter and body of the msesage 52 53 These messages are sent as stanzas which are simply elements within the \<stream\> tag. 54 55 ## E2E 56 57 The XMPP spec **does not** support E2E encryption. It does support TLS encryption for communication channels, but messages will be sent in plaintext underneath the TLS. The common approach to achieving E2E with XMPP is with OMEMO encryption. 58 59 ### OMEMO 60 61 OMEMO uses the double ratchet encryption algorithm for forward secrecy and X3DH for shared key consensus.