%ents; ]>
Stream Initiation This JEP defines a protocol for initiating a stream (with meta information) between any two Jabber entities. &LEGALNOTICE; 0095 Draft Standards Track Standards JIG XMPP Core JEP-0030 si http://jabber.org/protocol/si/si.xsd &temas; &linuxwolf; &reatmon; 1.1 2004-04-13 psa More fully defined the Jabber Registrar considerations. 1.0 2003-10-17 psa Per a vote of the Jabber Council, advanced status to Draft. 0.6 2003-07-15 rwe Stream ids not needed on return results. Moved s5b, ibb, and url-data to the actual namespaces of the stream protocols. 0.5 2003-07-06 lw Removed signalling; Strengthened the profile definition requirements; Allowed for optional feature negotiation under certain circumstances 0.4 2003-06-30 lw Actually added XML schemas; Added clarifications/requirements for stream interaction.; Fixed various typos and inconsistencies 0.3 2003-06-30 lw Added XML schemas; Added XMPP-style error conditions; Added signal/notification support; Moderate reorganization to accommodate changes 0.2 2003-06-23 tjm Added linuxwolf as an author (should have been there from the start), form uses stream-method as the field var, clarified the stream interaction. 0.1 2003-06-10 tjm Initial version.

As the Jabber protocols are extended beyond basic messaging and presence, the need has arisen for a generic protocol that can be used to negotiate content streams between any two entities. Such streams might be in-band, but more likely will be out-of-band, binary streams used in applications such as file transfer, voice chat, and video conferencing. This JEP provides a method for negotiating such streams, including meta-information about the intended usage of the stream.

The process for stream negotiation is as follows:

  1. Sender discovers if Receiver implements the desired profile. [E1]
  2. Sender offers a stream initiation. [E2]
  3. Receiver accepts stream initiation.
  4. Sender and receiver prepare for using negotiated profile and stream, EUC

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 typically accomplished using &jep0030;:

]]>

The Receiver advertises the "http://jabber.org/protocol/si" namespace as a feature to represent that they implement this JEP. The specific profiles are also announced this way; they can be found by looking for "http://jabber.org/protocol/si/profile/profile-name". Shown in the result is a potential file transfer profile:

... ... ]]>

Once support is determined, the Sender starts the negotiation with the Receiver by sending an &IQ; stanza of type "set", such as in the following example from &jep0096;:

This is info about the file. ]]>

At this point the Receiver can view the profile and other information to decide if they wish to accept the Stream Initiation. If acceptable the Receiver MUST select one of the presented stream types to use.

http://jabber.org/protocol/bytestreams ]]>

If the profile describes data to be sent back in the result it MUST be present as described in the profile's JEP.

returned value http://jabber.org/protocol/bytestreams ]]>

If none of the stream types are acceptable, or if the profile is not understood, the Receiver MUST reply with a "bad request" error:

]]> ]]>

If the Receiver rejects the request, they reply with a "forbidden" error:

Offer Declined ]]>

At this point, the Sender and Receiver make any preparations necessary for the stream to be used. The exact process is specific to each protocol, and is beyond the scope of this JEP. This step now marks the end of SI's responsibilities.

The <si/> element is the root element for this protocol. It is an identifiable container for all the information necessary for negotiation and signalling. It contains attributes for the identifier, intended MIME-type, and profile. The contents convey stream-negotation and profile information.

The "id" attribute is an opaque identifier. This attribute MUST be present on type='set', and MUST be a valid string. This SHOULD NOT be sent back on type='result', since the <iq/> "id" attribute provides the only context needed. This value is generated by the Sender, and the same value MUST be used throughout a session when talking to the Receiver.

