%ents;
]>
Bidirectional Server-to-Server ConnectionsThis specification defines a protocol for using server-to-server connections in a bidirectional way such that stanzas are sent and received on the same TCP connection.
&LEGALNOTICE;
0288DraftStandards TrackStandardsCouncilXMPP CoreXEP-0178XEP-0220bidihttp://xmpp.org/schemas/bidi.xsd
&fippo;
&dcridland;
1.02013-09-26psa

Required support for dialback error handling if the connecting server uses bidi in combination with dialback

0.22011-12-12ph

Minor clarifications about the implications of bidi and dialback.

0.12010-10-04psa

Initial published version.

0.0.22010-09-13dwd

belated run-over pre-publication

Added notes on authentication

0.0.12010-04-12ph

initial version

&rfc3920; restricted server-to-server communication in such a way that a server had to use one TCP connection for XML stanzas sent from the server to the peer, and another TCP connection (initiated by the peer) for stanzas from the peer to the server, for a total of two TCP connections. &rfc6120; allows two servers to send stanzas in a bidirectional way, but does not define methods for explicitly signalling the usage thereof. This is accomplished herein.

While this may seem like a mere optimization that decreases the number of sockets used by an implementation or increases the performance of the server-to-server connectionIn constrained environments, bidirectional server-to-server connections exhibit a reduced packet round trip time, see <http://www.isode.com/whitepapers/xmpp-performance-constrained.html>., it actually removes some of the practical barriers for the implementation of Multiplexing in &xep0220;.

If a server supports bidirectional server-to-server streams, it should inform the connecting entity when returning stream features during the stream negotiation process (both before and after TLS negotiation). This is done by including a <bidi/> element qualified by the 'urn:xmpp:features:bidi' namespace.

]]>

If the initiating entity chooses to use TLS, STARTTLS negotiation MUST be completed before enabling bidirectionality.

To enable bidirectional communication, the connecting server sends a <bidi/> element qualified by the 'urn:xmpp:bidi' namespace. This SHOULD be done before either SASL negotiation or Server Dialback.

]]>

After enabling bidirectionality, the connecting server continues to authenticate via SASL or requests to send stanzas for a domain pair with Server Dialback. The receiving server MUST NOT send stanzas to the peer before it has authenticated via SASL, or the peer's identity has been verified via Server Dialback. Note that the receiving server MUST NOT attempt to verify a dialback key on the same connection where the corresponding request was issued.

Also note that the receiving server MUST only send stanzas for which it has been authenticated - in the case of TLS/SASL based authentication, this is the value of the stream's 'to' attribute, whereas in the case of Server Dialback this is the inverse of any domain pair that has been used in a dialback request.

Finally, once bidirectionality is enabled, the receiving server MAY initiate Server Dialback authentications for other domains it hosts to any domain authenticated to be hosted by the connecting server. In particular, it may initiate Target Piggybacking for any target domain that has successfully been used as a source domain by the connecting server. Note that this implies that a connecting server that uses bidi and dialback MUST support dialback error conditions as defined in XEP 0220Ideally, support for dialback errors would be signalled by a proper extension mechanism such as <stream:features/>. However, these are currently only sent from the receiving server to the connecting server and can therefore not be used for signalling support for dialback errors in the other direction..

This section shows two complete examples of bidirectional streams, the first example uses SASL EXTERNAL, the second uses Server Dialback.

This specification introduces no security considerations above and beyond those discussed in RFC 6120 or XEP-0220.
Note that the impact of the "unsolicited server dialback" attack described in XEP-0220 is considerably larger for bidirectional streams, e.g. a vulnerability which allows spoofing might also route messages to the wrong targets. Additionally, dialback elements with a "type" attribute also need to be handled in incoming connections.

This document requires no interaction with &IANA;.

The &REGISTRAR; includes 'urn:xmpp:bidi' in its registry of protocol namespaces (see &NAMESPACES;).

The XMPP Registrar includes 'urn:xmpp:features:bidi' in its registry of stream features (see &STREAMFEATURES;).

The protocol documented by this schema is defined in
XEP-0288: http://www.xmpp.org/extensions/xep-0288.html
]]>
]]>