%ents; ]>
Stream Initiation A common method to initiate a stream with meta information &LEGALNOTICE; 0087 Retracted Standards Track Standards XEP-0030 XEP-0095 si Thomas Muldowney temas@jabber.org temas@jabber.org 0.1 2003-05-22 tjm Initial version.

As more people begin to make use of streams in Jabber, there becomes a need for more descriptive negotiation of which stream to use. This document provides a method to negotiate a stream and provide some meta-information about the streams usage.

Sender wishes to interact with another user, using a method that requires streams.

Primary Flow:

  1. Sender discovers if Receiver implements the desired profile. [E1]
  2. Sender offers a stream initiation. [E2]
  3. Receiver accepts stream initiation.
  4. Sender uses the negotiated stream and profile to send the information.

Error Conditions:

  1. The Receiver does not support the desired profile, EUC
  2. Receiver rejects the stream initiation, EUC

Before a Stream Initiation is attempted the Sender should be sure that the Receiver supports both Stream Initiation and the specific profile that they wish to use. This is discovered by using &xep0030;:

]]>

The Receiver will advertise the "http://jabber.org/protocol/si" namespace as a feature to represent they implement this document. The specific profiles can be found by looking for "http://jabber.org/protocol/si/profile/profile-name". Shown in the result is a potential file transfer profile:

]]>

Now that the Sender is sure that the Receiver support Stream Initiation they send the offer:

value
]]>

At this point the Receiver can view the headers and other information to decide if they wish to accept the Stream Initiation. If they accept they MUST select one of the presented stream types to use. If none of the stream types are acceptable the Receiver MUST reply with an error:

s5b ]]> Offer Declined ]]> No Valid Streams ]]>

If the Receiver has accepted the Stream Initiation the Sender may then used the semantics defined by the selected stream and start the usage.

While Stream Initiation itself is helpful, it makes much more sense when what is being transported over the stream is known. Knowing this allows the Receiver to make a more educated choice about whether or not to accept the stream. This information is transported in Stream Initiation through a profile. A profile is a series of required and optional headers that describe the stream data or how the stream is to be used. Each Stream Initiation MUST have only one profile, so the stream usage is kept clear.

Creating a profile is fairly simple. First, a name is chosen, the complete name is formatted like:

http://jabber.org/protocol/si/profile/profile-name

The complete name is what is presented in information discovery requests in order to show that the profile is supported. It is also used for the <si> profile attribute. Next, the information for the headers is decided upon. Each piece of information will be transported in a <header> tag. The name attribute is a descriptive key that can be looked up at the XMPP Registrar or XEP describing the profile. The actual data in the <header> is the fact related to the name attribute. It must also be stated whether the header is required or optional.

This document does not define any profiles, nor does it place any restrictions on what type of information a profile should detail. This document also does not place restrictions on what may be placed in a <header>. Other XEPs will define profiles to be used with Stream Initiation.

While Stream Initiation is not directly required for stream usage, it does provide many benefits. In order to fully appreciate these benefits, streams must link the Stream Initiation to the stream. The id attribute of the <si> node is intended to provide this link. It is out of scope of this document to define how streams will make use of this facility, but it does suggest some methods:

  • Transport the Stream Initiation id with the stream negotitation as a namespaced attribute, such as: ]]>
  • Transport the Stream Initiation id in a namespaced tag, such as: ]]>

The attributes and data of <si> are fairly simple:

  • id - An opaque identifier generated by the Sender.
  • mime-type - The mime-type of the data being negotiated, selected by Sender.
  • profile - The profile's fulle name, selected by Sender.

The data of the node is a mixture of a feature negotiation for the stream and the profiles headers.

When the Sender is offering a Stream Initiation all of the attributes must be present. The data MUST contain the required profile headers and the feature negotiation for the stream MUST be present with at least one option. The optional profile headers MAY also be in the node data.

When the Receiver accepts a Stream Initiation the id attribute MUST be present, all other attributes MUST NOT be present. The selected stream MUST be in the feature negotiation for the stream. There MUST only be one selected stream.

There are two error codes that are used. Following are the conditions, meanings and data:

  • Declining Transfer (403): During the Stream Initiation the Receiver may decline the transfer by sending the 403 error. The <error/> CDATA MAY contain a descriptive reason why, but is not necessary.
  • No Available Methods (406): When the Sender presents the available stream methods, and the Receiver can not use any of them, they send a 406 error. The <error/> CDATA is not important.

Data security concerns are left to the profiles to define. Wire security concerns are left to the stream definitions.

This document uses the MIME types as recorded by IANA, but no other direct interaction is necessary.

The "http://jabber.org/protocol/si" namespace will be registered. The registrar will track header profiles for different stream initiation uses.

To follow.

To follow.