4 min read
icerpc and multiplexed transports
Lean about the icerpc protocol and multiplexed transports
The icerpc protocol
When you create a client connection to server address icerpc://hello.zeroc.com
, you instruct IceRPC to establish a connection that uses the icerpc protocol.
icerpc is an application layer protocol that transmits RPCs (requests and responses) over a multiplexed connection.
We always spell icerpc in lowercase when discussing the icerpc protocol. This avoids confusion with the IceRPC framework.
Multiplexed transport
The multiplexed transport page describes an abstraction for a modern transport that provides independent streams within a connection. The prototypical multiplexed transport is QUIC.
An icerpc connection runs over a multiplexed connection created by a multiplexed transport.
The icerpc protocol sends requests and responses over a multiplexed connection by creating a dedicated bidirectional stream for each request + response pair. It creates a unidirectional stream for each one-way request, since a one-way request has no response.
Since each stream is independent, there is no head-of-line blocking. You can send a mix of large and small requests and responses over the same connection: the large requests and responses won't block or delay the small ones.
IceRPC's preferred protocol
icerpc is naturally IceRPC's preferred protocol.
icerpc provides the most direct realization of IceRPC's APIs and features. In particular, IceRPC's request fields, response fields and status codes are transmitted as-is by icerpc. It also supports payload continuations.
icerpc over a duplex connection
There is currently only one standard multiplexed transport: QUIC. Since QUIC is new and not universally available, you may want to use icerpc with a traditional duplex transport such as TCP.
The solution is IceRPC's Slic transport layer. Slic implements the multiplexed transport abstraction over the duplex transport abstraction.
In C#, the default multiplexed transport is Slic over TCP and is called tcp
. The following statements all create equivalent icerpc connections.
// Create a client connection with the default multiplexed client transport, Slic over TCP.using await var clientConnection = new ClientConnection("icerpc://hello.zeroc.com");
// Make sure we use Slic over TCP (correct but redundant).using await var clientConnection = new ClientConnection("icerpc://hello.zeroc.com?transport=tcp");
// Create a new multiplexed client transport with default options.var clientTransport = new SlicClientTransport(new TcpClientTransport());using await var clientConnection = new ClientConnection( "icerpc://hello.zeroc.com", multiplexedClientTransport: clientTransport);