KRCore: A Microsecond-scale RDMA Control Plane for Elastic Computing

cluster 2201.11578
RDMAcontrol-planeelastic-computingDCTkernel-moduleconnection-virtualization

§1 TL;DR #

KRCore virtualizes pre-initialized kernel-space RDMA DCT connections to achieve 5.4μs connection setup (vs 15.7ms verbs), using fixed O(1) memory regardless of cluster scale, while preserving low-level verbs API compatibility for existing RDMA optimizations.

§2 Q1 / Q2 / Q3 #

Q1 痛点 #

RDMA connection setup (control plane) is 15,700X slower than its data path — 15.7ms to create one RCQP vs ~1μs for a data operation. This bottleneck is critical for elastic computing (disaggregated storage adding nodes on-demand, serverless with ephemeral containers). The cost is dominated by hardware resource configuration on the NIC (87% of create_qp time), not network handshakes (only 2.4%). Existing kernel-space solution LITE still takes 2ms per connection on cache miss, consumes 1.52GB per node for 10k-node clusters, and exposes an inflexible high-level API.

Q2 方法 #

Core insight (核心技术壁垒): DCT (Dynamic Connected Transport) allows a single RDMA QP to communicate with different hosts through hardware-managed reconnection in <1μs — virtualizing pre-initialized kernel-space DCT connections lets applications skip the entire costly QP creation and configuration path.

