3 XMPP Working Group P. Saint-Andre, Ed.
4 Internet-Draft Jabber Software Foundation
5 Expires: November 4, 2004 May 6, 2004
8 Extensible Messaging and Presence Protocol (XMPP): Core
9 draft-ietf-xmpp-core-24
13 This document is an Internet-Draft and is in full conformance with
14 all provisions of Section 10 of RFC2026.
16 Internet-Drafts are working documents of the Internet Engineering
17 Task Force (IETF), its areas, and its working groups. Note that other
18 groups may also distribute working documents as Internet-Drafts.
20 Internet-Drafts are draft documents valid for a maximum of six months
21 and may be updated, replaced, or obsoleted by other documents at any
22 time. It is inappropriate to use Internet-Drafts as reference
23 material or to cite them other than as "work in progress."
25 The list of current Internet-Drafts can be accessed at http://
26 www.ietf.org/ietf/1id-abstracts.txt.
28 The list of Internet-Draft Shadow Directories can be accessed at
29 http://www.ietf.org/shadow.html.
31 This Internet-Draft will expire on November 4, 2004.
35 Copyright (C) The Internet Society (2004). All Rights Reserved.
39 This memo defines the core features of the Extensible Messaging and
40 Presence Protocol (XMPP), a protocol for streaming Extensible Markup
41 Language (XML) elements in order to exchange structured information
42 in close to real time between any two network endpoints. While XMPP
43 provides a generalized, extensible framework for exchanging XML data,
44 it is used mainly for the purpose of building instant messaging and
45 presence applications that meet the requirements of RFC 2779.
55 Saint-Andre Expires November 4, 2004 [Page 1]
57 Internet-Draft XMPP Core May 2004
62 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 3
63 2. Generalized Architecture . . . . . . . . . . . . . . . . . . . 4
64 3. Addressing Scheme . . . . . . . . . . . . . . . . . . . . . . 5
65 4. XML Streams . . . . . . . . . . . . . . . . . . . . . . . . . 8
66 5. Use of TLS . . . . . . . . . . . . . . . . . . . . . . . . . . 19
67 6. Use of SASL . . . . . . . . . . . . . . . . . . . . . . . . . 26
68 7. Resource Binding . . . . . . . . . . . . . . . . . . . . . . . 36
69 8. Server Dialback . . . . . . . . . . . . . . . . . . . . . . . 39
70 9. XML Stanzas . . . . . . . . . . . . . . . . . . . . . . . . . 47
71 10. Server Rules for Handling XML Stanzas . . . . . . . . . . . . 56
72 11. XML Usage within XMPP . . . . . . . . . . . . . . . . . . . . 58
73 12. Core Compliance Requirements . . . . . . . . . . . . . . . . . 60
74 13. Internationalization Considerations . . . . . . . . . . . . . 61
75 14. Security Considerations . . . . . . . . . . . . . . . . . . . 62
76 15. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 66
77 Normative References . . . . . . . . . . . . . . . . . . . . . 69
78 Informative References . . . . . . . . . . . . . . . . . . . . 71
79 Author's Address . . . . . . . . . . . . . . . . . . . . . . . 72
80 A. Nodeprep . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
81 B. Resourceprep . . . . . . . . . . . . . . . . . . . . . . . . . 74
82 C. XML Schemas . . . . . . . . . . . . . . . . . . . . . . . . . 75
83 D. Differences Between Core Jabber Protocols and XMPP . . . . . . 84
84 Intellectual Property and Copyright Statements . . . . . . . . 86
111 Saint-Andre Expires November 4, 2004 [Page 2]
113 Internet-Draft XMPP Core May 2004
120 The Extensible Messaging and Presence Protocol (XMPP) is an open XML
121 [XML] protocol for near-real-time messaging, presence, and
122 request-response services. The basic syntax and semantics were
123 developed originally within the Jabber open-source community, mainly
124 in 1999. In 2002, the XMPP WG was chartered with developing an
125 adaptation of the Jabber protocol that would be suitable as an IETF
126 instant messaging (IM) and presence technology. As a result of work
127 by the XMPP WG, the current memo defines the core features of XMPP
128 1.0; the extensions required to provide the instant messaging and
129 presence functionality defined in RFC 2779 [IMP-REQS] are specified
130 in Extensible Messaging and Presence Protocol (XMPP): Instant
131 Messaging and Presence [XMPP-IM].
135 The capitalized key words "MUST", "MUST NOT", "REQUIRED", "SHALL",
136 "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and
137 "OPTIONAL" in this document are to be interpreted as described in RFC
142 Most of the core aspects of the Extensible Messaging and Presence
143 Protocol were developed originally within the Jabber open-source
144 community in 1999. This community was founded by Jeremie Miller, who
145 released source code for the initial version of the jabberd server in
146 January 1999. Major early contributors to the base protocol also
147 included Ryan Eatmon, Peter Millard, Thomas Muldowney, and Dave
148 Smith. Work by the XMPP Working Group has concentrated especially on
149 security and internationalization; in these areas, protocols for the
150 use of TLS and SASL were originally contributed by Rob Norris, and
151 stringprep profiles were originally contributed by Joe Hildebrand.
152 The error code syntax was suggested by Lisa Dusseault.
156 Thanks are due to a number of individuals in addition to the
157 contributors listed. Although it is difficult to provide a complete
158 list, the following individuals were particularly helpful in defining
159 the protocols or in commenting on the specifications in this memo:
160 Thomas Charron, Richard Dobson, Sam Hartman, Schuyler Heath, Jonathan
161 Hogg, Cullen Jennings, Craig Kaes, Jacek Konieczny, Alexey Melnikov,
162 Keith Minkler, Julian Missig, Pete Resnick, Marshall Rose, Alexey
163 Shchepin, Jean-Louis Seguineau, Iain Shigeoka, Greg Troxel, and David
167 Saint-Andre Expires November 4, 2004 [Page 3]
169 Internet-Draft XMPP Core May 2004
172 Waite. Thanks also to members of the XMPP Working Group and the IETF
173 community for comments and feedback provided throughout the life of
176 2. Generalized Architecture
180 Although XMPP is not wedded to any specific network architecture, to
181 date it usually has been implemented via a client-server architecture
182 wherein a client utilizing XMPP accesses a server over a [TCP]
183 connection, and servers also communicate with each other over TCP
186 The following diagram provides a high-level overview of this
187 architecture (where "-" represents communications that use XMPP and
188 "=" represents communications that use any other protocol).
192 C2----+--G1===FN1===FC1
194 The symbols are as follows:
196 o C1, C2, C3 = XMPP clients
197 o S1, S2 = XMPP servers
198 o G1 = A gateway that translates between XMPP and the protocol(s)
199 used on a foreign (non-XMPP) messaging network
200 o FN1 = A foreign messaging network
201 o FC1 = A client on a foreign messaging network
205 A server acts as an intelligent abstraction layer for XMPP
206 communications. Its primary responsibilities are:
208 o to manage connections from or sessions for other entities, in the
209 form of XML streams (Section 4) to and from authorized clients,
210 servers, and other entities
211 o to route appropriately-addressed XML stanzas (Section 9) among
212 such entities over XML streams
214 Most XMPP-compliant servers also assume responsibility for the
215 storage of data that is used by clients (e.g., contact lists for
216 users of XMPP-based instant messaging and presence applications); in
217 this case, the XML data is processed directly by the server itself on
218 behalf of the client and is not routed to another entity.
223 Saint-Andre Expires November 4, 2004 [Page 4]
225 Internet-Draft XMPP Core May 2004
230 Most clients connect directly to a server over a [TCP] connection and
231 use XMPP to take full advantage of the functionality provided by a
232 server and any associated services. Multiple resources (e.g.,
233 devices or locations) MAY connect simultaneously to a server on
234 behalf of each authorized client, with each resource differentiated
235 by the resource identifier of an XMPP address (e.g., <node@domain/
236 home> vs. <node@domain/work>) as defined under Addressing Scheme
237 (Section 3). The RECOMMENDED port for connections between a client
238 and a server is 5222, as registered with the IANA (see Port Numbers
243 A gateway is a special-purpose server-side service whose primary
244 function is to translate XMPP into the protocol used by a foreign
245 (non-XMPP) messaging system, as well as to translate the return data
246 back into XMPP. Examples are gateways to email (see [SMTP]),
247 Internet Relay Chat (see [IRC]), SIMPLE (see [SIMPLE]), Short Message
248 Service (SMS), and legacy instant messaging services such as AIM,
249 ICQ, MSN Messenger, and Yahoo! Instant Messenger. Communications
250 between gateways and servers, and between gateways and the foreign
251 messaging system, are not defined in this document.
255 Because each server is identified by a network address and because
256 server-to-server communications are a straightforward extension of
257 the client-to-server protocol, in practice the system consists of a
258 network of servers that inter-communicate. Thus, for example,
259 <juliet@example.com> is able to exchange messages, presence, and
260 other information with <romeo@example.net>. This pattern is familiar
261 from messaging protocols (such as [SMTP]) that make use of network
262 addressing standards. Communications between any two servers are
263 OPTIONAL. If enabled, such communications SHOULD occur over XML
264 streams that are bound to [TCP] connections. The RECOMMENDED port
265 for connections between servers is 5269, as registered with the IANA
266 (see Port Numbers (Section 15.9)).
272 An entity is anything that can be considered a network endpoint
273 (i.e., an ID on the network) and that can communicate using XMPP.
274 All such entities are uniquely addressable in a form that is
275 consistent with RFC 2396 [URI]. For historical reasons, the address
279 Saint-Andre Expires November 4, 2004 [Page 5]
281 Internet-Draft XMPP Core May 2004
284 of an XMPP entity is called a Jabber Identifier or JID. A valid JID
285 contains a set of ordered elements formed of a domain identifier,
286 node identifier, and resource identifier.
288 The syntax for a JID is defined below using Augmented Backus-Naur
289 Form as defined in [ABNF]. (The IPv4address and IPv6address rules
290 are defined in Appendix B of [IPv6]; the allowable character
291 sequences that conform to the node rule are defined by the Nodeprep
292 profile of [STRINGPREP] as documented in Appendix A of this memo; the
293 allowable character sequences that conform to the resource rule are
294 defined by the Resourceprep profile of [STRINGPREP] as documented in
295 Appendix B of this memo; and the sub-domain rule makes reference to
296 the concept of a domain label as described in [IDNA].)
298 jid = [ node "@" ] domain [ "/" resource ]
299 domain = fqdn / address-literal
300 fqdn = (sub-domain 1*("." sub-domain))
301 sub-domain = ([IDNA] conformant domain label)
302 address-literal = IPv4address / IPv6address
304 All JIDs are based on the foregoing structure. The most common use
305 of this structure is to identify an instant messaging user, the
306 server to which the user connects, and the user's connected resource
307 (e.g., a specific client) in the form of <user@host/resource>.
308 However, node types other than clients are possible; for example, a
309 specific chat room offered by a multi-user chat service could be
310 addressed as <room@service> (where "room" is the name of the chat
311 room and "service" is the hostname of the multi-user chat service)
312 and a specific occupant of such a room could be addressed as
313 <room@service/nick> (where "nick" is the occupant's room nickname).
314 Many other JID types are possible (e.g., <domain/resource> could be a
315 server-side script or service).
317 Each allowable portion of a JID (node identifier, domain identifier,
318 and resource identifier) MUST NOT be more than 1023 bytes in length,
319 resulting in a maximum total size (including the '@' and '/'
320 separators) of 3071 bytes.
322 3.2 Domain Identifier
324 The domain identifier is the primary identifier and is the only
325 REQUIRED element of a JID (a mere domain identifier is a valid JID).
326 It usually represents the network gateway or "primary" server to
327 which other entities connect for XML routing and data management
328 capabilities. However, the entity referenced by a domain identifier
329 is not always a server, and may be a service that is addressed as a
330 subdomain of a server and that provides functionality above and
331 beyond the capabilities of a server (e.g., a multi-user chat service,
335 Saint-Andre Expires November 4, 2004 [Page 6]
337 Internet-Draft XMPP Core May 2004
340 a user directory, or a gateway to a foreign messaging system).
342 The domain identifier for every server or service that will
343 communicate over a network MAY be an IP address but SHOULD be a fully
344 qualified domain name (see [DNS]). A domain identifier MUST be an
345 "internationalized domain name" as defined in [IDNA], to which the
346 Nameprep [NAMEPREP] profile of stringprep [STRINGPREP] can be applied
347 without failing. Before comparing two domain identifiers, a server
348 MUST (and a client SHOULD) first apply the Nameprep profile to the
349 labels (as defined in [IDNA]) that make up each identifier.
353 The node identifier is an optional secondary identifier placed before
354 the domain identifier and separated from the latter by the '@'
355 character. It usually represents the entity requesting and using
356 network access provided by the server or gateway (i.e., a client),
357 although it can also represent other kinds of entities (e.g., a chat
358 room associated with a multi-user chat service). The entity
359 represented by a node identifier is addressed within the context of a
360 specific domain; within instant messaging and presence applications
361 of XMPP this address is called a "bare JID" and is of the form
364 A node identifier MUST be formatted such that the Nodeprep profile of
365 [STRINGPREP] can be applied to it without failing. Before comparing
366 two node identifiers, a server MUST (and a client SHOULD) first apply
367 the Nodeprep profile to each identifier.
369 3.4 Resource Identifier
371 The resource identifier is an optional tertiary identifier placed
372 after the domain identifier and separated from the latter by the '/'
373 character. A resource identifier may modify either a <node@domain>
374 or mere <domain> address. It usually represents a specific session,
375 connection (e.g., a device or location), or object (e.g., a
376 participant in a multi-user chat room) belonging to the entity
377 associated with a node identifier. A resource identifier is opaque
378 to both servers and other clients, and is typically defined by a
379 client implementation when it provides the information necessary to
380 complete Resource Binding (Section 7) (although it may be generated
381 by a server on behalf of a client), after which it is referred to as
382 a "connected resource". An entity MAY maintain multiple connected
383 resources simultaneously, with each connected resource differentiated
384 by a distinct resource identifier.
386 A resource identifier MUST be formatted such that the Resourceprep
387 profile of [STRINGPREP] can be applied to it without failing. Before
391 Saint-Andre Expires November 4, 2004 [Page 7]
393 Internet-Draft XMPP Core May 2004
396 comparing two resource identifiers, a server MUST (and a client
397 SHOULD) first apply the Resourceprep profile to each identifier.
399 3.5 Determination of Addresses
401 After SASL negotiation (Section 6) and, if appropriate, Resource
402 Binding (Section 7), the receiving entity for a stream MUST determine
403 the initiating entity's JID.
405 For server-to-server communications, the initiating entity's JID
406 SHOULD be the authorization identity, derived from the authentication
407 identity as defined by the Simple Authentication and Security Layer
408 (SASL) specification [SASL] if no authorization identity was
409 specified during SASL negotiation (Section 6).
411 For client-to-server communications, the "bare JID" (<node@domain>)
412 SHOULD be the authorization identity, derived from the authentication
413 identity as defined in [SASL] if no authorization identity was
414 specified during SASL negotiation (Section 6); the resource
415 identifier portion of the "full JID" (<node@domain/resource>) SHOULD
416 be the resource identifier negotiated by the client and server during
417 Resource Binding (Section 7).
419 The receiving entity MUST ensure that the resulting JID (including
420 node identifier, domain identifier, resource identifier, and
421 separator characters) conforms to the rules and formats defined
422 earlier in this section; to meet this restriction, the receiving
423 entity may need to replace the JID sent by the initiating entity with
424 the canonicalized JID as determined by the receiving entity.
430 Two fundamental concepts make possible the rapid, asynchronous
431 exchange of relatively small payloads of structured information
432 between presence-aware entities: XML streams and XML stanzas. These
433 terms are defined as follows:
435 Definition of XML Stream: An XML stream is a container for the
436 exchange of XML elements between any two entities over a network.
437 The start of an XML stream is denoted unambiguously by an opening
438 XML <stream> tag (with appropriate attributes and namespace
439 declarations), while the end of the XML stream is denoted
440 unambiguously by a closing XML </stream> tag. During the life of
441 the stream, the entity that initiated it can send an unbounded
442 number of XML elements over the stream, either elements used to
443 negotiate the stream (e.g., to negotiate use of TLS (Section 5) or
447 Saint-Andre Expires November 4, 2004 [Page 8]
449 Internet-Draft XMPP Core May 2004
452 use of SASL (Section 6)) or XML stanzas (as defined herein,
453 <message/>, <presence/>, or <iq/> elements qualified by the
454 default namespace). The "initial stream" is negotiated from the
455 initiating entity (usually a client or server) to the receiving
456 entity (usually a server), and can be seen as corresponding to the
457 initiating entity's "session" with the receiving entity. The
458 initial stream enables unidirectional communication from the
459 initiating entity to the receiving entity; in order to enable
460 information exchange from the receiving entity to the initiating
461 entity, the receiving entity MUST negotiate a stream in the
462 opposite direction (the "response stream").
463 Definition of XML Stanza: An XML stanza is a discrete semantic unit
464 of structured information that is sent from one entity to another
465 over an XML stream. An XML stanza exists at the direct child
466 level of the root <stream/> element and is said to be
467 well-balanced if it matches production [43] content of [XML]. The
468 start of any XML stanza is denoted unambiguously by the element
469 start tag at depth=1 of the XML stream (e.g., <presence>), and the
470 end of any XML stanza is denoted unambiguously by the
471 corresponding close tag at depth=1 (e.g., </presence>). An XML
472 stanza MAY contain child elements (with accompanying attributes,
473 elements, and XML character data) as necessary in order to convey
474 the desired information. The only XML stanzas defined herein are
475 the <message/>, <presence/>, and <iq/> elements qualified by the
476 default namespace for the stream, as described under XML Stanzas
477 (Section 9); an XML element sent for the purpose of Transport
478 Layer Security (TLS) negotiation (Section 5), Simple
479 Authentication and Security Layer (SASL) negotiation (Section 6),
480 or server dialback (Section 8) is not considered to be an XML
483 Consider the example of a client's session with a server. In order
484 to connect to a server, a client MUST initiate an XML stream by
485 sending an opening <stream> tag to the server, optionally preceded by
486 a text declaration specifying the XML version and the character
487 encoding supported (see Inclusion of Text Declaration (Section 11.4);
488 see also Character Encoding (Section 11.5)). Subject to local
489 policies and service provisioning, the server SHOULD then reply with
490 a second XML stream back to the client, again optionally preceded by
491 a text declaration. Once the client has completed SASL negotiation
492 (Section 6), the client MAY send an unbounded number of XML stanzas
493 over the stream to any recipient on the network. When the client
494 desires to close the stream, it simply sends a closing </stream> tag
495 to the server (alternatively, the stream may be closed by the
496 server), after which both the client and server SHOULD terminate the
497 underlying connection (usually a TCP connection) as well.
499 Those who are accustomed to thinking of XML in a document-centric
503 Saint-Andre Expires November 4, 2004 [Page 9]
505 Internet-Draft XMPP Core May 2004
508 manner may wish to view a client's session with a server as
509 consisting of two open-ended XML documents: one from the client to
510 the server and one from the server to the client. From this
511 perspective, the root <stream/> element can be considered the
512 document entity for each "document", and the two "documents" are
513 built up through the accumulation of XML stanzas sent over the two
514 XML streams. However, this perspective is a convenience only, and
515 XMPP does not deal in documents but in XML streams and XML stanzas.
517 In essence, then, an XML stream acts as an envelope for all the XML
518 stanzas sent during a session. We can represent this in a simplistic
521 |--------------------|
523 |--------------------|
527 |--------------------|
528 | <message to='foo'> |
531 |--------------------|
535 |--------------------|
537 |--------------------|
539 |--------------------|
544 Although there is no necessary coupling of an XML stream to a [TCP]
545 connection (e.g., two entities could connect to each other via
546 another mechanism such as polling over [HTTP]), this specification
547 defines a binding of XMPP to TCP only. In the context of
548 client-to-server communications, a server MUST allow a client to
549 share a single TCP connection for XML stanzas sent from client to
550 server and from server to client. In the context of server-to-server
551 communications, a server MUST use one TCP connection for XML stanzas
552 sent from the server to the peer and another TCP connection
553 (initiated by the peer) for stanzas from the peer to the server, for
554 a total of two TCP connections.
559 Saint-Andre Expires November 4, 2004 [Page 10]
561 Internet-Draft XMPP Core May 2004
566 When negotiating XML streams in XMPP 1.0, TLS SHOULD be used as
567 defined under Use of TLS (Section 5) and SASL MUST be used as defined
568 under Use of SASL (Section 6). The "initial stream" (i.e., the
569 stream from the initiating entity to the receiving entity) and the
570 "response stream" (i.e., the stream from the receiving entity to the
571 initiating entity) MUST be secured separately, although security in
572 both directions MAY be established via mechanisms that provide mutual
573 authentication. An entity SHOULD NOT attempt to send XML Stanzas
574 (Section 9) over the stream before the stream has been authenticated,
575 but if it does then the other entity MUST NOT accept such stanzas and
576 SHOULD return a <not-authorized/> stream error and then terminate
577 both the XML stream and the underlying TCP connection; note well that
578 this applies to XML stanzas only (i.e., <message/>, <presence/>, and
579 <iq/> elements scoped by the default namespace) and not to XML
580 elements used for stream negotiation (e.g., elements used to
581 negotiate use of TLS (Section 5) or Use of SASL (Section 6)).
583 4.4 Stream Attributes
585 The attributes of the stream element are as follows:
587 o to -- The 'to' attribute SHOULD be used only in the XML stream
588 header from the initiating entity to the receiving entity, and
589 MUST be set to a hostname serviced by the receiving entity. There
590 SHOULD NOT be a 'to' attribute set in the XML stream header by
591 which the receiving entity replies to the initiating entity;
592 however, if a 'to' attribute is included, it SHOULD be silently
593 ignored by the initiating entity.
594 o from -- The 'from' attribute SHOULD be used only in the XML stream
595 header from the receiving entity to the initiating entity, and
596 MUST be set to a hostname serviced by the receiving entity that is
597 granting access to the initiating entity. There SHOULD NOT be a
598 'from' attribute on the XML stream header sent from the initiating
599 entity to the receiving entity; however, if a 'from' attribute is
600 included, it SHOULD be silently ignored by the receiving entity.
601 o id -- The 'id' attribute SHOULD be used only in the XML stream
602 header from the receiving entity to the initiating entity. This
603 attribute is a unique identifier created by the receiving entity
604 to function as a session key for the initiating entity's streams
605 with the receiving entity, and MUST be unique within the receiving
606 application (normally a server). Note well that the stream ID may
607 be security-critical and therefore MUST be both unpredictable and
608 nonrepeating (see [RANDOM] for recommendations regarding
609 randomness for security purposes). There SHOULD NOT be an 'id'
610 attribute on the XML stream header sent from the initiating entity
611 to the receiving entity; however, if an 'id' attribute is
615 Saint-Andre Expires November 4, 2004 [Page 11]
617 Internet-Draft XMPP Core May 2004
620 included, it SHOULD be silently ignored by the receiving entity.
621 o xml:lang -- An 'xml:lang' attribute (as defined in Section 2.12 of
622 [XML]) SHOULD be included by the initiating entity on the header
623 for the initial stream to specify the default language of any
624 human-readable XML character data it sends over that stream. If
625 the attribute is included, the receiving entity SHOULD remember
626 that value as the default for both the initial stream and the
627 response stream; if the attribute is not included, the receiving
628 entity SHOULD use a configurable default value for both streams,
629 which it MUST communicate in the header for the response stream.
630 For all stanzas sent over the initial stream, if the initiating
631 entity does not include an 'xml:lang' attribute, the receiving
632 entity SHOULD apply the default value; if the initiating entity
633 does include an 'xml:lang' attribute, the receiving entity MUST
634 NOT modify or delete it (see also xml:lang (Section 9.1.5)). The
635 value of the 'xml:lang' attribute MUST be an NMTOKEN (as defined
636 in Section 2.3 of [XML]) and MUST conform to the format defined in
638 o version -- The presence of the version attribute set to a value of
639 at least "1.0" signals support for the stream-related protocols
640 (including stream features) defined in this specification.
641 Detailed rules regarding generation and handling of this attribute
644 We can summarize as follows:
646 | initiating to receiving | receiving to initiating
647 ---------+---------------------------+-----------------------
648 to | hostname of receiver | silently ignored
649 from | silently ignored | hostname of receiver
650 id | silently ignored | session key
651 xml:lang | default language | default language
652 version | signals XMPP 1.0 support | signals XMPP 1.0 support
655 4.4.1 Version Support
657 The version of XMPP specified herein is "1.0"; in particular, this
658 encapsulates the stream-related protocols (Use of TLS (Section 5),
659 Use of SASL (Section 6), and Stream Errors (Section 4.7)) as well as
660 the semantics of the three defined XML stanza types (<message/>,
661 <presence/>, and <iq/>). The numbering scheme for XMPP versions is
662 "<major>.<minor>". The major and minor numbers MUST be treated as
663 separate integers and each number MAY be incremented higher than a
664 single digit. Thus, "XMPP 2.4" would be a lower version than "XMPP
665 2.13", which in turn would be lower than "XMPP 12.3". Leading zeros
666 (e.g., "XMPP 6.01") MUST be ignored by recipients and MUST NOT be
671 Saint-Andre Expires November 4, 2004 [Page 12]
673 Internet-Draft XMPP Core May 2004
676 The major version number should be incremented only if the stream and
677 stanza formats or required actions have changed so dramatically that
678 an older version entity would not be able to interoperate with a
679 newer version entity if it simply ignored the elements and attributes
680 it did not understand and took the actions specified in the older
681 specification. The minor version number indicates new capabilities,
682 and MUST be ignored by an entity with a smaller minor version number,
683 but used for informational purposes by the entity with the larger
684 minor version number. For example, a minor version number might
685 indicate the ability to process a newly defined value of the 'type'
686 attribute for message, presence, or IQ stanzas; the entity with the
687 larger minor version number would simply note that its correspondent
688 would not be able to understand that value of the 'type' attribute
689 and therefore would not send it.
691 The following rules apply to the generation and handling by
692 implementations of the 'version' attribute within stream headers:
694 1. The initiating entity MUST set the value of the 'version'
695 attribute on the initial stream header to the highest version
696 number it supports (e.g., if the highest version number it
697 supports is that defined in this specification, it MUST set the
699 2. The receiving entity MUST set the value of the 'version'
700 attribute on the response stream header to either the value
701 supplied by the initiating entity or the highest version number
702 supported by the receiving entity, whichever is lower. The
703 receiving entity MUST perform a numeric comparison on the major
704 and minor version numbers, not a string match on
706 3. If the version number included in the response stream header is
707 at least one major version lower than the version number included
708 in the initial stream header and newer version entities cannot
709 interoperate with older version entities as described above, the
710 initiating entity SHOULD generate an <unsupported-version/>
711 stream error and terminate the XML stream and underlying TCP
713 4. If either entity receives a stream header with no 'version'
714 attribute, the entity MUST consider the version supported by the
715 other entity to be "0.0" and SHOULD NOT include a 'version'
716 attribute in the stream header it sends in reply.
718 4.5 Namespace Declarations
720 The stream element MUST possess both a streams namespace declaration
721 and a default namespace declaration (as "namespace declaration" is
722 defined in the XML namespaces specification [XML-NAMES]). For
723 detailed information regarding the streams namespace and default
727 Saint-Andre Expires November 4, 2004 [Page 13]
729 Internet-Draft XMPP Core May 2004
732 namespace, see Namespace Names and Prefixes (Section 11.2).
736 If the initiating entity includes the 'version' attribute set to a
737 value of at least "1.0" in the initial stream header, the receiving
738 entity MUST send a <features/> child element (prefixed by the streams
739 namespace prefix) to the initiating entity in order to announce any
740 stream-level features that can be negotiated (or capabilities that
741 otherwise need to be advertised). Currently this is used only to
742 advertise Use of TLS (Section 5), Use of SASL (Section 6), and
743 Resource Binding (Section 7) as defined herein, and for Session
744 Establishment as defined in [XMPP-IM]; however, the stream features
745 functionality could be used to advertise other negotiable features in
746 the future. If an entity does not understand or support some
747 features, it SHOULD silently ignore them. If one or more security
748 features (e.g., TLS and SASL) need to be successfully negotiated
749 before a non-security-related feature (e.g., Resource Binding) can be
750 offered, the non-security-related feature SHOULD NOT be included in
751 the stream features that are advertised before the relevant security
752 features have been negotiated.
756 The root stream element MAY contain an <error/> child element that is
757 prefixed by the streams namespace prefix. The error child MUST be
758 sent by a compliant entity (usually a server rather than a client) if
759 it perceives that a stream-level error has occurred.
763 The following rules apply to stream-level errors:
765 o It is assumed that all stream-level errors are unrecoverable;
766 therefore, if an error occurs at the level of the stream, the
767 entity that detects the error MUST send a stream error to the
768 other entity, send a closing </stream> tag, and terminate the
769 underlying TCP connection.
770 o If the error occurs while the stream is being set up, the
771 receiving entity MUST still send the opening <stream> tag, include
772 the <error/> element as a child of the stream element, send the
773 closing </stream> tag, and terminate the underlying TCP
774 connection. In this case, if the initiating entity provides an
775 unknown host in the 'to' attribute (or provides no 'to' attribute
776 at all), the server SHOULD provide the server's authoritative
777 hostname in the 'from' attribute of the stream header sent before
783 Saint-Andre Expires November 4, 2004 [Page 14]
785 Internet-Draft XMPP Core May 2004
790 The syntax for stream errors is as follows:
793 <defined-condition xmlns='urn:ietf:params:xml:ns:xmpp-streams'/>
794 <text xmlns='urn:ietf:params:xml:ns:xmpp-streams'
796 OPTIONAL descriptive text
798 [OPTIONAL application-specific condition element]
801 The <error/> element:
803 o MUST contain a child element corresponding to one of the defined
804 stanza error conditions defined below; this element MUST be
805 qualified by the 'urn:ietf:params:xml:ns:xmpp-streams' namespace
806 o MAY contain a <text/> child containing XML character data that
807 describes the error in more detail; this element MUST be qualified
808 by the 'urn:ietf:params:xml:ns:xmpp-streams' namespace and SHOULD
809 possess an 'xml:lang' attribute specifying the natural language of
810 the XML character data
811 o MAY contain a child element for an application-specific error
812 condition; this element MUST be qualified by an
813 application-defined namespace, and its structure is defined by
816 The <text/> element is OPTIONAL. If included, it SHOULD be used only
817 to provide descriptive or diagnostic information that supplements the
818 meaning of a defined condition or application-specific condition. It
819 SHOULD NOT be interpreted programmatically by an application. It
820 SHOULD NOT be used as the error message presented to a user, but MAY
821 be shown in addition to the error message associated with the
822 included condition element (or elements).
824 4.7.3 Defined Conditions
826 The following stream-level error conditions are defined:
828 o <bad-format/> -- the entity has sent XML that cannot be processed;
829 this error MAY be used rather than more specific XML-related
830 errors such as <bad-namespace-prefix/>, <invalid-xml/>,
831 <restricted-xml/>, <unsupported-encoding/>, and
832 <xml-not-well-formed/>, although the more specific errors are
834 o <bad-namespace-prefix/> -- the entity has sent a namespace prefix
835 that is unsupported, or has sent no namespace prefix on an element
839 Saint-Andre Expires November 4, 2004 [Page 15]
841 Internet-Draft XMPP Core May 2004
844 that requires such a prefix (see XML Namespace Names and Prefixes
846 o <conflict/> -- the server is closing the active stream for this
847 entity because a new stream has been initiated that conflicts with
849 o <connection-timeout/> -- the entity has not generated any traffic
850 over the stream for some period of time (configurable according to
851 a local service policy).
852 o <host-gone/> -- the value of the 'to' attribute provided by the
853 initiating entity in the stream header corresponds to a hostname
854 that is no longer hosted by the server.
855 o <host-unknown/> -- the value of the 'to' attribute provided by the
856 initiating entity in the stream header does not correspond to a
857 hostname that is hosted by the server.
858 o <improper-addressing/> -- a stanza sent between two servers lacks
859 a 'to' or 'from' attribute (or the attribute has no value).
860 o <internal-server-error/> -- the server has experienced a
861 misconfiguration or an otherwise-undefined internal error that
862 prevents it from servicing the stream.
863 o <invalid-from/> -- the JID or hostname provided in a 'from'
864 address does not match an authorized JID or validated domain
865 negotiated between servers via SASL or dialback, or between a
866 client and a server via authentication and resource binding.
867 o <invalid-id/> -- the stream ID or dialback ID is invalid or does
868 not match an ID previously provided.
869 o <invalid-namespace/> -- the streams namespace name is something
870 other than "http://etherx.jabber.org/streams" or the dialback
871 namespace name is something other than "jabber:server:dialback"
872 (see XML Namespace Names and Prefixes (Section 11.2)).
873 o <invalid-xml/> -- the entity has sent invalid XML over the stream
874 to a server that performs validation (see Validation (Section
876 o <not-authorized/> -- the entity has attempted to send data before
877 the stream has been authenticated, or otherwise is not authorized
878 to perform an action related to stream negotiation; the receiving
879 entity MUST NOT process the offending stanza before sending the
881 o <policy-violation/> -- the entity has violated some local service
882 policy; the server MAY choose to specify the policy in the <text/>
883 element or an application-specific condition element.
884 o <remote-connection-failed/> -- the server is unable to properly
885 connect to a remote entity that is required for authentication or
887 o <resource-constraint/> -- the server lacks the system resources
888 necessary to service the stream.
889 o <restricted-xml/> -- the entity has attempted to send restricted
890 XML features such as a comment, processing instruction, DTD,
891 entity reference, or unescaped character (see Restrictions
895 Saint-Andre Expires November 4, 2004 [Page 16]
897 Internet-Draft XMPP Core May 2004
901 o <see-other-host/> -- the server will not provide service to the
902 initiating entity but is redirecting traffic to another host; the
903 server SHOULD specify the alternate hostname or IP address (which
904 MUST be a valid domain identifier) as the XML character data of
905 the <see-other-host/> element.
906 o <system-shutdown/> -- the server is being shut down and all active
907 streams are being closed.
908 o <undefined-condition/> -- the error condition is not one of those
909 defined by the other conditions in this list; this error condition
910 SHOULD be used only in conjunction with an application-specific
912 o <unsupported-encoding/> -- the initiating entity has encoded the
913 stream in an encoding that is not supported by the server (see
914 Character Encoding (Section 11.5)).
915 o <unsupported-stanza-type/> -- the initiating entity has sent a
916 first-level child of the stream that is not supported by the
918 o <unsupported-version/> -- the value of the 'version' attribute
919 provided by the initiating entity in the stream header specifies a
920 version of XMPP that is not supported by the server; the server
921 MAY specify the version(s) it supports in the <text/> element.
922 o <xml-not-well-formed/> -- the initiating entity has sent XML that
923 is not well-formed as defined by [XML].
925 4.7.4 Application-Specific Conditions
927 As noted, an application MAY provide application-specific stream
928 error information by including a properly-namespaced child in the
929 error element. The application-specific element SHOULD supplement or
930 further qualify a defined element. Thus the <error/> element will
931 contain two or three child elements:
935 xmlns='urn:ietf:params:xml:ns:xmpp-streams'/>
936 <text xml:lang='en' xmlns='urn:ietf:params:xml:ns:xmpp-streams'>
937 Some special application diagnostic information!
939 <escape-your-data xmlns='application-ns'/>
944 4.8 Simplified Stream Examples
946 This section contains two simplified examples of a stream-based
947 "session" of a client on a server (where the "C" lines are sent from
951 Saint-Andre Expires November 4, 2004 [Page 17]
953 Internet-Draft XMPP Core May 2004
956 the client to the server, and the "S" lines are sent from the server
957 to the client); these examples are included for the purpose of
958 illustrating the concepts introduced thus far.
962 C: <?xml version='1.0'?>
965 xmlns='jabber:client'
966 xmlns:stream='http://etherx.jabber.org/streams'
968 S: <?xml version='1.0'?>
972 xmlns='jabber:client'
973 xmlns:stream='http://etherx.jabber.org/streams'
975 ... encryption, authentication, and resource binding ...
976 C: <message from='juliet@example.com'
977 to='romeo@example.net'
979 C: <body>Art thou not Romeo, and a Montague?</body>
981 S: <message from='romeo@example.net'
982 to='juliet@example.com'
984 S: <body>Neither, fair saint, if either thee dislike.</body>
1007 Saint-Andre Expires November 4, 2004 [Page 18]
1009 Internet-Draft XMPP Core May 2004
1012 A "session" gone bad:
1014 C: <?xml version='1.0'?>
1017 xmlns='jabber:client'
1018 xmlns:stream='http://etherx.jabber.org/streams'
1020 S: <?xml version='1.0'?>
1024 xmlns='jabber:client'
1025 xmlns:stream='http://etherx.jabber.org/streams'
1027 ... encryption, authentication, and resource binding ...
1028 C: <message xml:lang='en'>
1029 <body>Bad XML, no closing body tag!
1032 <xml-not-well-formed
1033 xmlns='urn:ietf:params:xml:ns:xmpp-streams'/>
1042 XMPP includes a method for securing the stream from tampering and
1043 eavesdropping. This channel encryption method makes use of the
1044 Transport Layer Security (TLS) protocol [TLS], along with a
1045 "STARTTLS" extension that is modelled after similar extensions for
1046 the IMAP [IMAP], POP3 [POP3], and ACAP [ACAP] protocols as described
1047 in RFC 2595 [USINGTLS]. The namespace name for the STARTTLS
1048 extension is 'urn:ietf:params:xml:ns:xmpp-tls'.
1050 An administrator of a given domain MAY require the use of TLS for
1051 client-to-server communications, server-to-server communications, or
1052 both. Clients SHOULD use TLS to secure the streams prior to
1053 attempting to complete SASL negotiation (Section 6), and servers
1054 SHOULD use TLS between two domains for the purpose of securing
1055 server-to-server communications.
1057 The following rules apply:
1063 Saint-Andre Expires November 4, 2004 [Page 19]
1065 Internet-Draft XMPP Core May 2004
1068 1. An initiating entity that complies with this specification MUST
1069 include the 'version' attribute set to a value of "1.0" in the
1070 initial stream header.
1071 2. If the TLS negotiation occurs between two servers,
1072 communications MUST NOT proceed until the Domain Name System
1073 (DNS) hostnames asserted by the servers have been resolved (see
1074 Server-to-Server Communications (Section 14.4)).
1075 3. When a receiving entity that complies with this specification
1076 receives an initial stream header that includes the 'version'
1077 attribute set to a value of at least "1.0", after sending a
1078 stream header in reply (including the version flag) it MUST
1079 include a <starttls/> element (qualified by the
1080 'urn:ietf:params:xml:ns:xmpp-tls' namespace) along with the list
1081 of other stream features it supports.
1082 4. If the initiating entity chooses to use TLS, TLS negotiation
1083 MUST be completed before proceeding to SASL negotiation; this
1084 order of negotiation is required in order to help safeguard
1085 authentication information sent during SASL negotiation, as well
1086 as to make it possible to base the use of the SASL EXTERNAL
1087 mechanism on a certificate provided during prior TLS
1089 5. During TLS negotiation, an entity MUST NOT send any white space
1090 characters (matching production [3] content of [XML]) within the
1091 root stream element as separators between elements (any white
1092 space characters shown in the TLS examples below are included
1093 for the sake of readability only); this prohibition helps to
1094 ensure proper security layer byte precision.
1095 6. The receiving entity MUST consider the TLS negotiation to have
1096 begun immediately after sending the closing ">" character of the
1097 <proceed/> element. The initiating entity MUST consider the TLS
1098 negotiation to have begun immediately after receiving the
1099 closing ">" character of the <proceed/> element from the
1101 7. The initiating entity MUST validate the certificate presented by
1102 the receiving entity; see Certificate Validation (Section 14.2)
1103 regarding certificate validation procedures.
1104 8. Certificates MUST be checked against the hostname as provided by
1105 the initiating entity (e.g., a user), not the hostname as
1106 resolved via the Domain Name System; e.g., if the user specifies
1107 a hostname of "example.com" but a DNS SRV [SRV] lookup returned
1108 "im.example.com", the certificate MUST be checked as
1109 "example.com". If a JID for any kind of XMPP entity (e.g.,
1110 client or server) is represented in a certificate, it SHOULD be
1111 encoded as a GeneralName entry of type otherName inside the
1112 subjectAltName, along with a type-id whose value is "xmpp" (as
1113 these terms are profiled in [X509]).
1114 9. If the TLS negotiation is successful, the receiving entity MUST
1115 discard any knowledge obtained in an insecure manner from the
1119 Saint-Andre Expires November 4, 2004 [Page 20]
1121 Internet-Draft XMPP Core May 2004
1124 initiating entity before TLS takes effect.
1125 10. If the TLS negotiation is successful, the initiating entity MUST
1126 discard any knowledge obtained in an insecure manner from the
1127 receiving entity before TLS takes effect.
1128 11. If the TLS negotiation is successful, the receiving entity MUST
1129 NOT offer the STARTTLS extension to the initiating entity along
1130 with the other stream features that are offered when the stream
1132 12. If the TLS negotiation is successful, the initiating entity MUST
1133 continue with SASL negotiation.
1134 13. If the TLS negotiation results in failure, the receiving entity
1135 MUST terminate both the XML stream and the underlying TCP
1137 14. See Mandatory-to-Implement Technologies (Section 14.7) regarding
1138 mechanisms that MUST be supported.
1142 When an initiating entity secures a stream with a receiving entity
1143 using TLS, the steps involved are as follows:
1145 1. The initiating entity opens a TCP connection and initiates the
1146 stream by sending the opening XML stream header to the receiving
1147 entity, including the 'version' attribute set to a value of at
1149 2. The receiving entity responds by opening a TCP connection and
1150 sending an XML stream header to the initiating entity, including
1151 the 'version' attribute set to a value of at least "1.0".
1152 3. The receiving entity offers the STARTTLS extension to the
1153 initiating entity by including it with the list of other
1154 supported stream features (if TLS is required for interaction
1155 with the receiving entity, it SHOULD signal that fact by
1156 including a <required/> element as a child of the <starttls/>
1158 4. The initiating entity issues the STARTTLS command (i.e., a
1159 <starttls/> element qualified by the
1160 'urn:ietf:params:xml:ns:xmpp-tls' namespace) to instruct the
1161 receiving entity that it wishes to begin a TLS negotiation to
1163 5. The receiving entity MUST reply with either a <proceed/> element
1164 or a <failure/> element qualified by the
1165 'urn:ietf:params:xml:ns:xmpp-tls' namespace. If the failure case
1166 occurs, the receiving entity MUST terminate both the XML stream
1167 and the underlying TCP connection. If the proceed case occurs,
1168 the entities MUST attempt to complete the TLS negotiation over
1169 the TCP connection and MUST NOT send any further XML data until
1170 the TLS negotiation is complete.
1175 Saint-Andre Expires November 4, 2004 [Page 21]
1177 Internet-Draft XMPP Core May 2004
1180 6. The initiating entity and receiving entity attempt to complete a
1181 TLS negotiation in accordance with [TLS].
1182 7. If the TLS negotiation is unsuccessful, the receiving entity MUST
1183 terminate the TCP connection. If the TLS negotiation is
1184 successful, the initiating entity MUST initiate a new stream by
1185 sending an opening XML stream header to the receiving entity (it
1186 is not necessary to send a closing </stream> tag first, since the
1187 receiving entity and initiating entity MUST consider the original
1188 stream to be closed upon successful TLS negotiation).
1189 8. Upon receiving the new stream header from the initiating entity,
1190 the receiving entity MUST respond by sending a new XML stream
1191 header to the initiating entity along with the available features
1192 (but not including the STARTTLS feature).
1194 5.3 Client-to-Server Example
1196 The following example shows the data flow for a client securing a
1197 stream using STARTTLS (note: the alternate steps shown below are
1198 provided to illustrate the protocol for failure cases; they are not
1199 exhaustive and would not necessarily be triggered by the data sent in
1202 Step 1: Client initiates stream to server:
1205 xmlns='jabber:client'
1206 xmlns:stream='http://etherx.jabber.org/streams'
1210 Step 2: Server responds by sending a stream tag to client:
1213 xmlns='jabber:client'
1214 xmlns:stream='http://etherx.jabber.org/streams'
1231 Saint-Andre Expires November 4, 2004 [Page 22]
1233 Internet-Draft XMPP Core May 2004
1236 Step 3: Server sends the STARTTLS extension to client along with
1237 authentication mechanisms and any other stream features:
1240 <starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'>
1243 <mechanisms xmlns='urn:ietf:params:xml:ns:xmpp-sasl'>
1244 <mechanism>DIGEST-MD5</mechanism>
1245 <mechanism>PLAIN</mechanism>
1249 Step 4: Client sends the STARTTLS command to server:
1251 <starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'/>
1253 Step 5: Server informs client that it is allowed to proceed:
1255 <proceed xmlns='urn:ietf:params:xml:ns:xmpp-tls'/>
1257 Step 5 (alt): Server informs client that TLS negotiation has failed
1258 and closes both stream and TCP connection:
1260 <failure xmlns='urn:ietf:params:xml:ns:xmpp-tls'/>
1263 Step 6: Client and server attempt to complete TLS negotiation over
1264 the existing TCP connection.
1266 Step 7: If TLS negotiation is successful, client initiates a new
1270 xmlns='jabber:client'
1271 xmlns:stream='http://etherx.jabber.org/streams'
1275 Step 7 (alt): If TLS negotiation is unsuccessful, server closes TCP
1287 Saint-Andre Expires November 4, 2004 [Page 23]
1289 Internet-Draft XMPP Core May 2004
1292 Step 8: Server responds by sending a stream header to client along
1293 with any available stream features:
1296 xmlns='jabber:client'
1297 xmlns:stream='http://etherx.jabber.org/streams'
1302 <mechanisms xmlns='urn:ietf:params:xml:ns:xmpp-sasl'>
1303 <mechanism>DIGEST-MD5</mechanism>
1304 <mechanism>PLAIN</mechanism>
1305 <mechanism>EXTERNAL</mechanism>
1309 Step 9: Client continues with SASL negotiation (Section 6).
1311 5.4 Server-to-Server Example
1313 The following example shows the data flow for two servers securing a
1314 stream using STARTTLS (note: the alternate steps shown below are
1315 provided to illustrate the protocol for failure cases; they are not
1316 exhaustive and would not necessarily be triggered by the data sent in
1319 Step 1: Server1 initiates stream to Server2:
1322 xmlns='jabber:server'
1323 xmlns:stream='http://etherx.jabber.org/streams'
1327 Step 2: Server2 responds by sending a stream tag to Server1:
1330 xmlns='jabber:server'
1331 xmlns:stream='http://etherx.jabber.org/streams'
1343 Saint-Andre Expires November 4, 2004 [Page 24]
1345 Internet-Draft XMPP Core May 2004
1348 Step 3: Server2 sends the STARTTLS extension to Server1 along with
1349 authentication mechanisms and any other stream features:
1352 <starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'>
1355 <mechanisms xmlns='urn:ietf:params:xml:ns:xmpp-sasl'>
1356 <mechanism>DIGEST-MD5</mechanism>
1357 <mechanism>KERBEROS_V4</mechanism>
1361 Step 4: Server1 sends the STARTTLS command to Server2:
1363 <starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'/>
1365 Step 5: Server2 informs Server1 that it is allowed to proceed:
1367 <proceed xmlns='urn:ietf:params:xml:ns:xmpp-tls'/>
1369 Step 5 (alt): Server2 informs Server1 that TLS negotiation has failed
1372 <failure xmlns='urn:ietf:params:xml:ns:xmpp-tls'/>
1375 Step 6: Server1 and Server2 attempt to complete TLS negotiation via
1378 Step 7: If TLS negotiation is successful, Server1 initiates a new
1382 xmlns='jabber:server'
1383 xmlns:stream='http://etherx.jabber.org/streams'
1387 Step 7 (alt): If TLS negotiation is unsuccessful, Server2 closes TCP
1399 Saint-Andre Expires November 4, 2004 [Page 25]
1401 Internet-Draft XMPP Core May 2004
1404 Step 8: Server2 responds by sending a stream header to Server1 along
1405 with any available stream features:
1408 xmlns='jabber:server'
1409 xmlns:stream='http://etherx.jabber.org/streams'
1414 <mechanisms xmlns='urn:ietf:params:xml:ns:xmpp-sasl'>
1415 <mechanism>DIGEST-MD5</mechanism>
1416 <mechanism>KERBEROS_V4</mechanism>
1417 <mechanism>EXTERNAL</mechanism>
1421 Step 9: Server1 continues with SASL negotiation (Section 6).
1427 XMPP includes a method for authenticating a stream by means of an
1428 XMPP-specific profile of the Simple Authentication and Security Layer
1429 (SASL) protocol [SASL]. SASL provides a generalized method for
1430 adding authentication support to connection-based protocols, and XMPP
1431 uses a generic XML namespace profile for SASL that conforms to the
1432 profiling requirements of [SASL].
1434 The following rules apply:
1436 1. If the SASL negotiation occurs between two servers,
1437 communications MUST NOT proceed until the Domain Name System
1438 (DNS) hostnames asserted by the servers have been resolved (see
1439 Server-to-Server Communications (Section 14.4)).
1440 2. If the initiating entity is capable of SASL negotiation, it MUST
1441 include the 'version' attribute set to a value of at least "1.0"
1442 in the initial stream header.
1443 3. If the receiving entity is capable of SASL negotiation, it MUST
1444 advertise one or more authentication mechanisms within a
1445 <mechanisms/> element qualified by the
1446 'urn:ietf:params:xml:ns:xmpp-sasl' namespace in reply to the
1447 opening stream tag received from the initiating entity (if the
1448 opening stream tag included the 'version' attribute set to a
1449 value of at least "1.0").
1450 4. During SASL negotiation, an entity MUST NOT send any white space
1451 characters (matching production [3] content of [XML]) within the
1455 Saint-Andre Expires November 4, 2004 [Page 26]
1457 Internet-Draft XMPP Core May 2004
1460 root stream element as separators between elements (any white
1461 space characters shown in the SASL examples below are included
1462 for the sake of readability only); this prohibition helps to
1463 ensure proper security layer byte precision.
1464 5. Any XML character data contained within the XML elements used
1465 during SASL negotiation MUST be encoded using base64, where the
1466 encoding adheres to the definition in Section 3 of RFC 3548
1468 6. If provision of a "simple username" is supported by the selected
1469 SASL mechanism (e.g., this is supported by the DIGEST-MD5 and
1470 CRAM-MD5 mechanisms but not by the EXTERNAL and GSSAPI
1471 mechanisms), during authentication the initiating entity SHOULD
1472 provide as the simple username its sending domain (IP address or
1473 fully qualified domain name as contained in a domain identifier)
1474 in the case of server-to-server communications or its registered
1475 account name (user or node name as contained in an XMPP node
1476 identifer) in the case of client-to-server communications.
1477 7. If the initiating entity wishes to act on behalf of another
1478 entity and the selected SASL mechanism supports transmission of
1479 an authorization identity, the initiating entity MUST provide an
1480 authorization identity during SASL negotiation. If the
1481 initiating entity does not wish to act on behalf of another
1482 entity, it MUST NOT provide an authorization identity. As
1483 specified in [SASL], the initiating entity MUST NOT provide an
1484 authorization identity unless the authorization identity is
1485 different from the default authorization identity derived from
1486 the authentication identity as described in [SASL]. If
1487 provided, the value of the authorization identity MUST be of the
1488 form <domain> (i.e., a domain identifier only) for servers and
1489 of the form <node@domain> (i.e., node identifier and domain
1490 identifier) for clients.
1491 8. Upon successful SASL negotiation that involves negotiation of a
1492 security layer, the receiving entity MUST discard any knowledge
1493 obtained from the initiating entity which was not obtained from
1494 the SASL negotiation itself.
1495 9. Upon successful SASL negotiation that involves negotiation of a
1496 security layer, the initiating entity MUST discard any knowledge
1497 obtained from the receiving entity which was not obtained from
1498 the SASL negotiation itself.
1499 10. See Mandatory-to-Implement Technologies (Section 14.7) regarding
1500 mechanisms that MUST be supported.
1504 When an initiating entity authenticates with a receiving entity using
1505 SASL, the steps involved are as follows:
1511 Saint-Andre Expires November 4, 2004 [Page 27]
1513 Internet-Draft XMPP Core May 2004
1516 1. The initiating entity requests SASL authentication by including
1517 the 'version' attribute in the opening XML stream header sent to
1518 the receiving entity, with the value set to "1.0".
1519 2. After sending an XML stream header in reply, the receiving entity
1520 advertises a list of available SASL authentication mechanisms;
1521 each of these is a <mechanism/> element included as a child
1522 within a <mechanisms/> container element qualified by the
1523 'urn:ietf:params:xml:ns:xmpp-sasl' namespace, which in turn is a
1524 child of a <features/> element in the streams namespace. If Use
1525 of TLS (Section 5) needs to be established before a particular
1526 authentication mechanism may be used, the receiving entity MUST
1527 NOT provide that mechanism in the list of available SASL
1528 authentication mechanisms prior to TLS negotiation. If the
1529 initiating entity presents a valid certificate during prior TLS
1530 negotiation, the receiving entity SHOULD offer the SASL EXTERNAL
1531 mechanism to the initiating entity during SASL negotiation (refer
1532 to [SASL]), although the EXTERNAL mechanism MAY be offered under
1533 other circumstances as well.
1534 3. The initiating entity selects a mechanism by sending an <auth/>
1535 element qualified by the 'urn:ietf:params:xml:ns:xmpp-sasl'
1536 namespace to the receiving entity and including an appropriate
1537 value for the 'mechanism' attribute. This element MAY contain
1538 XML character data (in SASL terminology, the "initial response")
1539 if the mechanism supports or requires it; if the initiating
1540 entity needs to send a zero-length initial response, it MUST
1541 transmit the response as a single equals sign ("="), which
1542 indicates that the response is present but contains no data.
1543 4. If necessary, the receiving entity challenges the initiating
1544 entity by sending a <challenge/> element qualified by the
1545 'urn:ietf:params:xml:ns:xmpp-sasl' namespace to the initiating
1546 entity; this element MAY contain XML character data (which MUST
1547 be computed in accordance with the definition of the SASL
1548 mechanism chosen by the initiating entity).
1549 5. The initiating entity responds to the challenge by sending a
1550 <response/> element qualified by the
1551 'urn:ietf:params:xml:ns:xmpp-sasl' namespace to the receiving
1552 entity; this element MAY contain XML character data (which MUST
1553 be computed in accordance with the definition of the SASL
1554 mechanism chosen by the initiating entity).
1555 6. If necessary, the receiving entity sends more challenges and the
1556 initiating entity sends more responses.
1558 This series of challenge/response pairs continues until one of three
1561 1. The initiating entity aborts the handshake by sending an <abort/>
1562 element qualified by the 'urn:ietf:params:xml:ns:xmpp-sasl'
1563 namespace to the receiving entity. Upon receiving an <abort/>
1567 Saint-Andre Expires November 4, 2004 [Page 28]
1569 Internet-Draft XMPP Core May 2004
1572 element, the receiving entity SHOULD allow a configurable but
1573 reasonable number of retries (at least 2), after which it MUST
1574 terminate the TCP connection; this enables the initiating entity
1575 (e.g., an end-user client) to tolerate incorrectly-provided
1576 credentials (e.g., a mistyped password) without being forced to
1578 2. The receiving entity reports failure of the handshake by sending
1579 a <failure/> element qualified by the
1580 'urn:ietf:params:xml:ns:xmpp-sasl' namespace to the initiating
1581 entity (the particular cause of failure SHOULD be communicated in
1582 an appropriate child element of the <failure/> element as defined
1583 under SASL Errors (Section 6.4)). If the failure case occurs,
1584 the receiving entity SHOULD allow a configurable but reasonable
1585 number of retries (at least 2), after which it MUST terminate the
1586 TCP connection; this enables the initiating entity (e.g., an
1587 end-user client) to tolerate incorrectly-provided credentials
1588 (e.g., a mistyped password) without being forced to reconnect.
1589 3. The receiving entity reports success of the handshake by sending
1590 a <success/> element qualified by the
1591 'urn:ietf:params:xml:ns:xmpp-sasl' namespace to the initiating
1592 entity; this element MAY contain XML character data (in SASL
1593 terminology, "additional data with success") if required by the
1594 chosen SASL mechanism. Upon receiving the <success/> element,
1595 the initiating entity MUST initiate a new stream by sending an
1596 opening XML stream header to the receiving entity (it is not
1597 necessary to send a closing </stream> tag first, since the
1598 receiving entity and initiating entity MUST consider the original
1599 stream to be closed upon sending or receiving the <success/>
1600 element). Upon receiving the new stream header from the
1601 initiating entity, the receiving entity MUST respond by sending a
1602 new XML stream header to the initiating entity, along with any
1603 available features (but not including the STARTTLS and SASL
1604 features) or an empty <features/> element (to signify that no
1605 additional features are available); any such additional features
1606 not defined herein MUST be defined by the relevant extension to
1611 The profiling requirements of [SASL] require that the following
1612 information be supplied by a protocol definition:
1614 service name: "xmpp"
1615 initiation sequence: After the initiating entity provides an opening
1616 XML stream header and the receiving entity replies in kind, the
1617 receiving entity provides a list of acceptable authentication
1618 methods. The initiating entity chooses one method from the list
1619 and sends it to the receiving entity as the value of the
1623 Saint-Andre Expires November 4, 2004 [Page 29]
1625 Internet-Draft XMPP Core May 2004
1628 'mechanism' attribute possessed by an <auth/> element, optionally
1629 including an initial response to avoid a round trip.
1630 exchange sequence: Challenges and responses are carried through the
1631 exchange of <challenge/> elements from receiving entity to
1632 initiating entity and <response/> elements from initiating entity
1633 to receiving entity. The receiving entity reports failure by
1634 sending a <failure/> element and success by sending a <success/>
1635 element; the initiating entity aborts the exchange by sending an
1636 <abort/> element. Upon successful negotiation, both sides
1637 consider the original XML stream to be closed and new stream
1638 headers are sent by both entities.
1639 security layer negotiation: The security layer takes effect
1640 immediately after sending the closing ">" character of the
1641 <success/> element for the receiving entity, and immediately after
1642 receiving the closing ">" character of the <success/> element for
1643 the initiating entity. The order of layers is first [TCP], then
1644 [TLS], then [SASL], then XMPP.
1645 use of the authorization identity: The authorization identity may be
1646 used by xmpp to denote the non-default <node@domain> of a client
1647 or the sending <domain> of a server.
1651 The following SASL-related error conditions are defined:
1653 o <aborted/> -- The receiving entity acknowledges an <abort/>
1654 element sent by the initiating entity; sent in reply to the
1656 o <incorrect-encoding/> -- The data provided by the initiating
1657 entity could not be processed because the [BASE64] encoding is
1658 incorrect (e.g., because the encoding does not adhere to the
1659 definition in Section 3 of [BASE64]); sent in reply to a
1660 <response/> element or an <auth/> element with initial response
1662 o <invalid-authzid/> -- The authzid provided by the initiating
1663 entity is invalid, either because it is incorrectly formatted or
1664 because the initiating entity does not have permissions to
1665 authorize that ID; sent in reply to a <response/> element or an
1666 <auth/> element with initial response data.
1667 o <invalid-mechanism/> -- The initiating entity did not provide a
1668 mechanism or requested a mechanism that is not supported by the
1669 receiving entity; sent in reply to an <auth/> element.
1670 o <mechanism-too-weak/> -- The mechanism requested by the initiating
1671 entity is weaker than server policy permits for that initiating
1672 entity; sent in reply to a <response/> element or an <auth/>
1673 element with initial response data.
1674 o <not-authorized/> -- The authentication failed because the
1675 initiating entity did not provide valid credentials (this includes
1679 Saint-Andre Expires November 4, 2004 [Page 30]
1681 Internet-Draft XMPP Core May 2004
1684 but is not limited to the case of an unknown username); sent in
1685 reply to a <response/> element or an <auth/> element with initial
1687 o <temporary-auth-failure/> -- The authentication failed because of
1688 a temporary error condition within the receiving entity; sent in
1689 reply to an <auth/> element or <response/> element.
1691 6.5 Client-to-Server Example
1693 The following example shows the data flow for a client authenticating
1694 with a server using SASL, normally after successful TLS negotiation
1695 (note: the alternate steps shown below are provided to illustrate the
1696 protocol for failure cases; they are not exhaustive and would not
1697 necessarily be triggered by the data sent in the example).
1699 Step 1: Client initiates stream to server:
1702 xmlns='jabber:client'
1703 xmlns:stream='http://etherx.jabber.org/streams'
1707 Step 2: Server responds with a stream tag sent to client:
1710 xmlns='jabber:client'
1711 xmlns:stream='http://etherx.jabber.org/streams'
1716 Step 3: Server informs client of available authentication mechanisms:
1719 <mechanisms xmlns='urn:ietf:params:xml:ns:xmpp-sasl'>
1720 <mechanism>DIGEST-MD5</mechanism>
1721 <mechanism>PLAIN</mechanism>
1725 Step 4: Client selects an authentication mechanism:
1727 <auth xmlns='urn:ietf:params:xml:ns:xmpp-sasl'
1728 mechanism='DIGEST-MD5'/>
1735 Saint-Andre Expires November 4, 2004 [Page 31]
1737 Internet-Draft XMPP Core May 2004
1740 Step 5: Server sends a [BASE64] encoded challenge to client:
1742 <challenge xmlns='urn:ietf:params:xml:ns:xmpp-sasl'>
1743 cmVhbG09InNvbWVyZWFsbSIsbm9uY2U9Ik9BNk1HOXRFUUdtMmhoIixxb3A9ImF1dGgi
1744 LGNoYXJzZXQ9dXRmLTgsYWxnb3JpdGhtPW1kNS1zZXNzCg==
1747 The decoded challenge is:
1749 realm="somerealm",nonce="OA6MG9tEQGm2hh",\
1750 qop="auth",charset=utf-8,algorithm=md5-sess
1752 Step 5 (alt): Server returns error to client:
1754 <failure xmlns='urn:ietf:params:xml:ns:xmpp-sasl'>
1755 <incorrect-encoding/>
1759 Step 6: Client sends a [BASE64] encoded response to the challenge:
1761 <response xmlns='urn:ietf:params:xml:ns:xmpp-sasl'>
1762 dXNlcm5hbWU9InNvbWVub2RlIixyZWFsbT0ic29tZXJlYWxtIixub25jZT0i
1763 T0E2TUc5dEVRR20yaGgiLGNub25jZT0iT0E2TUhYaDZWcVRyUmsiLG5jPTAw
1764 MDAwMDAxLHFvcD1hdXRoLGRpZ2VzdC11cmk9InhtcHAvZXhhbXBsZS5jb20i
1765 LHJlc3BvbnNlPWQzODhkYWQ5MGQ0YmJkNzYwYTE1MjMyMWYyMTQzYWY3LGNo
1769 The decoded response is:
1771 username="somenode",realm="somerealm",\
1772 nonce="OA6MG9tEQGm2hh",cnonce="OA6MHXh6VqTrRk",\
1773 nc=00000001,qop=auth,digest-uri="xmpp/example.com",\
1774 response=d388dad90d4bbd760a152321f2143af7,charset=utf-8
1776 Step 7: Server sends another [BASE64] encoded challenge to client:
1778 <challenge xmlns='urn:ietf:params:xml:ns:xmpp-sasl'>
1779 cnNwYXV0aD1lYTQwZjYwMzM1YzQyN2I1NTI3Yjg0ZGJhYmNkZmZmZAo=
1782 The decoded challenge is:
1784 rspauth=ea40f60335c427b5527b84dbabcdfffd
1791 Saint-Andre Expires November 4, 2004 [Page 32]
1793 Internet-Draft XMPP Core May 2004
1796 Step 7 (alt): Server returns error to client:
1798 <failure xmlns='urn:ietf:params:xml:ns:xmpp-sasl'>
1799 <temporary-auth-failure/>
1803 Step 8: Client responds to the challenge:
1805 <response xmlns='urn:ietf:params:xml:ns:xmpp-sasl'/>
1807 Step 9: Server informs client of successful authentication:
1809 <success xmlns='urn:ietf:params:xml:ns:xmpp-sasl'/>
1811 Step 9 (alt): Server informs client of failed authentication:
1813 <failure xmlns='urn:ietf:params:xml:ns:xmpp-sasl'>
1814 <temporary-auth-failure/>
1818 Step 10: Client initiates a new stream to server:
1821 xmlns='jabber:client'
1822 xmlns:stream='http://etherx.jabber.org/streams'
1826 Step 11: Server responds by sending a stream header to client along
1827 with any additional features (or an empty features element):
1830 xmlns='jabber:client'
1831 xmlns:stream='http://etherx.jabber.org/streams'
1836 <bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'/>
1837 <session xmlns='urn:ietf:params:xml:ns:xmpp-session'/>
1841 6.6 Server-to-Server Example
1843 The following example shows the data flow for a server authenticating
1847 Saint-Andre Expires November 4, 2004 [Page 33]
1849 Internet-Draft XMPP Core May 2004
1852 with another server using SASL, normally after successful TLS
1853 negotiation (note: the alternate steps shown below are provided to
1854 illustrate the protocol for failure cases; they are not exhaustive
1855 and would not necessarily be triggered by the data sent in the
1858 Step 1: Server1 initiates stream to Server2:
1861 xmlns='jabber:server'
1862 xmlns:stream='http://etherx.jabber.org/streams'
1866 Step 2: Server2 responds with a stream tag sent to Server1:
1869 xmlns='jabber:server'
1870 xmlns:stream='http://etherx.jabber.org/streams'
1875 Step 3: Server2 informs Server1 of available authentication
1879 <mechanisms xmlns='urn:ietf:params:xml:ns:xmpp-sasl'>
1880 <mechanism>DIGEST-MD5</mechanism>
1881 <mechanism>KERBEROS_V4</mechanism>
1885 Step 4: Server1 selects an authentication mechanism:
1887 <auth xmlns='urn:ietf:params:xml:ns:xmpp-sasl'
1888 mechanism='DIGEST-MD5'/>
1890 Step 5: Server2 sends a [BASE64] encoded challenge to Server1:
1892 <challenge xmlns='urn:ietf:params:xml:ns:xmpp-sasl'>
1893 cmVhbG09InNvbWVyZWFsbSIsbm9uY2U9Ik9BNk1HOXRFUUdtMmhoIixxb3A9
1894 ImF1dGgiLGNoYXJzZXQ9dXRmLTgsYWxnb3JpdGhtPW1kNS1zZXNz
1897 The decoded challenge is:
1899 realm="somerealm",nonce="OA6MG9tEQGm2hh",\
1903 Saint-Andre Expires November 4, 2004 [Page 34]
1905 Internet-Draft XMPP Core May 2004
1908 qop="auth",charset=utf-8,algorithm=md5-sess
1910 Step 5 (alt): Server2 returns error to Server1:
1912 <failure xmlns='urn:ietf:params:xml:ns:xmpp-sasl'>
1913 <incorrect-encoding/>
1917 Step 6: Server1 sends a [BASE64] encoded response to the challenge:
1919 <response xmlns='urn:ietf:params:xml:ns:xmpp-sasl'>
1920 dXNlcm5hbWU9ImV4YW1wbGUub3JnIixyZWFsbT0ic29tZXJlYWxtIixub25j
1921 ZT0iT0E2TUc5dEVRR20yaGgiLGNub25jZT0iT0E2TUhYaDZWcVRyUmsiLG5j
1922 PTAwMDAwMDAxLHFvcD1hdXRoLGRpZ2VzdC11cmk9InhtcHAvZXhhbXBsZS5v
1923 cmciLHJlc3BvbnNlPWQzODhkYWQ5MGQ0YmJkNzYwYTE1MjMyMWYyMTQzYWY3
1924 LGNoYXJzZXQ9dXRmLTgK
1927 The decoded response is:
1929 username="example.org",realm="somerealm",\
1930 nonce="OA6MG9tEQGm2hh",cnonce="OA6MHXh6VqTrRk",\
1931 nc=00000001,qop=auth,digest-uri="xmpp/example.org",\
1932 response=d388dad90d4bbd760a152321f2143af7,charset=utf-8
1934 Step 7: Server2 sends another [BASE64] encoded challenge to Server1:
1936 <challenge xmlns='urn:ietf:params:xml:ns:xmpp-sasl'>
1937 cnNwYXV0aD1lYTQwZjYwMzM1YzQyN2I1NTI3Yjg0ZGJhYmNkZmZmZAo=
1940 The decoded challenge is:
1942 rspauth=ea40f60335c427b5527b84dbabcdfffd
1944 Step 7 (alt): Server2 returns error to Server1:
1946 <failure xmlns='urn:ietf:params:xml:ns:xmpp-sasl'>
1951 Step 8: Server1 responds to the challenge:
1953 <response xmlns='urn:ietf:params:xml:ns:xmpp-sasl'/>
1959 Saint-Andre Expires November 4, 2004 [Page 35]
1961 Internet-Draft XMPP Core May 2004
1964 Step 8 (alt): Server1 aborts negotiation:
1966 <abort xmlns='urn:ietf:params:xml:ns:xmpp-sasl'/>
1968 Step 9: Server2 informs Server1 of successful authentication:
1970 <success xmlns='urn:ietf:params:xml:ns:xmpp-sasl'/>
1972 Step 9 (alt): Server2 informs Server1 of failed authentication:
1974 <failure xmlns='urn:ietf:params:xml:ns:xmpp-sasl'>
1979 Step 10: Server1 initiates a new stream to Server2:
1982 xmlns='jabber:server'
1983 xmlns:stream='http://etherx.jabber.org/streams'
1987 Step 11: Server2 responds by sending a stream header to Server1 along
1988 with any additional features (or an empty features element):
1991 xmlns='jabber:client'
1992 xmlns:stream='http://etherx.jabber.org/streams'
2001 After SASL negotiation (Section 6) with the receiving entity, the
2002 initiating entity MAY want or need to bind a specific resource to
2003 that stream. In general this applies only to clients: in order to
2004 conform to the addressing format (Section 3) and stanza delivery
2005 rules (Section 10) specified herein, there MUST be a resource
2006 identifier associated with the <node@domain> of the client (which is
2007 either generated by the server or provided by the client
2008 application); this ensures that the address for use over that stream
2009 is a "full JID" of the form <node@domain/resource>.
2011 Upon receiving a success indication within the SASL negotiation, the
2015 Saint-Andre Expires November 4, 2004 [Page 36]
2017 Internet-Draft XMPP Core May 2004
2020 client MUST send a new stream header to the server, to which the
2021 server MUST respond with a stream header as well as a list of
2022 available stream features. Specifically, if the server requires the
2023 client to bind a resource to the stream after successful SASL
2024 negotiation, it MUST include an empty <bind/> element qualified by
2025 the 'urn:ietf:params:xml:ns:xmpp-bind' namespace in the stream
2026 features list it presents to the client upon sending the header for
2027 the response stream sent after successful SASL negotiation (but not
2030 Server advertises resource binding feature to client:
2033 xmlns='jabber:client'
2034 xmlns:stream='http://etherx.jabber.org/streams'
2039 <bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'/>
2042 Upon being so informed that resource binding is required, the client
2043 MUST bind a resource to the stream by sending to the server an IQ
2044 stanza of type "set" (see IQ Semantics (Section 9.2.3)) containing
2045 data qualified by the 'urn:ietf:params:xml:ns:xmpp-bind' namespace.
2047 If the client wishes to allow the server to generate the resource
2048 identifier on its behalf, it sends an IQ stanza of type "set" that
2049 contains an empty <bind/> element:
2051 Client asks server to bind a resource:
2053 <iq type='set' id='bind_1'>
2054 <bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'/>
2057 A server that supports resource binding MUST be able to generate a
2058 resource identifier on behalf of a client. A resource identifier
2059 generated by the server MUST be unique for that <node@domain>.
2061 If the client wishes to specify the resource identifier, it sends an
2062 IQ stanza of type "set" that contains the desired resource identifier
2063 as the XML character data of a <resource/> element that is a child of
2064 the <bind/> element:
2071 Saint-Andre Expires November 4, 2004 [Page 37]
2073 Internet-Draft XMPP Core May 2004
2076 Client binds a resource:
2078 <iq type='set' id='bind_2'>
2079 <bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'>
2080 <resource>someresource</resource>
2084 Once the server has generated a resource identifier for the client or
2085 accepted the resource identifier provided by the client, it MUST
2086 return an IQ stanza of type "result" to the client, which MUST
2087 include a <jid/> child element that specifies the full JID for the
2088 connected resource as determined by the server:
2090 Server informs client of successful resource binding:
2092 <iq type='result' id='bind_2'>
2093 <bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'>
2094 <jid>somenode@example.com/someresource</jid>
2098 A server SHOULD accept the resource identifier provided by the
2099 client, but MAY override it with a resource identifier that the
2100 server generates; in this case, the server SHOULD NOT return a stanza
2101 error (e.g., <forbidden/>) to the client but instead SHOULD
2102 communicate the generated resource identifier to the client in the IQ
2103 result as shown above.
2105 When a client supplies a resource identifier, the following stanza
2106 error conditions are possible (see Stanza Errors (Section 9.3)):
2108 o The provided resource identifier cannot be processed by the server
2109 in accordance with Resourceprep (Appendix B).
2110 o The client is not allowed to bind a resource to the stream (e.g.,
2111 because the node or user has reached a limit on the number of
2112 connected resources allowed).
2113 o The provided resource identifier is already in use but the server
2114 does not allow binding of multiple connected resources with the
2117 The protocol for these error conditions is shown below.
2127 Saint-Andre Expires November 4, 2004 [Page 38]
2129 Internet-Draft XMPP Core May 2004
2132 Resource identifier cannot be processed:
2134 <iq type='error' id='bind_2'>
2135 <bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'>
2136 <resource>someresource</resource>
2138 <error type='modify'>
2139 <bad-request xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
2143 Client is not allowed to bind a resource:
2145 <iq type='error' id='bind_2'>
2146 <bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'>
2147 <resource>someresource</resource>
2149 <error type='cancel'>
2150 <not-allowed xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
2154 Resource identifier is in use:
2156 <iq type='error' id='bind_2'>
2157 <bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'>
2158 <resource>someresource</resource>
2160 <error type='cancel'>
2161 <conflict xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
2165 If, before completing the resource binding step, the client attempts
2166 to send an XML stanza other than an IQ stanza with a <bind/> child
2167 qualified by the 'urn:ietf:params:xml:ns:xmpp-bind' namespace, the
2168 server MUST NOT process the stanza and SHOULD return a
2169 <not-authorized/> stanza error to the client.
2175 The Jabber protocols from which XMPP was adapted include a "server
2176 dialback" method for protecting against domain spoofing, thus making
2177 it more difficult to spoof XML stanzas. Server dialback is not a
2178 security mechanism, and results in weak verification of server
2179 identities only (see Server-to-Server Communications (Section 14.4)
2183 Saint-Andre Expires November 4, 2004 [Page 39]
2185 Internet-Draft XMPP Core May 2004
2188 regarding this method's security characteristics). Domains requiring
2189 robust security SHOULD use TLS and SASL; see Server-to-Server
2190 Communications (Section 14.4) for details. If SASL is used for
2191 server-to-server authentication, dialback SHOULD NOT be used since it
2192 is unnecessary. Documentation of dialback is included mainly for the
2193 sake of backward-compatibility with existing implementations and
2196 The server dialback method is made possible by the existence of the
2197 Domain Name System (DNS), since one server can (normally) discover
2198 the authoritative server for a given domain. Because dialback
2199 depends on DNS, inter-domain communications MUST NOT proceed until
2200 the Domain Name System (DNS) hostnames asserted by the servers have
2201 been resolved (see Server-to-Server Communications (Section 14.4)).
2203 Server dialback is uni-directional, and results in (weak)
2204 verification of identities for one stream in one direction. Because
2205 server dialback is not an authentication mechanism, mutual
2206 authentication is not possible via dialback. Therefore server
2207 dialback MUST be completed in each direction in order to enable
2208 bi-directional communications between two domains.
2210 The method for generating and verifying the keys used in server
2211 dialback MUST take into account the hostnames being used, the stream
2212 ID generated by the receiving server, and a secret known by the
2213 authoritative server's network. The stream ID is security-critical
2214 in server dialback and therefore MUST be both unpredictable and
2215 non-repeating (see [RANDOM] for recommendations regarding randomness
2216 for security purposes).
2218 Any error that occurs during dialback negotiation MUST be considered
2219 a stream error, resulting in termination of the stream and of the
2220 underlying TCP connection. The possible error conditions are
2221 specified in the protocol description below.
2223 The following terminology applies:
2225 o Originating Server -- the server that is attempting to establish a
2226 connection between two domains.
2227 o Receiving Server -- the server that is trying to authenticate that
2228 Originating Server represents the domain which it claims to be.
2229 o Authoritative Server -- the server that answers to the DNS
2230 hostname asserted by Originating Server; for basic environments
2231 this will be Originating Server, but it could be a separate
2232 machine in Originating Server's network.
2239 Saint-Andre Expires November 4, 2004 [Page 40]
2241 Internet-Draft XMPP Core May 2004
2246 The following is a brief summary of the order of events in dialback:
2248 1. Originating Server establishes a connection to Receiving Server.
2249 2. Originating Server sends a 'key' value over the connection to
2251 3. Receiving Server establishes a connection to Authoritative
2253 4. Receiving Server sends the same 'key' value to Authoritative
2255 5. Authoritative Server replies that key is valid or invalid.
2256 6. Receiving Server informs Originating Server whether it is
2257 authenticated or not.
2259 We can represent this flow of events graphically as follows:
2295 Saint-Andre Expires November 4, 2004 [Page 41]
2297 Internet-Draft XMPP Core May 2004
2300 Originating Receiving
2302 ----------- ---------
2304 | establish connection |
2305 | ----------------------> |
2307 | send stream header |
2308 | ----------------------> |
2310 | send stream header |
2311 | <---------------------- |
2313 | send dialback key | Server
2314 | ----------------------> | -------------
2316 | establish connection |
2317 | ----------------------> |
2319 | send stream header |
2320 | ----------------------> |
2322 | send stream header |
2323 | <---------------------- |
2325 | send verify request |
2326 | ----------------------> |
2328 | send verify response |
2329 | <---------------------- |
2331 | report dialback result |
2332 | <---------------------- |
2338 The detailed protocol interaction between the servers is as follows:
2340 1. Originating Server establishes TCP connection to Receiving
2342 2. Originating Server sends a stream header to Receiving Server:
2351 Saint-Andre Expires November 4, 2004 [Page 42]
2353 Internet-Draft XMPP Core May 2004
2357 xmlns:stream='http://etherx.jabber.org/streams'
2358 xmlns='jabber:server'
2359 xmlns:db='jabber:server:dialback'>
2361 Note: The 'to' and 'from' attributes are OPTIONAL on the root
2362 stream element. The inclusion of the xmlns:db namespace
2363 declaration with the name shown indicates to Receiving Server
2364 that Originating Server supports dialback. If the namespace
2365 name is incorrect, then Receiving Server MUST generate an
2366 <invalid-namespace/> stream error condition and terminate both
2367 the XML stream and the underlying TCP connection.
2368 3. Receiving Server SHOULD send a stream header back to Originating
2369 Server, including a unique ID for this interaction:
2372 xmlns:stream='http://etherx.jabber.org/streams'
2373 xmlns='jabber:server'
2374 xmlns:db='jabber:server:dialback'
2377 Note: The 'to' and 'from' attributes are OPTIONAL on the root
2378 stream element. If the namespace name is incorrect, then
2379 Originating Server MUST generate an <invalid-namespace/> stream
2380 error condition and terminate both the XML stream and the
2381 underlying TCP connection. Note well that Receiving Server
2382 SHOULD reply but MAY silently terminate the XML stream and
2383 underlying TCP connection depending on security policies in
2384 place; however, if Receiving Server desires to proceed, it MUST
2385 send a stream header back to Originating Server.
2386 4. Originating Server sends a dialback key to Receiving Server:
2389 to='Receiving Server'
2390 from='Originating Server'>
2394 Note: This key is not examined by Receiving Server, since
2395 Receiving Server does not keep information about Originating
2396 Server between sessions. The key generated by Originating
2397 Server MUST be based in part on the value of the ID provided by
2398 Receiving Server in the previous step, and in part on a secret
2399 shared by Originating Server and Authoritative Server. If the
2400 value of the 'to' address does not match a hostname recognized
2401 by Receiving Server, then Receiving Server MUST generate a
2402 <host-unknown/> stream error condition and terminate both the
2403 XML stream and the underlying TCP connection. If the value of
2407 Saint-Andre Expires November 4, 2004 [Page 43]
2409 Internet-Draft XMPP Core May 2004
2412 the 'from' address matches a domain with which Receiving Server
2413 already has an established connection, then Receiving Server
2414 MUST maintain the existing connection until it validates whether
2415 the new connection is legitimate; additionally, Receiving Server
2416 MAY choose to generate a <not-authorized/> stream error
2417 condition for the new connection and then terminate both the XML
2418 stream and the underlying TCP connection related to the new
2420 5. Receiving Server establishes a TCP connection back to the domain
2421 name asserted by Originating Server, as a result of which it
2422 connects to Authoritative Server. (Note: As an optimization, an
2423 implementation MAY reuse an existing connection here.)
2424 6. Receiving Server sends Authoritative Server a stream header:
2427 xmlns:stream='http://etherx.jabber.org/streams'
2428 xmlns='jabber:server'
2429 xmlns:db='jabber:server:dialback'>
2431 Note: The 'to' and 'from' attributes are OPTIONAL on the root
2432 stream element. If the namespace name is incorrect, then
2433 Authoritative Server MUST generate an <invalid-namespace/>
2434 stream error condition and terminate both the XML stream and the
2435 underlying TCP connection.
2436 7. Authoritative Server sends Receiving Server a stream header:
2439 xmlns:stream='http://etherx.jabber.org/streams'
2440 xmlns='jabber:server'
2441 xmlns:db='jabber:server:dialback'
2444 Note: If the namespace name is incorrect, then Receiving Server
2445 MUST generate an <invalid-namespace/> stream error condition and
2446 terminate both the XML stream and the underlying TCP connection
2447 between it and Authoritative Server. If a stream error occurs
2448 between Receiving Server and Authoritative Server, then
2449 Receiving Server MUST generate a <remote-connection-failed/>
2450 stream error condition and terminate both the XML stream and the
2451 underlying TCP connection between it and Originating Server.
2452 8. Receiving Server sends Authoritative Server a request for
2453 verification of a key:
2463 Saint-Andre Expires November 4, 2004 [Page 44]
2465 Internet-Draft XMPP Core May 2004
2469 from='Receiving Server'
2470 to='Originating Server'
2475 Note: Passed here are the hostnames, the original identifier
2476 from Receiving Server's stream header to Originating Server in
2477 Step 3, and the key that Originating Server sent to Receiving
2478 Server in Step 4. Based on this information as well as shared
2479 secret information within the Authoritative Server's network,
2480 the key is verified. Any verifiable method MAY be used to
2481 generate the key. If the value of the 'to' address does not
2482 match a hostname recognized by Authoritative Server, then
2483 Authoritative Server MUST generate a <host-unknown/> stream
2484 error condition and terminate both the XML stream and the
2485 underlying TCP connection. If the value of the 'from' address
2486 does not match the hostname represented by Receiving Server when
2487 opening the TCP connection (or any validated domain thereof,
2488 such as a validated subdomain of Receiving Server's hostname or
2489 another validated domain hosted by Receiving Server), then
2490 Authoritative Server MUST generate an <invalid-from/> stream
2491 error condition and terminate both the XML stream and the
2492 underlying TCP connection.
2493 9. Authoritative Server verifies whether the key was valid or
2497 from='Originating Server'
2498 to='Receiving Server'
2500 id='457F9224A0...'/>
2505 from='Originating Server'
2506 to='Receiving Server'
2508 id='457F9224A0...'/>
2510 Note: If the ID does not match that provided by Receiving Server
2511 in Step 3, then Receiving Server MUST generate an <invalid-id/>
2512 stream error condition and terminate both the XML stream and the
2513 underlying TCP connection. If the value of the 'to' address
2514 does not match a hostname recognized by Receiving Server, then
2515 Receiving Server MUST generate a <host-unknown/> stream error
2519 Saint-Andre Expires November 4, 2004 [Page 45]
2521 Internet-Draft XMPP Core May 2004
2524 condition and terminate both the XML stream and the underlying
2525 TCP connection. If the value of the 'from' address does not
2526 match the hostname represented by Originating Server when
2527 opening the TCP connection (or any validated domain thereof,
2528 such as a validated subdomain of Originating Server's hostname
2529 or another validated domain hosted by Originating Server), then
2530 Receiving Server MUST generate an <invalid-from/> stream error
2531 condition and terminate both the XML stream and the underlying
2532 TCP connection. After returning the verification to Receiving
2533 Server, Authoritative Server SHOULD terminate the stream between
2535 10. Receiving Server informs Originating Server of the result:
2538 from='Receiving Server'
2539 to='Originating Server'
2542 Note: At this point the connection has either been validated via
2543 a type='valid', or reported as invalid. If the connection is
2544 invalid, then Receiving Server MUST terminate both the XML
2545 stream and the underlying TCP connection. If the connection is
2546 validated, data can be sent by Originating Server and read by
2547 Receiving Server; before that, all XML stanzas sent to Receiving
2548 Server SHOULD be silently dropped.
2550 The result of the foregoing is that Receiving Server has verified the
2551 identity of Originating Server, so that Originating Server can send,
2552 and Receiving Server can accept, XML stanzas over the "initial
2553 stream" (i.e., the stream from Originating Server to Receiving
2554 Server). In order to verify the identities of the entities using the
2555 "response stream" (i.e., the stream from Receiving Server to
2556 Originating Server), dialback MUST be completed in the opposite
2559 After successful dialback negotiation, Receiving Server SHOULD accept
2560 subsequent <db:result/> packets (e.g., validation requests sent to a
2561 subdomain or other hostname serviced by Receiving Server) from the
2562 Originating Server over the existing validated connection; this
2563 enables "piggybacking" of the original validated connection in one
2566 Even if dialback negotiation is successful, a server MUST verify that
2567 all XML stanzas received from the other server include a 'from'
2568 attribute and a 'to' attribute; if a stanza does not meet this
2569 restriction, the server that receives the stanza MUST generate an
2570 <improper-addressing/> stream error condition and terminate both the
2571 XML stream and the underlying TCP connection. Furthermore, a server
2575 Saint-Andre Expires November 4, 2004 [Page 46]
2577 Internet-Draft XMPP Core May 2004
2580 MUST verify that the 'from' attribute of stanzas received from the
2581 other server includes a validated domain for the stream; if a stanza
2582 does not meet this restriction, the server that receives the stanza
2583 MUST generate an <invalid-from/> stream error condition and terminate
2584 both the XML stream and the underlying TCP connection. Both of these
2585 checks help to prevent spoofing related to particular stanzas.
2589 After TLS negotiation (Section 5) if desired, SASL negotiation
2590 (Section 6), and Resource Binding (Section 7) if necessary, XML
2591 stanzas can be sent over the streams. Three kinds of XML stanza are
2592 defined for the 'jabber:client' and 'jabber:server' namespaces:
2593 <message/>, <presence/>, and <iq/>. In addition, there are five
2594 common attributes for these kinds of stanza. These common
2595 attributes, as well as the basic semantics of the three stanza kinds,
2596 are defined herein; more detailed information regarding the syntax of
2597 XML stanzas in relation to instant messaging and presence
2598 applications is provided in [XMPP-IM].
2600 9.1 Common Attributes
2602 The following five attributes are common to message, presence, and IQ
2607 The 'to' attribute specifies the JID of the intended recipient for
2610 In the 'jabber:client' namespace, a stanza SHOULD possess a 'to'
2611 attribute, although a stanza sent from a client to a server for
2612 handling by that server (e.g., presence sent to the server for
2613 broadcasting to other entities) SHOULD NOT possess a 'to' attribute.
2615 In the 'jabber:server' namespace, a stanza MUST possess a 'to'
2616 attribute; if a server receives a stanza that does not meet this
2617 restriction, it MUST generate an <improper-addressing/> stream error
2618 condition and terminate both the XML stream and the underlying TCP
2619 connection with the offending server.
2621 If the value of the 'to' attribute is invalid or cannot be contacted,
2622 the entity discovering that fact (usually the sender's or recipient's
2623 server) MUST return an appropriate error to the sender, setting the
2624 'from' attribute of the error stanza to the value provided in the
2625 'to' attribute of the offending stanza.
2631 Saint-Andre Expires November 4, 2004 [Page 47]
2633 Internet-Draft XMPP Core May 2004
2638 The 'from' attribute specifies the JID of the sender.
2640 When a server receives an XML stanza within the context of an
2641 authenticated stream qualified by the 'jabber:client' namespace, it
2642 MUST do one of the following:
2643 1. validate that the value of the 'from' attribute provided by the
2644 client is that of a connected resource for the associated entity
2645 2. add a 'from' address to the stanza whose value is the bare JID
2646 (<node@domain>) or the full JID (<node@domain/resource>)
2647 determined by the server for the connected resource that
2648 generated the stanza (see Determination of Addresses (Section
2651 If a client attempts to send an XML stanza for which the value of the
2652 'from' attribute does not match one of the connected resources for
2653 that entity, the server SHOULD return an <invalid-from/> stream error
2654 to the client. If a client attempts to send an XML stanza over a
2655 stream that is not yet authenticated, the server SHOULD return a
2656 <not-authorized/> stream error to the client. If generated, both of
2657 these conditions MUST result in closing of the stream and termination
2658 of the underlying TCP connection; this helps to prevent a denial of
2659 service attack launched from a rogue client.
2661 When a server generates a stanza from the server itself for delivery
2662 to a connected client (e.g., in the context of data storage services
2663 provided by the server on behalf of the client), the stanza MUST
2664 either (1) not include a 'from' attribute or (2) include a 'from'
2665 attribute whose value is the account's bare JID (<node@domain>) or
2666 client's full JID (<node@domain/resource>). A server MUST NOT send
2667 to the client a stanza without a 'from' attribute if the stanza was
2668 not generated by the server itself. When a client receives a stanza
2669 that does not include a 'from' attribute, it MUST assume that the
2670 stanza is from the server to which the client is connected.
2672 In the 'jabber:server' namespace, a stanza MUST possess a 'from'
2673 attribute; if a server receives a stanza that does not meet this
2674 restriction, it MUST generate an <improper-addressing/> stream error
2675 condition. Furthermore, the domain identifier portion of the JID
2676 contained in the 'from' attribute MUST match the hostname of the
2677 sending server (or any validated domain thereof, such as a validated
2678 subdomain of the sending server's hostname or another validated
2679 domain hosted by the sending server) as communicated in the SASL
2680 negotiation or dialback negotiation; if a server receives a stanza
2681 that does not meet this restriction, it MUST generate an
2682 <invalid-from/> stream error condition. Both of these conditions
2683 MUST result in closing of the stream and termination of the
2687 Saint-Andre Expires November 4, 2004 [Page 48]
2689 Internet-Draft XMPP Core May 2004
2692 underlying TCP connection; this helps to prevent a denial of service
2693 attack launched from a rogue server.
2697 The optional 'id' attribute MAY be used by a sending entity for
2698 internal tracking of stanzas that it sends and receives (especially
2699 for tracking the request-response interaction inherent in the
2700 semantics of IQ stanzas). It is OPTIONAL for the value of the 'id'
2701 attribute to be unique globally, within a domain, or within a stream.
2702 The semantics of IQ stanzas impose additional restrictions; see IQ
2703 Semantics (Section 9.2.3).
2707 The 'type' attribute specifies detailed information about the purpose
2708 or context of the message, presence, or IQ stanza. The particular
2709 allowable values for the 'type' attribute vary depending on whether
2710 the stanza is a message, presence, or IQ; the values for message and
2711 presence stanzas are specific to instant messaging and presence
2712 applications and therefore are defined in [XMPP-IM], whereas the
2713 values for IQ stanzas specify the role of an IQ stanza in a
2714 structured request-response "conversation" and thus are defined under
2715 IQ Semantics (Section 9.2.3) below. The only 'type' value common to
2716 all three stanzas is "error", for which see Stanza Errors (Section
2721 A stanza SHOULD possess an 'xml:lang' attribute (as defined in
2722 Section 2.12 of [XML]) if the stanza contains XML character data that
2723 is intended to be presented to a human user (as explained in RFC 2277
2724 [CHARSET], "internationalization is for humans"). The value of the
2725 'xml:lang' attribute specifies the default language of any such
2726 human-readable XML character data, which MAY be overridden by the
2727 'xml:lang' attribute of a specific child element. If a stanza does
2728 not possess an 'xml:lang' attribute, an implementation MUST assume
2729 that the default language is that specified for the stream as defined
2730 under Stream Attributes (Section 4.4) above. The value of the
2731 'xml:lang' attribute MUST be an NMTOKEN and MUST conform to the
2732 format defined in RFC 3066 [LANGTAGS].
2736 9.2.1 Message Semantics
2738 The <message/> stanza kind can be seen as a "push" mechanism whereby
2739 one entity pushes information to another entity, similar to the
2743 Saint-Andre Expires November 4, 2004 [Page 49]
2745 Internet-Draft XMPP Core May 2004
2748 communications that occur in a system such as email. All message
2749 stanzas SHOULD possess a 'to' attribute that specifies the intended
2750 recipient of the message; upon receiving such a stanza, a server
2751 SHOULD route or deliver it to the intended recipient (see Server
2752 Rules for Handling XML Stanzas (Section 10) for general routing and
2753 delivery rules related to XML stanzas).
2755 9.2.2 Presence Semantics
2757 The <presence/> element can be seen as a basic broadcast or
2758 "publish-subscribe" mechanism, whereby multiple entities receive
2759 information about an entity to which they have subscribed (in this
2760 case, network availability information). In general, a publishing
2761 entity SHOULD send a presence stanza with no 'to' attribute, in which
2762 case the server to which the entity is connected SHOULD broadcast or
2763 multiplex that stanza to all subscribing entities. However, a
2764 publishing entity MAY also send a presence stanza with a 'to'
2765 attribute, in which case the server SHOULD route or deliver that
2766 stanza to the intended recipient. See Server Rules for Handling XML
2767 Stanzas (Section 10) for general routing and delivery rules related
2768 to XML stanzas, and [XMPP-IM] for presence-specific rules in the
2769 context of an instant messaging and presence application.
2773 Info/Query, or IQ, is a request-response mechanism, similar in some
2774 ways to [HTTP]. The semantics of IQ enable an entity to make a
2775 request of, and receive a response from, another entity. The data
2776 content of the request and response is defined by the namespace
2777 declaration of a direct child element of the IQ element, and the
2778 interaction is tracked by the requesting entity through use of the
2779 'id' attribute. Thus IQ interactions follow a common pattern of
2780 structured data exchange such as get/result or set/result (although
2781 an error may be returned in reply to a request if appropriate):
2799 Saint-Andre Expires November 4, 2004 [Page 50]
2801 Internet-Draft XMPP Core May 2004
2804 Requesting Responding
2806 ---------- ----------
2808 | <iq type='get' id='1'> |
2809 | ------------------------> |
2811 | <iq type='result' id='1'> |
2812 | <------------------------ |
2814 | <iq type='set' id='2'> |
2815 | ------------------------> |
2817 | <iq type='error' id='2'> |
2818 | <------------------------ |
2821 In order to enforce these semantics, the following rules apply:
2823 1. The 'id' attribute is REQUIRED for IQ stanzas.
2824 2. The 'type' attribute is REQUIRED for IQ stanzas. The value MUST
2825 be one of the following:
2826 * get -- The stanza is a request for information or
2828 * set -- The stanza provides required data, sets new values, or
2829 replaces existing values.
2830 * result -- The stanza is a response to a successful get or set
2832 * error -- An error has occurred regarding processing or
2833 delivery of a previously-sent get or set (see Stanza Errors
2835 3. An entity that receives an IQ request of type "get" or "set" MUST
2836 reply with an IQ response of type "result" or "error" (which
2837 response MUST preserve the 'id' attribute of the request).
2838 4. An entity that receives a stanza of type "result" or "error" MUST
2839 NOT respond to the stanza by sending a further IQ response of
2840 type "result" or "error"; however, as shown above, the requesting
2841 entity MAY send another request (e.g., an IQ of type "set" in
2842 order to provide required information discovered through a get/
2844 5. An IQ stanza of type "get" or "set" MUST contain one and only one
2845 child element that specifies the semantics of the particular
2846 request or response.
2847 6. An IQ stanza of type "result" MUST include zero or one child
2849 7. An IQ stanza of type "error" SHOULD include the child element
2850 contained in the associated "get" or "set" and MUST include an
2851 <error/> child; for details, see Stanza Errors (Section 9.3).
2855 Saint-Andre Expires November 4, 2004 [Page 51]
2857 Internet-Draft XMPP Core May 2004
2862 Stanza-related errors are handled in a manner similar to stream
2863 errors (Section 4.7). However, unlike stream errors, stanza errors
2864 are recoverable; therefore error stanzas include hints regarding
2865 actions that the original sender can take in order to remedy the
2870 The following rules apply to stanza-related errors:
2872 o The receiving or processing entity that detects an error condition
2873 in relation to a stanza MUST return to the sending entity a stanza
2874 of the same kind (message, presence, or IQ) whose 'type' attribute
2875 is set to a value of "error" (such a stanza is called an "error
2877 o The entity that generates an error stanza SHOULD include the
2878 original XML sent so that the sender can inspect and if necessary
2879 correct the XML before attempting to resend.
2880 o An error stanza MUST contain an <error/> child element.
2881 o An <error/> child MUST NOT be included if the 'type' attribute has
2882 a value other than "error" (or if there is no 'type' attribute).
2883 o An entity that receives an error stanza MUST NOT respond to the
2884 stanza with a further error stanza; this helps to prevent looping.
2888 The syntax for stanza-related errors is as follows:
2890 <stanza-kind to='sender' type='error'>
2891 [RECOMMENDED to include sender XML here]
2892 <error type='error-type'>
2893 <defined-condition xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
2894 <text xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'
2895 xml:lang='langcode'>
2896 OPTIONAL descriptive text
2898 [OPTIONAL application-specific condition element]
2902 The stanza-kind is one of message, presence, or iq.
2904 The value of the <error/> element's 'type' attribute MUST be one of
2911 Saint-Andre Expires November 4, 2004 [Page 52]
2913 Internet-Draft XMPP Core May 2004
2916 o cancel -- do not retry (the error is unrecoverable)
2917 o continue -- proceed (the condition was only a warning)
2918 o modify -- retry after changing the data sent
2919 o auth -- retry after providing credentials
2920 o wait -- retry after waiting (the error is temporary)
2922 The <error/> element:
2924 o MUST contain a child element corresponding to one of the defined
2925 stanza error conditions specified below; this element MUST be
2926 qualified by the 'urn:ietf:params:xml:ns:xmpp-stanzas' namespace.
2927 o MAY contain a <text/> child containing XML character data that
2928 describes the error in more detail; this element MUST be qualified
2929 by the 'urn:ietf:params:xml:ns:xmpp-stanzas' namespace and SHOULD
2930 possess an 'xml:lang' attribute.
2931 o MAY contain a child element for an application-specific error
2932 condition; this element MUST be qualified by an
2933 application-defined namespace, and its structure is defined by
2936 The <text/> element is OPTIONAL. If included, it SHOULD be used only
2937 to provide descriptive or diagnostic information that supplements the
2938 meaning of a defined condition or application-specific condition. It
2939 SHOULD NOT be interpreted programmatically by an application. It
2940 SHOULD NOT be used as the error message presented to a user, but MAY
2941 be shown in addition to the error message associated with the
2942 included condition element (or elements).
2944 Finally, to maintain backward compatibility, the schema (specified in
2945 [XMPP-IM]) allows the optional inclusion of a 'code' attribute on the
2948 9.3.3 Defined Conditions
2950 The following conditions are defined for use in stanza errors.
2952 o <bad-request/> -- the sender has sent XML that is malformed or
2953 that cannot be processed (e.g., an IQ stanza that includes an
2954 unrecognized value of the 'type' attribute); the associated error
2955 type SHOULD be "modify".
2956 o <conflict/> -- access cannot be granted because an existing
2957 resource or session exists with the same name or address; the
2958 associated error type SHOULD be "cancel".
2959 o <feature-not-implemented/> -- the feature requested is not
2960 implemented by the recipient or server and therefore cannot be
2961 processed; the associated error type SHOULD be "cancel".
2962 o <forbidden/> -- the requesting entity does not possess the
2963 required permissions to perform the action; the associated error
2967 Saint-Andre Expires November 4, 2004 [Page 53]
2969 Internet-Draft XMPP Core May 2004
2972 type SHOULD be "auth".
2973 o <gone/> -- the recipient or server can no longer be contacted at
2974 this address (the error stanza MAY contain a new address in the
2975 XML character data of the <gone/> element); the associated error
2976 type SHOULD be "modify".
2977 o <internal-server-error/> -- the server could not process the
2978 stanza because of a misconfiguration or an otherwise-undefined
2979 internal server error; the associated error type SHOULD be "wait".
2980 o <item-not-found/> -- the addressed JID or item requested cannot be
2981 found; the associated error type SHOULD be "cancel".
2982 o <jid-malformed/> -- the sending entity has provided or
2983 communicated an XMPP address (e.g., a value of the 'to' attribute)
2984 or aspect thereof (e.g., a resource identifier) that does not
2985 adhere to the syntax defined in Addressing Scheme (Section 3); the
2986 associated error type SHOULD be "modify".
2987 o <not-acceptable/> -- the recipient or server understands the
2988 request but is refusing to process it because it does not meet
2989 criteria defined by the recipient or server (e.g., a local policy
2990 regarding acceptable words in messages); the associated error type
2992 o <not-allowed/> -- the recipient or server does not allow any
2993 entity to perform the action; the associated error type SHOULD be
2995 o <not-authorized/> -- the sender must provide proper credentials
2996 before being allowed to perform the action, or has provided
2997 improper credentials; the associated error type SHOULD be "auth".
2998 o <payment-required/> -- the requesting entity is not authorized to
2999 access the requested service because payment is required; the
3000 associated error type SHOULD be "auth".
3001 o <recipient-unavailable/> -- the intended recipient is temporarily
3002 unavailable; the associated error type SHOULD be "wait" (note: an
3003 application MUST NOT return this error if doing so would provide
3004 information about the intended recipient's network availability to
3005 an entity that is not authorized to know such information).
3006 o <redirect/> -- the recipient or server is redirecting requests for
3007 this information to another entity, usually temporarily (the error
3008 stanza SHOULD contain the alternate address, which MUST be a valid
3009 JID, in the XML character data of the <redirect/> element); the
3010 associated error type SHOULD be "modify".
3011 o <registration-required/> -- the requesting entity is not
3012 authorized to access the requested service because registration is
3013 required; the associated error type SHOULD be "auth".
3014 o <remote-server-not-found/> -- a remote server or service specified
3015 as part or all of the JID of the intended recipient does not
3016 exist; the associated error type SHOULD be "cancel".
3017 o <remote-server-timeout/> -- a remote server or service specified
3018 as part or all of the JID of the intended recipient (or required
3019 to fulfill a request) could not be contacted within a reasonable
3023 Saint-Andre Expires November 4, 2004 [Page 54]
3025 Internet-Draft XMPP Core May 2004
3028 amount of time; the associated error type SHOULD be "wait".
3029 o <resource-constraint/> -- the server or recipient lacks the system
3030 resources necessary to service the request; the associated error
3031 type SHOULD be "wait".
3032 o <service-unavailable/> -- the server or recipient does not
3033 currently provide the requested service; the associated error type
3035 o <subscription-required/> -- the requesting entity is not
3036 authorized to access the requested service because a subscription
3037 is required; the associated error type SHOULD be "auth".
3038 o <undefined-condition/> -- the error condition is not one of those
3039 defined by the other conditions in this list; any error type may
3040 be associated with this condition, and it SHOULD be used only in
3041 conjunction with an application-specific condition.
3042 o <unexpected-request/> -- the recipient or server understood the
3043 request but was not expecting it at this time (e.g., the request
3044 was out of order); the associated error type SHOULD be "wait".
3046 9.3.4 Application-Specific Conditions
3048 As noted, an application MAY provide application-specific stanza
3049 error information by including a properly-namespaced child in the
3050 error element. The application-specific element SHOULD supplement or
3051 further qualify a defined element. Thus the <error/> element will
3052 contain two or three child elements:
3054 <iq type='error' id='some-id'>
3055 <error type='modify'>
3056 <bad-request xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
3057 <too-many-parameters xmlns='application-ns'/>
3062 <message type='error' id='another-id'>
3063 <error type='modify'>
3064 <undefined-condition
3065 xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
3067 xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'>
3068 Some special application diagnostic information...
3070 <special-application-condition xmlns='application-ns'/>
3079 Saint-Andre Expires November 4, 2004 [Page 55]
3081 Internet-Draft XMPP Core May 2004
3084 10. Server Rules for Handling XML Stanzas
3086 Compliant server implementations MUST ensure in-order processing of
3087 XML stanzas between any two entities.
3089 Beyond the requirement for in-order processing, each server
3090 implementation will contain its own "delivery tree" for handling
3091 stanzas it receives. Such a tree determines whether a stanza needs
3092 to be routed to another domain, processed internally, or delivered to
3093 a resource associated with a connected node. The following rules
3096 10.1 No 'to' Address
3098 If the stanza possesses no 'to' attribute, the server SHOULD process
3099 it on behalf of the entity that sent it. Because all stanzas
3100 received from other servers MUST possess a 'to' attribute, this rule
3101 applies only to stanzas received from a registered entity (such as a
3102 client) that is connected to the server. If the server receives a
3103 presence stanza with no 'to' attribute, the server SHOULD broadcast
3104 it to the entities that are subscribed to the sending entity's
3105 presence, if applicable (the semantics of presence broadcast for
3106 instant messaging and presence applications are defined in
3107 [XMPP-IM]). If the server receives an IQ stanza of type "get" or
3108 "set" with no 'to' attribute and it understands the namespace that
3109 qualifies the content of the stanza, it MUST either process the
3110 stanza on behalf of sending entity (where the meaning of "process" is
3111 determined by the semantics of the qualifying namespace) or return an
3112 error to the sending entity.
3116 If the hostname of the domain identifier portion of the JID contained
3117 in the 'to' attribute does not match one of the configured hostnames
3118 of the server itself or a subdomain thereof, the server SHOULD route
3119 the stanza to the foreign domain (subject to local service
3120 provisioning and security policies regarding inter-domain
3121 communication). There are two possible cases:
3123 A server-to-server stream already exists between the two domains: The
3124 sender's server routes the stanza to the authoritative server for
3125 the foreign domain over the existing stream
3126 There exists no server-to-server stream between the two domains: The
3127 sender's server (1) resolves the hostname of the foreign domain
3128 (as defined under Server-to-Server Communications (Section 14.4)),
3129 (2) negotiates a server-to-server stream between the two domains
3130 (as defined under Use of TLS (Section 5) and Use of SASL (Section
3131 6)), and (3) routes the stanza to the authoritative server for the
3135 Saint-Andre Expires November 4, 2004 [Page 56]
3137 Internet-Draft XMPP Core May 2004
3140 foreign domain over the newly-established stream
3142 If routing to the recipient's server is unsuccessful, the sender's
3143 server MUST return an error to the sender; if the recipient's server
3144 can be contacted but delivery by the recipient's server to the
3145 recipient is unsuccessful, the recipient's server MUST return an
3146 error to the sender by way of the sender's server.
3150 If the hostname of the domain identifier portion of the JID contained
3151 in the 'to' attribute matches a subdomain of one of the configured
3152 hostnames of the server itself, the server MUST either process the
3153 stanza itself or route the stanza to a specialized service that is
3154 responsible for that subdomain (if the subdomain is configured), or
3155 return an error to the sender (if the subdomain is not configured).
3157 10.4 Mere Domain or Specific Resource
3159 If the hostname of the domain identifier portion of the JID contained
3160 in the 'to' attribute matches a configured hostname of the server
3161 itself and the JID contained in the 'to' attribute is of the form
3162 <domain> or <domain/resource>, the server (or a defined resource
3163 thereof) MUST either process the stanza as appropriate for the stanza
3164 kind or return an error stanza to the sender.
3166 10.5 Node in Same Domain
3168 If the hostname of the domain identifier portion of the JID contained
3169 in the 'to' attribute matches a configured hostname of the server
3170 itself and the JID contained in the 'to' attribute is of the form
3171 <node@domain> or <node@domain/resource>, the server SHOULD deliver
3172 the stanza to the intended recipient of the stanza as represented by
3173 the JID contained in the 'to' attribute. The following rules apply:
3175 1. If the JID contains a resource identifier (i.e., is of the form
3176 <node@domain/resource>) and there exists a connected resource
3177 that matches the full JID, the recipient's server SHOULD deliver
3178 the stanza to the stream or session that exactly matches the
3179 resource identifier.
3180 2. If the JID contains a resource identifier and there exists no
3181 connected resource that matches the full JID, the recipient's
3182 server SHOULD return a <service-unavailable/> stanza error to the
3184 3. If the JID is of the form <node@domain> and there exists at least
3185 one connected resource for the node, the recipient's server
3186 SHOULD deliver the stanza to at least one of the connected
3187 resources, according to application-specific rules (a set of
3191 Saint-Andre Expires November 4, 2004 [Page 57]
3193 Internet-Draft XMPP Core May 2004
3196 delivery rules for instant messaging and presence applications is
3197 defined in [XMPP-IM]).
3199 11. XML Usage within XMPP
3203 XMPP is a simplified and specialized protocol for streaming XML
3204 elements in order to exchange structured information in close to real
3205 time. Because XMPP does not require the parsing of arbitrary and
3206 complete XML documents, there is no requirement that XMPP needs to
3207 support the full feature set of [XML]. In particular, the following
3210 With regard to XML generation, an XMPP implementation MUST NOT inject
3211 into an XML stream any of the following:
3213 o comments (as defined in Section 2.5 of [XML])
3214 o processing instructions (Section 2.6 therein)
3215 o internal or external DTD subsets (Section 2.8 therein)
3216 o internal or external entity references (Section 4.2 therein) with
3217 the exception of predefined entities (Section 4.6 therein)
3218 o character data or attribute values containing unescaped characters
3219 that map to the predefined entities (Section 4.6 therein); such
3220 characters MUST be escaped
3222 With regard to XML processing, if an XMPP implementation receives
3223 such restricted XML data, it MUST ignore the data.
3225 11.2 XML Namespace Names and Prefixes
3227 XML Namespaces [XML-NAMES] are used within all XMPP-compliant XML to
3228 create strict boundaries of data ownership. The basic function of
3229 namespaces is to separate different vocabularies of XML elements that
3230 are structurally mixed together. Ensuring that XMPP-compliant XML is
3231 namespace-aware enables any allowable XML to be structurally mixed
3232 with any data element within XMPP. Rules for XML namespace names and
3233 prefixes are defined in the following subsections.
3235 11.2.1 Streams Namespace
3237 A streams namespace declaration is REQUIRED in all XML stream
3238 headers. The name of the streams namespace MUST be 'http://
3239 etherx.jabber.org/streams'. The element names of the <stream/>
3240 element and its <features/> and <error/> children MUST be qualified
3241 by the streams namespace prefix in all instances. An implementation
3242 SHOULD generate only the 'stream:' prefix for these elements, and for
3243 historical reasons MAY accept only the 'stream:' prefix.
3247 Saint-Andre Expires November 4, 2004 [Page 58]
3249 Internet-Draft XMPP Core May 2004
3252 11.2.2 Default Namespace
3254 A default namespace declaration is REQUIRED and is used in all XML
3255 streams in order to define the allowable first-level children of the
3256 root stream element. This namespace declaration MUST be the same for
3257 the initial stream and the response stream so that both streams are
3258 qualified consistently. The default namespace declaration applies to
3259 the stream and all stanzas sent within a stream (unless explicitly
3260 qualified by another namespace, or by the prefix of the streams
3261 namespace or the dialback namespace).
3263 A server implementation MUST support the following two default
3264 namespaces (for historical reasons, some implementations MAY support
3265 only these two default namespaces):
3267 o jabber:client -- this default namespace is declared when the
3268 stream is used for communications between a client and a server
3269 o jabber:server -- this default namespace is declared when the
3270 stream is used for communications between two servers
3272 A client implementation MUST support the 'jabber:client' default
3273 namespace, and for historical reasons MAY support only that default
3276 An implementation MUST NOT generate namespace prefixes for elements
3277 in the default namespace if the default namespace is 'jabber:client'
3278 or 'jabber:server'. An implementation SHOULD NOT generate namespace
3279 prefixes for elements qualified by content (as opposed to stream)
3280 namespaces other than 'jabber:client' and 'jabber:server'.
3282 Note: The 'jabber:client' and 'jabber:server' namespaces are nearly
3283 identical but are used in different contexts (client-to-server
3284 communications for 'jabber:client' and server-to-server
3285 communications for 'jabber:server'). The only difference between the
3286 two is that the 'to' and 'from' attributes are OPTIONAL on stanzas
3287 sent within 'jabber:client', whereas they are REQUIRED on stanzas
3288 sent within 'jabber:server'. If a compliant implementation accepts a
3289 stream that is qualified by the 'jabber:client' or 'jabber:server'
3290 namespace, it MUST support the common attributes (Section 9.1) and
3291 basic semantics (Section 9.2) of all three core stanza kinds
3292 (message, presence, and IQ).
3294 11.2.3 Dialback Namespace
3296 A dialback namespace declaration is REQUIRED for all elements used in
3297 server dialback (Section 8). The name of the dialback namespace MUST
3298 be 'jabber:server:dialback'. All elements qualified by this
3299 namespace MUST be prefixed. An implementation SHOULD generate only
3303 Saint-Andre Expires November 4, 2004 [Page 59]
3305 Internet-Draft XMPP Core May 2004
3308 the 'db:' prefix for such elements and MAY accept only the 'db:'
3313 Except as noted with regard to 'to' and 'from' addresses for stanzas
3314 within the 'jabber:server' namespace, a server is not responsible for
3315 validating the XML elements forwarded to a client or another server;
3316 an implementation MAY choose to provide only validated data elements
3317 but this is OPTIONAL (although an implementation MUST NOT accept XML
3318 that is not well-formed). Clients SHOULD NOT rely on the ability to
3319 send data which does not conform to the schemas, and SHOULD ignore
3320 any non-conformant elements or attributes on the incoming XML stream.
3321 Validation of XML streams and stanzas is OPTIONAL, and schemas are
3322 included herein for descriptive purposes only.
3324 11.4 Inclusion of Text Declaration
3326 Implementations SHOULD send a text declaration before sending a
3327 stream header. Applications MUST follow the rules in [XML] regarding
3328 the circumstances under which a text declaration is included.
3330 11.5 Character Encoding
3332 Implementations MUST support the UTF-8 (RFC 3269 [UTF-8])
3333 transformation of Universal Character Set (ISO/IEC 10646-1 [UCS2])
3334 characters, as required by RFC 2277 [CHARSET]. Implementations MUST
3335 NOT attempt to use any other encoding.
3337 12. Core Compliance Requirements
3339 This section summarizes the specific aspects of the Extensible
3340 Messaging and Presence Protocol that MUST be supported by servers and
3341 clients in order to be considered compliant implementations, as well
3342 as additional protocol aspects that SHOULD be supported. For
3343 compliance purposes, we draw a distinction between core protocols
3344 (which MUST be supported by any server or client, regardless of the
3345 specific application) and instant messaging protocols (which MUST be
3346 supported only by instant messaging and presence applications built
3347 on top of the core protocols). Compliance requirements that apply to
3348 all servers and clients are specified in this section; compliance
3349 requirements for instant messaging servers and clients are specified
3350 in the corresponding section of [XMPP-IM].
3354 In addition to all defined requirements with regard to security, XML
3355 usage, and internationalization, a server MUST support the following
3359 Saint-Andre Expires November 4, 2004 [Page 60]
3361 Internet-Draft XMPP Core May 2004
3364 core protocols in order to be considered compliant:
3366 o Application of the [NAMEPREP], Nodeprep (Appendix A), and
3367 Resourceprep (Appendix B) profiles of [STRINGPREP] to addresses
3368 (including ensuring that domain identifiers are internationalized
3369 domain names as defined in [IDNA])
3370 o XML streams (Section 4), including Use of TLS (Section 5), Use of
3371 SASL (Section 6), and Resource Binding (Section 7)
3372 o The basic semantics of the three defined stanza kinds (i.e.,
3373 <message/>, <presence/>, and <iq/>) as specified in stanza
3374 semantics (Section 9.2)
3375 o Generation (and, where appropriate, handling) of error syntax and
3376 semantics related to streams, TLS, SASL, and XML stanzas
3378 In addition, a server MAY support the following core protocol:
3380 o Server dialback (Section 8)
3384 A client MUST support the following core protocols in order to be
3385 considered compliant:
3387 o XML streams (Section 4), including Use of TLS (Section 5), Use of
3388 SASL (Section 6), and Resource Binding (Section 7)
3389 o The basic semantics of the three defined stanza kinds (i.e.,
3390 <message/>, <presence/>, and <iq/>) as specified in stanza
3391 semantics (Section 9.2)
3392 o Handling (and, where appropriate, generation) of error syntax and
3393 semantics related to streams, TLS, SASL, and XML stanzas
3395 In addition, a client SHOULD support the following core protocols:
3397 o Generation of addresses to which the [NAMEPREP], Nodeprep
3398 (Appendix A), and Resourceprep (Appendix B) profiles of
3399 [STRINGPREP] can be applied without failing
3401 13. Internationalization Considerations
3403 XML streams MUST be encoded in UTF-8 as specified under Character
3404 Encoding (Section 11.5). As specified under Stream Attributes
3405 (Section 4.4), an XML stream SHOULD include an 'xml:lang' attribute
3406 that is treated as the default language for any XML character data
3407 sent over the stream that is intended to be presented to a human
3408 user. As specified under xml:lang (Section 9.1.5), an XML stanza
3409 SHOULD include an 'xml:lang' attribute if the stanza contains XML
3410 character data that is intended to be presented to a human user. A
3411 server SHOULD apply the default 'xml:lang' attribute to stanzas it
3415 Saint-Andre Expires November 4, 2004 [Page 61]
3417 Internet-Draft XMPP Core May 2004
3420 routes or delivers on behalf of connected entities, and MUST NOT
3421 modify or delete 'xml:lang' attributes from stanzas it receives from
3424 14. Security Considerations
3428 For the purposes of XMPP communications (client-to-server and
3429 server-to-server), the term "high security" refers to the use of
3430 security technologies that provide both mutual authentication and
3431 integrity-checking; in particular, when using certificate-based
3432 authentication to provide high security, a chain-of-trust SHOULD be
3433 established out-of-band, although a shared certificate authority
3434 signing certificates could allow a previously unknown certificate to
3435 establish trust in-band. See Section 14.2 below regarding
3436 certificate validation procedures.
3438 Implementations MUST support high security. Service provisioning
3439 SHOULD use high security, subject to local security policies.
3441 14.2 Certificate Validation
3443 When an XMPP peer communicates with another peer securely, it MUST
3444 validate the peer's certificate. There are three possible cases:
3446 Case #1: The peer contains an End Entity certificate which appears to
3447 be certified by a chain of certificates terminating in a trust
3448 anchor (as described in Section 6.1 of [X509]).
3449 Case #2: The peer certificate is certified by a Certificate Authority
3450 not known to the validating peer.
3451 Case #3: The peer certificate is self-signed.
3453 In Case #1, the validating peer MUST do one of two things:
3454 1. Verify the peer certificate according to the rules of [X509].
3455 The certificate SHOULD then be checked against the expected
3456 identity of the peer following the rules described in [HTTP-TLS],
3457 except that a subjectAltName extension of type "xmpp" MUST be
3458 used as the identity if present. If one of these checks fails,
3459 user-oriented clients MUST either notify the user (clients MAY
3460 give the user the opportunity to continue with the connection in
3461 any case) or terminate the connection with a bad certificate
3462 error. Automated clients SHOULD terminate the connection (with a
3463 bad certificate error) and log the error to an appropriate audit
3464 log. Automated clients MAY provide a configuration setting that
3465 disables this check, but MUST provide a setting which enables it.
3466 2. The peer SHOULD show the certificate to a user for approval,
3467 including the entire certificate chain. The peer MUST cache the
3471 Saint-Andre Expires November 4, 2004 [Page 62]
3473 Internet-Draft XMPP Core May 2004
3476 certificate (or some non-forgeable representation such as a
3477 hash). In future connections, the peer MUST verify that the same
3478 certificate was presented and MUST notify the user if it has
3481 In Case #2 and Case #3, implementations SHOULD act as in (2) above.
3483 14.3 Client-to-Server Communications
3485 A compliant client implementation MUST support both TLS and SASL for
3486 connections to a server.
3488 The TLS protocol for encrypting XML streams (defined under Use of TLS
3489 (Section 5)) provides a reliable mechanism for helping to ensure the
3490 confidentiality and data integrity of data exchanged between two
3493 The SASL protocol for authenticating XML streams (defined under Use
3494 of SASL (Section 6)) provides a reliable mechanism for validating
3495 that a client connecting to a server is who it claims to be.
3497 Client-to-server communications MUST NOT proceed until the DNS
3498 hostname asserted by the server has been resolved. Such resolutions
3499 SHOULD first attempt to resolve the hostname using an [SRV] Service
3500 of "xmpp-client" and Proto of "tcp", resulting in resource records
3501 such as "_xmpp-client._tcp.example.com." (the use of the string
3502 "xmpp-client" for the service identifier is consistent with the IANA
3503 registration). If the SRV lookup fails, the fallback is a normal
3504 IPv4/IPv6 address record resolution to determine the IP address,
3505 using the "xmpp-client" port of 5222 registered with the IANA.
3507 The IP address and method of access of clients MUST NOT be made
3508 public by a server, nor are any connections other than the original
3509 server connection required. This helps to protect the client's
3510 server from direct attack or identification by third parties.
3512 14.4 Server-to-Server Communications
3514 A compliant server implementation MUST support both TLS and SASL for
3515 inter-domain communications. For historical reasons, a compliant
3516 implementation SHOULD also support Server Dialback (Section 8).
3518 Because service provisioning is a matter of policy, it is OPTIONAL
3519 for any given domain to communicate with other domains, and
3520 server-to-server communications MAY be disabled by the administrator
3521 of any given deployment. If a particular domain enables inter-domain
3522 communications, it SHOULD enable high security.
3527 Saint-Andre Expires November 4, 2004 [Page 63]
3529 Internet-Draft XMPP Core May 2004
3532 Administrators may want to require use of SASL for server-to-server
3533 communications in order to ensure both authentication and
3534 confidentiality (e.g., on an organization's private network).
3535 Compliant implementations SHOULD support SASL for this purpose.
3537 Inter-domain connections MUST NOT proceed until the DNS hostnames
3538 asserted by the servers have been resolved. Such resolutions MUST
3539 first attempt to resolve the hostname using an [SRV] Service of
3540 "xmpp-server" and Proto of "tcp", resulting in resource records such
3541 as "_xmpp-server._tcp.example.com." (the use of the string
3542 "xmpp-server" for the service identifier is consistent with the IANA
3543 registration; note well that the "xmpp-server" service identifier
3544 supersedes the earlier use of a "jabber" service identifier, since
3545 the earlier usage did not conform to [SRV]; implementations desiring
3546 to be backward compatible should continue to look for or answer to
3547 the "jabber" service identifier as well). If the SRV lookup fails,
3548 the fallback is a normal IPv4/IPv6 address record resolution to
3549 determine the IP address, using the "xmpp-server" port of 5269
3550 registered with the IANA.
3552 Server dialback helps protect against domain spoofing, thus making it
3553 more difficult to spoof XML stanzas. It is not a mechanism for
3554 authenticating, securing, or encrypting streams between servers as is
3555 done via SASL and TLS, and results in weak verification of server
3556 identities only. Furthermore, it is susceptible to DNS poisoning
3557 attacks unless DNSSec [DNSSEC] is used, and even if the DNS
3558 information is accurate, dialback cannot protect from attacks where
3559 the attacker is capable of hijacking the IP address of the remote
3560 domain. Domains requiring robust security SHOULD use TLS and SASL.
3561 If SASL is used for server-to-server authentication, dialback SHOULD
3562 NOT be used since it is unnecessary.
3564 14.5 Order of Layers
3566 The order of layers in which protocols MUST be stacked is as follows:
3573 The rationale for this order is that [TCP] is the base connection
3574 layer used by all of the protocols stacked on top of TCP, [TLS] is
3575 often provided at the operating system layer, [SASL] is often
3576 provided at the application layer, and XMPP is the application
3583 Saint-Andre Expires November 4, 2004 [Page 64]
3585 Internet-Draft XMPP Core May 2004
3588 14.6 Lack of SASL Channel Binding to TLS
3590 The SASL framework does not provide a mechanism to bind SASL
3591 authentication to a security layer providing confidentiality and
3592 integrity protection that was negotiated at a lower layer. This lack
3593 of a "channel binding" prevents SASL from being able to verify that
3594 the source and destination end points to which the lower layer's
3595 security is bound are equivalent to the end points that SASL is
3596 authenticating. If the end points are not identical, the lower
3597 layer's security cannot be trusted to protect data transmitted
3598 between the SASL authenticated entities. In such a situation, a SASL
3599 security layer should be negotiated which effectively ignores the
3600 presence of the lower layer security.
3602 14.7 Mandatory-to-Implement Technologies
3604 At a minimum, all implementations MUST support the following
3607 for authentication: the SASL [DIGEST-MD5] mechanism
3608 for confidentiality: TLS (using the TLS_RSA_WITH_3DES_EDE_CBC_SHA
3610 for both: TLS plus SASL EXTERNAL(using the
3611 TLS_RSA_WITH_3DES_EDE_CBC_SHA cipher supporting client-side
3616 Communications using XMPP normally occur over [TCP] connections on
3617 port 5222 (client-to-server) or port 5269 (server-to-server), as
3618 registered with the IANA (see IANA Considerations (Section 15)). Use
3619 of these well-known ports allows administrators to easily enable or
3620 disable XMPP activity through existing and commonly-deployed
3623 14.9 Use of base64 in SASL
3625 Both the client and the server MUST verify any [BASE64] data received
3626 during SASL negotiation. An implementation MUST reject (not ignore)
3627 any characters that are not explicitly allowed by the base64
3628 alphabet; this helps to guard against creation of a covert channel
3629 that could be used to "leak" information. An implementation MUST NOT
3630 break on invalid input and MUST reject any sequence of base64
3631 characters containing the pad ('=') character if that character is
3632 included as something other than the last character of the data (e.g.
3633 "=AAA" or "BBBB=CCC"); this helps to guard against buffer overflow
3634 attacks and other attacks on the implementation. Base 64 encoding
3635 visually hides otherwise easily recognized information, such as
3639 Saint-Andre Expires November 4, 2004 [Page 65]
3641 Internet-Draft XMPP Core May 2004
3644 passwords, but does not provide any computational confidentiality.
3645 Base 64 encoding MUST follow the definition in Section 3 of RFC 3548
3648 14.10 Stringprep Profiles
3650 XMPP makes use of the [NAMEPREP] profile of [STRINGPREP] for
3651 processing of domain identifiers; for security considerations related
3652 to Nameprep, refer to the appropriate section of [NAMEPREP].
3654 In addition, XMPP defines two profiles of [STRINGPREP]: Nodeprep
3655 (Appendix A) for node identifiers and Resourceprep (Appendix B) for
3656 resource identifiers.
3658 The Unicode and ISO/IEC 10646 repertoires have many characters that
3659 look similar. In many cases, users of security protocols might do
3660 visual matching, such as when comparing the names of trusted third
3661 parties. Because it is impossible to map similar-looking characters
3662 without a great deal of context such as knowing the fonts used,
3663 stringprep does nothing to map similar-looking characters together
3664 nor to prohibit some characters because they look like others.
3666 A node identifier can be employed as one part of an entity's address
3667 in XMPP. One common usage is as the username of an instant messaging
3668 user; another is as the name of a multi-user chat room; and many
3669 other kinds of entities could use node identifiers as part of their
3670 addresses. The security of such services could be compromised based
3671 on different interpretations of the internationalized node
3672 identifier; for example, a user entering a single internationalized
3673 node identifier could access another user's account information, or a
3674 user could gain access to an otherwise restricted chat room or
3677 A resource identifier can be employed as one part of an entity's
3678 address in XMPP. One common usage is as the name for an instant
3679 messaging user's connected resource (active session); another is as
3680 the nickname of a user in a multi-user chat room; and many other
3681 kinds of entities could use resource identifiers as part of their
3682 addresses. The security of such services could be compromised based
3683 on different interpretations of the internationalized resource
3684 identifier; for example, a user could attempt to initiate multiple
3685 sessions with the same name, or a user could send a message to
3686 someone other than the intended recipient in a multi-user chat room.
3688 15. IANA Considerations
3695 Saint-Andre Expires November 4, 2004 [Page 66]
3697 Internet-Draft XMPP Core May 2004
3700 15.1 XML Namespace Name for TLS Data
3702 A URN sub-namespace for TLS-related data in the Extensible Messaging
3703 and Presence Protocol (XMPP) is defined as follows. (This namespace
3704 name adheres to the format defined in The IETF XML Registry
3707 URI: urn:ietf:params:xml:ns:xmpp-tls
3709 Description: This is the XML namespace name for TLS-related data in
3710 the Extensible Messaging and Presence Protocol (XMPP) as defined
3712 Registrant Contact: IETF, XMPP Working Group, <xmppwg@jabber.org>
3714 15.2 XML Namespace Name for SASL Data
3716 A URN sub-namespace for SASL-related data in the Extensible Messaging
3717 and Presence Protocol (XMPP) is defined as follows. (This namespace
3718 name adheres to the format defined in [XML-REG].)
3720 URI: urn:ietf:params:xml:ns:xmpp-sasl
3722 Description: This is the XML namespace name for SASL-related data in
3723 the Extensible Messaging and Presence Protocol (XMPP) as defined
3725 Registrant Contact: IETF, XMPP Working Group, <xmppwg@jabber.org>
3727 15.3 XML Namespace Name for Stream Errors
3729 A URN sub-namespace for stream-related error data in the Extensible
3730 Messaging and Presence Protocol (XMPP) is defined as follows. (This
3731 namespace name adheres to the format defined in [XML-REG].)
3733 URI: urn:ietf:params:xml:ns:xmpp-streams
3735 Description: This is the XML namespace name for stream-related error
3736 data in the Extensible Messaging and Presence Protocol (XMPP) as
3738 Registrant Contact: IETF, XMPP Working Group, <xmppwg@jabber.org>
3740 15.4 XML Namespace Name for Resource Binding
3742 A URN sub-namespace for resource binding in the Extensible Messaging
3743 and Presence Protocol (XMPP) is defined as follows. (This namespace
3744 name adheres to the format defined in [XML-REG].)
3751 Saint-Andre Expires November 4, 2004 [Page 67]
3753 Internet-Draft XMPP Core May 2004
3756 URI: urn:ietf:params:xml:ns:xmpp-bind
3758 Description: This is the XML namespace name for resource binding in
3759 the Extensible Messaging and Presence Protocol (XMPP) as defined
3761 Registrant Contact: IETF, XMPP Working Group, <xmppwg@jabber.org>
3763 15.5 XML Namespace Name for Stanza Errors
3765 A URN sub-namespace for stanza-related error data in the Extensible
3766 Messaging and Presence Protocol (XMPP) is defined as follows. (This
3767 namespace name adheres to the format defined in [XML-REG].)
3769 URI: urn:ietf:params:xml:ns:xmpp-stanzas
3771 Description: This is the XML namespace name for stanza-related error
3772 data in the Extensible Messaging and Presence Protocol (XMPP) as
3774 Registrant Contact: IETF, XMPP Working Group, <xmppwg@jabber.org>
3776 15.6 Nodeprep Profile of Stringprep
3778 The Nodeprep profile of stringprep is defined under Nodeprep
3779 (Appendix A). The IANA registers Nodeprep in the stringprep profile
3782 Name of this profile:
3786 RFC in which the profile is defined:
3790 Indicator whether or not this is the newest version of the profile:
3792 This is the first version of Nodeprep
3794 15.7 Resourceprep Profile of Stringprep
3796 The Resourceprep profile of stringprep is defined under Resourceprep
3797 (Appendix B). The IANA registers Resourceprep in the stringprep
3800 Name of this profile:
3807 Saint-Andre Expires November 4, 2004 [Page 68]
3809 Internet-Draft XMPP Core May 2004
3814 RFC in which the profile is defined:
3818 Indicator whether or not this is the newest version of the profile:
3820 This is the first version of Resourceprep
3822 15.8 GSSAPI Service Name
3824 The IANA registers "xmpp" as a GSSAPI [GSS-API] service name, as
3825 defined under SASL Definition (Section 6.3).
3829 The IANA registers "xmpp-client" and "xmpp-server" as keywords for
3830 [TCP] ports 5222 and 5269 respectively.
3832 These ports SHOULD be used for client-to-server and server-to-server
3833 communications respectively, but their use is OPTIONAL.
3835 Normative References
3837 [ABNF] Crocker, D. and P. Overell, "Augmented BNF for Syntax
3838 Specifications: ABNF", RFC 2234, November 1997.
3840 [BASE64] Josefsson, S., "The Base16, Base32, and Base64 Data
3841 Encodings", RFC 3548, July 2003.
3843 [CHARSET] Alvestrand, H., "IETF Policy on Character Sets and
3844 Languages", BCP 18, RFC 2277, January 1998.
3847 Leach, P. and C. Newman, "Using Digest Authentication as a
3848 SASL Mechanism", RFC 2831, May 2000.
3850 [DNS] Mockapetris, P., "Domain names - implementation and
3851 specification", STD 13, RFC 1035, November 1987.
3853 [GSS-API] Linn, J., "Generic Security Service Application Program
3854 Interface, Version 2", RFC 2078, January 1997.
3857 Rescorla, E., "HTTP Over TLS", RFC 2818, May 2000.
3859 [IDNA] Faltstrom, P., Hoffman, P. and A. Costello,
3863 Saint-Andre Expires November 4, 2004 [Page 69]
3865 Internet-Draft XMPP Core May 2004
3868 "Internationalizing Domain Names in Applications (IDNA)",
3869 RFC 3490, March 2003.
3871 [IPv6] Hinden, R. and S. Deering, "IP Version 6 Addressing
3872 Architecture", RFC 2373, July 1998.
3875 Alvestrand, H., "Tags for the Identification of
3876 Languages", BCP 47, RFC 3066, January 2001.
3879 Hoffman, P. and M. Blanchet, "Nameprep: A Stringprep
3880 Profile for Internationalized Domain Names (IDN)", RFC
3883 [RANDOM] Eastlake, D., Crocker, S. and J. Schiller, "Randomness
3884 Recommendations for Security", RFC 1750, December 1994.
3886 [SASL] Myers, J., "Simple Authentication and Security Layer
3887 (SASL)", RFC 2222, October 1997.
3889 [SRV] Gulbrandsen, A., Vixie, P. and L. Esibov, "A DNS RR for
3890 specifying the location of services (DNS SRV)", RFC 2782,
3894 Hoffman, P. and M. Blanchet, "Preparation of
3895 Internationalized Strings ("STRINGPREP")", RFC 3454,
3898 [TCP] Postel, J., "Transmission Control Protocol", STD 7, RFC
3899 793, September 1981.
3901 [TERMS] Bradner, S., "Key words for use in RFCs to Indicate
3902 Requirement Levels", BCP 14, RFC 2119, March 1997.
3904 [TLS] Dierks, T., Allen, C., Treese, W., Karlton, P., Freier, A.
3905 and P. Kocher, "The TLS Protocol Version 1.0", RFC 2246,
3908 [UCS2] International Organization for Standardization,
3909 "Information Technology - Universal Multiple-octet coded
3910 Character Set (UCS) - Amendment 2: UCS Transformation
3911 Format 8 (UTF-8)", ISO Standard 10646-1 Addendum 2,
3914 [UTF-8] Yergeau, F., "UTF-8, a transformation format of ISO
3915 10646", STD 63, RFC 3629, November 2003.
3919 Saint-Andre Expires November 4, 2004 [Page 70]
3921 Internet-Draft XMPP Core May 2004
3924 [X509] Housley, R., Polk, W., Ford, W. and D. Solo, "Internet
3925 X.509 Public Key Infrastructure Certificate and
3926 Certificate Revocation List (CRL) Profile", RFC 3280,
3929 [XML] Bray, T., Paoli, J., Sperberg-McQueen, C. and E. Maler,
3930 "Extensible Markup Language (XML) 1.0 (2nd ed)", W3C
3931 REC-xml, October 2000, <http://www.w3.org/TR/REC-xml>.
3934 Bray, T., Hollander, D. and A. Layman, "Namespaces in
3935 XML", W3C REC-xml-names, January 1999, <http://www.w3.org/
3938 Informative References
3940 [ACAP] Newman, C. and J. Myers, "ACAP -- Application
3941 Configuration Access Protocol", RFC 2244, November 1997.
3943 [DNSSEC] Eastlake, D., "Domain Name System Security Extensions",
3944 RFC 2535, March 1999.
3946 [HTTP] Fielding, R., Gettys, J., Mogul, J., Frystyk, H.,
3947 Masinter, L., Leach, P. and T. Berners-Lee, "Hypertext
3948 Transfer Protocol -- HTTP/1.1", RFC 2616, June 1999.
3950 [IMAP] Crispin, M., "Internet Message Access Protocol - Version
3951 4rev1", RFC 2060, December 1996.
3954 Day, M., Aggarwal, S. and J. Vincent, "Instant Messaging /
3955 Presence Protocol Requirements", RFC 2779, February 2000.
3957 [IRC] Oikarinen, J. and D. Reed, "Internet Relay Chat Protocol",
3960 [JSF] Jabber Software Foundation, "Jabber Software Foundation",
3961 <http://www.jabber.org/>.
3963 [POP3] Myers, J. and M. Rose, "Post Office Protocol - Version 3",
3964 STD 53, RFC 1939, May 1996.
3966 [SIMPLE] SIMPLE Working Group, "SIMPLE WG", <http://www.ietf.org/
3967 html.charters/simple-charter.html>.
3969 [SMTP] Klensin, J., "Simple Mail Transfer Protocol", RFC 2821,
3975 Saint-Andre Expires November 4, 2004 [Page 71]
3977 Internet-Draft XMPP Core May 2004
3980 [URI] Berners-Lee, T., Fielding, R. and L. Masinter, "Uniform
3981 Resource Identifiers (URI): Generic Syntax", RFC 2396,
3985 Newman, C., "Using TLS with IMAP, POP3 and ACAP", RFC
3988 [XML-REG] Mealling, M., "The IETF XML Registry", BCP 81, RFC 3688,
3991 [XMPP-IM] Saint-Andre, P., "Extensible Messaging and Presence
3992 Protocol (XMPP): Instant Messaging and Presence",
3993 draft-ietf-xmpp-im-22 (work in progress), April 2004.
3998 Peter Saint-Andre (editor)
3999 Jabber Software Foundation
4001 EMail: stpeter@jabber.org
4003 Appendix A. Nodeprep
4007 This appendix defines the "Nodeprep" profile of [STRINGPREP]. As
4008 such, it specifies processing rules that will enable users to enter
4009 internationalized node identifiers in the Extensible Messaging and
4010 Presence Protocol (XMPP) and have the highest chance of getting the
4011 content of the strings correct. (An XMPP node identifier is the
4012 optional portion of an XMPP address that precedes a domain identifier
4013 and the '@' separator; it is often but not exclusively associated
4014 with an instant messaging username.) These processing rules are
4015 intended only for XMPP node identifiers and are not intended for
4016 arbitrary text or any other aspect of an XMPP address.
4018 This profile defines the following, as required by [STRINGPREP]:
4020 o The intended applicability of the profile: internationalized node
4021 identifiers within XMPP
4022 o The character repertoire that is the input and output to
4023 stringprep: Unicode 3.2, specified in Section 2 of this Appendix
4024 o The mappings used: specified in Section 3
4025 o The Unicode normalization used: specified in Section 4
4026 o The characters that are prohibited as output: specified in Section
4031 Saint-Andre Expires November 4, 2004 [Page 72]
4033 Internet-Draft XMPP Core May 2004
4036 o Bidirectional character handling: specified in Section 6
4038 A.2 Character Repertoire
4040 This profile uses Unicode 3.2 with the list of unassigned code points
4041 being Table A.1, both defined in Appendix A of [STRINGPREP].
4045 This profile specifies mapping using the following tables from
4053 This profile specifies using Unicode normalization form KC, as
4054 described in [STRINGPREP].
4056 A.5 Prohibited Output
4058 This profile specifies prohibiting use of the following tables from
4073 In addition, the following Unicode characters are also prohibited:
4087 Saint-Andre Expires November 4, 2004 [Page 73]
4089 Internet-Draft XMPP Core May 2004
4095 A.6 Bidirectional Characters
4097 This profile specifies checking bidirectional strings as described in
4098 Section 6 of [STRINGPREP].
4100 Appendix B. Resourceprep
4104 This appendix defines the "Resourceprep" profile of [STRINGPREP]. As
4105 such, it specifies processing rules that will enable users to enter
4106 internationalized resource identifiers in the Extensible Messaging
4107 and Presence Protocol (XMPP) and have the highest chance of getting
4108 the content of the strings correct. (An XMPP resource identifier is
4109 the optional portion of an XMPP address that follows a domain
4110 identifier and the '/' separator; it is often but not exclusively
4111 associated with an instant messaging session name.) These processing
4112 rules are intended only for XMPP resource identifiers and are not
4113 intended for arbitrary text or any other aspect of an XMPP address.
4115 This profile defines the following, as required by [STRINGPREP]:
4117 o The intended applicability of the profile: internationalized
4118 resource identifiers within XMPP
4119 o The character repertoire that is the input and output to
4120 stringprep: Unicode 3.2, specified in Section 2 of this Appendix
4121 o The mappings used: specified in Section 3
4122 o The Unicode normalization used: specified in Section 4
4123 o The characters that are prohibited as output: specified in Section
4125 o Bidirectional character handling: specified in Section 6
4127 B.2 Character Repertoire
4129 This profile uses Unicode 3.2 with the list of unassigned code points
4130 being Table A.1, both defined in Appendix A of [STRINGPREP].
4134 This profile specifies mapping using the following tables from
4143 Saint-Andre Expires November 4, 2004 [Page 74]
4145 Internet-Draft XMPP Core May 2004
4152 This profile specifies using Unicode normalization form KC, as
4153 described in [STRINGPREP].
4155 B.5 Prohibited Output
4157 This profile specifies prohibiting use of the following tables from
4171 B.6 Bidirectional Characters
4173 This profile specifies checking bidirectional strings as described in
4174 Section 6 of [STRINGPREP].
4176 Appendix C. XML Schemas
4178 The following XML schemas are descriptive, not normative. For
4179 schemas defining the 'jabber:client' and 'jabber:server' namespaces,
4182 C.1 Streams namespace
4184 <?xml version='1.0' encoding='UTF-8'?>
4187 xmlns:xs='http://www.w3.org/2001/XMLSchema'
4188 targetNamespace='http://etherx.jabber.org/streams'
4189 xmlns='http://etherx.jabber.org/streams'
4190 elementFormDefault='unqualified'>
4192 <xs:element name='stream'>
4194 <xs:sequence xmlns:client='jabber:client'
4195 xmlns:server='jabber:server'
4199 Saint-Andre Expires November 4, 2004 [Page 75]
4201 Internet-Draft XMPP Core May 2004
4204 xmlns:db='jabber:server:dialback'>
4205 <xs:element ref='features' minOccurs='0' maxOccurs='1'/>
4206 <xs:any namespace='urn:ietf:params:xml:ns:xmpp-tls'
4208 maxOccurs='unbounded'/>
4209 <xs:any namespace='urn:ietf:params:xml:ns:xmpp-sasl'
4211 maxOccurs='unbounded'/>
4212 <xs:choice minOccurs='0' maxOccurs='1'>
4213 <xs:choice minOccurs='0' maxOccurs='unbounded'>
4214 <xs:element ref='client:message'/>
4215 <xs:element ref='client:presence'/>
4216 <xs:element ref='client:iq'/>
4218 <xs:choice minOccurs='0' maxOccurs='unbounded'>
4219 <xs:element ref='server:message'/>
4220 <xs:element ref='server:presence'/>
4221 <xs:element ref='server:iq'/>
4222 <xs:element ref='db:result'/>
4223 <xs:element ref='db:verify'/>
4226 <xs:element ref='error' minOccurs='0' maxOccurs='1'/>
4228 <xs:attribute name='from' type='xs:string' use='optional'/>
4229 <xs:attribute name='id' type='xs:NMTOKEN' use='optional'/>
4230 <xs:attribute name='to' type='xs:string' use='optional'/>
4231 <xs:attribute name='version' type='xs:decimal' use='optional'/>
4232 <xs:attribute ref='xml:lang' use='optional'/>
4236 <xs:element name='features'>
4238 <xs:all xmlns:tls='urn:ietf:params:xml:ns:xmpp-tls'
4239 xmlns:sasl='urn:ietf:params:xml:ns:xmpp-sasl'
4240 xmlns:bind='urn:ietf:params:xml:ns:xmpp-bind'
4241 xmlns:sess='urn:ietf:params:xml:ns:xmpp-session'>
4242 <xs:element ref='tls:starttls' minOccurs='0'/>
4243 <xs:element ref='sasl:mechanisms' minOccurs='0'/>
4244 <xs:element ref='bind:bind' minOccurs='0'/>
4245 <xs:element ref='sess:session' minOccurs='0'/>
4250 <xs:element name='error'>
4255 Saint-Andre Expires November 4, 2004 [Page 76]
4257 Internet-Draft XMPP Core May 2004
4260 <xs:sequence xmlns:err='urn:ietf:params:xml:ns:xmpp-streams'>
4261 <xs:group ref='err:streamErrorGroup'/>
4262 <xs:element ref='err:text'
4272 C.2 Stream error namespace
4274 <?xml version='1.0' encoding='UTF-8'?>
4277 xmlns:xs='http://www.w3.org/2001/XMLSchema'
4278 targetNamespace='urn:ietf:params:xml:ns:xmpp-streams'
4279 xmlns='urn:ietf:params:xml:ns:xmpp-streams'
4280 elementFormDefault='qualified'>
4282 <xs:element name='bad-format' type='empty'/>
4283 <xs:element name='bad-namespace-prefix' type='empty'/>
4284 <xs:element name='conflict' type='empty'/>
4285 <xs:element name='connection-timeout' type='empty'/>
4286 <xs:element name='host-gone' type='empty'/>
4287 <xs:element name='host-unknown' type='empty'/>
4288 <xs:element name='improper-addressing' type='empty'/>
4289 <xs:element name='internal-server-error' type='empty'/>
4290 <xs:element name='invalid-from' type='empty'/>
4291 <xs:element name='invalid-id' type='empty'/>
4292 <xs:element name='invalid-namespace' type='empty'/>
4293 <xs:element name='invalid-xml' type='empty'/>
4294 <xs:element name='not-authorized' type='empty'/>
4295 <xs:element name='policy-violation' type='empty'/>
4296 <xs:element name='remote-connection-failed' type='empty'/>
4297 <xs:element name='resource-constraint' type='empty'/>
4298 <xs:element name='restricted-xml' type='empty'/>
4299 <xs:element name='see-other-host' type='xs:string'/>
4300 <xs:element name='system-shutdown' type='empty'/>
4301 <xs:element name='undefined-condition' type='empty'/>
4302 <xs:element name='unsupported-encoding' type='empty'/>
4303 <xs:element name='unsupported-stanza-type' type='empty'/>
4304 <xs:element name='unsupported-version' type='empty'/>
4305 <xs:element name='xml-not-well-formed' type='empty'/>
4307 <xs:group name='streamErrorGroup'>
4311 Saint-Andre Expires November 4, 2004 [Page 77]
4313 Internet-Draft XMPP Core May 2004
4317 <xs:element ref='bad-format'/>
4318 <xs:element ref='bad-namespace-prefix'/>
4319 <xs:element ref='conflict'/>
4320 <xs:element ref='connection-timeout'/>
4321 <xs:element ref='host-gone'/>
4322 <xs:element ref='host-unknown'/>
4323 <xs:element ref='improper-addressing'/>
4324 <xs:element ref='internal-server-error'/>
4325 <xs:element ref='invalid-from'/>
4326 <xs:element ref='invalid-id'/>
4327 <xs:element ref='invalid-namespace'/>
4328 <xs:element ref='invalid-xml'/>
4329 <xs:element ref='not-authorized'/>
4330 <xs:element ref='policy-violation'/>
4331 <xs:element ref='remote-connection-failed'/>
4332 <xs:element ref='resource-constraint'/>
4333 <xs:element ref='restricted-xml'/>
4334 <xs:element ref='see-other-host'/>
4335 <xs:element ref='system-shutdown'/>
4336 <xs:element ref='undefined-condition'/>
4337 <xs:element ref='unsupported-encoding'/>
4338 <xs:element ref='unsupported-stanza-type'/>
4339 <xs:element ref='unsupported-version'/>
4340 <xs:element ref='xml-not-well-formed'/>
4344 <xs:element name='text'>
4347 <xs:extension base='xs:string'>
4348 <xs:attribute ref='xml:lang' use='optional'/>
4354 <xs:simpleType name='empty'>
4355 <xs:restriction base='xs:string'>
4356 <xs:enumeration value=''/>
4367 Saint-Andre Expires November 4, 2004 [Page 78]
4369 Internet-Draft XMPP Core May 2004
4374 <?xml version='1.0' encoding='UTF-8'?>
4377 xmlns:xs='http://www.w3.org/2001/XMLSchema'
4378 targetNamespace='urn:ietf:params:xml:ns:xmpp-tls'
4379 xmlns='urn:ietf:params:xml:ns:xmpp-tls'
4380 elementFormDefault='qualified'>
4382 <xs:element name='starttls'>
4394 <xs:element name='proceed' type='empty'/>
4395 <xs:element name='failure' type='empty'/>
4397 <xs:simpleType name='empty'>
4398 <xs:restriction base='xs:string'>
4399 <xs:enumeration value=''/>
4408 <?xml version='1.0' encoding='UTF-8'?>
4411 xmlns:xs='http://www.w3.org/2001/XMLSchema'
4412 targetNamespace='urn:ietf:params:xml:ns:xmpp-sasl'
4413 xmlns='urn:ietf:params:xml:ns:xmpp-sasl'
4414 elementFormDefault='qualified'>
4416 <xs:element name='mechanisms'>
4419 <xs:element name='mechanism'
4423 Saint-Andre Expires November 4, 2004 [Page 79]
4425 Internet-Draft XMPP Core May 2004
4428 maxOccurs='unbounded'
4434 <xs:element name='auth'>
4437 <xs:extension base='empty'>
4438 <xs:attribute name='mechanism'
4446 <xs:element name='challenge' type='xs:string'/>
4447 <xs:element name='response' type='xs:string'/>
4448 <xs:element name='abort' type='empty'/>
4449 <xs:element name='success' type='empty'/>
4451 <xs:element name='failure'>
4453 <xs:choice minOccurs='0'>
4454 <xs:element name='aborted' type='empty'/>
4455 <xs:element name='incorrect-encoding' type='empty'/>
4456 <xs:element name='invalid-authzid' type='empty'/>
4457 <xs:element name='invalid-mechanism' type='empty'/>
4458 <xs:element name='mechanism-too-weak' type='empty'/>
4459 <xs:element name='not-authorized' type='empty'/>
4460 <xs:element name='temporary-auth-failure' type='empty'/>
4465 <xs:simpleType name='empty'>
4466 <xs:restriction base='xs:string'>
4467 <xs:enumeration value=''/>
4479 Saint-Andre Expires November 4, 2004 [Page 80]
4481 Internet-Draft XMPP Core May 2004
4484 C.5 Resource binding namespace
4486 <?xml version='1.0' encoding='UTF-8'?>
4489 xmlns:xs='http://www.w3.org/2001/XMLSchema'
4490 targetNamespace='urn:ietf:params:xml:ns:xmpp-bind'
4491 xmlns='urn:ietf:params:xml:ns:xmpp-bind'
4492 elementFormDefault='qualified'>
4494 <xs:element name='bind'>
4496 <xs:choice minOccurs='0' maxOccurs='1'>
4497 <xs:element name='resource' type='xs:string'/>
4498 <xs:element name='jid' type='xs:string'/>
4506 C.6 Dialback namespace
4508 <?xml version='1.0' encoding='UTF-8'?>
4511 xmlns:xs='http://www.w3.org/2001/XMLSchema'
4512 targetNamespace='jabber:server:dialback'
4513 xmlns='jabber:server:dialback'
4514 elementFormDefault='qualified'>
4516 <xs:element name='result'>
4519 <xs:extension base='xs:NMTOKEN'>
4520 <xs:attribute name='from' type='xs:string' use='required'/>
4521 <xs:attribute name='to' type='xs:string' use='required'/>
4522 <xs:attribute name='type' use='optional'>
4524 <xs:restriction base='xs:NCName'>
4525 <xs:enumeration value='invalid'/>
4526 <xs:enumeration value='valid'/>
4535 Saint-Andre Expires November 4, 2004 [Page 81]
4537 Internet-Draft XMPP Core May 2004
4543 <xs:element name='verify'>
4546 <xs:extension base='xs:NMTOKEN'>
4547 <xs:attribute name='from' type='xs:string' use='required'/>
4548 <xs:attribute name='id' type='xs:NMTOKEN' use='required'/>
4549 <xs:attribute name='to' type='xs:string' use='required'/>
4550 <xs:attribute name='type' use='optional'>
4552 <xs:restriction base='xs:NCName'>
4553 <xs:enumeration value='invalid'/>
4554 <xs:enumeration value='valid'/>
4566 C.7 Stanza error namespace
4568 <?xml version='1.0' encoding='UTF-8'?>
4571 xmlns:xs='http://www.w3.org/2001/XMLSchema'
4572 targetNamespace='urn:ietf:params:xml:ns:xmpp-stanzas'
4573 xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'
4574 elementFormDefault='qualified'>
4576 <xs:element name='bad-request' type='empty'/>
4577 <xs:element name='conflict' type='empty'/>
4578 <xs:element name='feature-not-implemented' type='empty'/>
4579 <xs:element name='forbidden' type='empty'/>
4580 <xs:element name='gone' type='xs:string'/>
4581 <xs:element name='internal-server-error' type='empty'/>
4582 <xs:element name='item-not-found' type='empty'/>
4583 <xs:element name='jid-malformed' type='empty'/>
4584 <xs:element name='not-acceptable' type='empty'/>
4585 <xs:element name='not-allowed' type='empty'/>
4586 <xs:element name='payment-required' type='empty'/>
4587 <xs:element name='recipient-unavailable' type='empty'/>
4591 Saint-Andre Expires November 4, 2004 [Page 82]
4593 Internet-Draft XMPP Core May 2004
4596 <xs:element name='redirect' type='xs:string'/>
4597 <xs:element name='registration-required' type='empty'/>
4598 <xs:element name='remote-server-not-found' type='empty'/>
4599 <xs:element name='remote-server-timeout' type='empty'/>
4600 <xs:element name='resource-constraint' type='empty'/>
4601 <xs:element name='service-unavailable' type='empty'/>
4602 <xs:element name='subscription-required' type='empty'/>
4603 <xs:element name='undefined-condition' type='empty'/>
4604 <xs:element name='unexpected-request' type='empty'/>
4606 <xs:group name='stanzaErrorGroup'>
4608 <xs:element ref='bad-request'/>
4609 <xs:element ref='conflict'/>
4610 <xs:element ref='feature-not-implemented'/>
4611 <xs:element ref='forbidden'/>
4612 <xs:element ref='gone'/>
4613 <xs:element ref='internal-server-error'/>
4614 <xs:element ref='item-not-found'/>
4615 <xs:element ref='jid-malformed'/>
4616 <xs:element ref='not-acceptable'/>
4617 <xs:element ref='not-allowed'/>
4618 <xs:element ref='payment-required'/>
4619 <xs:element ref='recipient-unavailable'/>
4620 <xs:element ref='redirect'/>
4621 <xs:element ref='registration-required'/>
4622 <xs:element ref='remote-server-not-found'/>
4623 <xs:element ref='remote-server-timeout'/>
4624 <xs:element ref='resource-constraint'/>
4625 <xs:element ref='service-unavailable'/>
4626 <xs:element ref='subscription-required'/>
4627 <xs:element ref='undefined-condition'/>
4628 <xs:element ref='unexpected-request'/>
4632 <xs:element name='text'>
4635 <xs:extension base='xs:string'>
4636 <xs:attribute ref='xml:lang' use='optional'/>
4642 <xs:simpleType name='empty'>
4643 <xs:restriction base='xs:string'>
4647 Saint-Andre Expires November 4, 2004 [Page 83]
4649 Internet-Draft XMPP Core May 2004
4652 <xs:enumeration value=''/>
4659 Appendix D. Differences Between Core Jabber Protocols and XMPP
4661 This section is non-normative.
4663 XMPP has been adapted from the protocols originally developed in the
4664 Jabber open-source community, which can be thought of as "XMPP 0.9".
4665 Because there exists a large installed base of Jabber implementations
4666 and deployments, it may be helpful to specify the key differences
4667 between the relevant Jabber protocols and XMPP in order to expedite
4668 and encourage upgrades of those implementations and deployments to
4669 XMPP. This section summarizes the core differences, while the
4670 corresponding section of [XMPP-IM] summarizes the differences that
4671 relate specifically to instant messaging and presence applications.
4673 D.1 Channel Encryption
4675 It was common practice in the Jabber community to use SSL for channel
4676 encryption on ports other than 5222 and 5269 (the convention is to
4677 use ports 5223 and 5270). XMPP uses TLS over the IANA-registered
4678 ports for channel encryption, as defined under Use of TLS (Section 5)
4683 The client-server authentication protocol developed in the Jabber
4684 community used a basic IQ interaction qualified by the
4685 'jabber:iq:auth' namespace (documentation of this protocol is
4686 contained in "JEP-0078: Non-SASL Authentication", published by the
4687 Jabber Software Foundation [JSF]). XMPP uses SASL for
4688 authentication, as defined under Use of SASL (Section 6) herein.
4690 The Jabber community did not develop an authentication protocol for
4691 server-to-server communications, only the Server Dialback (Section 8)
4692 protocol to prevent server spoofing. XMPP supersedes Server Dialback
4693 with a true server-to-server authentication protocol, as defined
4694 under Use of SASL (Section 6) herein.
4696 D.3 Resource Binding
4698 Resource binding in the Jabber community was handled via the
4699 'jabber:iq:auth' namespace (which was also used for client
4703 Saint-Andre Expires November 4, 2004 [Page 84]
4705 Internet-Draft XMPP Core May 2004
4708 authentication with a server). XMPP defines a dedicated namespace
4709 for resource binding as well as the ability for a server to generate
4710 a resource identifier on behalf of a client, as defined under
4711 Resource Binding (Section 7).
4715 JID processing was somewhat loosely defined by the Jabber community
4716 (documentation of forbidden characters and case handling is contained
4717 in "JEP-0029: Definition of Jabber Identifiers", published by the
4718 Jabber Software Foundation [JSF]). XMPP specifies the use of
4719 [NAMEPREP] for domain identifiers and supplements Nameprep with two
4720 additional [STRINGPREP] profiles for JID processing: Nodeprep
4721 (Appendix A) for node identifiers and Resourceprep (Appendix B) for
4722 resource identifiers.
4726 Stream-related errors were handled in the Jabber community via XML
4727 character data text in a <stream:error/> element. In XMPP,
4728 stream-related errors are handled via an extensible mechanism defined
4729 under Stream Errors (Section 4.7) herein.
4731 Stanza-related errors were handled in the Jabber community via
4732 HTTP-style error codes. In XMPP, stanza-related errors are handled
4733 via an extensible mechanism defined under Stanza Errors (Section 9.3)
4734 herein. (Documentation of a mapping between Jabber and XMPP error
4735 handling mechanisms is contained in "JEP-0086: Error Condition
4736 Mappings", published by the Jabber Software Foundation [JSF].)
4738 D.6 Internationalization
4740 Although use of UTF-8 has always been standard practice within the
4741 Jabber community, the community did not define mechanisms for
4742 specifying the language of human-readable text provided in XML
4743 character data. XMPP specifies the use of the 'xml:lang' attribute
4744 in such contexts, as defined under Stream Attributes (Section 4.4)
4745 and xml:lang (Section 9.1.5) herein.
4747 D.7 Stream Version Attribute
4749 The Jabber community did not include a 'version' attribute in stream
4750 headers. XMPP specifies inclusion of that attribute as a way to
4751 signal support for the stream features (authentication, encryption,
4752 etc.) defined under Version Support (Section 4.4.1) herein.
4759 Saint-Andre Expires November 4, 2004 [Page 85]
4761 Internet-Draft XMPP Core May 2004
4764 Intellectual Property Statement
4766 The IETF takes no position regarding the validity or scope of any
4767 intellectual property or other rights that might be claimed to
4768 pertain to the implementation or use of the technology described in
4769 this document or the extent to which any license under such rights
4770 might or might not be available; neither does it represent that it
4771 has made any effort to identify any such rights. Information on the
4772 IETF's procedures with respect to rights in standards-track and
4773 standards-related documentation can be found in BCP-11. Copies of
4774 claims of rights made available for publication and any assurances of
4775 licenses to be made available, or the result of an attempt made to
4776 obtain a general license or permission for the use of such
4777 proprietary rights by implementors or users of this specification can
4778 be obtained from the IETF Secretariat.
4780 The IETF invites any interested party to bring to its attention any
4781 copyrights, patents or patent applications, or other proprietary
4782 rights which may cover technology that may be required to practice
4783 this standard. Please address the information to the IETF Executive
4787 Full Copyright Statement
4789 Copyright (C) The Internet Society (2004). All Rights Reserved.
4791 This document and translations of it may be copied and furnished to
4792 others, and derivative works that comment on or otherwise explain it
4793 or assist in its implementation may be prepared, copied, published
4794 and distributed, in whole or in part, without restriction of any
4795 kind, provided that the above copyright notice and this paragraph are
4796 included on all such copies and derivative works. However, this
4797 document itself may not be modified in any way, such as by removing
4798 the copyright notice or references to the Internet Society or other
4799 Internet organizations, except as needed for the purpose of
4800 developing Internet standards in which case the procedures for
4801 copyrights defined in the Internet Standards process must be
4802 followed, or as required to translate it into languages other than
4805 The limited permissions granted above are perpetual and will not be
4806 revoked by the Internet Society or its successors or assignees.
4808 This document and the information contained herein is provided on an
4809 "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
4810 TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
4811 BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION
4815 Saint-Andre Expires November 4, 2004 [Page 86]
4817 Internet-Draft XMPP Core May 2004
4820 HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
4821 MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
4826 Funding for the RFC Editor function is currently provided by the
4871 Saint-Andre Expires November 4, 2004 [Page 87]