Interworking between the Session Initiation Protocol (SIP) and the Extensible Messaging and Presence Protocol (XMPP): CoreCiscopsaintan@cisco.comIBMBuilding 18/D, Kiryat Weizmann Science ParkRehovot76123Israelavshalom@il.ibm.comCiscojhildebr@cisco.com
Applications
XMPPSIPAs 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.The IETF has worked on two signalling technologies that can be used for multimedia session negotiation, messaging, presence, capabilities discovery, notifications, and other application-level functionality:The Session Initiation Protocol , along with various SIP extensions developed within the SIP for Instant Messaging and Presence Leveraging Extensions (SIMPLE) Working Group.The Extensible Messaging and Presence Protocol , along with various XMPP extensions developed by the IETF as well as by the XMPP Standards Foundation.Because these technologies are widely deployed, it is important to clearly define mappings between them for the sake of interworking. This document inaugurates a series of SIP-XMPP interworking specifications by defining the architectural assumptions underlying such mappings as well as the mapping of addresses and error conditions.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.Protocol translation between SIP and XMPP could occur in a number of different entities, depending on the architecture of presence and messaging deployments. For example, protocol translation could occur within a multi-protocol server, within a multi-protocol client, or within a gateway that acts as a dedicated protocol translator.This document assumes that the protocol translation will occur within a gateway. (This assumption not meant to discourage protocol translation within multi-protocol clients or servers; instead, this assumption is followed mainly to clarify the discussion and examples so that the protocol translation principles can be more easily understood and can be applied by client and server implementors with appropriate modifications to the examples and terminology.) Specifically, we assume that the protocol translation will occur within an "XMPP-to-SIP gateway" that translates XMPP syntax and semantics on behalf of an XMPP service when communicating with SIP services and/or within a "SIP-to-XMPP gateway" that translates SIP syntax and semantics on behalf of a SIP service when communicating with XMPP services.This document assumes that a gateway will translate directly from one protocol to the other. We further assume that protocol translation will occur within a gateway in the source domain, so that messages and presence information generated by the user of an XMPP service will be translated by a gateway within the trust domain of that XMPP service, and messages and presence information generated by the user of a SIP service will be translated by a gateway within the trust domain of that SIP service.An architectural diagram for a typical gateway deployment is shown below, where the entities have the following significance and the "#" character is used to show the boundary of a trust domain:romeo@example.net -- a SIP user.example.net -- a SIP service.s2x.example.net -- a SIP-to-XMPP gateway.juliet@example.com -- an XMPP user.example.com -- an XMPP service.x2s.example.com -- an XMPP-to-SIP gateway.The basic SIP address format is a "sip:" or "sips:" URI as specified in . When a SIP entity supports extensions for instant messageing it may be identified by an 'im:' URI as specified in (see ) and when a SIP entity spports extensions for presence it may be identified by a 'pres:' URI as specified in (see ).The XMPP address format is specified in ; as specified in , instant messaging and presence applications of XMPP must also support 'im:' and 'pres:' URIs as specified in and respectively, although such support may simply involve leaving resolution of such addresses up to an XMPP server.In this document we describe mappings for addresses of the form <user@domain> only, ignoring (for the purpose of address mapping) any protocol-specific extensions such as SIP telephone numbers and passwords or XMPP resource identifiers. In addition, we have ruled the mapping of domain names as out of scope for now since that is a matter for the Domain Name System; specifically, the issue for interworking between SIP and XMPP relates to the translation of fully internationalized domain names (which the SIP address format does not allow, but which the XMPP address format does allow via ) into non-internationalized domain names. Therefore, in the following sections we discuss local-part addresses only (these are called variously "usernames", "instant inboxes", "presentities", and "node identifiers" in the protocols at issue).The sip:/sips:, im:/pres:, and XMPP address schemes allow different sets of characters (although all three allow alphanumeric characters and disallow both spaces and control characters). In some cases, characters allowed in one scheme are disallowed in others; these characters must be mapped appropriately in order to ensure interworking across systems.The local-part address in sip:/sips: URIs inherits from the "userinfo" rule in with several changes; here we discuss the SIP "user" rule only:Here we make the simplifying assumption that the local-part address in im:/pres: URIs inherits from the "dot-atom-text" rule in rather than the more complicated "local-part" rule:The local-part address in XMPP addresses allows any US-ASCII character except space, controls, and the " & ' / : < > @ characters.Therefore, following table lists the allowed and disallowed characters in the local-part addresses of each protocol (aside from the alphanumeric, space, and control characters), in order by hexadecimal character number (where the "A" row shows the allowed characters and the "D" row shows the disallowed characters).When transforming a local-part address from one scheme to another, an application SHOULD proceed as follows:Unescape any escaped characters in the source address (e.g., from SIP to XMPP unescape "%2F" to "/" and from XMPP to SIP unescape "\27" to "'").Leave unmodified any characters that are allowed in the destination scheme.Escape any characters that are allowed in the source scheme but reserved in the destination scheme, as escaping is defined for the destination scheme. In particular:
Where the destination scheme is a URI (i.e., an im:, pres:, sip:, or sips: URI), each reserved character MUST be percent-encoded to "%hexhex" as specified in Section 2.6 of (e.g., when transforming from XMPP to SIP, encode "/" as "%2F").Where the destination scheme is a native XMPP address, each reserved character MUST be encoded to "\hexhex" as specified in (e.g., when transforming from SIP to XMPP, encode "'" as "\27").The following is a high-level algorithm for mapping a sip:, sips:, im:, or pres: URI to an XMPP address:Remove URI scheme.Split at the first '@' character into local-part and hostname (mapping the latter is out of scope).Translate %hexhex to equivalent octets.Treat result as a UTF-8 string.Translate "&" to "\26", "'" to "\27", and "/" to "\2f" respectively in order to properly handle the characters disallowed in XMPP addresses but allowed in sip:/sips: URIs and im:/pres: URIs as shown in Column 3 of Table 3 above (this is consistent with ).Apply Nodeprep profile of (as specified in ) for canonicalization (OPTIONAL).Recombine local-part with mapped hostname to form local@domain address.The following is a high-level algorithm for mapping an XMPP address to a sip:, sips:, im:, or pres: URI:Split XMPP address into node identifier (local-part; mapping described in remaining steps), domain identifier (hostname; mapping is out of scope), and resource identifier (specifier for particular device or connection; discard this for cross-system interworking).Apply Nodeprep profile of (as specified in ) for canonicalization (OPTIONAL).Translate "\26" to "&", "\27" to "'", and "\2f" to "/" respectively (this is consistent with ).Determine if the foreign domain supports im: and pres: URIs (discovered via lookup as specified in ), else assume that the foreign domain supports sip:/sips: URIs.If converting into im: or pres: URI, for each byte, if the byte is in the set (),.;[\] (i.e., the partial complement from Row 3, Column 2 of Table 3 above) or is a UTF-8 character outside the US-ASCII range then transform that byte to %hexhex. If converting into sip: or sips: URI, for each byte, if the byte is in the set #%[\]^`{|} (i.e., the partial complement from Row 3, Column 1 of Table 3 above) or is a UTF-8 character outside the US-ASCII range then transform that byte to %hexhex.Combine resulting local-part with mapped hostname to form local@domain address.Prepend with 'im:' scheme (for XMPP <message/> stanzas) or 'pres:' scheme (for XMPP <presence/> stanzas) if foreign domain supports these, else prepend with 'sip:' or 'sips:' scheme according to local service policy.SIP response codes are specified in and XMPP error conditions are specified in .The mapping of SIP response codes to XMPP error conditions SHOULD be as follows (note that XMPP does not include 100-series or 200-series response codes, only error conditions):Detailed security considerations for SIP are given in and for XMPP in .SIP: Session Initiation ProtocolKey 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.Uniform Resource Identifier (URI): Generic SyntaxWorld Wide Web ConsortiumMassachusetts Institute of Technology77 Massachusetts AvenueCambridgeMA02139USA+1-617-253-5702+1-617-258-5999timbl@w3.orghttp://www.w3.org/People/Berners-Lee/Day Software5251 California Ave., Suite 110IrvineCA92617USA+1-949-679-2960+1-949-679-2972fielding@gbiv.comhttp://roy.gbiv.com/Adobe Systems Incorporated345 Park AveSan JoseCA95110USA+1-408-536-3024LMM@acm.orghttp://larry.masinter.net/
Applications
uniform resource identifierURIURLURNWWWresource
A Uniform Resource Identifier (URI) is a compact sequence of characters
that identifies an abstract or physical resource. This specification
defines the generic URI syntax and a process for resolving URI references
that might be in relative form, along with guidelines and security
considerations for the use of URIs on the Internet.
The URI syntax defines a grammar that is a superset of all valid URIs,
allowing an implementation to parse the common components of a URI
reference without knowing the scheme-specific requirements of every
possible identifier. This specification does not define a generative
grammar for URIs; that task is performed by the individual
specifications of each URI scheme.
Guidelines and Registration Procedures for New URI SchemesAT&T Laboratories200 Laurel Ave.MiddletownNJ07748UStony+urireg@maillennium.att.comQualcomm, Inc.675 Campbell Technology ParkwayCampbellCAUShardie@qualcomm.comAdobe Systems345 Park AveSan JoseCA95110USLMM@acm.orgThis document provides guidelines and recommendations for the definition of Uniform Resource Identifier (URI) schemes. It also updates the process and IANA registry for URI schemes. It obsoletes both RFC 2717 and RFC 2718.Extensible Messaging and Presence Protocol (XMPP): CoreJabber Software FoundationCommon Profile for Instant Messaging (CPIM)Common Profile for Presence (CPP)Internationalizing Domain Names in Applications (IDNA)Internet Message FormatThis document specifies a syntax for text messages that are sent between computer users, within the framework of "electronic mail" messages. [STANDARDS TRACK] Session Initiation Protocol (SIP) Extension for Instant MessagingA Presence Event Package for the Session Initiation Protocol (SIP)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.Preparation of Internationalized Strings ("STRINGPREP")JID Escapingstpeter@jabber.orgjhildebrand@jabber.comExtensible Messaging and Presence Protocol (XMPP): Instant Messaging and PresenceJabber Software Foundation