%ents; ]>
XMPP Ping This document defines an XMPP protocol extension for sending pings over XML streams. &LEGALNOTICE; 0199 Experimental Standards Track Standards JIG Council XMPP Core ping &stpeter; 0.2 2006-11-22 psa

Changed IQ-set to IQ-get; clarified requirements; specified protocol description; added use cases.

0.1 2006-11-21 psa

Initial version.

As specified in &rfc3920;, 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 &xep0124;.

This document addresses the following requirements:

  1. Determining the viability of an XML stream (i.e., its underlying binding) between a client and a server, or between two servers.
  2. Determining end-to-end connectivity between any two XMPP entities (e.g., two clients).

The XMPP ping protocol is extremely simple:

  1. The pinging entity sends an IQ-get containing a <ping/> element qualified by the 'urn:xmpp:ping' namespace.
  2. The pinged entity returns either an IQ-result (if it supports the namespace) or an IQ-error (if it does not). 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.

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.

]]>

If the other party to the stream supports the ping namespace, it MUST return an IQ result:

]]>

If the other party to the stream does not support the ping namespace, it MUST return an IQ error, which SHOULD be &unavailable;:

]]>

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.

]]>

If the other party to the stream supports the ping namespace, it MUST return an IQ result:

]]>

If the other party to the stream does not support the ping namespace, it MUST return an IQ error, which SHOULD be &unavailable;:

]]>

Pings can also be used for client-to-client (i.e., end-to-end) pings.

]]>

If the pinged entity supports the ping namespace, it SHOULD return an IQ result:

]]>

If the pinged entity does not support the ping namespace, it SHOULD return an IQ error, which SHOULD be &unavailable;:

]]>

Pings can also be used for component-to-client pings, for example from a &xep0045; component to a client.

]]>

If the pinged entity supports the ping namespace, it SHOULD return an IQ result:

]]>

If the pinged entity does not support the ping namespace, it SHOULD return an IQ error, which SHOULD be &unavailable;:

]]>

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 &IANA; is necessary as a result of this document.

The ®ISTRAR; shall include 'urn:xmpp:ping' in its registry of protocol namespaces (see &NAMESPACES;).

]]>