Interworking between the Session Initiation Protocol (SIP) and the Extensible Messaging and Presence Protocol (XMPP): Instant MessagingCiscopsaintan@cisco.comIBMBuilding 18/D, Kiryat Weizmann Science ParkRehovot76123Israelavshalom@il.ibm.comCiscojhildebr@cisco.com
Applications
XMPPJabberSIPSIMPLEIMInstant MessagingThis 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).In order to help ensure interworking between instant messaging systems that conform to the requirements of RFC 2779, it is important to clearly define protocol mappings between such systems. Within the IETF, work has proceeded on two instant messaging technologies:Various extensions to the Session Initiation Protocol () for instant messaging, as developed within the SIP for Instant Messaging and Presence Leveraging Extensions (SIMPLE) Working Group; the relevant specification for instant messaging is The Extensible Messaging and Presence Protocol (XMPP), which consists of a formalization of the core XML streaming protocols developed originally by the Jabber open-source community; the relevant specifications are for the XML streaming layer and for basic presence and instant messaging extensionsOne approach to helping ensure interworking between these protocols is to map each protocol to the abstract semantics described in ; that is the approach taken by and . 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 , 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.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:Single messages, which are sent from the sender to the recipient outside the context of any one-to-one chat session or multi-user text conference.Chat messages, which are sent from the sender to the recipient in the context of a "messaging session" between the two entities.Groupchat messages, which are sent from a sender to multiple recipients in the context of a text conference.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 . Instant messaging using SIP requests of type MESSAGE (often called "page-mode" messaging) is specified in .As described in , 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 , 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>.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 . The following is an example of such a stanza: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 , the XMPP server needs to determine the identity of the foreign domain, which it does by performing one or more lookups. For message stanzas, the order of lookups recommended by is to first try the "_xmpp-server" service as specified in and to then try the "_im" service as specified in . 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: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.)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 . The following is an example of such a request:Section 5 of 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 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 or MAY return an error to the sender (the SIP "502 Bad Gateway" error seems most appropriate; see 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: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.)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 of this document regarding handling of SIP message bodies that contain content types other than plain text.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 .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.Detailed security considerations for instant messaging protocols are given in , for SIP-based instant messaging in (see also ), and for XMPP-based instant messaging in (see also ).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 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 for instant messages. 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.Address Resolution for Instant Messaging and PresenceSIP: Session Initiation ProtocolSession Initiation Protocol (SIP) Extension for Instant MessagingInterworking between the Session Initiation Protocol (SIP) and the Extensible Messaging and Presence Protocol (XMPP): CoreAs a foundation for the definition of application-specific, bi-directional protocol mappings between the Session Initiation Protocol (SIP) and the Extensible Messaging and Presence Protocol (XMPP), this document specifies the architectural assumptions underlying such mappings as well as the mapping of addresses and error conditions.A DNS RR for specifying the location of services (DNS SRV)Troll TechWaldemar Thranes gate 98BOsloN-0175NO+47 22 806390+47 22 806380arnt@troll.noInternet Software Consortium950 Charter StreetRedwood CityCA94063US+1 650 779 7001Microsoft CorporationOne Microsoft WayRedmondWA98052USlevone@microsoft.comThis document describes a DNS RR which specifies the location of the
server(s) for a specific protocol and domain.Key words for use in RFCs to Indicate Requirement LevelsHarvard University1350 Mass. Ave.CambridgeMA 02138- +1 617 495 3864-
General
keywordIn many standards track documents several words are used to signify the requirements in the specification. These words are often capitalized. This document defines these words as they should be interpreted in IETF documents. Authors who follow these guidelines should incorporate this phrase near the beginning of their document:
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119.Note that the force of these words is modified by the requirement level of the document in which they are used.Extensible Messaging and Presence Protocol (XMPP): CoreJabber Software FoundationExtensible Messaging and Presence Protocol (XMPP): Instant Messaging and PresenceJabber Software FoundationCommon Profile for Instant Messaging (CPIM)Instant Messaging / Presence Protocol RequirementsSightPath, Inc.135 Beaver StreetWalthamMA02452USmday@alum.mit.eduMicrosoft CorporationOne Microsoft WayRedmondWA98052USsonuag@microsoft.comInto Networks, Inc.150 Cambridgepark DriveCambridgeMA02140USjesse@intonet.comPresence and Instant Messaging have recently emerged as a new medium of communications over the Internet. Presence is a means for finding, retrieving, and subscribing to changes in the presence information (e.g. "online" or "offline") of other users. Instant messaging is a means for sending small, simple messages that are delivered immediately to online users.Applications of presence and instant messaging currently use independent, non-standard and non-interoperable protocols developed by various vendors. The goal of the Instant Messaging and Presence Protocol (IMPP) Working Group is to define a standard protocol so that independently developed applications of instant messaging and/or presence can interoperate across the Internet. This document defines a minimal set of requirements that IMPP must meet.Common Presence and Instant Messaging (CPIM): Message FormatCPIM Mapping of SIMPLE Presence and Instant MessagingXHTML-IMstpeter@jabber.orgMapping the Extensible Messaging and Presence Protocol (XMPP) to Common Presence and Instant Messaging (CPIM)Jabber Software Foundation