# microsoft/windows-usb4-rdma architecture

> Architecture diagram of the GitHub repository microsoft/windows-usb4-rdma, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-21). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/microsoft/windows-usb4-rdma
- Repository: https://github.com/microsoft/windows-usb4-rdma

## Overview

NetworkDirect over USB4 is a Windows NDv2 provider that exposes RDMA-style operations over Windows’ USB4 peer-to-peer networking drivers. The principal workflow is an application using the standard NetworkDirect interfaces, which the provider implements by forwarding supported two-sided send/receive operations to the kernel driver. The README also documents provider discovery and address-based adapter selection, installation, and example tools. Provider internals beyond the sampled entry point and interface declarations are described only at the README level, so those relationships cite the README.

Main entry points: [`src/ndprov/ndprov.cpp`](https://github.com/microsoft/windows-usb4-rdma/blob/main/src/ndprov/ndprov.cpp) (USB4 provider), [`src/ndutil`](https://github.com/microsoft/windows-usb4-rdma/tree/main/src/ndutil) (Provider helper library), [`src/ndutil/ndspi.h`](https://github.com/microsoft/windows-usb4-rdma/blob/main/src/ndutil/ndspi.h) (NDv2 interfaces), [`src/ndutil/ndfrmwrk.cpp`](https://github.com/microsoft/windows-usb4-rdma/blob/main/src/ndutil/ndfrmwrk.cpp) (Address and adapter selection)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["Application API"]
  node_ndv2["NDv2 interfaces<br/>[ndspi.h]"]
end

subgraph group_provider["Provider Runtime"]
  node_provider_dll["USB4 provider<br/>[ndprov.cpp]"]
  node_dll_entry["Provider entry point<br/>[dllmain.cpp]"]
  node_ioctl["RDMA IOCTL definitions<br/>[RdmaIoctl.h]"]
end

subgraph group_support["Discovery and Setup"]
  node_networkdirect_helpers["Provider helper library"]
  node_provider_catalog[("Provider catalog")]
  node_address_selection["Address and adapter selection<br/>[ndfrmwrk.cpp]"]
  node_address_helpers["Address helpers<br/>[ndaddr.cpp]"]
  node_installer["Catalog installer<br/>[ndprov_install.cpp]"]
end

subgraph group_tools["Example Tools"]
  node_example_tools["Example tools"]
end

node_application(("RDMA application"))
node_usb4_driver["USB4 P2P RDMA driver"]
node_administrator(("Administrator"))
node_peer(("Peer PC"))

node_application -->|"uses"| node_ndv2
node_ndv2 -->|"dispatches verbs"| node_provider_dll
node_dll_entry -->|"creates provider"| node_provider_dll
node_provider_dll -->|"forwards operations"| node_usb4_driver
node_ioctl -->|"defines requests"| node_provider_dll
node_networkdirect_helpers -->|"finds providers"| node_provider_catalog
node_networkdirect_helpers -->|"selects adapter"| node_address_selection
node_address_selection -->|"uses address data"| node_address_helpers
node_administrator -->|"installs provider"| node_installer
node_installer -->|"registers DLL"| node_provider_catalog
node_example_tools -.->|"exercises API"| node_application
node_usb4_driver -->|"transfers data"| node_peer

click node_ndv2 "https://github.com/microsoft/windows-usb4-rdma/blob/main/src/ndutil/ndspi.h"
click node_provider_dll "https://github.com/microsoft/windows-usb4-rdma/blob/main/src/ndprov/ndprov.cpp"
click node_dll_entry "https://github.com/microsoft/windows-usb4-rdma/blob/main/src/ndprov/dllmain.cpp"
click node_ioctl "https://github.com/microsoft/windows-usb4-rdma/blob/main/src/ndprov/RdmaIoctl.h"
click node_networkdirect_helpers "https://github.com/microsoft/windows-usb4-rdma/tree/main/src/ndutil"
click node_address_selection "https://github.com/microsoft/windows-usb4-rdma/blob/main/src/ndutil/ndfrmwrk.cpp"
click node_address_helpers "https://github.com/microsoft/windows-usb4-rdma/blob/main/src/ndutil/ndaddr.cpp"
click node_installer "https://github.com/microsoft/windows-usb4-rdma/blob/main/src/install/ndprov_install.cpp"
click node_example_tools "https://github.com/microsoft/windows-usb4-rdma/tree/main/src/examples"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_ndv2 toneBlue
class node_provider_dll,node_dll_entry,node_ioctl toneAmber
class node_networkdirect_helpers,node_provider_catalog,node_address_selection,node_address_helpers,node_installer toneMint
class node_example_tools toneRose
class node_application,node_usb4_driver,node_administrator,node_peer toneIndigo
```

## Components

### Application API

- [NDv2 interfaces](https://github.com/microsoft/windows-usb4-rdma/blob/main/src/ndutil/ndspi.h): `src/ndutil/ndspi.h`

### Provider Runtime

- [USB4 provider](https://github.com/microsoft/windows-usb4-rdma/blob/main/src/ndprov/ndprov.cpp): `src/ndprov/ndprov.cpp`
- [Provider entry point](https://github.com/microsoft/windows-usb4-rdma/blob/main/src/ndprov/dllmain.cpp): `src/ndprov/dllmain.cpp`
- [RDMA IOCTL definitions](https://github.com/microsoft/windows-usb4-rdma/blob/main/src/ndprov/RdmaIoctl.h): `src/ndprov/RdmaIoctl.h`

### Discovery and Setup

- [Provider helper library](https://github.com/microsoft/windows-usb4-rdma/tree/main/src/ndutil): `src/ndutil`
- **Provider catalog**
- [Address and adapter selection](https://github.com/microsoft/windows-usb4-rdma/blob/main/src/ndutil/ndfrmwrk.cpp): `src/ndutil/ndfrmwrk.cpp`
- [Address helpers](https://github.com/microsoft/windows-usb4-rdma/blob/main/src/ndutil/ndaddr.cpp): `src/ndutil/ndaddr.cpp`
- [Catalog installer](https://github.com/microsoft/windows-usb4-rdma/blob/main/src/install/ndprov_install.cpp): `src/install/ndprov_install.cpp`

### Example Tools

- [Example tools](https://github.com/microsoft/windows-usb4-rdma/tree/main/src/examples): `src/examples`

### Other components

- **RDMA application**
- **USB4 P2P RDMA driver**
- **Administrator**
- **Peer PC**

## Connections

- RDMA application → NDv2 interfaces: uses (evidence: `README.md`)
- NDv2 interfaces → USB4 provider: dispatches verbs (evidence: `README.md`)
- Provider entry point → USB4 provider: creates provider (evidence: `src/ndprov/dllmain.cpp`)
- USB4 provider → USB4 P2P RDMA driver: forwards operations (evidence: `README.md`)
- RDMA IOCTL definitions → USB4 provider: defines requests
- Provider helper library → Provider catalog: finds providers (evidence: `README.md`)
- Provider helper library → Address and adapter selection: selects adapter (evidence: `src/ndutil/ndfrmwrk.cpp`)
- Address and adapter selection → Address helpers: uses address data (evidence: `src/ndutil/ndfrmwrk.cpp`)
- Administrator → Catalog installer: installs provider (evidence: `README.md`)
- Catalog installer → Provider catalog: registers DLL (evidence: `README.md`)
- Example tools → RDMA application: exercises API (evidence: `README.md`)
- USB4 P2P RDMA driver → Peer PC: transfers data (evidence: `README.md`)
