]>
Tubes over XMPP A protocol for extensible collaboration over XMPP, designed specifically to implement Telepathy Tubes. This document is copyright 2007 Collabora Ltd. and may be distributed under the same terms as the Telepathy specification. proto-tubes ProtoXEP External extension Telepathy project Telepathy project XMPP Core XEP-0045 XEP-0047 XEP-0095 XEP-proto-muc-bytestream NOT YET ASSIGNED Simon McVittie simon.mcvittie@collabora.co.uk simon.mcvittie@collabora.co.uk Alban Crequy alban.crequy@collabora.co.uk alban.crequy@collabora.co.uk Robert McQueen robert.mcqueen@collabora.co.uk robert.mcqueen@collabora.co.uk Gabble 0.7.17 2008-12-14 ac/ram

Define Tube capabilities.

Gabble 0.7.0 2007-09-27 smcv
  • Don't copy stream tubes into MUC presence
  • Tube IDs must be numeric (uint32)
  • Don't put initiator in MUC stream tube info
  • Use a mesage-based protocol to offer 1-1 stream tubes, rather than the weird default bytestream thing
  • Non-initiator can close 1-1 stream tubes too
  • Remove /protocol/ from namespace URI
0.0.1 2007-09-25 smcv

First draft. Only protocol changes are listed in subsequent proto-XEP versions.

The XML namespace defined here is &NS_TUBES; (NS_TUBES in the telepathy-gabble source code).

The Telepathy project defines an API called Tubes to be used by arbitrary collaborative applications to communicate with instant messaging contacts. This API is intended to be the same for several IM protocols.

Tubes can be used in two types of context, referred to in Telepathy as Tubes channels:

Each tube has a service name, used to dispatch it to an appropriate client application, and some essentially arbitrary parameters understood by that client application. The tube's initiator (the contact who started it) must also be tracked.

The following tube types are currently supported:

As well as sending and receiving data, the following operations are supported:

hello aGVsbG8= 123 -123 ]]> hello aGVsbG8= 123 -123 ]]> announcement. --> base64base64... ]]> hello aGVsbG8= 123 -123 anonymous password /plots/macbeth ]]> and not in order to disambiguate between SI-based streams in a MUC Tubes channel, and SI-based streams in a 1-1 channel between two members of a MUC. The first witch MUST NOT copy the tube into her own presence in this case - only the initiator should put stream tubes in their presence, since stream tubes cannot continue after the initiator leaves. --> ]]> hello aGVsbG8= 123 -123 ]]>

Leaving the MUC also implicitly implies leaving all tubes.

type='dbus' service='com.example.Chess' id='333'> montagues-vs-capulets.conf ]]> http://jabber.org/protocol/ibb ]]> /poetry/for-juliet/ ]]> http://jabber.org/protocol/ibb ]]>

If Juliet's web browser opens multiple parallel connections to her XMPP implementation, the implementation will open multiple parallel SI streams as shown above, and Romeo's XMPP implementation will open multiple parallel connections to his web server. This MUST be supported by implementations.

]]> ]]>

Only stream tubes use a message stanza to be closed. D-Bus tubes are closed implicitly when the underlying bytestream is closed and thus do not need an explicit message stanza.

swords ]]> swords ]]> ]]> swords swords ]]> swords /warez ]]> and not . Romeo MUST NOT copy the tube into his own tube announcements in this case - only the initiator should announce stream tubes, since stream tubes cannot continue after the initiator leaves. --> jabber:iq:oob x-tcp://angstbook.local:1234 ]]> swords ]]>

Leaving the link-local MUC (a leave or split event from rMulticast) also implicitly implies leaving all tubes.

The tube feature is advertised with XEP-0115 Entity Capabilities using this string:

http://telepathy.freedesktop.org/xmpp/tubes

We want to know which tube the contacts can handle. There is two different kind of tube capabilities:

  • Can my contact receive a tube offer of a specific service?
  • Can my contact offer a tube of a specific service?

Only the first kind is considered. The second is out of scope of this specification. Each specific service is advertised with XEP-0115 Entity Capabilities with this string:

http://telepathy.freedesktop.org/xmpp/tubes/$type#$service

where $type is the tube type (either "dbus" or "stream") and $service is the service name (e.g. "vnc" or "TicTacTube").

The D-Bus unique names used in the MUC SHOULD be ":2." followed by the MUC nick (i.e. the resource part of the MUC JID) processed with the following algorithm:

  • Let utf8nick be the MUC nick encoded using UTF-8
  • If utf8nick has 186 octets or fewer, encode it using Base64; otherwise encode a string consisting of the first 169 octets of utf8nick, followed by the 20 octets of the SHA-1 of utf8nick (note that this is the whole of the raw binary SHA-1, and not the first half of the SHA-1 written in hexadecimal).
  • Remove all whitespace
  • Replace "+" with "_", "/" with "-" and "=" with "A"

