RedN: Turing-Complete RDMA Offload
- RedN is a Turing-complete RDMA offload framework that uses self-modifying chains and advanced ordering to enable dynamic in-network computations.
- It leverages atomic RDMA operations and circular work queues to execute conditional branches, loops, and hash lookups efficiently.
- Empirical evaluations demonstrate that RedN reduces latency and improves throughput for data structure offloads compared to traditional CPU-based methods.
RedN is the name of a Turing-complete RDMA offload framework that enables complex in-network computations by orchestrating self-modifying chains of RDMA work requests over commodity RDMA NICs, as introduced by (Reda et al., 2021). Unlike approaches that rely solely on CPU involvement or are constrained by the fixed set of RDMA verbs, RedN exploits advanced ordering and self-modification primitives present in Mellanox ConnectX-class NICs to perform sophisticated remote execution tasks, including hash lookups, atomic updates, and conditional branching, all without specialized custom hardware or firmware modification.
1. Principles and Programming Model
RedN's abstraction centers on representing programs as chains of work requests (WRs) in circular work-queues (WQs) in host memory. Each WR descriptor specifies both the operation (Read, Write, Send, Recv, CAS, etc.) and its arguments. The key innovation is allowing these WR descriptors to be self-modified at runtime by previous WRs using RDMA-atomic primitives (notably, 64-bit compare-and-swap), enabling dynamic control flow and conditional execution without leaving the data path.
Three main ordering mechanisms are leveraged:
- Doorbell order: No WR is fetched until the WQ is explicitly enabled.
- Completion order: A WR may be held back until a specified earlier WR completes.
- Default WQ order: Standard in-queue FIFO semantics, with prefetch permitted by the RNIC for throughput.
Crucially, the combination of atomic modification and fine-grained ordering guarantees is used to build "if"-like branch constructs, loop constructs (by WQ recycling or CPU-side unrolling), and even simulate universal computation. The RedN framework provides a small C API and DSL that compiles high-level logic into concrete WR chains and required enable/wait operations.
2. Formal Properties and Turing Completeness
RedN is shown to be Turing complete via the following mechanisms:
- Unbounded remote memory: Provided by RDMA Read/Write.
- Conditional branching: Achieved by having a WR (typically CAS) alter the opcode or arguments of a later WR prior to its execution. For example, a later WR may be switched between Noop and Write depending on a computed condition.
- Loops: Supported by recycling WQ pointers to the start of the chain on completion (autonomous looping), or by unrolling loops in memory.
A formal sketch in (Reda et al., 2021) shows how the RedN micro-ISA can simulate the minimal x86 "mov" and "jmp" operations underlying universal computation.
3. System Architecture and Implementation
A RedN deployment on a server consists of:
- Hardware: Standard Mellanox ConnectX-3+ or later NIC, with support for CAS, Wait, and Enable verbs.
- Host Software: The RedN user-level library (≈2.3 KLoC, C), using libmlx5 to allocate and manage the WR queues in DRAM. The queues are "managed," i.e., prefetching can be disabled, and explicit enable operations control execution.
- Control Plane: Server posts WR chains at initialization; clients simply trigger pre-installed chains.
- Data Plane: When a client issues a request (e.g., Send), the associated WR chain is executed entirely in the NIC, with all memory reads, conditional checks, and writebacks performed as a single in-network operation.
An example use is offloading the main key lookup in Memcached: the server generates and posts a WR chain implementing the cuckoo hash traversal logic, which can include multiple conditional branches and value retrievals, all executed through the NIC.
4. Performance and Evaluation
Empirical evaluation on a three-node testbed (Haswell CPUs, Mellanox CX5, 100 GbE) demonstrates:
- Microbenchmarks: Single-verb RDMA Write completes at 1.6 μs; CAS and Enable operate at ≈1.7–1.8 μs; aggregate chain overhead is ~0.17–0.54 μs per WR depending on the ordering guarantee.
- Data-structure offloads: For hash table lookups, RedN achieves median latency of 16.2 μs (64 KB value), compared to ~33 μs for state-of-the-art one-sided (FaRM-KV) and even higher for two-sided (Send RPC) approaches.
- Throughput: RDMA Reads/Writes saturate at 63–65 Mops/s, while an "if" chain achieves 0.7 Mops/s, bottlenecked by PUs or PCIe.
- Performance isolation: RedN provides strong isolation, with 99th percentile tail latency remaining <6 μs under heavy background write traffic (up to 16 concurrent writers), while two-sided designs degrade by up to 35×.
- Failure resiliency: RedN chains execute independently of host process liveness; for example, a process crash and recovery on the Memcached server has no impact on in-flight offloads.
Comparison with FPGA-based SmartNIC offloads demonstrates comparable or superior latency for hash lookup and pointer-traversal workloads without the need for custom hardware.
5. API, Application Integration, and Workflow
RedN provides a programming model where developers write offload routines using a high-level API or DSL specifying control flow ("if", "while", "read", "write", "CAS"). This is compiled into WR chains and supporting memory regions. Deployment comprises:
- Allocating WQs and memory regions per client or data structure.
- Compiling and registering code/data segments with the NIC.
- On client request, triggering offloads by ringing a doorbell register.
In the Memcached integration, the main code differences are limited to the server triggering the pre-installed WR chain instead of invoking CPU logic to serve a key-value get request.
6. Limitations, Scalability, and Open Directions
Several limitations exist:
- Resource scaling: Per-client WQs can become resource-intensive. Mitigation is possible via dynamically connected transports.
- Operand sizes: CAS is limited to 48 bits; larger operations require multiple linked CAS steps.
- Overhead of strict ordering: Doorbell- or completion-order introduces higher latency per WR and should be used sparingly, with unrolled chains preferred when possible.
Open challenges remain in further exploiting features of Intel RNICs, improving security (code/data region key protection), integrating with higher-level sockets/legacy stacks, and extending the RedN DSL for more automated offload synthesis.
A plausible implication is that as PCIe and RDMA NICs grow in programmable capability and support richer atomic operations, the range and efficiency of network-side computation achievable with RedN-like frameworks will expand, potentially enabling widespread in-network acceleration for a variety of distributed data structure and storage workloads.
7. Impact and Research Significance
By demonstrating the Turing completeness of the RDMA verbs interface, RedN fundamentally recasts what is feasible with commodity RNICs: applications formerly bound to the CPU can now offload arbitrary computation—key lookups, pointer chasing, atomic update logic—to the NIC, achieving order-of-magnitude performance gains and strong isolation. RedN is a practical, hardware-agnostic answer to the demand for flexible, user-space offloading in the datacenter, significantly advancing both the conceptual and empirical state of RDMA offload models (Reda et al., 2021).