RoCE & Ethernet
RDMA over Converged Ethernet — DCQCN congestion control, PFC, ECN, and when RoCE is used instead of InfiniBand for AI clusters.
RoCE (RDMA over Converged Ethernet) provides RDMA capability on standard Ethernet infrastructure — lower cost than InfiniBand but requiring careful congestion control configuration for AI workloads.
1. Why RoCE?
| Factor | InfiniBand | RoCE v2 |
|---|---|---|
| Network hardware | Dedicated IB switches (~$15K+) | Standard Ethernet switches (~$5K) |
| Bandwidth | NDR 400 Gb/s | 100-400 GbE |
| Existing infrastructure | None (new build) | Can reuse existing Ethernet |
| Cloud availability | Limited | Widely available (Azure, some AWS) |
| Configuration | Plug-and-play | Requires PFC/ECN tuning |
Azure uses RoCE for its AI clusters (ND A100v4, ND H100v5). InfiniBand is used by NVIDIA DGX, Meta, and most dedicated training clusters.
2. The Congestion Problem
Ethernet is a lossy network — packets can be dropped when buffers overflow. For TCP, this is fine (retransmits). For RDMA, dropped packets are catastrophic — RDMA assumes reliable delivery.
Priority Flow Control (PFC)
PFC makes Ethernet lossless for RDMA traffic:
When switch buffer fills → send PAUSE frame to upstream sender → sender stops
When buffer drains → send RESUME → sender continues
PFC classes: Traffic is classified by priority (CoS). Only RDMA traffic (typically CoS 3) gets PFC — other traffic can still be dropped.
PFC storms: If PAUSE frames cascade across switches, the entire network can stall. This is the #1 operational risk with RoCE.
ECN (Explicit Congestion Notification)
ECN marks packets instead of dropping them:
Switch detects congestion → marks packet with ECN CE bit
Receiver sends ECN feedback to sender → sender reduces rate
DCQCN (Data Center QCN)
DCQCN combines ECN with a rate-control algorithm:
- Sender starts at full line rate
- ECN marks trigger rate reduction (multiplicative decrease)
- Without ECN marks, rate slowly increases (additive increase)
- Converges to fair share of bandwidth
# Typical RoCE switch configuration
# Enable PFC on CoS 3 (RDMA traffic)
# Enable ECN marking at 50% buffer threshold
# Configure DCQCN on NICs
For details on InfiniBand’s credit-based flow control (which avoids these issues), see RDMA Concepts.
3. RoCE Performance for AI
| Metric | InfiniBand NDR | RoCE v2 (100 GbE) | RoCE v2 (400 GbE) |
|---|---|---|---|
| Per-port BW | 50 GB/s | 12.5 GB/s | 50 GB/s |
| Latency | ~1 μs | ~2-5 μs | ~2 μs |
| AllReduce 1 GB (8 nodes) | ~20 ms | ~80 ms | ~20 ms |
| Stability | Excellent | Requires tuning | Good with tuning |
400 GbE RoCE closes the bandwidth gap with InfiniBand NDR. The remaining difference is congestion control reliability and multi-rail support.
When RoCE Works Well
- Cloud environments (Azure ND series)
- Moderate-scale training (≤256 GPUs)
- When existing Ethernet infrastructure exists
- When InfiniBand switches are unavailable
When RoCE Struggles
- Very large clusters (1000+ GPUs) — PFC storm risk increases
- Shared networks (RDMA and non-RDMA traffic on same fabric)
- Without dedicated network engineering for PFC/ECN tuning
4. NCCL with RoCE
# Force NCCL to use RoCE instead of IB
export NCCL_IB_DISABLE=1
export NCCL_SOCKET_IFNAME=eth0
# Or use RoCE explicitly
export NCCL_IB_GID_INDEX=3 # RoCEv2 GID
export NCCL_IB_DISABLE=0 # keep IB verbs (RoCE uses IB verbs)
NCCL treats RoCE as InfiniBand at the API level (both use IB verbs). The configuration difference is at the network layer.
Self-Check
- Explain why Ethernet needs PFC and ECN for RDMA (lossy vs lossless)
- Explain PFC storms and why they’re the #1 RoCE risk
- Explain DCQCN and how it achieves fair bandwidth sharing
- Compare RoCE v2 100 GbE vs 400 GbE vs InfiniBand NDR for AllReduce
- Configure NCCL for RoCE vs InfiniBand