RDMA 2022-12-13

RDMA (Remote DMA),远程DMA,即本地主机可以直接访问远端主机内存进行数据搬移。普遍对RDMA的认识是RDMA提供了一种相比TCP/IP更高效的硬件实现的网络协议栈
In computing, remote direct memory access (RDMA) is a direct memory access from the memory of one computer into that of another without involving either one's operating system

核心:
zero-copy + full prototol offload

zero-copy

RDMA supports zero-copy networking by enabling the network adapter to transfer data from the wire directly to application memory or from application memory directly to the wire, eliminating the need to copy data between application memory and the data buffers in the operating system.
Such transfers require no work to be done by CPUs, caches, or context switches, and transfers continue in parallel with other system operations. This reduces latency in message transfer.
在用户空间的虚拟内存和网卡进行数据传输的过程中不涉及内核参与,无需多余的数据拷贝(zero-copy)

注:传统的TCP/IP通信,在两台机器间发送数据时,发送方首先需要将数据从用户空间copy到内核,然后由内核协议栈对数据切块并添加报头进行数据封装(如下图所示)。之后,驱动再copy数据到网卡的内存上,由网卡送到链路上传输。在接收端同样至少需要2次copy和协议栈解析后,数据被放到用户buffer,并通知用户

full prototol offload

你可能感兴趣的:(RDMA 2022-12-13)