---
title: "IceRPC"
description: "A modular RPC framework built for QUIC"
url: https://docs.icerpc.dev/icerpc
docs_index: https://docs.icerpc.dev/llms.txt
---

> For an index of every page, see [llms.txt](https://docs.icerpc.dev/llms.txt).

# IceRPC

A modular RPC framework built for QUIC

## RPC framework

Remote procedure call (RPC) is a fundamental paradigm for networked applications: a client sends a request to a server over a network connection, the server processes this request and then sends back a response to the client over the same connection.

An RPC framework like IceRPC helps you apply this paradigm to your own networked applications without reinventing the wheel.

## Built for QUIC

IceRPC was built from the ground up to take advantage of [QUIC](https://en.wikipedia.org/wiki/QUIC), the new multiplexed transport that underpins [HTTP/3](https://en.wikipedia.org/wiki/HTTP/3).

QUIC is ideally suited for RPCs: an RPC maps to a request/response pair carried by a bidirectional QUIC stream. Multiple request/response pairs can proceed in parallel inside the same QUIC connection without interfering with each other.

IceRPC uses its own application protocol, [icerpc](https://docs.icerpc.dev/icerpc/icerpc-protocol/mapping-rpcs-to-streams.md), to exchange connection settings, transmit requests and responses, and ensure an orderly shutdown. This new RPC-focused protocol is a thin layer over QUIC.

### Not only for QUIC

The primary transport for IceRPC is QUIC, but we're still in the early days of QUIC, so being QUIC-only is not practical.

To bridge this gap, IceRPC provides a multiplexing adapter called [Slic](https://docs.icerpc.dev/icerpc/slic-transport/overview.md). Slic implements a QUIC-like multiplexed transport over any duplex transport such as TCP. This way, you can use IceRPC with QUIC, with TCP (via Slic), and with various other traditional transports such as Bluetooth and named pipes.

> **Note**
>
> Slic over TCP suffers from the same [head-of-line blocking](https://en.wikipedia.org/wiki/Head-of-line_blocking) issue as HTTP/2. QUIC was created in part to address this issue.

## Modular and extensible

### Invocation and dispatch pipelines

When you make an RPC with IceRPC, your request and response travel through an invocation pipeline (on the client side) and a dispatch pipeline (on the server side):

```mermaid
---
title: Client-side
---
flowchart LR
    subgraph pipeline[Invocation pipeline]
        direction LR
        di[Deadline<br>interceptor] --> ri[Retry<br>interceptor] --> connection[network<br>connection] --> ri --> di
    end
    client -- request --> di
    client -- response --- di
```

```mermaid
---
title: Server-side
---
flowchart LR
    subgraph pipeline [Dispatch pipeline]
        direction LR
        lm[Logger<br>middleware] --> dm[Deadline<br>middleware] --> service --> dm --> lm

    end
    connection[network<br>connection] -- request --> lm
    connection -- response --- lm
```

These pipelines intercept your requests and responses and you decide what they do with them. If you want to log your requests and responses, add the Logger interceptor to your invocation pipeline or the Logger middleware to your dispatch pipeline. If you want to automatically retry failed requests that can be retried, add the Retry interceptor to your invocation pipeline. IceRPC provides a number of interceptors and middleware for compression, deadlines, logging, metrics, OpenTelemetry integration, and more. You can also easily create and install your own interceptors or middleware to customize these pipelines.

Since all this functionality is optional and not hard-coded inside IceRPC, you can choose exactly the behavior you want. For example, you don't need the Compress interceptor if you're not compressing anything: if you don't install this interceptor, there is no compression code at all. Less code means simpler logic, fewer dependencies, faster execution and fewer bugs.

### Transports and more

This modularity and extensibility is everywhere in IceRPC. You can easily implement a new duplex or multiplexed transport and then plug it into IceRPC. All the transport interfaces are public and fully documented.

And you can use IceRPC with a [DI container](https://docs.icerpc.dev/icerpc/dependency-injection/di-and-icerpc-for-csharp.md)—or not. It's all opt-in.

### Choose your IDL

IceRPC provides everything you need to make RPCs. When you use only IceRPC's core API, the payloads of your requests and responses are streams of bytes, and you need to manually encode and decode any typed data (such as strings and integers) in these streams. This is doable but laborious.

It is easier and more typical to use IceRPC together with an [Interface Definition Language](https://en.wikipedia.org/wiki/Interface_description_language) (IDL) and its associated serialization format. For example, you can define an RPC in [Protobuf](https://protobuf.dev/) or [Slice](https://docs.icerpc.dev/slice.md) and then let the corresponding code generator generate code that encodes and decodes the RPC arguments and return value to and from bytes in the Protobuf or Slice binary format.

The IceRPC + Slice integration helps you build applications with IceRPC and Slice. And the IceRPC + Protobuf integration brings the same level of convenience to Protobuf.

## Key features

- [How to create a connection](https://docs.icerpc.dev/icerpc/connection/how-to-create-a-connection.md): Learn how to create and accept connections with IceRPC.
- [Invocation](https://docs.icerpc.dev/icerpc/invocation/invocation-pipeline.md): Learn how to send requests and receive responses.
- [Dispatch](https://docs.icerpc.dev/icerpc/dispatch/dispatch-pipeline.md): Learn how to accept requests and return responses.
- [Server address](https://docs.icerpc.dev/icerpc/connection/server-address.md): Understand the server address concept and syntax.
- [Service address](https://docs.icerpc.dev/icerpc/invocation/service-address.md): Understand the service address concept and syntax.
- [Routing](https://docs.icerpc.dev/icerpc/dispatch/router.md): Learn how to route incoming requests based on their path.

## C# examples

- [Slice examples](https://github.com/icerpc/icerpc-csharp/tree/0.7.x/examples/slice/): Using IceRPC with Slice
- [Protobuf examples](https://github.com/icerpc/icerpc-csharp/tree/0.7.x/examples/protobuf/): Using IceRPC with Protobuf.
- [JSON examples](https://github.com/icerpc/icerpc-csharp/tree/0.7.x/examples/json/): Using the core IceRPC API together with JSON.
