This document defines an XMPP protocol extension for sending pings over XML streams.
WARNING: This Standards-Track document is Experimental. Publication as an XMPP Extension Protocol does not imply approval of this proposal by the XMPP Standards Foundation. Implementation of the protocol described herein is encouraged in exploratory implementations, but production systems should not deploy implementations of this protocol until it advances to a status of Draft.
Series: XEP
Number: 0199
Publisher: XMPP Standards Foundation
Status:
Experimental
Type:
Standards Track
Version: 0.2
Last Updated: 2006-11-22
Approving Body: XMPP Council
Dependencies: XMPP Core
Supersedes: None
Superseded By: None
Short Name: ping
Wiki Page: <http://wiki.jabber.org/index.php/XMPP Ping (XEP-0199)>
Email:
stpeter@jabber.org
JabberID:
stpeter@jabber.org
This XMPP Extension Protocol is copyright 1999 - 2007 by the XMPP Standards Foundation (XSF) and is in full conformance with the XSF's Intellectual Property Rights Policy <http://www.xmpp.org/extensions/ipr-policy.shtml>. This material may be distributed only subject to the terms and conditions set forth in the Creative Commons Attribution License (<http://creativecommons.org/licenses/by/2.5/>).
The preferred venue for discussion of this document is the Standards discussion list: <http://mail.jabber.org/mailman/listinfo/standards>.
The Extensible Messaging and Presence Protocol (XMPP) is defined in the XMPP Core (RFC 3920) and XMPP IM (RFC 3921) specifications contributed by the XMPP Standards Foundation to the Internet Standards Process, which is managed by the Internet Engineering Task Force in accordance with RFC 2026. Any protocol defined in this document has been developed outside the Internet Standards Process and is to be understood as an extension to XMPP rather than as an evolution, development, or modification of XMPP itself.
The following keywords as used in this document are to be interpreted as described in RFC 2119: "MUST", "SHALL", "REQUIRED"; "MUST NOT", "SHALL NOT"; "SHOULD", "RECOMMENDED"; "SHOULD NOT", "NOT RECOMMENDED"; "MAY", "OPTIONAL".
1. Introduction
2. Requirements
3. Protocol
4. Use Cases
4.1. Client-To-Server Pings
4.2. Server-To-Server Pings
4.3. Client-to-Client Pings
4.4. Component-to-Client Pings
5. Security Considerations
6. IANA Considerations
7. XMPP Registrar Considerations
7.1. Protocol Namespaces
8. XML Schema
Notes
Revision History
As specified in RFC 3920 [1], the XML streams used in XMPP are bound to TCP. Unfortunately, TCP connections can go down without the application (XMPP) layer knowing about it. The traditional approach to solving this issue has been to periodically send so-called "whitespace pings" over the XML stream. This document recommends a more XML-friendly approach, which can also be used with other bindings such as the HTTP Binding [2].
This document addresses the following requirements:
The XMPP ping protocol is extremely simple:
The number of "hops" for which the ping tests connectivity depends on how far the pinged entity is from the pinging entity, as shown in the following use cases.
One popular usage is for a server to test the viability of the underlying stream connection by pinging a connected client (note: a client may send pings as well). This is done by sending an <iq/> get over the stream between the two entities.
<iq from='capulet.com' to='juliet@capulet.com/balcony' id='ping123' type='get'> <ping xmlns='urn:xmpp:ping'/> </iq>
If the other party to the stream supports the ping namespace, it MUST return an IQ result:
<iq from='juliet@capulet.com/balcony' to='capulet.com' id='ping123' type='result'/>
If the other party to the stream does not support the ping namespace, it MUST return an IQ error, which SHOULD be <service-unavailable/>:
<iq from='juliet@capulet.com/balcony' to='capulet.com' id='ping123' type='error'> <ping xmlns='urn:xmpp:ping'/> <error type='cancel'> <service-unavailable xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/> </error> </iq>
Pings can also be used to test a server-to-server connection. This is done by sending an <iq/> get over the stream from one server to another.
<iq from='capulet.com' to='montague.net' id='ping234' type='get'> <ping xmlns='urn:xmpp:ping'/> </iq>
If the other party to the stream supports the ping namespace, it MUST return an IQ result:
<iq from='montague.net' to='capulet.com' id='ping234' type='result'/>
If the other party to the stream does not support the ping namespace, it MUST return an IQ error, which SHOULD be <service-unavailable/>:
<iq from='montague.net' to='capulet.com' id='ping234' type='error'> <ping xmlns='urn:xmpp:ping'/> <error type='cancel'> <service-unavailable xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/> </error> </iq>
Pings can also be used for client-to-client (i.e., end-to-end) pings.
<iq from='romeo@montague.net/home' to='juliet@capulet.com/chamber' type='get' id='ping345'> <ping xmlns='urn:xmpp:ping'/> </iq>
If the pinged entity supports the ping namespace, it SHOULD return an IQ result:
<iq from='juliet@capulet.com/chamber' to='romeo@montague.net/home' id='ping345' type='result'/>
If the pinged entity does not support the ping namespace, it SHOULD return an IQ error, which SHOULD be <service-unavailable/>:
<iq from='juliet@capulet.com/chamber' to='romeo@montague.net/home' id='ping345' type='result'> <ping xmlns='urn:xmpp:ping'/> <error type='cancel'> <service-unavailable xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/> </error> </iq>
Pings can also be used for component-to-client pings, for example from a Multi-User Chat [4] component to a client.
<iq from='chat.shakespeare.lit' to='juliet@capulet.com/chamber' type='get' id='ping456'> <ping xmlns='urn:xmpp:ping'/> </iq>
If the pinged entity supports the ping namespace, it SHOULD return an IQ result:
<iq from='juliet@capulet.com/chamber' to='chat.shakespeare.lit' id='ping456' type='result'/>
If the pinged entity does not support the ping namespace, it SHOULD return an IQ error, which SHOULD be <service-unavailable/>:
<iq from='juliet@capulet.com/chamber' to='chat.shakespeare.lit' id='ping456' type='error'> <ping xmlns='urn:xmpp:ping'/> <error type='cancel'> <service-unavailable xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/> </error> </iq>
A pinged entity MAY ignore the IQ (i.e., return neither a result nor an error) if doing so would reveal its presence information to an entity that is not authorized to view that information; this mainly applies to client-to-client pings.
No interaction with the Internet Assigned Numbers Authority (IANA) [5] is necessary as a result of this document.
The XMPP Registrar [6] shall include 'urn:xmpp:ping' in its registry of protocol namespaces (see <http://www.xmpp.org/registrar/namespaces.html>).
<?xml version='1.0' encoding='UTF-8'?> <xs:schema xmlns:xs='http://www.w3.org/2001/XMLSchema' targetNamespace='urn:xmpp:ping' xmlns='urn:xmpp:ping' elementFormDefault='qualified'> <xs:element name='ping' type='empty'/> <xs:simpleType name='empty'> <xs:restriction base='xs:string'> <xs:enumeration value=''/> </xs:restriction> </xs:simpleType> </xs:schema>
1. RFC 3920: Extensible Messaging and Presence Protocol (XMPP): Core <http://tools.ietf.org/html/rfc3920>.
2. XEP-0124: HTTP Binding <http://www.xmpp.org/extensions/xep-0124.html>.
3. The pinged entity MAY ignore the IQ (i.e., return neither a result nor an error) if doing so would reveal its presence information to an entity that is not authorized to view that information; this mainly applies to client-to-client pings.
4. XEP-0045: Multi-User Chat <http://www.xmpp.org/extensions/xep-0045.html>.
5. The Internet Assigned Numbers Authority (IANA) is the central coordinator for the assignment of unique parameter values for Internet protocols, such as port numbers and URI schemes. For further information, see <http://www.iana.org/>.
6. The XMPP Registrar maintains a list of reserved protocol namespaces as well as registries of parameters used in the context of XMPP extension protocols approved by the XMPP Standards Foundation. For further information, see <http://www.xmpp.org/registrar/>.
Changed IQ-set to IQ-get; clarified requirements; specified protocol description; added use cases.
(psa)Initial version.
(psa)END