This document defines an XMPP protocol extension for stream-level (single-hop) stanza acknowledgement and pinging.
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: 0198
Publisher: XMPP Standards Foundation
Status:
Experimental
Type:
Standards Track
Version: 0.2
Last Updated: 2007-04-05
Approving Body: XMPP Council
Dependencies: None
Supersedes: None
Superseded By: None
Short Name: ack
Wiki Page: <http://wiki.jabber.org/index.php/Stanza Acknowledgements (XEP-0198)>
Email:
justin@affinix.com
JabberID:
justin@andbit.net
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. Stanza Acknowledgements
2.1. Overview
2.2. Narrative
3. Examples
4. Pinging
5. Implementation Notes
6. Minimal Implementation Guideline
7. IANA Considerations
8. Jabber Registrar Considerations
8.1. Stream Features
8.2. Protocol Namespaces
9. XML Schemas
9.1. Stream Feature
9.2. Protocol Namespace
Notes
Revision History
XMPP Core [1] does not specify a way for entities in a stream (single-hop) to acknowledge successful receipt of a stanza. This specification proposes a mechanism for efficient and flexible acknowledgement of stanzas. The protocol is intended for use with both Client-to-Server and Server-to-Server streams.
It is important not to confuse the facilities provided by this specification with those provided by Message Events [2], Advanced Message Processing [3], and Message Receipts [4]. The other specifications cover end-to-end and multi-hop acknowledgements, which are useful in special scenarios, but unnecessary and overkill for general use. In contrast, this specification proposes a protocol intended for widespread, general use. It is also expected that this protocol will revive interest in AMP, as single-hop acknowledgements are necessary for AMP delivery receipts to function properly.
There is a lot to be gained by adding this feature to the protocol, such as:
In addition, this specification also provides a way to "ping" the peer, useful to determine if the peer is available without having to send a real stanza.
XMPP includes a method for acknowledging stanza reception between the initiating and receiving entities, to allow for transmission error detection and recovery.
The following rules apply:
When an initiating entity activates the acknowledgement feature with a receiving entity, the steps involved are as follows:
Examples of stanza acknowledgements are provided in the next section.
<stream:features> <ack xmlns='http://www.xmpp.org/extensions/xep-0198.html#ns'/> <bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'> <required/> </bind> </stream:features>
<enable xmlns='http://www.xmpp.org/extensions/xep-0198.html#ns'/>
<enabled xmlns='http://www.xmpp.org/extensions/xep-0198.html#ns'/>
<message from='laurence@example.net/churchyard' to='juliet@example.com' xml:lang='en'> <body>I'll send a friar with speed, to Mantua, with my letters to thy lord.</body> </message> <r xmlns:ack='http://www.xmpp.org/extensions/xep-0198.html#ns' c='1'/>
<a xmlns='http://www.xmpp.org/extensions/xep-0198.html#ns' b='1'/>
<message from='laurence@example.net/churchyard' to='juliet@example.com' xml:lang='en'> <body>I'll send a friar with speed, to Mantua, with my letters to thy lord.</body> </message> <a xmlns:ack='http://www.xmpp.org/extensions/xep-0198.html#ns' c='7'/>
<enable xmlns='http://www.xmpp.org/extensions/xep-0198.html#ns' previd='c2s_345'/>
<enabled xmlns='http://www.xmpp.org/extensions/xep-0198.html#ns' b='7'/>
Either entity can also ping the other, useful for ensuring that the TCP connection is still up and working, and also determining latency. The procedure should replace the legacy behavior of sending whitespace. Pinging is done by sending a 'ping' element:
<ping xmlns='http://www.xmpp.org/extensions/xep-0198.html#ns'/>
The peer then MUST reply immediately with a 'pong' element.
<pong xmlns='http://www.xmpp.org/extensions/xep-0198.html#ns'/>
A server that is throttling stanzas (and thus withholding acks until later) SHOULD still immediately reply to pings.
To save bandwidth, it is recommended that implementations specify an XML namespace prefix assignment in the initial <stream> element for the 'http://www.xmpp.org/extensions/xep-0198.html#ns' namespace.
<stream:stream to='example.com' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' xmlns:ack='http://www.xmpp.org/extensions/xep-0198.html#ns' version='1.0'>
<ack:a/>
The Stanza Acknowledgements protocol has a complex appearance, and indeed it is complex to implement if you want to perform all of the optimizations allowed. However, a basic implementation is not very difficult, if you just want simple acking and don't care about sequence numbers too much. Here is what a basic implementation would do:
This is enough of an implementation to minimally satisfy the remote entity, and allows basic tracking of your own stanzas sent. If the stream connection is broken, you have a queue of unacknowledged stanzas that you can choose to do something with.
This XEP requires no interaction with the Internet Assigned Numbers Authority (IANA) [5].
Upon approval of this XEP, the Jabber Registrar shall add 'http://www.xmpp.org/extensions/xep-0198.html#ns' to its registry of stream features.
Upon approval of this XEP, the XMPP Registrar [6] shall add 'http://www.xmpp.org/extensions/xep-0198.html#ns' to its registry of protocol namespaces.
<?xml version='1.0' encoding='UTF-8'?> <xs:schema xmlns:xs='http://www.w3.org/2001/XMLSchema' targetNamespace='http://www.xmpp.org/extensions/xep-0198.html#ns' xmlns='http://www.xmpp.org/extensions/xep-0198.html#ns' elementFormDefault='qualified'> <xs:element name='ack'/> </xs:schema>
<?xml version='1.0' encoding='UTF-8'?> <xs:schema xmlns:xs='http://www.w3.org/2001/XMLSchema' targetNamespace='http://www.xmpp.org/extensions/xep-0198.html#ns' xmlns='http://www.xmpp.org/extensions/xep-0198.html#ns' elementFormDefault='qualified'> <xs:element name='enable' type='empty'/> <xs:element name='enabled' type='empty'/> <xs:element name='r' type='empty'/> <xs:element name='a' type='empty'/> <xs:element name='ping' type='empty'/> <xs:element name='pong' 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-0022: Message Events <http://www.xmpp.org/extensions/xep-0022.html>.
3. XEP-0079: Advanced Message Processing <http://www.xmpp.org/extensions/xep-0079.html>.
4. XEP-0184: Message Receipts <http://www.xmpp.org/extensions/xep-0184.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/>.
Require c attribute on <r/> element. Describe minimal implementation. Switch to standard temporary namespace.
(jk)Initial published version.
(psa)END