Copyright (c) 1999 - 2009 XMPP Standards Foundation. See Legal Notices.
This specification defines an XMPP protocol extension that enables any two entities to establish a one-to-one bytestream between themselves, where the data is broken down into smaller chunks and transported in-band over XMPP.
NOTICE: The protocol defined herein is a Draft Standard of the XMPP Standards Foundation. Implementations are encouraged and the protocol is appropriate for deployment in production systems, but some changes to the protocol are possible before it becomes a Final Standard.
1. Introduction
2. Uses
3. Implementation
3.1. Creating a bytestream
3.2. Sending data
3.3. Closing the bytestream
3.4. Receiving packets
4. Usage Guidelines
5. Security Considerations
6. IANA Considerations
7. XMPP Registrar Considerations
7.1. Protocol Namespaces
8. XML Schema
Appendices
A: Document Information
B: Author Information
C: Legal Notices
D: Relation to XMPP
E: Discussion Venue
F: Requirements Conformance
G: Notes
H: Revision History
This document describes In-Band Bytestreams (or IBB), a reliable bytestream protocol between two Jabber entities over a Jabber XML stream. The basic idea is that binary data is encoded as Base64 and transferred over the Jabber network.
IBB is a generic bytestream, and so its usage is left open-ended. It is likely to be useful for sending small payloads, such as files that would otherwise be too cumbersome to send as an instant message (such as a text file) or impossible to send (such as a small binary image file). It could also be useful for any kind of low-bandwidth activity, such as a chess game or a shell session. And, while it is mostly intended as a fallback in situations where a SOCKS5 Bytestreams [1] is unavailable, IBB could be more desirable for many of the simple bytestream use-cases that do not have high bandwidth requirements.
<iq type='set' from='romeo@montague.net/orchard' to='juliet@capulet.com/balcony' id='inband_1'> <open sid='mySID' block-size='4096' xmlns='http://jabber.org/protocol/ibb'/> </iq>
This asks Juliet if she would like to form an In-Band Bytestreams connection, using the session ID 'mySID' (generated by the initiator here) to uniquely reference the bytestream. The 'block-size' attribute specifies the maximum amount of data (in bytes) that an IBB packet may contain.
<iq type='result' from='juliet@capulet.com/balcony' to='romeo@montague.net/orchard' id='inband_1'/>
This is a success response from juliet@capulet.com/balcony, saying that the bytestream is active.
<iq type='error' from='juliet@capulet.com/balcony' to='romeo@montague.net/orchard' id='inband_1'/> <error code='501' type='cancel'> <feature-not-implemented xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/> </error> </iq>
This is an error response from juliet@capulet.com/balcony saying that an In-Band Bytestreams is not possible.
Data is sent using either <message> or <iq> stanzas. Either participant in the bytestream may send such packets. The data to be sent, prior to any encoding or wrapping in the stanza, must be no larger than the 'block-size' determined in the stream negotiation. All stanzas are to be addressed to the FULL JID of the bytestream peer. In order to keep track of stanzas sent and any errors received, the sender SHOULD include the 'id' attribute on stanzas sent to the recipient. When using <message> stanzas, Advanced Message Processing [2] SHOULD be used to ensure that the data packet is not spooled or sent to the wrong resource.
<message from='romeo@montague.net/orchard' to='juliet@capulet.com/balcony' id='msg1'> <data xmlns='http://jabber.org/protocol/ibb' sid='mySID' seq='0'> qANQR1DBwU4DX7jmYZnncmUQB/9KuKBddzQH+tZ1ZywKK0yHKnq57kWq+RFtQdCJ WpdWpR0uQsuJe7+vh3NWn59/gTc5MDlX8dS9p0ovStmNcyLhxVgmqS8ZKhsblVeu IpQ0JgavABqibJolc3BKrVtVV1igKiX/N7Pi8RtY1K18toaMDhdEfhBRzO/XB0+P AQhYlRjNacGcslkhXqNjK5Va4tuOAPy2n1Q8UUrHbUd0g+xJ9Bm0G0LZXyvCWyKH kuNEHFQiLuCY6Iv0myq6iX6tjuHehZlFSh80b5BVV9tNLwNR5Eqz1klxMhoghJOA </data> <amp xmlns='http://jabber.org/protocol/amp'> <rule condition='deliver' value='stored' action='error'/> <rule condition='match-resource' value='exact' action='error'/> </amp> </message>
<iq from='romeo@montague.net/orchard' to='juliet@capulet.com/balcony' type='set' id='ibb1'> <data xmlns='http://jabber.org/protocol/ibb' sid='mySID' seq='0'> qANQR1DBwU4DX7jmYZnncmUQB/9KuKBddzQH+tZ1ZywKK0yHKnq57kWq+RFtQdCJ WpdWpR0uQsuJe7+vh3NWn59/gTc5MDlX8dS9p0ovStmNcyLhxVgmqS8ZKhsblVeu IpQ0JgavABqibJolc3BKrVtVV1igKiX/N7Pi8RtY1K18toaMDhdEfhBRzO/XB0+P AQhYlRjNacGcslkhXqNjK5Va4tuOAPy2n1Q8UUrHbUd0g+xJ9Bm0G0LZXyvCWyKH kuNEHFQiLuCY6Iv0myq6iX6tjuHehZlFSh80b5BVV9tNLwNR5Eqz1klxMhoghJOA </data> </iq>
The data to send is included as XML character data of the <data/> element after being encoded as Base64 as specified in Section 4 of RFC 4648 [3]. The 'seq' attribute is a 16-bit unsigned integer counter starting at 0, and MUST be incremented for each packet sent. Thus, the next packet sent should have a 'seq' of 1, the one after that with a 'seq' of 2, and so on. The counter loops at maximum, so after value 65535, 'seq' MUST start again at 0.
Note that in the case of iq stanzas, the recipient must reply with an iq of type 'result'.
<iq from='juliet@capulet.com/balcony' to='romeo@montague.net/orchard' type='result' id='ibb1'/>
The sender need not wait for these acknowledgements before sending further stanzas. However, it is RECOMMENDED that the sender does wait in order to minimize possible rate-limiting penalties.
It is possible that the stanza may fail to be delivered:
<message from='juliet@capulet.com/balcony' to='romeo@montague.net/orchard' id='msg1' type='error'> ... <error code='504' type='cancel'> <remote-server-timeout xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/> </error> </message>
<iq from='juliet@capulet.com/balcony' to='romeo@montague.net/orchard' id='ibb1' type='error'> ... <error code='504' type='cancel'> <remote-server-timeout xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/> </error> </iq>
Upon delivery failure, the sender MUST consider the bytestream to be closed and invalid.
To close the bytestream, send the following:
<iq type='set' from='romeo@montague.net/orchard' to='juliet@capulet.com/balcony' id='inband_2'> <close xmlns='http://jabber.org/protocol/ibb' sid='mySID'/> </iq>
<iq type='result' from='juliet@capulet.com/balcony' to='romeo@montague.net/orchard' id='inband_2'/>
This is a success response from juliet@capulet.com/balcony, saying that the bytestream is now closed.
<iq type='error' from='juliet@capulet.com/balcony' to='romeo@montague.net/orchard' id='inband_2'> <error code='404' type='cancel'> <item-not-found xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/> </error> </iq>
Upon error, the bytestream MUST be considered closed and invalid.
Data packets MUST be processed in the order they are received. If an out-of-sequence packet is received for a particular bytestream (determined by checking the 'seq' attribute), then this indicates that a packet has been lost. The recipient MUST NOT process the data of such an out-of-sequence packet, nor any that follow it within the same bytestream, and at this point MUST consider the bytestream closed and invalid.
In-Band Bytestreams is as secure as the underlying Jabber transport. The bytestream application could have its own security layer, but this is outside of the scope of IBB.
An entity MUST verify any Base64 data received. An implementation MUST reject (not ignore) any characters that are not explicitly allowed by the Base64 alphabet; this helps to guard against creation of a covert channel that could be used to "leak" information. An implementation MUST NOT break on invalid input and MUST reject any sequence of Base64 characters containing the pad ('=') character if that character is included as something other than the last character of the data (e.g. "=AAA" or "BBBB=CCC"); this helps to guard against buffer overflow attacks and other attacks on the implementation. Base encoding visually hides otherwise easily recognized information, such as passwords, but does not provide any computational confidentiality. Base64 encoding MUST follow the definition in Section 4 of RFC 4648.
This document requires no interaction with the Internet Assigned Numbers Authority (IANA) [5].
The XMPP Registrar [6] shall register the 'http://jabber.org/protocol/ibb' namespace as a result of this document.
<?xml version='1.0' encoding='UTF-8'?> <xs:schema xmlns:xs='http://www.w3.org/2001/XMLSchema' targetNamespace='http://jabber.org/protocol/ibb' xmlns='http://jabber.org/protocol/ibb' elementFormDefault='qualified'> <xs:annotation> <xs:documentation> The protocol documented by this schema is defined in XEP-0047: http://www.xmpp.org/extensions/xep-0047.html </xs:documentation> </xs:annotation> <xs:element name='open'> <xs:complexType> <xs:simpleContent> <xs:extension base='empty'> <xs:attribute name='sid' type='xs:string' use='required'/> <xs:attribute name='block-size' type='xs:string' use='required'/> </xs:extension> </xs:simpleContent> </xs:complexType> </xs:element> <xs:element name='close'> <xs:complexType> <xs:simpleContent> <xs:extension base='empty'> <xs:attribute name='sid' type='xs:string' use='required'/> </xs:extension> </xs:simpleContent> </xs:complexType> </xs:element> <xs:element name='data'> <xs:complexType> <xs:simpleContent> <xs:extension base='xs:string'> <xs:attribute name='sid' type='xs:string' use='required'/> <xs:attribute name='seq' type='xs:string' use='required'/> </xs:extension> </xs:simpleContent> </xs:complexType> </xs:element> <xs:simpleType name='empty'> <xs:restriction base='xs:string'> <xs:enumeration value=''/> </xs:restriction> </xs:simpleType> </xs:schema>
Series: XEP
Number: 0047
Publisher: XMPP Standards Foundation
Status:
Draft
Type:
Standards Track
Version: 1.1
Last Updated: 2006-11-21
Approving Body: XMPP Council
Dependencies: XMPP Core, XEP-0079
Supersedes: None
Superseded By: None
Short Name: ibb
Schema: <http://www.xmpp.org/schemas/ibb.xsd>
Source Control:
HTML
RSS
Email:
justin@affinix.com
JabberID:
justin@andbit.net
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 primary venue for discussion of XMPP Extension Protocols is the <standards@xmpp.org> discussion list.
Discussion on other xmpp.org discussion lists might also be appropriate; see <http://xmpp.org/about/discuss.shtml> for a complete list.
Errata may be sent to <editor@xmpp.org>.
The following requirements 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. XEP-0065: SOCKS5 Bytestreams <http://xmpp.org/extensions/xep-0065.html>.
2. XEP-0079: Advanced Message Processing <http://xmpp.org/extensions/xep-0079.html>.
3. RFC 4648: The Base16, Base32, and Base64 Data Encodings <http://tools.ietf.org/html/rfc4648>.
4. XEP-0079: Advanced Message Processing <http://xmpp.org/extensions/xep-0079.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://xmpp.org/registrar/>.
END