3.1.4 The connection protocol

The ssh2 Connection Protocol is used by applications to establish communications channels. Once this service has started, the server and the client are both allowed to open channels and send requests. Those are the two primitives offered by the connection protocol:

  • Once opened successfully, a channel allows the two applications to transmit a stream of data over ssh2. A channel has a textual type name that identifies its usage. Channel open messages are transmitted by either side and can be accepted or rejected based on the channel type name. Opening a new channel is an asynchronous process and multiple open messages can be sent without waiting for replies. The replies can be sent in any order, so that connecting to a remote resource due to a channel open request may take some time without blocking other channels.

    The protocol supports a windowed flow control mechanism which enables limiting the data throughput per channel. This can be used to prevent exceeding the capacity of the underlying transport data pipe which would make all channels unresponsive.

  • A request is an application generated message identified by a textual type name. It may have a specific data payload attached. The sender of the request may or may not ask for a reply. When the remote application acknowledges the request successfully, it may also attach a payload. Requests can not live longer than a single round trip and must be replied in order. A request may be either global or related to an open channel.

Some standard types of channel and request are specified for use on top of the ssh2 protocol:

  • A set is specified for supporting interactive sessions. This is designed to run shell instances and other programs on the remote server. Multiple interactive sessions can run over a single ssh2 session.

    Examples of standard request types are the shell and exec ones that request execution of a process on the server. Those must be related to an open channel of the session type that is used to transport the standard IO streams of the remotely executing process.

  • An other set is specified for supporting the TCP port forwarding feature. It allows the client to connect to a remote TCP port on the behalf of the server and can also be used to instruct the server to listen on a TCP port and forward any incoming connections back to the client.

The application is allowed to implement private channel types and private request types.

Valid XHTML 1.0 StrictGenerated by diaxen on Sun Oct 25 23:30:45 2020 using MkDoc