TOC |
|
By submitting this Internet-Draft, each author represents that any applicable patent or other IPR claims of which he or she is aware have been or will be disclosed, and any of which he or she becomes aware will be disclosed, in accordance with Section 6 of BCP 79.
Internet-Drafts are working documents of the Internet Engineering Task Force (IETF), its areas, and its working groups. Note that other groups may also distribute working documents as Internet-Drafts.
Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as “work in progress.”
The list of current Internet-Drafts can be accessed at http://www.ietf.org/ietf/1id-abstracts.txt.
The list of Internet-Draft Shadow Directories can be accessed at http://www.ietf.org/shadow.html.
This Internet-Draft will expire on July 7, 2008.
This document defines a bi-directional protocol mapping for the exchange of single instant messages between the Session Initiation Protocol (SIP) and the Extensible Messaging and Presence Protocol (XMPP).
1.
Introduction
2.
Instant Messages
2.1.
Overview
2.2.
XMPP to SIP
2.3.
SIP to XMPP
3.
Content Types
4.
Security Considerations
5.
References
5.1.
Normative References
5.2.
Informative References
§
Authors' Addresses
§
Intellectual Property and Copyright Statements
TOC |
In order to help ensure interworking between instant messaging systems that conform to the requirements of RFC 2779 (Day, M., Aggarwal, S., and J. Vincent, “Instant Messaging / Presence Protocol Requirements,” February 2000.) [IMP‑REQS], it is important to clearly define protocol mappings between such systems. Within the IETF, work has proceeded on two instant messaging technologies:
One approach to helping ensure interworking between these protocols is to map each protocol to the abstract semantics described in [CPIM] (Peterson, J., “Common Profile for Instant Messaging (CPIM),” August 2004.); that is the approach taken by [SIMPLE‑CPIM] (Rosenberg, J. and B. Campbell, “CPIM Mapping of SIMPLE Presence and Instant Messaging,” June 2002.) and [XMPP‑CPIM] (Saint-Andre, P., “Mapping the Extensible Messaging and Presence Protocol (XMPP) to Common Presence and Instant Messaging (CPIM),” October 2004.). The approach taken in this document is to directly map semantics from one protocol to another (i.e., from SIP/SIMPLE to XMPP and vice-versa).
The architectural assumptions underlying such direct mappings are provided in [SIP‑XMPP] (Saint-Andre, P., Houri, A., and J. Hildebrand, “Interworking between the Session Initiation Protocol (SIP) and the Extensible Messaging and Presence Protocol (XMPP): Core,” January 2008.), including mapping of addresses and error condisions. The mappings specified in this document cover basic instant messaging functionality, i.e., the exchange of a single instant message between a SIP user and an XMPP user in either direction. Mapping of more advanced functionality is out of scope for this document, but other documents in this "series" cover such topics.
Note: The capitalized key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119 (Bradner, S., “Key words for use in RFCs to Indicate Requirement Levels,” March 1997.) [TERMS].
TOC |
TOC |
Both XMPP and IM-aware SIP systems enable entities (often but not necessarily human users) to send "instant messages" to other entities. The term "instant message" usually refers to messages sent between two entities for delivery in close to real time (rather than messages that are stored and forwarded to the intended recipient upon request). Generally there are three kinds of instant message:
This document covers single messages only, since they form the "lowest common denominator" for instant messaging on the Internet. It is likely that future documents will address one-to-one chat sessions and multi-user chat.
Instant messaging using XMPP message stanzas of type "normal" is specified in [XMPP‑IM] (Saint-Andre, P., “Extensible Messaging and Presence Protocol (XMPP): Instant Messaging and Presence,” October 2004.). Instant messaging using SIP requests of type MESSAGE (often called "page-mode" messaging) is specified in [SIP‑IM] (Campbell, B., Rosenberg, J., Schulzrinne, H., Huitema, C., and D. Gurle, “Session Initiation Protocol (SIP) Extension for Instant Messaging,” December 2002.).
As described in [XMPP‑IM] (Saint-Andre, P., “Extensible Messaging and Presence Protocol (XMPP): Instant Messaging and Presence,” October 2004.), a single instant message is an XML <message/> stanza of type "normal" sent over an XML stream (since "normal" is the default for the 'type' attribute of the <message/> stanza, the attribute is often omitted). In this document we will assume that such a message is sent from an XMPP client to an XMPP server over an XML stream negotiated between the client and the server, and that the client is controlled by a human user (this is a simplifying assumption introduced for explanatory purposes only; the XMPP sender could be a bot-controlled client, a component such as a workflow application, a server, etc.). Continuing the tradition of Shakespeare examples in XMPP documentation, we will say that the XMPP user has an XMPP address of <juliet@example.com>.
As described in [SIP‑IM] (Campbell, B., Rosenberg, J., Schulzrinne, H., Huitema, C., and D. Gurle, “Session Initiation Protocol (SIP) Extension for Instant Messaging,” December 2002.), a single instant message is a SIP MESSAGE request sent from a SIP user agent to an intended recipient who is most generally referenced by an Instant Message URI of the form <im:user@domain> but who may be referenced by a SIP or SIPS URI of the form <sip:user@domain> or <sips:user@domain> Here again we introduce the simplifying assumption that the user agent is controlled by a human user, whom we shall dub <romeo@example.net>.
TOC |
When Juliet wants to send an instant message to Romeo, she interacts with her XMPP client, which generates an XMPP <message/> stanza. The syntax of the <message/> stanza, including required and optional elements and attributes, is defined in [XMPP‑IM] (Saint-Andre, P., “Extensible Messaging and Presence Protocol (XMPP): Instant Messaging and Presence,” October 2004.). The following is an example of such a stanza:
Example: XMPP user sends message:
| <message from='juliet@example.com/balcony' | to='romeo@example.net'> | <body>Art thou not Romeo, and a Montague?</body> | </message>
Upon receiving such a stanza, the XMPP server to which Juliet has connected either delivers it to a local recipient (if the hostname in the 'to' attribute matches one of the hostnames serviced by the XMPP server) or attempts to route it to the foreign domain that services the hostname in the 'to' attribute. Naturally, in this document we assume that the hostname in the 'to' attribute is an IM-aware SIP service hosted by a separate server. As specified in [XMPP‑IM] (Saint-Andre, P., “Extensible Messaging and Presence Protocol (XMPP): Instant Messaging and Presence,” October 2004.), the XMPP server needs to determine the identity of the foreign domain, which it does by performing one or more [SRV] (Gulbrandsen, A., Vixie, P., and L. Esibov, “A DNS RR for specifying the location of services (DNS SRV),” February 2000.) lookups. For message stanzas, the order of lookups recommended by [XMPP‑IM] (Saint-Andre, P., “Extensible Messaging and Presence Protocol (XMPP): Instant Messaging and Presence,” October 2004.) is to first try the "_xmpp-server" service as specified in [XMPP] (Saint-Andre, P., “Extensible Messaging and Presence Protocol (XMPP): Core,” October 2004.) and to then try the "_im" service as specified in [IMP‑SRV] (Peterson, J., “Address Resolution for Instant Messaging and Presence,” August 2004.). Here we assume that the first lookup will fail but that the second lookup will succeed and return a resolution "_im._simple.example.net.", since we have already assumed that the example.net hostname is running a SIP instant messaging service. (Note: The XMPP server may have previously determined that the foreign domain is a SIMPLE server, in which case it would not need to perform the SRV lookups; the caching of such information is a matter of implementation and local service policy, and is therefore out of scope for this document.)
Once the XMPP server has determined that the foreign domain is serviced by a SIMPLE server, it must determine how to proceed. We here assume that the XMPP server contains or has available to it an XMPP-SIMPLE gateway. The XMPP server would then deliver the message stanza to the XMPP-SIMPLE gateway.
The XMPP-SIMPLE gateway is then responsible for translating the XMPP message stanza into a SIP MESSAGE request from the XMPP user to the SIP user:
Example: XMPP user sends message (SIP transformation):
| MESSAGE sip:romeo@example.net SIP/2.0 | Via: SIP/2.0/TCP x2s.example.com;branch=z9hG4bK776sgdkse | Max-Forwards: 70 | From: sip:juliet@example.com;tag=49583 | To: sip:romeo@example.net | Call-ID: Hr0zny9l3@example.com | CSeq: 1 MESSAGE | Content-Type: text/plain | Content-Length: 35 | | Art thou not Romeo, and a Montague?
The mapping of XMPP syntax elements to SIP syntax elements SHOULD be as shown in the following table. (Mappings for elements not mentioned are undefined.)
Table 4: Message syntax mapping from XMPP to SIP
+-----------------------------+--------------------------+ | XMPP Element or Attribute | SIP Header or Contents | +-----------------------------+--------------------------+ | <body/> | body of MESSAGE | | <subject/> | Subject | | <thread/> | Call-ID | | from | From | | id | (no mapping) | | to | To | | type | (no mapping) | | xml:lang | Content-Language | +-----------------------------+--------------------------+
TOC |
When Romeo wants to send an instant message to Juliet, he interacts with his SIP user agent, which generates a SIP MESSAGE request. The syntax of the MESSAGE request is defined in [SIP‑IM] (Campbell, B., Rosenberg, J., Schulzrinne, H., Huitema, C., and D. Gurle, “Session Initiation Protocol (SIP) Extension for Instant Messaging,” December 2002.). The following is an example of such a request:
Example: SIP user sends message:
| MESSAGE sip:juliet@example.com SIP/2.0 | Via: SIP/2.0/TCP s2x.example.net;branch=z9hG4bKeskdgs677 | Max-Forwards: 70 | From: sip:romeo@example.net;tag=38594 | To: sip:juliet@example.com | Call-ID: M4spr4vdu@example.net | CSeq: 1 MESSAGE | Content-Type: text/plain | Content-Length: 44 | | Neither, fair saint, if either thee dislike.
Section 5 of [SIP‑IM] (Campbell, B., Rosenberg, J., Schulzrinne, H., Huitema, C., and D. Gurle, “Session Initiation Protocol (SIP) Extension for Instant Messaging,” December 2002.) stipulates that a SIP User Agent presented with an im: URI should resolve it to a sip: or sips: URI. Therefore we assume that the To header of a request received by a SIMPLE-XMPP gateway will contain a sip: or sips: URI. The gateway SHOULD resolve that address to an im: URI for SIP MESSAGE requests, then follow the rules in [IMP‑SRV] (Peterson, J., “Address Resolution for Instant Messaging and Presence,” August 2004.) regarding the "_im" SRV service for the target domain contained in the To header. If SRV address resolution fails for the "_im" service, the gateway MAY attempt a lookup for the "_xmpp-server" service as specified in [XMPP] (Saint-Andre, P., “Extensible Messaging and Presence Protocol (XMPP): Core,” October 2004.) or MAY return an error to the sender (the SIP "502 Bad Gateway" error seems most appropriate; see [SIP‑XMPP] (Saint-Andre, P., Houri, A., and J. Hildebrand, “Interworking between the Session Initiation Protocol (SIP) and the Extensible Messaging and Presence Protocol (XMPP): Core,” January 2008.) for details). If SRV address resolution succeeds, the gateway is responsible for translating the request into an XMPP message stanza from the SIP user to the XMPP user and returning a SIP "200 OK" message to the sender:
Example: SIP user sends message (XMPP transformation):
| <message from='romeo@example.net' | to='juliet@example.com'> | <body>Neither, fair saint, if either thee dislike.</body> | </message>
The mapping of SIP syntax elements to XMPP syntax elements SHOULD be as shown in the following table. (Mappings for elements not mentioned in the foregoing table are undefined.)
Table 5: Message syntax mapping from SIP to XMPP
+--------------------------+-----------------------------+ | SIP Header or Contents | XMPP Element or Attribute | +--------------------------+-----------------------------+ | Call-ID | <thread/> | | Content-Language | xml:lang | | CSeq | (no mapping) | | From | from | | Subject | <subject/> | | To | to | | body of MESSAGE | <body/> | +--------------------------+-----------------------------+
Note: When transforming SIP page-mode messages, a SIMPLE-XMPP gateway SHOULD specify no XMPP 'type' attribute or a 'type' attribute whose value is "normal" (alternatively, the value of the 'type' attribute MAY be "chat", although it SHOULD NOT be "headline" and MUST NOT be "groupchat").
Note: See the Content Types (Content Types) of this document regarding handling of SIP message bodies that contain content types other than plain text.
TOC |
SIP requests of type MESSAGE may contain essentially any content type. The recommended procedures for SIMPLE-to-XMPP gateways to use in handling these content types are as follows.
A SIMPLE-to-XMPP gateway MUST process SIP messages that contain message bodies of type "text/plain" and MUST encapsulate such message bodies as the XML character data of the XMPP <body/> element.
A SIMPLE-to-XMPP gateway SHOULD process SIP messages that contain message bodies of type "text/html"; if so, a gateway MUST transform the "text/html" content into XHTML content that conforms to the XHTML 1.0 Integration Set specified in [XEP‑0071] (Saint-Andre, P., “XHTML-IM,” January 2006.).
A SIMPLE-to-XMPP gateway MAY process SIP messages that contain message bodies of types other than "text/plain" and "text/html" but handling of such content types is a matter of implementation.
TOC |
Detailed security considerations for instant messaging protocols are given in [IMP‑REQS] (Day, M., Aggarwal, S., and J. Vincent, “Instant Messaging / Presence Protocol Requirements,” February 2000.), for SIP-based instant messaging in [SIP‑IM] (Campbell, B., Rosenberg, J., Schulzrinne, H., Huitema, C., and D. Gurle, “Session Initiation Protocol (SIP) Extension for Instant Messaging,” December 2002.) (see also [SIP] (Rosenberg, J., Schulzrinne, H., Camarillo, G., Johnston, A., Peterson, J., Sparks, R., Handley, M., and E. Schooler, “SIP: Session Initiation Protocol,” June 2002.)), and for XMPP-based instant messaging in [XMPP‑IM] (Saint-Andre, P., “Extensible Messaging and Presence Protocol (XMPP): Instant Messaging and Presence,” October 2004.) (see also [XMPP] (Saint-Andre, P., “Extensible Messaging and Presence Protocol (XMPP): Core,” October 2004.)).
This document specifies methods for exchanging instant messages information through a gateway that translates between SIP and XMPP. Such a gateway MUST be compliant with the minimum security requirements of the instant messaging protocols for which it translates (i.e., SIP and XMPP). The addition of gateways to the security model of instant messaging specified in [IMP‑REQS] (Day, M., Aggarwal, S., and J. Vincent, “Instant Messaging / Presence Protocol Requirements,” February 2000.) introduces some new risks. In particular, end-to-end security properties (especially confidentiality and integrity) between instant messaging user agents that interface through a SIMPLE-XMPP gateway can be provided only if common formats are supported. Specification of those common formats is out of scope for this document, although it is recommended to use [MSGFMT] (Klyne, G. and D. Atkins, “Common Presence and Instant Messaging (CPIM): Message Format,” August 2004.) for instant messages.
[IMP‑REQS] (Day, M., Aggarwal, S., and J. Vincent, “Instant Messaging / Presence Protocol Requirements,” February 2000.) requires that conformant technologies shall include methods for blocking communications from unwanted addresses. Such blocking is the responsibility of conformant technology (e.g., XMPP or SIP) and is out of scope for this memo.
TOC |
TOC |
TOC |
[CPIM] | Peterson, J., “Common Profile for Instant Messaging (CPIM),” RFC 3860, August 2004 (TXT). |
[IMP-REQS] | Day, M., Aggarwal, S., and J. Vincent, “Instant Messaging / Presence Protocol Requirements,” RFC 2779, February 2000 (TXT). |
[MSGFMT] | Klyne, G. and D. Atkins, “Common Presence and Instant Messaging (CPIM): Message Format,” RFC 3862, August 2004 (TXT). |
[SIMPLE-CPIM] | Rosenberg, J. and B. Campbell, “CPIM Mapping of SIMPLE Presence and Instant Messaging,” draft-ietf-simple-cpim-mapping-01 (work in progress), June 2002 (TXT). |
[XEP-0071] | Saint-Andre, P., “XHTML-IM,” XSF XEP 0071, January 2006. |
[XMPP-CPIM] | Saint-Andre, P., “Mapping the Extensible Messaging and Presence Protocol (XMPP) to Common Presence and Instant Messaging (CPIM),” RFC 3922, October 2004 (TXT). |
TOC |
Peter Saint-Andre | |
XMPP Standards Foundation | |
P.O. Box 1641 | |
Denver, CO 80201 | |
USA | |
Email: | stpeter@jabber.org |
Avshalom Houri | |
IBM | |
Building 18/D, Kiryat Weizmann Science Park | |
Rehovot 76123 | |
Israel | |
Email: | avshalom@il.ibm.com |
Joe Hildebrand | |
Jabber, Inc. | |
1899 Wynkoop Street, Suite 600 | |
Denver, CO 80202 | |
USA | |
Email: | jhildebrand@jabber.com |
TOC |
Copyright © The IETF Trust (2008).
This document is subject to the rights, licenses and restrictions contained in BCP 78, and except as set forth therein, the authors retain all their rights.
This document and the information contained herein are provided on an “AS IS” basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY, THE IETF TRUST AND THE INTERNET ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
The IETF takes no position regarding the validity or scope of any Intellectual Property Rights or other rights that might be claimed to pertain to the implementation or use of the technology described in this document or the extent to which any license under such rights might or might not be available; nor does it represent that it has made any independent effort to identify any such rights. Information on the procedures with respect to rights in RFC documents can be found in BCP 78 and BCP 79.
Copies of IPR disclosures made to the IETF Secretariat and any assurances of licenses to be made available, or the result of an attempt made to obtain a general license or permission for the use of such proprietary rights by implementers or users of this specification can be obtained from the IETF on-line IPR repository at http://www.ietf.org/ipr.
The IETF invites any interested party to bring to its attention any copyrights, patents or patent applications, or other proprietary rights that may cover technology that may be required to implement this standard. Please address the information to the IETF at ietf-ipr@ietf.org.