2.8 Data center networking protocols
How data gets from one machine's memory, or one GPU's memory, into another's without slowing down: RDMA, GPUDirect RDMA, RoCE, and the InfiniBand Subnet Manager.
Where this fits
Step 8 of 22 · Part 3: Connecting machines · Exam objective 2.8
In the big picture this is stage 3, the network moves data between GPUs. It is step 2 of 3 in Part 3, Connecting machines.
You should already know:
- 2.9 High-speed network options: the main links: NVLink between GPUs inside a server, and InfiniBand and Ethernet between servers.
- 1.8 GPU vs CPU architecture: a CPU and a GPU each have their own memory, called host memory and device memory.
Up next: 2.10 DPUs in the data center: a DPU is a chip that moves network and security work off the main CPU.
Why this exists
GPUs in one job keep sending data to GPUs in other machines. If the CPU has to copy every piece of that data on its way in and out of memory, it becomes a middleman and adds copies, delay and CPU load. NVIDIA's documentation describes the fix as removing extra copies and reducing CPU overhead and latency. That fix is called RDMA.
Everyday picture (our analogy). Picture two offices swapping paper files. Without RDMA, every file goes to the front desk, where a clerk copies it and carries it to the right desk. With RDMA, the courier walks straight to the right desk and the clerk keeps working. GPUDirect RDMA is the courier who can reach the desk inside the GPU's own office. (This picture is our analogy, not NVIDIA's wording.)
Words you will meet
- RDMA
- remote direct memory access: a network adapter moves data straight into another machine's memory, without the CPU copying it.
- GPUDirect RDMA
- the same idea, but the memory being read or written is a GPU's memory.
- InfiniBand
- a high-performance, low-latency, RDMA-capable network used between GPU servers and storage.
- RoCE
- RDMA over Converged Ethernet: RDMA carried over ordinary Ethernet instead of InfiniBand.
- Fabric
- the network that connects the servers: the switches, cables and adapters together.
- Subnet Manager
- the program that configures an InfiniBand fabric. Here SM means Subnet Manager, not the GPU's streaming multiprocessor.
- PCIe
- PCI Express, the standard link inside a server that connects the CPU to GPUs, network adapters and storage.
Key points
1. The core idea: skip the middleman (RDMA)
Start here. Everything else in this guide is a variation on this one idea.
RDMA (remote direct memory access) means a network adapter can move data straight into another machine's memory, without the CPU copying it. NVIDIA describes InfiniBand, the high-speed network from 2.9 High-speed network options, as RDMA-capable. In a DGX SuperPOD (NVIDIA's reference design for a whole GPU cluster, covered in 2.2 Scaling GPU infrastructure), storage is reached over InfiniBand using RDMA, to get the most performance and the least CPU overhead.
What NVIDIA says (2)
“InfiniBand is a high-performance, low latency, RDMA capable networking technology”
“Storage is provided over InfiniBand and leverages RDMA to provide maximum performance and minimize CPU overhead.”
2. Reaching the GPU's own memory (GPUDirect RDMA)
Ordinary RDMA delivers data into the CPU's memory. GPUs keep their data in separate memory, so this section covers the version that reaches GPU memory directly, and its limits.
Ordinary RDMA moves data into host (CPU) memory. GPUDirect RDMA goes one step further: it lets a peer device, such as a network adapter, read and write GPU memory directly, using standard PCI Express (PCIe) features. PCIe is the link inside a server that connects the CPU, GPUs and adapters. NVIDIA says this gives direct communication between GPUs in remote systems.
What NVIDIA says (3)
“GPUDirect RDMA is a technology introduced in Kepler-class GPUs and CUDA 5.0 that enables a direct path for data exchange between the GPU and a third-party peer device using standard features of PCI Express.”
“enables a direct path for data exchange between the GPU and a third-party peer device using standard features of PCI Express.”
“Designed specifically for the needs of GPU acceleration, GPUDirect RDMA provides direct communication between NVIDIA GPUs in remote systems.”
So the full recipe has two parts. First, a network adapter that can do RDMA. Second, GPUDirect RDMA, so that adapter can reach GPU memory directly. NVIDIA says network adapters can then read and write GPU memory directly, which removes extra copies and reduces CPU overhead and latency.
What NVIDIA says (3)
“enables a direct path for data exchange between the GPU and a third-party peer device using standard features of PCI Express.”
“Examples of third-party devices are: network interfaces, video acquisition devices, storage adapters.”
“avoids a bounce buffer through the CPU. Using this direct path can relieve system bandwidth bottlenecks and decrease the latency and utilization load on the CPU.”
There are limits. The GPUDirect RDMA guide says the most important one is that the two devices must share the same upstream PCIe root complex, meaning the top of the PCIe layout inside the server. Of the possible paths, one that goes only through PCIe switches performs best. Paths through the CPU, or across CPU sockets, can be slow or fail.
What NVIDIA says (2)
“A number of limitations can apply, the most important being that the two devices must share the same upstream PCI Express root complex.”
“The first situation, where there are only PCIe switches on the path, is optimal and yields the best performance.”
GPUDirect RDMA also needs kernel support, so that the network adapter can map GPU memory. The kernel is the core of the operating system. The GPU Operator documentation (the GPU Operator installs NVIDIA software on Kubernetes nodes; see 3.2 Orchestration and job scheduling) lists two ways to provide it: DMA-BUF in the Linux kernel, or the older nvidia-peermem module from the GPU driver. NVIDIA recommends DMA-BUF.
What NVIDIA says (2)
“The kernel mode support is provided by one of two approaches: DMA-BUF from the Linux kernel or the legacy nvidia-peermem kernel module.”
“NVIDIA recommends using the DMA-BUF rather than using the nvidia-peermem kernel module from the GPU Driver.”
3. Road A: RDMA on InfiniBand
On InfiniBand, two practical details come up: a manager program has to be running on the network, and ordinary IP software can still be used.
An InfiniBand network needs a manager. The Subnet Manager (SM) configures the InfiniBand fabric: it discovers devices and sets up routing. NVIDIA's OFED documentation (OFED is NVIDIA's networking software package) says all InfiniBand-compliant upper-layer protocols need a Subnet Manager running on the fabric at all times. OpenSM is one, installed with NVIDIA OFED. Here SM means Subnet Manager, not the streaming multiprocessor from 1.8 GPU vs CPU architecture.
What NVIDIA says (2)
“InfiniBand Subnet Manager All InfiniBand-compliant ULPs require a proper operation of a Subnet Manager (SM) running on the InfiniBand fabric, at all times.”
“OpenSM is an InfiniBand-compliant Subnet Manager, and it is installed as part of NVIDIA OFED”
Normal internet software can still run on InfiniBand. IPoIB (IP over InfiniBand) is a network driver that wraps IP packets inside InfiniBand transport, so normal TCP/IP software works on an InfiniBand fabric. An HCA (host channel adapter) is the InfiniBand network card. MLNX_OFED says configuring IPoIB means giving each HCA port an IP address and subnet mask, just like any other network adapter.
What NVIDIA says (2)
“IPoIB encapsulates IP datagrams over an InfiniBand Datagram transport service.”
“The configuration of IPoIB requires assigning an IP address and a subnet mask to each HCA port, like any other network adapter card”
4. Road B: RDMA on Ethernet (RoCE)
Ethernet is the other network option from 2.9 High-speed network options. RoCE carries RDMA over it, and it works best when the network does not drop packets.
RoCE (RDMA over Converged Ethernet) carries RDMA over Ethernet. As with any RDMA, one machine reads or writes another machine's memory without involving either CPU in every transfer, which keeps latency low. NVIDIA's MLNX_OFED documentation describes RoCE as a way to move data efficiently with very low latency on lossless Ethernet networks. Lossless means the network avoids dropping packets under congestion, usually with flow-control features on the switches.
What NVIDIA says (1)
“RDMA over Converged Ethernet (RoCE) is a mechanism to provide this efficient data transfer with very low latencies on lossless Ethernet networks.”
The next detail is how far RoCE traffic can be routed. Layer 2 is the switched Ethernet segment; layer 3 is IP routing between segments. MLNX_OFED describes RoCEv2 as a simple change to the RoCE packet format that lets the traffic run in IP layer 3 environments, so it can be routed.
What NVIDIA says (2)
“A straightforward extension of the RoCE protocol enables traffic to operate in IP layer 3 environments.”
“This capability is obtained via a simple modification of the RoCE packet format.”
RoCE performs best when packets are not dropped, and two switch features help. ECN (explicit congestion notification) marks packets when queues build up, so senders slow down before buffers overflow. PFC (priority flow control) pauses traffic for one priority class (a CoS group, short for class of service) when a buffer fills, instead of pausing the whole link. The Cumulus Linux documentation states that RoCE relies on ECN and PFC to operate.
What NVIDIA says (2)
“RoCE relies on ECN and PFC to operate.”
“PFC allows more granular control by pausing the traffic flow for a given CoS group instead of the entire link.”
There is also a blunter tool. Link pause stops all traffic on a link when the receiver is congested. PFC pauses only one traffic class, so other traffic keeps flowing. Cumulus Linux says link pause is another way to get lossless Ethernet, but PFC is the preferred method because it gives finer control.
What NVIDIA says (2)
“Link pause is another way to provide lossless ethernet; however, PFC is the preferred method.”
“PFC allows more granular control by pausing the traffic flow for a given CoS group instead of the entire link.”
One monitoring gotcha: RoCE is handled by the network adapter hardware, not by the normal Ethernet driver path. MLNX_OFED therefore says RoCE traffic does not show up in the Ethernet device counters. It is counted where InfiniBand traffic is counted, under /sys/class/infiniband/<device>/ports/<port>/counters/. So look there before deciding the link is idle.
What NVIDIA says (2)
“RoCE traffic is not shown in the associated Ethernet device's counters since it is offloaded by the hardware and does not go through Ethernet network driver.”
“RoCE traffic is counted in the same place where InfiniBand traffic is counted; /sys/class/infiniband/<device>/ports/<port number>/counters/”
Compare the two roads. On InfiniBand, the Subnet Manager discovers the fabric, assigns addresses and programs routes. RoCE runs on Ethernet, which handles addressing differently. MLNX_OFED lists, for RDMA applications over the Ethernet link layer, that a Subnet Manager is not required.
What NVIDIA says (1)
“When working with RDMA applications over Ethernet link layer the following points should be noted: The presence of a Subnet Manager (SM) is not required in the fabric.”
5. How much bandwidth is there? Oversubscription
The last idea is about capacity rather than protocol.
Oversubscription means more bandwidth can enter a switch layer than can leave it. A ratio near 4:3 means about four units of possible demand for every three units of capacity. NVIDIA chose this for the storage fabric, the network that carries storage traffic, to allow more flexibility on cost and performance. The compute fabric, the network that carries GPU-to-GPU traffic between servers, is by contrast a full fat-tree, a design with leaf and spine switches.
What NVIDIA says (2)
“The DGX H100 system connections are slightly oversubscribed with a ratio near 4:3 with adjustments as needed to enable more storage flexibility regarding cost and performance.”
“Rail-optimized, full fat-tree network with eight NDR400 connections per system”
In one minute
- RDMA lets a network adapter move data into another machine's memory without the CPU copying it, which keeps latency low.
- GPUDirect RDMA needs two things: an RDMA-capable adapter and GPUDirect RDMA itself. The best path goes only through PCIe switches.
- InfiniBand needs a Subnet Manager running at all times. RDMA over Ethernet does not require one.
- RoCE works best on lossless Ethernet and relies on ECN and PFC. PFC is preferred to link pause.
- RoCE traffic is counted in the InfiniBand counters under /sys/class/infiniband, not in the Ethernet counters.
- Oversubscription near 4:3 was chosen for the storage fabric. The compute fabric is a full fat-tree.
Try it
Sample question
What is RDMA, and why do AI fabrics rely on it?
Show the answer
Answer: Remote direct memory access. It lets devices read and write memory directly, cutting copies, CPU overhead and latency.
RDMA (remote direct memory access) lets a network adapter move data straight into another machine's memory without the CPU copying it. NVIDIA describes InfiniBand as RDMA-capable. In DGX SuperPOD, storage uses RDMA over InfiniBand to maximize performance and minimize CPU overhead.
What NVIDIA says (2)
“InfiniBand is a high-performance, low latency, RDMA capable networking technology”
“Storage is provided over InfiniBand and leverages RDMA to provide maximum performance and minimize CPU overhead.”
Practice 2.8 (14 questions) Full AI Infrastructure guide
← 2.9 High-speed network options · 2.10 DPUs in the data center →