Three-part design:

  1. Kernel DCT virtualization: Virtual QPs (VQPs) backed by shared physical DCQPs in a per-CPU hybrid pool. Applications get full verbs semantics without paying creation costs.
    1. RDMA-based metadata service: DCT metadata (12B per node) stored in a replicated KVS (DrTM-KV) queried via one-sided RDMA READs — no CPU involvement at server, deterministic μs-scale latency (vs RPC's ms-scale tail).
      1. Hybrid DC→RC escalation: Pool maintains both DCQPs (instant, any-target) and RCQPs (faster sustained throughput). Background monitoring detects hot paths and transparently upgrades DC→RC connections without application awareness.
      2. Q3 结果 #

        • Connection setup: 5.4μs (KRCore) vs 15.7ms (verbs) vs 2ms (LITE) — 2,900X and 370X faster
        • Throughput: 22M connections/sec (KRCore) vs 712 QPs/sec (verbs/LITE hardware-bottlenecked)
        • Memory: 6.3MB for 5,000 connections (KRCore) vs 780MB (LITE)
        • RACE Hashing bootstrap: 83% faster (244ms vs 1.4s) under load spikes
        • Serverless data transfer: 99% latency reduction (0.12μs vs 33.3ms)
        • Data path overhead: ≤46% for sync one-sided (dominated by 1μs syscall), ≤20% for async two-sided

        §3 架构 / 方法图 #

        flowchart TB subgraph UserSpace["User Space (per-application)"] App1["App 1"] App2["App 2"] VQP1["VQP₁ (ibv_post_send compatible)"] VQP2["VQP₂"] App1 --> VQP1 App2 --> VQP2 end subgraph KernelModule["KRCore Kernel Module (Rust, loadable)"] direction TB API["Extended API Layer
        (qconnect / qbind / qpop_msgs)"] PreCheck["Pre-check Engine
        (queue capacity + request integrity)"] subgraph HybridPool["Hybrid QP Pool (per-CPU)"] DC["DCQP × 8
        (static, any-target)"] RC["RCQP pool
        (on-the-fly, hot-path)"] end BGMon["Background Monitor
        (LRU eviction + hot-path RC creation)"] DCCache["DCCache
        (local metadata cache, 12B/node)"] end subgraph MetaServer["Meta Server (few nodes)"] KVS["DrTM-KV
        (DCT# + DCT_key per node)"] end subgraph Remote["Remote Nodes"] RNIC_R["Target RNIC
        (DCT endpoint)"] end VQP1 -->|"ioctl syscall"| API VQP2 -->|"ioctl syscall"| API API --> PreCheck PreCheck --> HybridPool DC -->|"hw reconnect <1μs"| RNIC_R RC -->|"dedicated channel"| RNIC_R HybridPool -.->|"RDMA READ (metadata query)"| KVS BGMon -->|"creates/evicts"| RC DCCache -.->|"cache hit path"| DC

        Execution flow for a new connection to target S1:

        1. App calls qconnect(VQP, S1_gid, port)
        2. KRCore checks hybrid pool — no RCQP to S1
        3. Selects DCQP from per-CPU pool
        4. Looks up S1's DCT metadata: DCCache hit → 0μs; miss → one-sided RDMA READ to meta server (~3-4μs)
        5. VQP bound to physical DCQP — app can now ibv_post_send immediately
        6. Background monitor detects repeated S1 traffic → creates RCQP in background → transparently transfers VQP to RC
        7. Scale: system scope is rack/pod-scale datacenter (10-10k+ nodes), 100Gbps InfiniBand. Workload: elastic storage/serverless with bursty connection patterns. Hardware class: Mellanox ConnectX-4/5/6/7 with DCT support (Connect-IB onward).

          §4 作者证明 #

          无形式化数学模型 — paper presents algorithmic pseudocode (Algorithm 1: VQP creation/connection; Algorithm 2: virtualized post_send/poll_cq) with empirical validation rather than formal proofs.

          Notation table #

          SymbolMeaning
          RCQPReliable Connected Queue Pair (one-to-one, full RDMA)
          DCQPDynamically Connected QP (one-to-many, hw reconnect)
          VQPVirtual QP — KRCore's user-facing abstraction
          DCTDynamic Connected Transport (RNIC feature)
          $wr\_id$Work request identifier, overloaded to encode VQP + completion count
          $uncomp\_cnt$Outstanding unsignaled requests counter per VQP

          6 minimum checks #

          #ClaimVerification
          1DCT reconnection <1μsHardware specification from Mellanox (ref [1], OpenFabrics 2014). Validated: KRCore(DC) sync latency 3.24μs includes syscall(1μs) + RDMA op (~2μs), leaving <0.5μs for DCT overhead
          2RNIC dominates QP creation cost (87%)Figure 3(b) breakdown: 361μs of 413μs create_qp is hardware queue allocation. Cross-validated: ConnectX-6 still 17ms (§6), confirming NIC firmware, not driver, is bottleneck
          3Memory scaling O(1) vs O(N)DCT metadata 12B/node → 17KB/1000 nodes. RCQP 159KB each → 1.52GB/10k nodes. Ratio grows linearly with cluster size
          4Pre-check prevents QP corruptionAlgorithm 2: checks queue capacity (line 7: polls to clear), validates opcode + MR (line 13), force-signals last unsignaled request (lines 24-26). LITE fails at >6 threads; KRCore handles arbitrarily many
          5Meta server CPU-bypass advantageOne-sided RDMA READ bypasses remote CPU entirely. Figure 9(a): 11.8X throughput and 13X lower latency vs kernel-space RPC (bottlenecked by server CPU scheduling)
          6Hybrid DC→RC benefit measurableFigure 16 time 2.2→3: RACE throughput jumps from 18M to 26M req/sec (1.4X) after transparent RC upgrade. Matches verbs peak, confirming RC benefit for sustained traffic

          Cluster-specific: bandwidth budget #

          • Single RDMA READ payload: 8B (microbenchmark). At 100Gbps link, theoretical: ~1.5 billion 8B reads/sec
          • Measured peak: 138M reads/sec (KRCore RC async, 240 clients) — bottlenecked by RNIC processing, not link BW
          • DCT overhead: 14% throughput reduction (118M vs 138M) due to additional DCT connection state processing in NIC firmware

          Cluster-specific: scaling formula #

          • Connection throughput: $T_{conn}(N) = N \times t_{meta\_query}^{-1}$ where $t_{meta\_query} \approx 5.4\mu s$. At 240 clients: 22M conn/sec (limited by meta server IOPS, not per-client)
          • Memory per node: $M = 8 \times 159KB_{DCQP} + n_{RC} \times 159KB_{RC} + N_{remote} \times 12B_{meta}$. With default 8 DC + local RC cache + metadata: stays in single-digit MB range regardless of cluster N

          §5 实验与数据 #

          Control plane performance #

          MetricKRCore (DC)VerbsLITESpeedup
          Single connection5.4μs15.7ms2ms2,900X / 370X
          240-client throughput22M conn/s712 QP/s712 QP/s30,900X
          Full-mesh (240 workers)81μs2.7s2.3s33,300X / 28,400X

          Verbs and LITE throughput identical at 712 QP/s because both are bottlenecked by RNIC hardware QP creation capacity — the fundamental limit KRCore sidesteps by never creating new QPs at connection time.

          Data plane overhead #

          OperationKRCore(RC) vs VerbsKRCore(DC) vs VerbsRoot cause
          1-client sync READ+46% (3.15 vs 2.15μs)+51% (3.24 vs 2.15μs)1μs syscall overhead
          Async READ peak (240 cli)≈0% (138M vs 138M)−14% (118M vs 138M)NIC-bound; DC firmware overhead
          Async WRITE peak≈0% (145M vs 145M)−8.9% (132M vs 145M)Same NIC-bound pattern
          Two-sided async peak−20% (33.7M vs 42.3M)−20% (same)CPU cost of user-kernel crossing

          System call cost dominates for small sync operations but becomes negligible for large payloads (overhead <7% for READ ≥256KB, negligible for WRITE ≥8KB).

          Application: RACE Hashing under load spike #

          • Scenario: 180 new computing processors forked at time 0
          • Bootstrap time: KRCore 244ms, LITE 1s, verbs 1.4s (83% reduction vs verbs)
          • KRCore bottleneck: OS process creation (not RDMA)
          • During ramp-up (t=0-3s): KRCore 4.9X lower 99% tail latency than verbs
          • Steady-state (t>3): KRCore(RC) 26M req/s ≈ verbs; LITE only 15M due to inflexible API (no doorbell batching)
          • DC→RC switch overhead at t=2.2: negligible (transparent to application)

          Application: Serverless (Fn platform) #

          • Data transfer between two serverless functions on separate machines
          • KRCore: 0.12μs for 1-9KB transfers
          • Verbs: 33.3ms (dominated by connection setup, not transfer itself)
          • 99% reduction — connection cost completely removed from critical path

          Memory efficiency #

          ConnectionsLITEKRCoreRatio
          5,000780MB (1.5GB w/ msg queues)6.3MB124X (238X)
          10,0001.52GB+~12MB127X+

          KRCore achieves this through the fundamental DCT property: one physical DCQP serves unlimited virtual connections, metadata is 12B/target.

          §6 论证链 #

          StepClaimEvidenceLogical link
          1RDMA control plane is the bottleneck for elastic computingFigure 1: 15.7ms connection vs μs-scale data ops; Figure 3(b): 87% cost in NIC hardware setupEstablishes that the problem is fundamental to hardware architecture, not fixable by software optimization of existing path
          2DCT provides sub-μs hardware reconnection on commodity RNICsMellanox spec [1]: ConnectX-IB through ConnectX-7 support DCT; paper measures <1μs reconnectIdentifies the exploitable hardware capability — widely deployed but unused for control plane
          3Kernel-space virtualization of DCT eliminates per-connection creation costAlgorithm 1: VQP reuses pre-initialized physical DCQP; no new hardware QP creation at connect timeTransforms the connection operation from "create expensive hardware resource" to "assign pointer to existing resource"
          4RDMA-based meta server provides deterministic μs-scale metadata accessFigure 9(a): one-sided READ 11.8X throughput vs RPC; CPU-bypass eliminates scheduling jitterSolves the DCT metadata query challenge without introducing new latency variability
          5Pre-check mechanism preserves safety under QP sharingAlgorithm 2: validates queue capacity, opcodes, MR before forwarding; LITE breaks at >6 threads, KRCore does notDemonstrates correctness — shared physical QP requires active protection that prior work lacked
          6Hybrid DC+RC pool amortizes DC performance gap for sustained workloadsFigure 16 t>2.2: transparent upgrade recovers full RC throughput (26M vs 18M req/s) with negligible switch costAddresses the performance objection: DC is optimal for connection speed, RC for sustained throughput, KRCore provides both
          7End-to-end: elastic applications see order-of-magnitude improvementsRACE: 83% boot reduction; serverless: 99% transfer reduction; both limited by OS, not RDMAValidates that control plane speedup translates to real application benefit, not just microbenchmark

          §7 实现 cross-reference #

          Repository: https://github.com/SJTU-IPADS/krcore-artifacts

          ComponentImplementation detail
          Kernel module>10,000 LoC Rust, loadable Linux 4.15 module, exports via ioctl
          DCT kernel port250 LoC C patch to mlnx-ofed-4.9 driver
          User shim100 LoC C library wrapping extended API (§4.1)
          Meta server backendDrTM-KV [58] — existing RDMA-enabled KV store
          QP pool sizing8 DCQPs per CPU (empirically chosen, Figure 14(a): >2 eliminates contention)
          MR validityLease-based invalidation with 1s flush period

          核心技术壁垒 #

          The single hardest-to-replicate insight is the realization that DCT's hardware reconnection capability — designed for reducing NIC memory consumption in MPI workloads — can be repurposed as a control plane accelerator by virtualizing kernel-space DCT connections. This requires: (1) understanding that QP creation cost is NIC-firmware dominated (not network-dominated), (2) kernel-level access to DCT which no user-space library provides, and (3) a safe virtualization layer (Algorithm 2) that prevents corruption under arbitrary sharing patterns. The combination creates a "free" connection operation from pre-existing hardware capability.

          关键实现细节 #

          1. wr_id overloading (Algorithm 2, lines 17,26): Unsignaled RDMA requests do not generate completions, so KRCore encodes the count of preceding unsignaled requests into the wr_id of the next signaled request. This allows correct deallocation of send queue entries during poll without per-request tracking overhead — missing this would cause silent queue slot leaks under high concurrency.
            1. Per-CPU pool division: Hybrid pool is partitioned per-CPU to eliminate lock contention (inspired by FaSST [26]). Thread migration between CPUs triggers background VQP re-virtualization to a local physical QP via the transfer protocol (§4.6). Without per-CPU partitioning, the pool becomes a centralized bottleneck destroying the μs-scale latency guarantee.
            2. NIC feature implications (software → hardware) #

              KRCore argues for:

              • DCT as first-class kernel-space primitive: current drivers expose DCT only in user-space; KRCore required a 250-line driver patch
              • Faster NIC QP creation firmware: ConnectX-4→6 shows no improvement (15.7→17ms); NIC vendors have not prioritized this
              • Hardware-assisted VQP multiplexing: if NIC supported native QP virtualization (like SR-IOV for network functions), the kernel module overhead (syscall cost) could be eliminated entirely

              Vendor dependency #

              Relies on Mellanox/NVIDIA ConnectX series (Connect-IB through ConnectX-7) for DCT support. InfiniBand fabric required for full functionality. Tested on ConnectX-4 with mlnx-ofed-4.9. Not directly portable to non-Mellanox RNICs (Intel, Broadcom) as DCT is a Mellanox-proprietary transport extension.