P1L1
P1L2
P1L3
P1L4 Network Working Group P. Saint-Andre, Ed.
P1L5 Request for Comments: 3921 Jabber Software Foundation
P1L6 Category: Standards Track October 2004
P1L7
P1L8
P1L9 Extensible Messaging and Presence Protocol (XMPP):
P1L10 Instant Messaging and Presence
P1L11
P1L12 Status of this Memo
P1L13
P1L14 This document specifies an Internet standards track protocol for the
P1L15 Internet community, and requests discussion and suggestions for
P1L16 improvements. Please refer to the current edition of the "Internet
P1L17 Official Protocol Standards" (STD 1) for the standardization state
P1L18 and status of this protocol. Distribution of this memo is unlimited.
P1L19
P1L20 Copyright Notice
P1L21
P1L22 Copyright (C) The Internet Society (2004).
P1L23
P1L24 Abstract
P1L25
P1L26 This memo describes extensions to and applications of the core
P1L27 features of the Extensible Messaging and Presence Protocol (XMPP)
P1L28 that provide the basic instant messaging (IM) and presence
P1L29 functionality defined in RFC 2779.
P1L30
P1L31
P1L32
P1L33
P1L34
P1L35
P1L36
P1L37
P1L38
P1L39
P1L40
P1L41
P1L42
P1L43
P1L44
P1L45
P1L46
P1L47
P1L48
P2L1 Table of Contents
P2L2
P2L3 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2
P2L4 2. Syntax of XML Stanzas . . . . . . . . . . . . . . . . . . . 4
P2L5 3. Session Establishment . . . . . . . . . . . . . . . . . . . 10
P2L6 4. Exchanging Messages . . . . . . . . . . . . . . . . . . . . 13
P2L7 5. Exchanging Presence Information . . . . . . . . . . . . . . 16
P2L8 6. Managing Subscriptions . . . . . . . . . . . . . . . . . . . 26
P2L9 7. Roster Management . . . . . . . . . . . . . . . . . . . . . 27
P2L10 8. Integration of Roster Items and Presence Subscriptions . . . 32
P2L11 9. Subscription States . . . . . . . . . . . . . . . . . . . . 56
P2L12 10. Blocking Communication . . . . . . . . . . . . . . . . . . . 62
P2L13 11. Server Rules for Handling XML Stanzas . . . . . . . . . . . 85
P2L14 12. IM and Presence Compliance Requirements . . . . . . . . . . 88
P2L15 13. Internationalization Considerations . . . . . . . . . . . . 89
P2L16 14. Security Considerations . . . . . . . . . . . . . . . . . . 89
P2L17 15. IANA Considerations . . . . . . . . . . . . . . . . . . . . 90
P2L18 16. References . . . . . . . . . . . . . . . . . . . . . . . . . 91
P2L19 A. vCards . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
P2L20 B. XML Schemas. . . . . . . . . . . . . . . . . . . . . . . . . 93
P2L21 C. Differences Between Jabber IM/Presence Protocols and XMPP. . 105
P2L22 Contributors . . . . . . . . . . . . . . . . . . . . . . . . . . 106
P2L23 Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . 106
P2L24 Author's Address. . . . . . . . . . . . . . . . . . . . . . . . . 106
P2L25 Full Copyright Statement. . . . . . . . . . . . . . . . . . . . . 107
P2L26
P2L27 1. Introduction
P2L28
P2L29 1.1. Overview
P2L30
P2L31 The Extensible Messaging and Presence Protocol (XMPP) is a protocol
P2L32 for streaming XML [XML] elements in order to exchange messages and
P2L33 presence information in close to real time. The core features of
P2L34 XMPP are defined in Extensible Messaging and Presence Protocol
P2L35 (XMPP): Core [XMPP-CORE]. These features -- mainly XML streams, use
P2L36 of TLS and SASL, and the , , and children
P2L37 of the stream root -- provide the building blocks for many types of
P2L38 near-real-time applications, which may be layered on top of the core
P2L39 by sending application-specific data qualified by particular XML
P2L40 namespaces [XML-NAMES]. This memo describes extensions to and
P2L41 applications of the core features of XMPP that provide the basic
P2L42 functionality expected of an instant messaging (IM) and presence
P2L43 application as defined in RFC 2779 [IMP-REQS].
P2L44
P2L45
P2L46
P2L47
P2L48
P3L1 1.2. Requirements
P3L2
P3L3 For the purposes of this memo, the requirements of a basic instant
P3L4 messaging and presence application are defined by [IMP-REQS], which
P3L5 at a high level stipulates that a user must be able to complete the
P3L6 following use cases:
P3L7
P3L8 o Exchange messages with other users
P3L9 o Exchange presence information with other users
P3L10 o Manage subscriptions to and from other users
P3L11 o Manage items in a contact list (in XMPP this is called a "roster")
P3L12 o Block communications to or from specific other users
P3L13
P3L14 Detailed definitions of these functionality areas are contained in
P3L15 [IMP-REQS], and the interested reader is directed to that document
P3L16 regarding the requirements addressed herein.
P3L17
P3L18 [IMP-REQS] also stipulates that presence services must be separable
P3L19 from instant messaging services; i.e., it must be possible to use the
P3L20 protocol to provide a presence service, an instant messaging service,
P3L21 or both. Although the text of this memo assumes that implementations
P3L22 and deployments will want to offer a unified instant messaging and
P3L23 presence service, there is no requirement that a service must offer
P3L24 both a presence service and an instant messaging service, and the
P3L25 protocol makes it possible to offer separate and distinct services
P3L26 for presence and for instant messaging.
P3L27
P3L28 Note: While XMPP-based instant messaging and presence meets the
P3L29 requirements of [IMP-REQS], it was not designed explicitly with that
P3L30 specification in mind, since the base protocol evolved through an
P3L31 open development process within the Jabber open-source community
P3L32 before RFC 2779 was written. Note also that although protocols
P3L33 addressing many other functionality areas have been defined in the
P3L34 Jabber community, such protocols are not included in this memo
P3L35 because they are not required by [IMP-REQS].
P3L36
P3L37 1.3. Terminology
P3L38
P3L39 This memo inherits the terminology defined in [XMPP-CORE].
P3L40
P3L41 The capitalized key words "MUST", "MUST NOT", "REQUIRED", "SHALL",
P3L42 "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and
P3L43 "OPTIONAL" in this document are to be interpreted as described in BCP
P3L44 14, RFC 2119 [TERMS].
P3L45
P3L46
P3L47
P3L48
P4L1 2. Syntax of XML Stanzas
P4L2
P4L3 The basic semantics and common attributes of XML stanzas qualified by
P4L4 the 'jabber:client' and 'jabber:server' namespaces are defined in
P4L5 [XMPP-CORE]. However, these namespaces also define various child
P4L6 elements, as well as values for the common 'type' attribute, that are
P4L7 specific to instant messaging and presence applications. Thus,
P4L8 before addressing particular "use cases" for such applications, we
P4L9 here further describe the syntax of XML stanzas, thereby
P4L10 supplementing the discussion in [XMPP-CORE].
P4L11
P4L12 2.1. Message Syntax
P4L13
P4L14 Message stanzas qualified by the 'jabber:client' or 'jabber:server'
P4L15 namespace are used to "push" information to another entity. Common
P4L16 uses in instant messaging applications include single messages,
P4L17 messages sent in the context of a chat conversation, messages sent in
P4L18 the context of a multi-user chat room, headlines and other alerts,
P4L19 and errors.
P4L20
P4L21 2.1.1. Types of Message
P4L22
P4L23 The 'type' attribute of a message stanza is RECOMMENDED; if included,
P4L24 it specifies the conversational context of the message, thus
P4L25 providing a hint regarding presentation (e.g., in a GUI). If
P4L26 included, the 'type' attribute MUST have one of the following values:
P4L27
P4L28 o chat -- The message is sent in the context of a one-to-one chat
P4L29 conversation. A compliant client SHOULD present the message in an
P4L30 interface enabling one-to-one chat between the two parties,
P4L31 including an appropriate conversation history.
P4L32
P4L33 o error -- An error has occurred related to a previous message sent
P4L34 by the sender (for details regarding stanza error syntax, refer to
P4L35 [XMPP-CORE]). A compliant client SHOULD present an appropriate
P4L36 interface informing the sender of the nature of the error.
P4L37
P4L38 o groupchat -- The message is sent in the context of a multi-user
P4L39 chat environment (similar to that of [IRC]). A compliant client
P4L40 SHOULD present the message in an interface enabling many-to-many
P4L41 chat between the parties, including a roster of parties in the
P4L42 chatroom and an appropriate conversation history. Full definition
P4L43 of XMPP-based groupchat protocols is out of scope for this memo.
P4L44
P4L45 o headline -- The message is probably generated by an automated
P4L46 service that delivers or broadcasts content (news, sports, market
P4L47 information, RSS feeds, etc.). No reply to the message is
P4L48 expected, and a compliant client SHOULD present the message in an
P5L1 interface that appropriately differentiates the message from
P5L2 standalone messages, chat sessions, or groupchat sessions (e.g.,
P5L3 by not providing the recipient with the ability to reply).
P5L4
P5L5 o normal -- The message is a single message that is sent outside the
P5L6 context of a one-to-one conversation or groupchat, and to which it
P5L7 is expected that the recipient will reply. A compliant client
P5L8 SHOULD present the message in an interface enabling the recipient
P5L9 to reply, but without a conversation history.
P5L10
P5L11 An IM application SHOULD support all of the foregoing message types;
P5L12 if an application receives a message with no 'type' attribute or the
P5L13 application does not understand the value of the 'type' attribute
P5L14 provided, it MUST consider the message to be of type "normal" (i.e.,
P5L15 "normal" is the default). The "error" type MUST be generated only in
P5L16 response to an error related to a message received from another
P5L17 entity.
P5L18
P5L19 Although the 'type' attribute is OPTIONAL, it is considered polite to
P5L20 mirror the type in any replies to a message; furthermore, some
P5L21 specialized applications (e.g., a multi-user chat service) MAY at
P5L22 their discretion enforce the use of a particular message type (e.g.,
P5L23 type='groupchat').
P5L24
P5L25 2.1.2. Child Elements
P5L26
P5L27 As described under extended namespaces (Section 2.4), a message
P5L28 stanza MAY contain any properly-namespaced child element.
P5L29
P5L30 In accordance with the default namespace declaration, by default a
P5L31 message stanza is qualified by the 'jabber:client' or 'jabber:server'
P5L32 namespace, which defines certain allowable children of message
P5L33 stanzas. If the message stanza is of type "error", it MUST include
P5L34 an child; for details, see [XMPP-CORE]. Otherwise, the
P5L35 message stanza MAY contain any of the following child elements
P5L36 without an explicit namespace declaration:
P5L37
P5L38 1.
P5L39 2.