diff --git a/xep-0199.xml b/xep-0199.xml index c1c795f0..96cb1c88 100644 --- a/xep-0199.xml +++ b/xep-0199.xml @@ -19,8 +19,14 @@ - ping + TO BE ASSIGNED &stpeter; + + 0.3 + 2007-05-07 + psa +

Added use case for client pinging server; changed namespace to conform to XMPP Registrar requirements, with namespace to be issued upon advancement to Draft; added section on discovering support.

+
0.2 2006-11-22 @@ -35,128 +41,178 @@ -

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;.

+

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; method for which &xep0206; is the XMPP profile.

-

This document addresses the following requirements:

+

This specification 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 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. However, this specification does not provide per-hop information similar to that provided by the traceroute protocol (&rfc1393;); a future specification may define such functionality for XMPP.

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. +
  3. The pinging entity sends an IQ-get containing a <ping/> element qualified by the 'http://www.xmpp.org/extensions/xep-0199.html#ns' namespace &NSNOTE;.
  4. 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.

+ +

One popular usage is for a server to test the viability of the underlying stream connection by pinging a connected client. This is done by sending an &IQ; get over the stream from the server to the client.

- + + ]]> -

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

+

If the client 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;:

+

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

- + + ]]> +

The other error conditions defined in RFC 3920 could also be returned if appropriate.

+
+ +

A client may also ping its server by sending an &IQ; get over the stream between the two entities.

+ + + + ]]> +

Note: The client MAY include a 'to' address of the client's bare JID (&BAREJID;, in this instance "juliet@capulet.lit" or MAY include no 'to' address (this signifies that the stanza shall be handled by the server on behalf of the connected user's bare JID, which in the case of &IQ; stanzas is equivalent to directing the IQ-get to the server itself).

+

If the server supports the ping namespace, it MUST return an IQ result:

+ + ]]> +

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

+ + + + + + + ]]> +

The other error conditions defined in RFC 3920 could also be returned if appropriate.

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;:

- + + ]]> +

The other error conditions defined in RFC 3920 could also be returned if appropriate.

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

- + id='e2e1'> + ]]>

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;:

- + ]]> +

The other error conditions defined in RFC 3920 could also be returned if appropriate.

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

- + id='comp1'> + ]]>

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;:

- + ]]> +

The other error conditions defined in RFC 3920 could also be returned if appropriate.

+ +

If an entity supports the XMPP Ping protocol, it MUST report that by including a service discovery feature of "http://www.xmpp.org/extensions/xep-0199.html#ns" &NSNOTE; in response to a &xep0030; information request:

+ + + + ]]> + + + ... + + ... + + + ]]> +

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.

@@ -167,7 +223,7 @@ -

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

+

Until this specification advances to a status of Draft, its associated namespace shall be "http://www.xmpp.org/extensions/xep-0199.html#ns"; upon advancement of this specification, the ®ISTRAR; shall issue a permanent namespace in accordance with the process defined in Section 4 of &xep0053;.

@@ -177,8 +233,8 @@