This produces collision-free unique names of length no more than 251 octets (4/3 * 186 + 3) for nicknames no longer than 186 UTF-8 octets (replacing "=" with "A" is harmless here because XMPP resources cannot contain U+0000).

For longer nicknames it makes collisions highly unlikely, and produces 255-octet unique names (4/3 * 189 + 3), which still fit into D-Bus' 255-octet limit.

The choice of 186 and 169 for the magic numbers ensures that these long nicknames can only have unique-name collisions with other long nicknames, and that the Base64 encoding step when applied to long nicknames does not leave any trailing "=" characters.

Implementations MUST NOT use unique names that start with ":2." but are not formed according to the above rules, and SHOULD treat tube elements containing such a dbus-name as if they were invalid.

For backwards compatibility with earlier implementations, the dbus-name MAY also be ":1." followed by an arbitrary unique string of up to 252 characters chosen from A-Z, a-z, 0-9, "-" or "_".

The D-Bus unique names used in a link-local MUC SHOULD be ":2." followed by the _presence._tcp instance name (e.g. mercutio@mab) processed with the algorithm above.

Again, implementations MUST NOT use unique names that start with ":2." but are not formed according to the above rules, and SHOULD treat tube elements containing such a dbus-name as if they were invalid.

The Tubes SI profile is indicated by the profile string &NS_TUBES;. A Tubes SI IQ can be classified as follows:

  • If the IQ contains a <tube> element with the namespace &NS_TUBES;, then the IQ represents a new tube being offered.
  • If the IQ contains a <stream> element with the namespace &NS_TUBES;, then the IQ represents a new connection to an existing stream tube in a 1-1 Tubes channel.
  • If the IQ contains a <muc-stream> element with the namespace &NS_TUBES;, then the IQ represents a new connection to an existing stream tube in a MUC Tubes channel - this message type is invalid and must be rejected unless received via a MUC.
  • Otherwise, the SI is invalid and MUST be rejected.

The allowed parameter types are:

  • "str": A Unicode string containing no zero bytes '\0'. In this implementation it cannot contain any other character forbidden by XML either. The <parameter> character content is the string itself. The corresponding D-Bus signature is 's'. This corresponds to xs:string in XML Schema Part 2.
  • "bytes": An array of bytes, represented in Base64. The corresponding D-Bus signature is 'ay'. This corresponds to xs:base64Binary in XML Schema Part 2.
  • "uint": An unsigned integer representable in 32 bits. The corresponding D-Bus signature is 'u' or 'q' on input, 'u' on output. The element's character content is an ASCII unsigned decimal integer. This corresponds to xs:unsignedInt in XML Schema Part 2.
  • "int": A signed integer representable in 32 bits using two's complement. The corresponding D-Bus signature is 'i' or 'n' on input, 'i' on output, and the element's character content is an ASCII decimal integer, possibly starting with '-' or '+'. This corresponds to xs:int in XML Schema Part 2.
  • "bool": A boolean value represented as one of the strings "false", "true", "0" or "1", as per xs:boolean in XML Schema Part 2. The corresponding D-Bus signature is 'b'. (Implementation note: early versions of Tubes in Gabble only accepted "0" or "1", so implementations that care about backwards compatibility SHOULD emit those representations).

FIXME: how big do we want to allow a message to be? In the D-Bus specification the limit is 2**27 bytes, in the default dbus-daemon configuration (as used on the system bus) it's 32M.

FIXME: limit how many messages are queued up somehow (the system bus limits it to 127M in total)

FIXME

None.

None, this isn't a real XEP (yet?).

]]>

The string "short" produces the unique name ":2.c2hvcnQA".

The string "FirstWitch", as used in the examples, produces the unique name ":2.Rmlyc3RXaXRjaAAA".

The string "Second witch", as used in the examples, produces the unique name ":2.U2Vjb25kIHdpdGNo".

The string consisting of 18 repetitions of "0123456789" followed by "012345" (186 characters) produces a unique name consisting of ":2.", followed by 6 repetitions of the 40-character string "MDEyMzQ1Njc4OTAxMjM0NTY3ODkwMTIzNDU2Nzg5", followed by "MDEyMzQ1".

The string consisting of 18 repetitions of "0123456789" followed by "0123456" (187 characters) produces a unique name consisting of ":2.", followed by 5 repetitions of the 40-character string above, followed by "MDEyMzQ1Njc4OTAxMjM0NTY3OEVd9C5NgmmRD6jp1ftG6XUEc11x".

The string consisting of 20 repetitions of "0123456789" (200 characters) produces a unique name consisting of ":2.", followed by 5 repetitions of the 40-character string above, followed by "MDEyMzQ1Njc4OTAxMjM0NTY3OO-utwRnwcoUFhnJVMKg5pm9Hxal".