From: http://www.ietf.org/internet-drafts/draft-ietf-xmpp-im-00.txt
See: http://xml.coverpages.org/xmpp.html - Extensible Messaging and Presence Protocol (XMPP)
------------------------------------------------------------------------
Network Working Group J. Miller
Internet-Draft P. Saint-Andre
Expires: June 6, 2003 Jabber Software Foundation
December 06, 2002
XMPP Instant Messaging
draft-ietf-xmpp-im-00
Status of this Memo
This document is an Internet-Draft and is in full conformance with
all provisions of Section 10 of RFC2026.
Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF), its areas, and its working groups. Note that
other groups may also distribute working documents as Internet-
Drafts.
Internet-Drafts are draft documents valid for a maximum of six months
and may be updated, replaced, or obsoleted by other documents at any
time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress."
The list of current Internet-Drafts can be accessed at http://
www.ietf.org/ietf/1id-abstracts.txt.
The list of Internet-Draft Shadow Directories can be accessed at
http://www.ietf.org/shadow.html.
This Internet-Draft will expire on June 6, 2003.
Copyright Notice
Copyright (C) The Internet Society (2002). All Rights Reserved.
Abstract
This document describes the specific extensions to and applications
of the eXtensible Messaging and Presence Protocol (XMPP) that are
necessary to create a basic instant messaging and presence
application.
Miller & Saint-Andre Expires June 6, 2003 [Page 1]
Internet-Draft XMPP Instant Messaging December 2002
Table of Contents
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 4
1.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.2 Terminology . . . . . . . . . . . . . . . . . . . . . . . . 4
1.3 Requirements . . . . . . . . . . . . . . . . . . . . . . . . 4
1.4 Conventions Used in this Document . . . . . . . . . . . . . 4
1.5 Discussion Venue . . . . . . . . . . . . . . . . . . . . . . 5
1.6 Intellectual Property Notice . . . . . . . . . . . . . . . . 5
2. Registration . . . . . . . . . . . . . . . . . . . . . . . . 6
2.1 Registration Data Flow . . . . . . . . . . . . . . . . . . . 6
2.2 Cancellation Data Flow . . . . . . . . . . . . . . . . . . . 8
3. Authentication . . . . . . . . . . . . . . . . . . . . . . . 9
4. Authorizing a Resource . . . . . . . . . . . . . . . . . . . 10
5. Exchanging Messages . . . . . . . . . . . . . . . . . . . . 11
5.1 Specifying an Intended Recipient . . . . . . . . . . . . . . 11
5.2 Specifying a Message Type . . . . . . . . . . . . . . . . . 11
5.3 Specifying a Message Subject . . . . . . . . . . . . . . . . 12
5.4 Specifying a Message Thread . . . . . . . . . . . . . . . . 12
5.5 Specifying a Message Body . . . . . . . . . . . . . . . . . 13
5.6 Specifying Additional Information . . . . . . . . . . . . . 13
5.7 Message-Related Errors . . . . . . . . . . . . . . . . . . . 13
6. Exchanging Presence Information . . . . . . . . . . . . . . 14
6.1 Client and Server Responsibilities . . . . . . . . . . . . . 14
6.2 Sending Initial Presence . . . . . . . . . . . . . . . . . . 14
6.3 Specifying Availability Status . . . . . . . . . . . . . . . 15
6.4 Specifying Detailed Status Information . . . . . . . . . . . 15
6.5 Probing for Presence . . . . . . . . . . . . . . . . . . . . 15
6.6 Sending Final Presence . . . . . . . . . . . . . . . . . . . 16
6.7 Determining When a Contact Went Offline . . . . . . . . . . 16
7. Managing Subscriptions . . . . . . . . . . . . . . . . . . . 17
7.1 Requesting a Subscription . . . . . . . . . . . . . . . . . 17
7.2 Handling a Subscription Request . . . . . . . . . . . . . . 17
7.3 Cancelling a Subscription from Another Entity . . . . . . . 18
7.4 Unsubscribing from Another Entity's Presence . . . . . . . . 18
8. Blocking Communication . . . . . . . . . . . . . . . . . . . 19
8.1 Retrieving One's Privacy Lists . . . . . . . . . . . . . . . 19
8.2 Changing the Active List . . . . . . . . . . . . . . . . . . 20
8.3 Editing a Privacy List . . . . . . . . . . . . . . . . . . . 20
8.4 Removing a Privacy List . . . . . . . . . . . . . . . . . . 21
8.5 Blacklisted Entity Attempts to Communicate with User . . . . 21
9. Managing One's Roster . . . . . . . . . . . . . . . . . . . 23
9.1 Receiving One's Roster on Login . . . . . . . . . . . . . . 23
9.2 Adding a Roster Item . . . . . . . . . . . . . . . . . . . . 24
9.3 Deleting a Roster Item . . . . . . . . . . . . . . . . . . . 25
10. Routing and Delivery Guidelines . . . . . . . . . . . . . . 27
11. Security Considerations . . . . . . . . . . . . . . . . . . 28
References . . . . . . . . . . . . . . . . . . . . . . . . . 29
Miller & Saint-Andre Expires June 6, 2003 [Page 2]
Internet-Draft XMPP Instant Messaging December 2002
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . 29
A. vCards . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
A.1 Retrieving One's vCard . . . . . . . . . . . . . . . . . . . 30
A.2 Updating One's vCard . . . . . . . . . . . . . . . . . . . . 31
A.3 Viewing Another User's vCard . . . . . . . . . . . . . . . . 32
B. Authentication Using jabber:iq:auth . . . . . . . . . . . . 33
C. Formal Definitions . . . . . . . . . . . . . . . . . . . . . 35
C.1 jabber:iq:last . . . . . . . . . . . . . . . . . . . . . . . 35
C.1.1 DTD . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
C.1.2 Schema . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
C.2 jabber:iq:privacy . . . . . . . . . . . . . . . . . . . . . 35
C.2.1 DTD . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
C.2.2 Schema . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
C.3 jabber:iq:register . . . . . . . . . . . . . . . . . . . . . 37
C.3.1 Children . . . . . . . . . . . . . . . . . . . . . . . . . . 37
C.3.2 DTD . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
C.3.3 Schema . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
C.4 jabber:iq:roster . . . . . . . . . . . . . . . . . . . . . . 40
C.4.1 Children . . . . . . . . . . . . . . . . . . . . . . . . . . 40
C.4.2 DTD . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
C.4.3 Schema . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
C.5 vcard-temp . . . . . . . . . . . . . . . . . . . . . . . . . 42
D. Revision History . . . . . . . . . . . . . . . . . . . . . . 50
D.1 Changes from draft-miller-xmpp-im-02 . . . . . . . . . . . . 50
Full Copyright Statement . . . . . . . . . . . . . . . . . . 51
Miller & Saint-Andre Expires June 6, 2003 [Page 3]
Internet-Draft XMPP Instant Messaging December 2002
1. Introduction
1.1 Overview
The core features of the XMPP protocol are defined in XMPP Core [1].
These features, specifically XML streams and the 'jabber:client' and
'jabber:server' namespaces, provide the building blocks for many
types of near-real-time applications, which may be layered on top of
the core by sending XML stanzas that are scoped by specific XML
namespaces. This document describes the specific extensions to and
applications of XMPP Core that are used to create the basic
functionality expected of an instant messaging and presence
application as defined in RFC 2779 [2]. Extended namespaces for many
other functionality areas have been defined and continue to be
defined by the Jabber Software Foundation [3], including service
discovery, multi-user chat, search, remote procedure calls, data
gathering and forms submission, encryption, feature negotiation,
message composing events, message expiration, delayed delivery, and
file transfer; however, such functionality is not described herein
because it is not required by RFC 2779 [2].
1.2 Terminology
This document inherits the terminology defined in XMPP Core [1].
1.3 Requirements
For the purposes of this document, we stipulate that a basic instant
messaging and presence application needs to enable a user to perform
the following functionality by using a compliant client:
o Register an account with a server
o Authenticate with a server
o Exchange messages with other users
o Exchange presence information with other users
o Manage subscriptions to and from other users
o Manage the items in the user's contact list (called a "roster")
1.4 Conventions Used in this Document
The capitalized key words "MUST", "MUST NOT", "REQUIRED", "SHALL",
"SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and
Miller & Saint-Andre Expires June 6, 2003 [Page 4]
Internet-Draft XMPP Instant Messaging December 2002
"OPTIONAL" in this document are to be interpreted as described in RFC
2119 [4].
1.5 Discussion Venue
The authors welcome discussion and comments related to the topics
presented in this document, preferably on the "xmppwg@jabber.org"
mailing list (archives and subscription information are available at
http://www.jabber.org/cgi-bin/mailman/listinfo/xmppwg/).
1.6 Intellectual Property Notice
This document is in full compliance with all provisions of Section 10
of RFC 2026. Parts of this specification use the term "jabber" for
identifying namespaces and other protocol syntax. Jabber[tm] is a
registered trademark of Jabber, Inc. Jabber, Inc. grants permission
to the IETF for use of Jabber trademark in association with this
specification and its successors, if any.
Miller & Saint-Andre Expires June 6, 2003 [Page 5]
Internet-Draft XMPP Instant Messaging December 2002
2. Registration
Registering with a server is necessary in order for a user to engage
in any desired functionality by means of a client. Certainly such
registration MAY (and frequently does) occur outside the context of
an instant messaging and presence application. However, XMPP also
enables a user to register with a server within the context of an IM
system. This functionality is enabled by sending and receiving IQ
stanzas in a request-response pattern, where the IQ stanzas contain
elements in the 'jabber:iq:register' namespace.
2.1 Registration Data Flow
Step 1: Client queries server regarding information that is required
in order to register:
Step 2: Server responds with the required registration fields:
Choose a username and password to register with this service.
Note: the client is REQUIRED to provide information for all of the
elements (other than ) contained in the IQ result.
(Note also that the XML stanza shown above does not include a 'to'
attribute, since the connected socket does not yet have an account.)
Miller & Saint-Andre Expires June 6, 2003 [Page 6]
Internet-Draft XMPP Instant Messaging December 2002
Step 3: Client provides required information:
juliet@capulet.com
R0m30
juliet
Step 4: Server informs client of successful registration:
Step 4 (alt 1): Server informs client of failed registration
(required field not provided):
juliet@capulet.com
R0m30
Not Acceptable
Miller & Saint-Andre Expires June 6, 2003 [Page 7]
Internet-Draft XMPP Instant Messaging December 2002
Step 4 (alt 2): Client is already registered:
juliet@capulet.com
R0m30
juliet
Bad Request
2.2 Cancellation Data Flow
The 'jabber:iq:register' namespace also makes it possible for a user
to cancel a registration with a server by sending a element
as shown below.
Step 1: Client sends request to unregister:
Step 2: Server informs client of successful unregistration:
Miller & Saint-Andre Expires June 6, 2003 [Page 8]
Internet-Draft XMPP Instant Messaging December 2002
3. Authentication
In order to gain access to the network of XMPP-compliant applications
and thus engage in standard IM functionality such as exchanging
messages and presence, a client must authenticate with a server.
If a client is capable of authenticating with SASL, it MUST include a
'version' attribute (set to a value of "1.0") within the opening
element with which it initiated communications with the
server. The protocol describing how a client authenticates with a
server using SASL is defined XMPP Core [1].
Earlier iterations of the Jabber protocol contained a client-server
authentication protocol that was enforced after the stream was
negotiated; this protocol, which uses the 'jabber:iq:auth' namespace,
is described for the sake of completeness in Authentication Using
jabber:iq:auth (Appendix B).
Miller & Saint-Andre Expires June 6, 2003 [Page 9]
Internet-Draft XMPP Instant Messaging December 2002
4. Authorizing a Resource
Once a client has authenticated with a server using SASL, it MUST
define a resource that the server can associate with the connection
for purposes of authorization and addressing. This is necessary
because all stanzas sent to or received from the server within the
context of an active session must use a "full JID" (user@host/
resource) for addressing. Authorizing a resource is accomplished by
means of the 'jabber:iq:auth' namespace as described below.
Step 1: Client queries server regarding information that is still
required to begin a session:
juliet
Step 2: Server responds with the required fields (in this case, only
the username and authorized resource):
juliet
Step 3: Client sends name of authorized resource:
juliet
balcony
Step 4: Server informs client of successful session initiation:
Miller & Saint-Andre Expires June 6, 2003 [Page 10]
Internet-Draft XMPP Instant Messaging December 2002
5. Exchanging Messages
Exchanging messages is simple within XMPP: using a message stanza, a
user can send a message to any other user (or, more generally, any
entity).
5.1 Specifying an Intended Recipient
A client SHOULD specify an intended recipient for the message by
providing an appropriate JID in the 'to' attribute of the
element. Normally, the value of the 'to' attribute specifies an
entity other than the sending user (for exceptions, see the next
paragraph). The intended recipient MAY be any valid JID (e.g., a
user on the same server, a user on a different server, the server
itself, or another server).
If no 'to' address is specified, it is implied that the message is
addressed to the sending user itself (i.e., the user@domain sending
the stanza); furthermore, a message explicitly or implicitly
addressed to the sending user itself is processed by the server on
behalf of that user. A message addressed to a specific connected
resource associated with the sending user is delivered to that
user@domain/resource (which MAY be different from the connected
resource that generated the message).
5.2 Specifying a Message Type
As mentioned in XMPP Core [1], there are several defined types of
messages (specified by means of a 'type' attribute within the
element). In the context of an instant messaging
application, a client MAY include a message type in order to capture
the conversational context of the message, thus providing a hint
regarding presentation (e.g., in a GUI). If included, the 'type'
attribute SHOULD have one of the following values (any other value
MAY be ignored):
o chat -- The message is sent in the context of a one-to-one chat
conversation.
o groupchat -- The message is sent in the context of a multi-user
chat environment.
o headline -- The message is generated by an automated service that
delivers content (news, sports, market information, etc.).
o error - A message returned to a sender specifying an error
associated with a previous message sent by the sender (for a full
list of error messages, see XMPP Core [1])
Miller & Saint-Andre Expires June 6, 2003 [Page 11]
Internet-Draft XMPP Instant Messaging December 2002
5.3 Specifying a Message Subject
A message stanza MAY contain a child element specifying the subject
of the message. The subject MUST NOT contain mixed content.
A message with a subject:
Imploring
Wherefore art thou, Romeo?
5.4 Specifying a Message Thread
A message stanza MAY contain a child element specifying the thread of
the message for the purpose of tracking a conversation thread. The
content of the element is a random string that is generated
by the sender; this string MAY be copied back to the sender in
subsequent replies. If included, the element MUST have no
attributes and MUST NOT contain mixed content.
A simple threaded conversation:
Art thou not Romeo, and a Montague?
283461923759234
Neither, fair saint, if either thee dislike.
283461923759234
How cam'st thou hither, tell me, and wherefore?
283461923759234
Miller & Saint-Andre Expires June 6, 2003 [Page 12]
Internet-Draft XMPP Instant Messaging December 2002
5.5 Specifying a Message Body
A message stanza MAY (and usually will) contain a child element
specifying the body of the message. The body MUST NOT contain mixed
content. If it is necessary to provide the message body in an
alternate form (e.g., encrypted using the public key infrastructure
or formatted using XHTML), the alternate form SHOULD be contained in
an appropriately-namespaced child of the message stanza other than
the