The "mime-type" attribute identifies the MIME-type for the data across the stream. This attribute MUST be a valid MIME-type as registered with &IANA; (specifically, as listed at <http://www.iana.org/assignments/media-types>). During negotiation, this attribute SHOULD be present, and is otherwise not required. If not included during negotiation, its value is assumed to be "binary/octect-stream".

The "profile" attribute defines the SI profile in use. This value MUST be present during negotiation, and is the namespace of the profile to use.

When the Sender first negotiates a Stream Initiation, all of the attributes SHOULD be present, and the id" and "profile" MUST be present. The contents MUST contain one profile, in the namespace declared in the "profile" attribute, and the feature negotiation for the stream. The feature negotiation MUST contain at least one option and use the field var "stream-method".

When the Receiver accepts a Stream Initiation, the <si/> element SHOULD NOT possess any attributes. The selected stream MUST be in the feature negotiation for the stream. There MUST only be one selected stream.

To simplify the discussion on error conditions, this document uses the following mapping between namespace URIs and namespace prefixesThis mapping is provided for the purpose of simplifying this discussion, and is not intended to be used in the actual protocol..

Prefix URI
xmpp urn:ietf:params:xml:ns:xmpp-stanzas
si http://jabber.org/protocol/si

Below are the most common errors that can result.

Error Code Error Type General Condition Specific Condition Description
400 cancel <xmpp:bad-request/> <si:no-valid-streams/> None of the available streams are acceptable.
400 modify <xmpp:bad-request/> <si:bad-profile/> The profile is not understood or invalid. The profile MAY supply a profile-specific error condition.
403 cancel <xmpp:forbidden/> NONE The stream is rejected.

For further information about the relationship between XMPP error handling and "legacy" (HTTP-style) error codes, refer to &jep0086;.

Stream Initiation on its own is of limited use; the Receiver almost always requires some reason for SI. Knowing this allows the Receiver to make a more educated choice about whether or not to accept the stream. This information is provided in Stream Initiation via a profile. A profile is a collection of information that describes the reason for and structure of the stream data, including what the data represents and what stream protocols are expected to be supported.

The initial request for Stream Initiation MUST have only one profile, and this profile is in its own namespace. The profile is indicated not only by the presence of a "root" element in that particular namespace, but also be the "profile" attribute in <si/> The SUGGESTED format for profile namespaces is:

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

The information that the profile presents SHOULD be defined in an official JEP. The JEP defining the profile SHOULD contain explanations of what the profile consists of and MUST define the profile in a complete manner using DTD, Schema or another appropiate definition language.

A profile SHOULD define what stream protocols MUST be supported, and MUST define what stream protocols MAY be supported. If a profile specifies only a single stream protocol that MUST be supported (even if others MAY also be supported), the "fneg" for the stream protocol may be omitted from the initial <si/>; the receiving entity then assumes the stream protocol that MUST be supported is the one to use.

This JEP does not define any profiles, nor does it place any restrictions on what type of information a profile should detail. Other JEPs 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 transported on the <si/> element is intended to do this. Once a session is fully negotiated, the value of the <si/> "id" attribute is used during the actual stream negotiation as the protocol's stream identifier attribute.

To be compatible to this JEP, a stream protocol MUST define a stream identifier (typically "sid"), which MUST have a unique string representation. The stream protocol MUST be able to use any string identifier chosen during Stream Initiation, as long as the sending party does not use the same identifier more than once.

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

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

The ®ISTRAR; includes the 'http://jabber.org/protocol/si' namespace in its registry of protocol namespaces.

The Jabber Registrar shall maintain a registry of stream initiation profiles, located at <http://www.jabber.org/registrar/si-profiles.html>. Any such profile defined in a Jabber Enhancement Proposal MUST be submitted to the Jabber Registrar; profiles defined in non-standard protocol extensions SHOULD be submitted to the Jabber Registrar.

®PROCESS; The profile name The JEP or other document that defines the profile A natural-language description of the profile ]]>
The protocol documented by this schema is defined in JEP-0095: http://www.jabber.org/jeps/jep-0095.html This is the root content element. All other elements in this namespace are for communicating error information. ]]>