Network Working Group | P. Saint-Andre |
Internet-Draft | Cisco Systems, Inc. |
Intended status: Standards Track | A. Houri |
Expires: December 16, 2013 | IBM |
J. Hildebrand | |
Cisco Systems, Inc. | |
June 14, 2013 |
Interworking between the Session Initiation Protocol (SIP) and the Extensible Messaging and Presence Protocol (XMPP): Addresses and Error Conditions
draft-saintandre-sip-xmpp-core-05
As a foundation for the definition of bidirectional 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.
This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79.
Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet-Drafts is at http://datatracker.ietf.org/drafts/current/.
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."
This Internet-Draft will expire on December 16, 2013.
Copyright (c) 2013 IETF Trust and the persons identified as the document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License.
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:
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.
The discussion venue for this document is the mailing list of the DISPATCH WG; visit https://www.ietf.org/mailman/listinfo/dispatch for subscription information and discussion archives.
The 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 [RFC2119].
Protocol translation between SIP and XMPP could occur in a number of different entities, depending on the architecture of real-time communication deployments. For example, protocol translation could occur within a multi-protocol server (which uses application-specific connection managers to initiate traffic to and accept traffic from clients or other servers natively using SIP/SIMPLE, XMPP, etc.), within a multi-protocol client (which enables a user to establish connections natively with various servers using SIP/SIMPLE, XMPP, etc.), or within a gateway that acts as a dedicated protocol translator (which takes one protocol as input and provides another protocol as output).
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 (naturally, these logical functions could occur in one and the same actual translator).
This document assumes that a gateway will translate directly from one protocol to the other. For the sake of the examples, we further assume that protocol translation will occur within a gateway in the source domain, so that information generated by the user of an XMPP service will be translated by a gateway within the trust domain of that XMPP service, and information generated by the user of a SIP service will be translated by a gateway within the trust domain of that SIP service. However, nothing in this document ought to be taken as recommending against protocol translation at the destination domain.
An architectural diagram for a possible 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:
##@####################################################### # # # # +-------------+----+ # +----+-------------+ # # | example.net | GW |---#---| GW | example.com | # # +-------------+----+ # +----+-------------+ # # | # | # # romeo@example.net # juliet@example.com # # # # ##########################################################
The basic SIP address format is a "sip:" or "sips:" URI as specified in [RFC3261]. When a SIP entity supports extensions for instant messaging it might be identified by an 'im:' URI as specified in the Common Profile for Instant Messaging [RFC3860] (see [RFC3428]) and when a SIP entity spports extensions for presence it might be identified by a 'pres:' URI as specified in the Common Profile for Presence [RFC3859] (see [RFC3856]).
The XMPP address format is specified in [RFC6122]; as discussed in [RFC6121], instant messaging and presence applications of XMPP also need to support 'im:' and 'pres:' URIs as specified in [RFC3860] and [RFC3859] respectively, although such support might simply involve leaving resolution of such addresses up to an XMPP server.
In this document we primarily describe mappings for addresses of the form <user@domain>; however, we also provide guidelines for mapping the addresses of specific user agent instances, which take the form of Globally Routable User Agent URIs (GRUUs) in SIP and "resourceparts" in XMPP. Mapping of protocol-specific identifiers (such as telephone numbers) is out of scope for this specification. 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 (IDNs) into non-internationalized domain names (IDNs are not allowed in the SIP address format, but are allowed in the XMPP address via Internationalized Domain Names in Applications, see [RFC6122] and [I-D.ietf-xmpp-6122bis]). Therefore, in the following sections we focus primarily on the local part of an address (these are called variously "usernames", "instant inboxes", "presentities", and "localparts" in the protocols at issue), secondarily on the instance-specific part of an address, and not at all on the domain-name part of an address.
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 need to be mapped appropriately in order to ensure interworking across systems.
The local part of a sip:/sips: URI inherits from the "userinfo" rule in [RFC3986] with several changes; here we discuss the SIP "user" rule only:
user = 1*( unreserved / escaped / user-unreserved ) user-unreserved = "&" / "=" / "+" / "$" / "," / ";" / "?" / "/" unreserved = alphanum / mark mark = "-" / "_" / "." / "!" / "~" / "*" / "'" / "(" / ")"
Here we make the simplifying assumption that the local part of an im:/pres: URI inherits from the "dot-atom-text" rule in [RFC5322] rather than the more complicated "local-part" rule:
dot-atom-text = 1*atext *("." 1*atext) atext = ALPHA / DIGIT / ; Any character except "!" / "#" / "$" / ; controls, SP, and "%" / "&" / "'" / ; specials. Used for "*" / "+" / "-" / ; atoms. "/" / "=" / "?" / "^" / "_" / "`" / "{" / "|" / "}" / "~"
The local part of an XMPP address allows any ASCII character except space, controls, and the " & ' / : < > @ characters.
To summarize the foregoing information, the following table lists the allowed and disallowed characters in the local part of identifiers for each protocol (aside from the alphanumeric, space, and control characters), in order by hexadecimal character number (where each "A" row shows the allowed characters and each "D" row shows the disallowed characters).
Table 1: Allowed and disallowed characters
+---+----------------------------------+ | SIP/SIPS CHARACTERS | +---+----------------------------------+ | A | ! $ &'()*+,-./ ; = ? _ ~ | | D | "# % : < > @[\]^ `{|} | +---+----------------------------------+ | IM/PRES CHARACTERS | +---+----------------------------------+ | A | ! #$%&' *+ - / = ? ^_`{|}~ | | D | " () , . :;< > @[\] | +---+----------------------------------+ | XMPP CHARACTERS | +---+----------------------------------+ | A | ! #$% ()*+,-. ; = ? [\]^_`{|}~ | | D | " &' /: < > @ | +---+----------------------------------+
When transforming the local part of an address from one scheme to another, an application SHOULD proceed as follows:
The meaning of a resourcepart in XMPP (i.e., the portion of a JID after the slash character, such as "foo" in "user@example.com/foo") matches that of a Globally Routable User Agent URI (GRUU) in SIP [RFC5627]. In both cases, these constructs identify a particular device associated with the bare JID ("localpart@domainpart") of an XMPP entity or with the Address of Record (AOR) of a SIP entity. Therefore, it is reasonable to map the value of a "gr" URI parameter to an XMPP resource part, and vice-versa.
Note that the "gr" URI parameter in SIP can contain only characters from the ASCII range, whereas an XMPP resourcepart can contain nearly any Unicode character [UNICODE]. Therefore Unicode characters outside the ASCII range need to be mapped to characters in the ASCII range, as described below.
The following is a high-level algorithm for mapping a sip:, sips:, im:, or pres: URI to an XMPP address:
The following is a high-level algorithm for mapping an XMPP address to a sip:, sips:, im:, or pres: URI:
SIP response codes are specified in [RFC3261] and XMPP error conditions are specified in [RFC6120]. Because there is no equivalent in XMPP for the provisional (1xx) and successful (2xx) response codes in SIP, mappings are provided only for the redirection (3xx), request failure (4xx), server failure (5xx), and glogal failure (6xx) codes.
Table 8: Mapping of XMPP error conditions to SIP response codes
+------------------------------+---------------------+ | XMPP Error Condition | SIP Response Code | +------------------------------+---------------------+ | <bad-request/> | 400 | | <conflict/> | 400 | | <feature-not-implemented/> | 501 | | <forbidden/> | 403 | | <gone/> | 410 | | <internal-server-error/> | 500 | | <item-not-found/> | 404 | | <jid-malformed/> | 484 | | <not-acceptable/> | 406 | | <not-allowed/> | 405 | | <not-authorized/> | 401 | | <recipient-unavailable/> | 480 | | <redirect/> | 300 | | <registration-required/> | 407 | | <remote-server-not-found/> | 502 | | <remote-server-timeout/> | 504 | | <resource-constraint/> | 500 | | <service-unavailable/> | 503 | | <subscription-required/> | 407 | | <undefined-condition/> | 400 | | <unexpected-request/> | 491 | +------------------------------+---------------------+
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):
Table 9: Mapping of SIP response codes to XMPP error conditions
+---------------------+------------------------------+ | SIP Response Code | XMPP Error Condition | +---------------------+------------------------------+ | 300 | <redirect/> | | 301 | <gone/> | | 302 | <redirect/> | | 305 | <redirect/> | | 380 | <not-acceptable/> | | 400 | <bad-request/> | | 401 | <not-authorized/> | | 402 | see note [1] | | 403 | <forbidden/> | | 404 | <item-not-found/> | | 405 | <not-allowed/> | | 406 | <not-acceptable/> | | 407 | <registration-required/> | | 408 | <recipient-unavailable/> | | 410 | <gone/> | | 413 | <bad-request/> | | 414 | <bad-request/> | | 415 | <bad-request/> | | 416 | <bad-request/> | | 420 | <bad-request/> | | 421 | <bad-request/> | | 423 | <bad-request/> | | 480 | <recipient-unavailable/> | | 481 | <item-not-found/> | | 482 | <not-acceptable/> | | 483 | <not-acceptable/> | | 484 | <jid-malformed/> | | 485 | <item-not-found/> | | 486 | <recipient-unavailable/> | | 487 | <recipient-unavailable/> | | 488 | <not-acceptable/> | | 491 | <unexpected-request/> | | 493 | <bad-request/> | | 500 | <internal-server-error/> | | 501 | <feature-not-implemented/> | | 502 | <remote-server-not-found/> | | 503 | <service-unavailable/> | | 504 | <remote-server-timeout/> | | 505 | <not-acceptable/> | | 513 | <bad-request/> | | 600 | <recipient-unavailable/> | | 603 | <recipient-unavailable/> | | 604 | <item-not-found/> | | 606 | <not-acceptable/> | +---------------------+------------------------------+
Detailed security considerations for SIP are given in [RFC3261] and for XMPP in [RFC6120].
This document requests no actions of IANA.
The authors wish to thank the following individuals for their feedback: Fabio Forno, Adrian Georgescu, Saul Ibarra, Markus Isomaki, Salvatore Loreto, Daniel-Constantin Mierla, Tory Patnoe, and Robert Sparks.