RFC 8166

Remote Direct Memory Access Transport for Remote Procedure Call Version 1

๐Ÿ“… published June 2017, from ietf

RFC 8166: Remote Direct Memory Access Transport for Remote Procedure Call Version 1 ๐Ÿ’–

Okay bestie, let's get into it! ๐Ÿฆ‹ This one is from the IETF, filed as a Standards Track document in June 2017 (ISSN 2070-1721). The editor is C. Lever, the co-authors are W. Simpson and T. Talpey, and they're repping Oracle, Red Hat, and Microsoft. ๐Ÿ‘‘

The big news is that this doc obsoletes RFC 5666, so if you've been reading the old one, this is the glow-up. ๐Ÿ’… It's giving "we fixed the vague bits and cut the stuff nobody actually built" energy. โœจ

This is part 1 of 11, so we're just getting started! ๐ŸŒธ

Abstract

Okay so the whole point is that this doc describes how to send Remote Procedure Call (RPC) messages over physical transports that can do Remote Direct Memory Access (RDMA). ๐Ÿ”ฅ The protocol is called the RPC-over-RDMA version 1 protocol here. The best part? It doesn't need any changes to application RPC protocols or to RPC itself. Main character energy, no cap. ๐Ÿ’œ

This document obsoletes RFC 5666. ๐Ÿซถ

Status of This Memo

This is an Internet Standards Track document. ๐ŸŒˆ

It's a product of the Internet Engineering Task Force (IETF), so it represents the consensus of the IETF community. It got public review and was approved for publication by the Internet Engineering Steering Group (IESG). ๐ŸŽ€ If you want more on Internet Standards, check Section 2 of RFC 7841. ๐Ÿงš

Info about the current status of this doc, any errata, and how to send feedback lives at http://www.rfc-editor.org/info/rfc8166. ๐Ÿ“

Copyright (c) 2017 IETF Trust and the persons identified as the document authors. All rights reserved. ๐ŸŒธ

This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info) in effect on the date of publication. Please read those carefully, because they spell out your rights and restrictions. ๐Ÿ™ˆ Code Components pulled out of this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions, and they come without warranty, as the Simplified BSD License describes. ๐Ÿ’…

This document may contain material from IETF Documents or IETF Contributions published or made publicly available before November 10, 2008. The people controlling the copyright in some of that older material may not have granted the IETF Trust the right to allow modifications outside the IETF Standards Process. So unless you get an adequate license from them, this document may not be modified outside the IETF Standards Process, and derivative works may not be created outside it. The exceptions are formatting it for publication as an RFC or translating it into languages other than English. ๐Ÿฆ‹

Table of Contents

Here's the map of the whole doc, so you know where everything lives. ๐Ÿ—บ๏ธ Section numbers and page numbers are copied exactly from the original.

1.  Introduction  . . . . . . . . . . . . . . . . . . . . . . . .   4
  1.1.  RPCs on RDMA Transports . . . . . . . . . . . . . . . . .   4
2.  Terminology . . . . . . . . . . . . . . . . . . . . . . . . .   5
  2.1.  Requirements Language . . . . . . . . . . . . . . . . . .   5
  2.2.  RPCs  . . . . . . . . . . . . . . . . . . . . . . . . . .   5
  2.3.  RDMA  . . . . . . . . . . . . . . . . . . . . . . . . . .   8
3.  RPC-over-RDMA Protocol Framework  . . . . . . . . . . . . . .  10
  3.1.  Transfer Models . . . . . . . . . . . . . . . . . . . . .  10
  3.2.  Message Framing . . . . . . . . . . . . . . . . . . . . .  11
  3.3.  Managing Receiver Resources . . . . . . . . . . . . . . .  11
  3.4.  XDR Encoding with Chunks  . . . . . . . . . . . . . . . .  14
  3.5.  Message Size  . . . . . . . . . . . . . . . . . . . . . .  19
4.  RPC-over-RDMA in Operation  . . . . . . . . . . . . . . . . .  23
  4.1.  XDR Protocol Definition . . . . . . . . . . . . . . . . .  23
  4.2.  Fixed Header Fields . . . . . . . . . . . . . . . . . . .  28
  4.3.  Chunk Lists . . . . . . . . . . . . . . . . . . . . . . .  30
  4.4.  Memory Registration . . . . . . . . . . . . . . . . . . .  33
  4.5.  Error Handling  . . . . . . . . . . . . . . . . . . . . .  34
  4.6.  Protocol Elements No Longer Supported . . . . . . . . . .  37
  4.7.  XDR Examples  . . . . . . . . . . . . . . . . . . . . . .  38
5.  RPC Bind Parameters . . . . . . . . . . . . . . . . . . . . .  39
6.  ULB Specifications  . . . . . . . . . . . . . . . . . . . . .  41
  6.1.  DDP-Eligibility . . . . . . . . . . . . . . . . . . . . .  41
  6.2.  Maximum Reply Size  . . . . . . . . . . . . . . . . . . .  43
  6.3.  Additional Considerations . . . . . . . . . . . . . . . .  43
  6.4.  ULP Extensions  . . . . . . . . . . . . . . . . . . . . .  43
7.  Protocol Extensibility  . . . . . . . . . . . . . . . . . . .  44
  7.1.  Conventional Extensions . . . . . . . . . . . . . . . . .  44
8.  Security Considerations . . . . . . . . . . . . . . . . . . .  44
  8.1.  Memory Protection . . . . . . . . . . . . . . . . . . . .  44
  8.2.  RPC Message Security  . . . . . . . . . . . . . . . . . .  46
9.  IANA Considerations . . . . . . . . . . . . . . . . . . . . .  49
10. References  . . . . . . . . . . . . . . . . . . . . . . . . .  50
  10.1.  Normative References . . . . . . . . . . . . . . . . . .  50
  10.2.  Informative References . . . . . . . . . . . . . . . . .  51
Appendix A.  Changes from RFC 5666  . . . . . . . . . . . . . . .  53
  A.1.  Changes to the Specification  . . . . . . . . . . . . . .  53
  A.2.  Changes to the Protocol . . . . . . . . . . . . . . . . .  53
Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . .  54
Authors' Addresses  . . . . . . . . . . . . . . . . . . . . . . .  55

1. Introduction โœจ

This doc specifies the RPC-over-RDMA version 1 protocol. It's based on existing implementations of RFC 5666 plus what people learned from actually deploying it. ๐ŸŒท It obsoletes RFC 5666, which we already know. ๐Ÿ’–

So what's new? This spec clears up text that people kept reading in different ways, and it removes support for RPC-over-RDMA version 1 protocol elements that nobody implemented. ๐Ÿงน It also clarifies the role of Upper-Layer Bindings (ULBs) and says what they're supposed to contain. ๐ŸŽ€

On top of that, the doc describes how things currently work when you use RPCSEC_GSS [RFC7861] over RDMA transports. ๐Ÿ”

Here's a fun detail: the protocol version number did not change. ๐Ÿ™Œ That's because the protocol in this document fully interoperates with implementations of the RPC-over-RDMA version 1 protocol from [RFC5666]. So old and new can talk to each other, no drama. ๐Ÿซถ

1.1. RPCs on RDMA Transports

Let's set the scene. ๐ŸŽฌ RDMA [RFC5040] [RFC5041] [IBARCH] is a technique for moving data efficiently between end nodes. Data gets directed into destination buffers as it's sent over the network, and hardware places it via direct memory access. The payoff is faster transfers and less host overhead. Iconic. ๐Ÿš€

Open Network Computing Remote Procedure Call (ONC RPC, often shortened in NFSv4 documents to RPC) [RFC5531] is an RPC protocol that runs over a bunch of different transports. ๐Ÿงš Most RPC implementations today use UDP [RFC768] or TCP [RFC793]. Over UDP, RPC messages get wrapped inside datagrams. Over a TCP byte stream, they're separated by a record marking protocol. ๐Ÿฆ‹ An RDMA transport also carries RPC messages in a specific way, and that way has to be fully described or RPC implementations won't be able to interoperate. Not me panicking. ๐Ÿ’€

RDMA transports act differently from both UDP and TCP. ๐ŸŒˆ They keep message boundaries like UDP does, but they give you reliable, sequenced data transfer like TCP does. They also offer an offloaded bulk transfer service that neither UDP nor TCP provides. Because of all that, RPC should treat RDMA transports as a brand new transport type. ๐Ÿ‘‘

The Network File System (NFS) protocols are the obvious beneficiaries here. That includes the ones described in [RFC1094], [RFC1813], [RFC7530], [RFC5661], and future NFSv4 minor versions. ๐Ÿ“ A full problem statement lives in [RFC5532]. Plenty of other RPC-based protocols can benefit too. ๐Ÿ’œ

The RDMA transport in this doc can give you pretty transparent support for any RPC application. ๐ŸŒธ But the doc also describes extra mechanisms that squeeze out even more data-transfer performance, for RPC applications that are willing to be RDMA-aware. โญ


2. Terminology ๐ŸŽ€

2.1. Requirements Language ๐Ÿ’…

Here's the important bit about the capital letters. ๐Ÿ™ˆ The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are interpreted as described in BCP 14 [RFC2119] [RFC8174], but only when they appear in all capitals, exactly as shown here. ๐Ÿ”ฅ

2.2. RPCs ๐Ÿงš

This section highlights key parts of the RPC [RFC5531] and External Data Representation (XDR) [RFC4506] protocols, which RPC-over-RDMA version 1 is built on. ๐ŸŒท Honestly, you should have a strong grip on these two before reading the rest. ๐Ÿซถ

2.2.1. Upper-Layer Protocols ๐Ÿฆ‹

RPCs are an abstraction used to implement the operations of an Upper-Layer Protocol (ULP). "ULP" refers to an RPC Program and Version tuple, which is a versioned set of procedure calls that together make up a single, well-defined API. ๐Ÿ‘‘ One example of a ULP is the Network File System Version 4.0 [RFC7530]. ๐Ÿ’–

In this document, the term "RPC consumer" refers to an implementation of a ULP running on an RPC client endpoint. โœจ


Part 1 of 11 done! ๐ŸŽ€ Next up: the rest of Section 2 and into Section 3. Stay tuned, bestie! ๐Ÿ’œ

2.2.2. Requesters and Responders โœจ

okay so, just like a local procedure call, every RPC procedure has a set of "arguments" and a set of "results" ๐Ÿ’… A calling context invokes a procedure, passes it the arguments, and then the procedure hands back a set of results. the difference is that the called procedure runs remotely, not in the local app's own execution context ๐ŸŒธ

The RPC protocol described in [RFC5531] is basically a message-passing protocol between one or more clients (where the RPC consumers are running) and a server (where a remote execution context is available to process RPC transactions for those consumers) ๐Ÿซถ

ONC RPC transactions are made up of two types of messages:

CALL : An "RPC Call message" requests that work be done ๐Ÿ’– This type of message is designated by the value zero (0) in the message's msg_type field. An arbitrary unique value is placed in the message's XID field so the RPC Call message can be matched up with its corresponding RPC Reply message ๐Ÿ”ฅ

REPLY : An "RPC Reply message" reports the results of work that an RPC Call message asked for ๐Ÿฆ‹ An RPC Reply message is designated by the value one (1) in the message's msg_type field. The value in an RPC Reply message's XID field is copied from the RPC Call message whose results are being reported โœจ

The RPC client endpoint acts as a "Requester" ๐Ÿ’œ It serializes the procedure's arguments and conveys them to a server endpoint via an RPC Call message. This message has an RPC protocol header, a header describing the requested upper-layer operation, and all of the arguments ๐ŸŽ€

The RPC server endpoint acts as a "Responder" ๐Ÿ‘‘ It deserializes the arguments and processes the requested operation. Then it serializes the operation's results into another byte stream. That byte stream gets conveyed back to the Requester via an RPC Reply message. This message has an RPC protocol header, a header describing the upper-layer reply, and all of the results ๐ŸŒˆ

The Requester deserializes the results and lets the original caller carry on ๐Ÿ’… At this point, the RPC transaction designated by the XID in the RPC Call message is complete, and that XID is retired ๐Ÿซถ

so to sum it all up: RPC Call messages are sent by Requesters to Responders to start RPC transactions, and RPC Reply messages are sent by Responders to Requesters to finish up the processing on an RPC transaction ๐Ÿ’€

2.2.3. RPC Transports ๐Ÿงš

the role of an "RPC transport" is to mediate the exchange of RPC messages between Requesters and Responders ๐Ÿ’– An RPC transport bridges the gap between the RPC message abstraction and the native operations of a particular network transport. it's giving bridge energy honestly โœจ

RPC-over-RDMA is a connection-oriented RPC transport ๐Ÿฆ‹ When a connection-oriented transport is used, clients initiate the transport connections, while servers wait passively for incoming connection requests ๐ŸŒธ

2.2.4. External Data Representation ๐ŸŽ€

you can't assume that all Requesters and Responders represent data objects the same way internally ๐Ÿ™ˆ RPC uses External Data Representation (XDR) to translate native data types and serialize arguments and results [RFC4506] ๐Ÿ’œ

The XDR protocol encodes data independently of the endianness or size of host-native data types, which allows unambiguous decoding of data on the receiving end ๐Ÿ”ฅ RPC Programs are specified by writing an XDR definition of their procedures, argument data types, and result data types ๐Ÿ‘‘

XDR assumes that the number of bits in a byte (octet) and their order are the same on both endpoints and on the physical network ๐ŸŒˆ The smallest indivisible unit of XDR encoding is a group of four octets. XDR also flattens lists, arrays, and other complex data types so they can be conveyed as a stream of bytes ๐Ÿ“

A serialized stream of bytes that is the result of XDR encoding is called an "XDR stream" โœจ A sending endpoint encodes native data into an XDR stream and then transmits that stream to a receiver. A receiving endpoint decodes incoming XDR byte streams back into its native data representation format ๐Ÿ’…

2.2.4.1. XDR Opaque Data ๐Ÿซถ

sometimes a data item has to be transferred as is, without any encoding or decoding ๐Ÿฆ‹ The contents of such a data item are called "opaque data" ๐Ÿ’– XDR encoding places the content of opaque data items directly into an XDR stream without altering it in any way. ULPs or applications handle any data translation that's needed in this case ๐ŸŒธ Examples of opaque data items include the content of files or generic byte strings ๐Ÿงš

2.2.4.2. XDR Roundup ๐ŸŽ€

the number of octets in a variable-length data item comes right before that item in an XDR stream ๐Ÿ’œ If the size of an encoded data item is not a multiple of four octets, octets containing zero are added after the end of the item. This happens so that the next encoded data item in the XDR stream starts on a four-octet boundary ๐Ÿ”ฅ The encoded size of the item doesn't change from adding those extra octets, and these extra octets are never exposed to ULPs ๐Ÿ‘‘

this technique is called "XDR roundup", and the extra octets are called "XDR roundup padding" ๐ŸŒˆ

2.3. RDMA ๐Ÿฆ‹

RPC Requesters and Responders can get a lot more efficient if large RPC messages are transferred by a third party, like intelligent network-interface hardware (data movement offload), and placed in the receiver's memory so that no extra adjustment of data alignment has to happen (direct data placement or "DDP") โœจ RDMA transports enable both of these optimizations ๐Ÿ’–

2.3.1. DDP ๐ŸŒธ

typically, RPC implementations copy the contents of RPC messages into a buffer before sending them ๐Ÿ™ˆ An efficient RPC implementation sends bulk data without copying it into a separate send buffer first ๐Ÿ’…

socket-based RPC implementations are often unable to receive data directly into its final place in memory ๐Ÿ˜ญ Receivers often need to copy incoming data to finish an RPC operation, sometimes just to adjust data alignment ๐Ÿซถ

in this document, "RDMA" refers to the physical mechanism an RDMA transport uses when moving data ๐Ÿฆ‹ Even though this may not be efficient, before an RDMA transfer a sender may copy data into an intermediate buffer. After an RDMA transfer, a receiver may copy that data again to its final destination ๐Ÿ’€

in this document, the term "DDP" refers to any optimized data transfer where it's unnecessary for a receiving host's CPU to copy transferred data to another location after it has been received ๐Ÿ‘‘

Just as [RFC5666] did, this document focuses on using RDMA Read and Write operations to achieve both data movement offload and DDP ๐Ÿ”ฅ However, not all RDMA-based data transfer qualifies as DDP, and DDP can be achieved using non-RDMA mechanisms ๐ŸŒˆ

2.3.2. RDMA Transport Requirements ๐ŸŽ€

to get good performance during receive operations, RDMA transports require that RDMA consumers provision resources in advance to receive incoming messages ๐Ÿ’œ

an RDMA consumer can provide Receive buffers in advance by posting an RDMA Receive Work Request for every expected RDMA Send from a remote peer ๐Ÿงš These buffers are provided before the remote peer posts RDMA Send Work Requests, so this is often called "pre-posting" buffers ๐Ÿ’–

an RDMA Receive Work Request stays outstanding until hardware matches it to an inbound Send operation. The resources associated with that Receive must be kept in host memory, or "pinned", until the Receive completes ๐Ÿ˜ญ

okay so given these basic tenets of RDMA transport operation, the RPC-over-RDMA version 1 protocol assumes each transport provides the following abstract operations ๐Ÿซถ A more complete discussion of these operations is found in [RFC5040] ๐ŸŒธ

Registered Memory : Registered memory is a region of memory that is assigned a steering tag, which temporarily permits access by the RDMA provider to perform data-transfer operations ๐Ÿ’… The RPC-over-RDMA version 1 protocol assumes that each region of registered memory MUST be identified with a steering tag of no more than 32 bits and memory addresses of up to 64 bits in length ๐Ÿ”ฅ

RDMA Send : The RDMA provider supports an RDMA Send operation, with completion signaled on the receiving peer after data has been placed in a pre-posted buffer ๐Ÿฆ‹ Sends complete at the receiver in the order they were issued at the sender. The amount of data transferred by a single RDMA Send operation is limited by the size of the remote peer's pre-posted buffers ๐ŸŽ€

RDMA Receive : The RDMA provider supports an RDMA Receive operation to receive data conveyed by incoming RDMA Send operations ๐Ÿ’œ To reduce the amount of memory that has to stay pinned while waiting for incoming Sends, the amount of pre-posted memory is limited. Flow control to prevent overrunning receiver resources is provided by the RDMA consumer (in this case, the RPC-over-RDMA version 1 protocol) ๐Ÿงš

RDMA Write : The RDMA provider supports an RDMA Write operation to place data directly into a remote memory region ๐Ÿ’– The local host initiates an RDMA Write, and completion is signaled there. No completion is signaled on the remote peer. The local host provides a steering tag, memory address, and length of the remote peer's memory region ๐Ÿ˜ญ

RDMA Writes are not ordered with respect to one another, but they are ordered with respect to RDMA Sends ๐Ÿซถ A subsequent RDMA Send completion obtained at the write initiator guarantees that prior RDMA Write data has been successfully placed in the remote peer's memory ๐ŸŒธ

RDMA Read : The RDMA provider supports an RDMA Read operation to place peer source data directly into the read initiator's memory ๐Ÿ’… The local host initiates an RDMA Read, and completion is signaled there. No completion is signaled on the remote peer. The local host provides steering tags, memory addresses, and a length for the remote source and local destination memory regions ๐Ÿ”ฅ

The local host signals Read completion to the remote peer as part of a subsequent RDMA Send message ๐Ÿฆ‹ The remote peer can then release steering tags and subsequently free the associated source memory regions ๐ŸŽ€

the RPC-over-RDMA version 1 protocol is designed to be carried over RDMA transports that support the above abstract operations ๐Ÿ’œ This protocol conveys the information an RPC peer needs to direct an RDMA provider to perform transfers containing RPC data and to communicate their result(s) ๐Ÿงš

3. RPC-over-RDMA Protocol Framework โœจ

3.1. Transfer Models ๐Ÿฆ‹

okay so a "transfer model" is basically answering two questions: which endpoint shows off its memory, and which one is in charge of starting the transfer ๐Ÿ’… For RDMA Read and Write ops, an endpoint first exposes regions of its memory to a remote endpoint, and that remote endpoint is the one that kicks off the operations against the exposed memory ๐Ÿซถ

Read-Read ๐Ÿ“– Requesters expose their memory to the Responder, and the Responder exposes its memory to Requesters. The Responder reads (aka pulls) RPC arguments or whole RPC calls from each Requester. Requesters pull RPC results or whole RPC replies from the Responder ๐ŸŒธ

Write-Write โœ๏ธ Requesters expose their memory to the Responder, and the Responder exposes its memory to Requesters. Requesters write (aka push) RPC arguments or whole RPC calls to the Responder. The Responder pushes RPC results or whole RPC replies to each Requester ๐Ÿ’œ

Read-Write ๐Ÿ“ Requesters expose their memory to the Responder, but the Responder does not expose its memory. The Responder pulls RPC arguments or whole RPC calls from each Requester. The Responder pushes RPC results or whole RPC replies to each Requester. ngl this one is giving "one-way street" energy ๐Ÿšฆ

Write-Read ๐Ÿงš The Responder exposes its memory to Requesters, but Requesters do not expose their memory. Requesters push RPC arguments or whole RPC calls to the Responder. Requesters pull RPC results or whole RPC replies from the Responder โœจ

3.2. Message Framing ๐ŸŽ€

okay this part is so cute ๐Ÿฅน On an RPC-over-RDMA transport, each RPC message gets wrapped up by an RPC-over-RDMA message. An RPC-over-RDMA message is made of two XDR streams ๐Ÿง

RPC Payload Stream ๐Ÿ’– The "Payload stream" holds the encapsulated RPC message being moved by this RPC-over-RDMA message. This stream always starts with the Transaction ID (XID) field of the encapsulated RPC message ๐ŸŒˆ

Transport Stream ๐Ÿ”ฅ The "Transport stream" holds a header that describes and controls the transfer of the Payload stream in this RPC-over-RDMA message. It's basically the cousin of the record marking used for RPC on TCP sockets, but way more extra, because RDMA transports support several modes of data transfer ๐Ÿ˜ญ

In its simplest form, an RPC-over-RDMA message is a Transport stream followed right away by a Payload stream, all sent together in a single RDMA Send. For big RPC messages, you combine one RDMA Send operation with one or more other RDMA operations ๐Ÿ‘‘

RPC-over-RDMA framing replaces all other RPC framing (like TCP record marking) when it's used on top of an RPC-over-RDMA association, even if the underlying RDMA protocol is itself layered on top of a transport with a defined RPC framing (like TCP). no cap, it's the main character here ๐Ÿ’…

BUT it's also possible for RPC-over-RDMA to get turned on dynamically while RDMA is being negotiated through a ULP exchange ๐Ÿฆ‹ Because RPC framing marks off an entire RPC request or reply, the switch in framing has to happen between distinct RPC messages, and in sync with the underlying transport ๐Ÿซถ

3.3. Managing Receiver Resources ๐Ÿ›ก๏ธ

It is critical to provide RDMA Send flow control for an RDMA connection ๐Ÿšจ If any pre-posted Receive buffer on the connection is too small to accept an incoming RDMA Send, or if no pre-posted Receive buffer is available to accept one, the RDMA connection can be terminated ๐Ÿ’€ This is different from conventional TCP/IP networking, where buffers get allocated dynamically as messages come in ๐ŸŒธ

The longevity of an RDMA connection means sending endpoints have to respect the resource limits of their peer receivers ๐Ÿซถ To make sure messages can be sent and received reliably, each connection has two operational parameters ๐Ÿงš

3.3.1. RPC-over-RDMA Credits ๐Ÿ’œ

Flow control for RDMA Send operations directed to the Responder is a simple request/grant protocol, living in the RPC-over-RDMA header on each RPC message ๐Ÿ“ฌ

An RPC-over-RDMA version 1 credit is the capability to handle one RPC-over-RDMA transaction ๐ŸŽ€ Each RPC-over-RDMA message sent from Requester to Responder requests a number of credits from the Responder. Each RPC-over-RDMA message sent from Responder to Requester tells the Requester how many credits the Responder has granted ๐Ÿ“ The requested and granted values ride along in each RPC-over-RDMA message's rdma_credit field (see Section 4.2.3) โœจ

Practically speaking, the critical value is the granted value ๐Ÿ‘‘ A Requester MUST NOT send unacknowledged requests in excess of the Responder's granted credit limit ๐Ÿšซ If the granted value gets exceeded, the RDMA layer may signal an error, possibly terminating the connection ๐Ÿ’€ The granted value MUST NOT be zero, since that would result in deadlock ๐Ÿ™ˆ

RPC calls can complete in any order, but the current granted credit limit at the Responder is known to the Requester from RDMA Send ordering properties ๐Ÿฆ‹ The number of new requests the Requester is allowed to send is the lower of the current requested and granted credit values, minus the number of requests in flight ๐Ÿงฎ Advertised credit values don't change when individual RPCs start or finish ๐ŸŒˆ

The requested and granted credit values MAY be adjusted to match the needs or policies in effect on either peer ๐Ÿ”„ For instance, a Responder may reduce the granted credit value to accommodate the available resources in a Shared Receive Queue ๐Ÿง  The Responder MUST ensure that an increase in receive resources is in effect before the next RPC Reply message is sent ๐Ÿ’…

A Requester MUST maintain enough receive resources to accommodate expected replies ๐Ÿ›๏ธ Responders have to be prepared for there to be no receive resources available on Requesters that have no pending RPC transactions ๐Ÿฅบ

Certain RDMA implementations may impose additional flow-control restrictions, such as limits on RDMA Read operations in progress at the Responder ๐Ÿšง Accommodating those restrictions is the responsibility of each RPC-over-RDMA version 1 implementation ๐Ÿซก

3.3.2. Inline Threshold ๐Ÿ“

An "inline threshold" value is the largest message size (in octets) that can be conveyed in one direction between peer implementations using RDMA Send and Receive ๐Ÿ“ฆ The inline threshold value is the smaller of two things: the largest number of bytes the sender can post via a single RDMA Send operation, and the largest number of bytes the receiver can accept via a single RDMA Receive operation ๐Ÿค“ Each connection has two inline threshold values: one for messages flowing from Requester-to-Responder (called the "call inline threshold") and one for messages flowing from Responder-to-Requester (called the "reply inline threshold") ๐ŸŽ€

Unlike credit limits, inline threshold values are not advertised to peers via the RPC-over-RDMA version 1 protocol, and there's no provision for them to change during the lifetime of an RPC-over-RDMA version 1 connection ๐Ÿ™…โ€โ™€๏ธ

3.3.3. Initial Connection State ๐ŸŒฑ

When a connection is first established, peers might not know how many receive resources the other has, or how large the other peer's inline thresholds are ๐Ÿคทโ€โ™€๏ธ

As a starting point for an initial exchange of RPC requests, each RPC-over-RDMA version 1 connection gives you the ability to exchange at least one RPC message at a time, where the RPC Call and Reply messages are no more than 1024 bytes in size ๐Ÿผ A Responder MAY exceed this basic level of configuration, BUT a Requester MUST NOT assume more than one credit is available, and it MUST receive a valid reply from the Responder carrying the actual number of available credits before sending its next request ๐Ÿ˜ค

Receiver implementations MUST support inline thresholds of 1024 bytes, but MAY support larger inline threshold values ๐Ÿ“ An independent mechanism for discovering a peer's inline thresholds before a connection is established may be used to optimize the use of RDMA Send and Receive operations ๐Ÿง  Without such a mechanism, receivers MUST assume the inline thresholds are 1024 bytes ๐Ÿซถ

3.4. XDR Encoding with Chunks ๐Ÿงฉ

When a DDP capability is available, the transport places the contents of one or more XDR data items directly into the receiver's memory, separately from the transfer of other parts of the containing XDR stream โœจ

3.4.1. Reducing an XDR Stream ๐Ÿฐ

RPC-over-RDMA version 1 has a mechanism for moving part of an RPC message through a data transfer that's separate from an RDMA Send/Receive pair ๐Ÿญ The sender takes one or more XDR data items out of the Payload stream, and they get conveyed via other mechanisms, like one or more RDMA Read or Write operations ๐Ÿš€ As the receiver decodes an incoming message, it skips over the directly placed data items ๐Ÿ™Œ

The portion of an XDR stream that gets split out and moved separately is called a "chunk" ๐Ÿง In some contexts, the data in an RPC-over-RDMA header that describes these split-out regions of memory may also be called a "chunk" ๐Ÿ“

A Payload stream after the chunks have been removed is called a "reduced" Payload stream ๐Ÿ’… Likewise, a data item that's been removed from a Payload stream to be transferred separately is called a "reduced" data item ๐Ÿซถ

3.4.2. DDP-Eligibility ๐ŸŽŸ๏ธ

Not every XDR data item benefits from DDP ๐Ÿ™ƒ For example, small data items, or data items that require XDR unmarshaling by the receiver, don't benefit from it ๐Ÿ˜… Plus, it's impractical for receivers to prepare for every possible XDR data item in a protocol that might get transferred in a chunk ๐Ÿฅด

To keep interoperability on an RPC-over-RDMA transport, somebody has to decide which few XDR data items in each ULP are allowed to use DDP ๐Ÿค

That decision is made by additional specifications that describe how ULPs employ DDP ๐Ÿ“œ A "ULB specification" identifies which specific individual XDR data items in a ULP MAY be transferred via DDP ๐ŸŽฏ Those data items are called "DDP-eligible" ๐Ÿ’– All other XDR data items MUST NOT be reduced ๐Ÿšซ

Detailed requirements for ULBs are in Section 6 ๐Ÿ“š

3.4.3. RDMA Segments ๐Ÿ“

When encoding a Payload stream that contains a DDP-eligible data item, a sender may choose to reduce that data item ๐Ÿซง When it does, the sender doesn't put the item into the Payload stream. Instead, it records in the RPC-over-RDMA header the location and size of the memory region containing that data item ๐Ÿ—บ๏ธ

The Requester provides location information for DDP-eligible data items in both RPC Call and Reply messages ๐Ÿ“ฎ The Responder uses this information to retrieve arguments contained in the specified region of the Requester's memory, or to place results in that memory region ๐Ÿซถ

An "RDMA segment", or "plain segment", is an RPC-over-RDMA Transport header data object that contains the exact coordinates of a contiguous memory region to be conveyed separately from the Payload stream ๐ŸŽฏ Plain segments contain the following information:

  • Handle ๐Ÿท๏ธ Steering tag (STag) or R_key generated by registering this memory with the RDMA provider.
  • Length ๐Ÿ“ The length of the RDMA segment's memory region, in octets. An "empty segment" is an RDMA segment with the value zero (0) in its length field.
  • Offset ๐Ÿ“ The offset or beginning memory address of the RDMA segment's memory region.

See [RFC5040] for further discussion ๐Ÿ“š๐ŸŒธ

3.4.4. Chunks โœจ

Okay so in RPC-over-RDMA version 1, a "chunk" is a bit of the Payload stream that gets moved on its own, separate from the RPC-over-RDMA Transport header and the rest of the Payload stream ๐Ÿ“ฆ. The chunk data gets pulled out of the sender's Payload stream, sent over separate operations, and then slotted back into the receiver's Payload stream to make one complete RPC message ๐Ÿงฉ. It's giving puzzle energy, bestie ๐Ÿ’–

Each chunk is made of RDMA segments, and each RDMA segment is one contiguous piece of that chunk ๐ŸŽ€. A Requester MAY divide a chunk into RDMA segments using any boundaries that are convenient ๐ŸŒธ. The length of a chunk is the sum of the lengths of the RDMA segments that make it up โœจ.

The RPC-over-RDMA version 1 transport protocol does not place a limit on chunk size ๐Ÿ™ˆ. However, each ULP may cap the amount of data that can be transferred by a single RPC (for example, NFS has "rsize" and "wsize", which restrict the payload size of NFS READ and WRITE operations) ๐Ÿ’…. The Responder can use such limits to sanity check chunk sizes before using them in RDMA operations ๐Ÿ”ฅ.

3.4.4.1. Counted Arrays

If a chunk contains a counted array data type, the count of array elements MUST remain in the Payload stream, while the array elements MUST be moved to the chunk ๐Ÿ’œ. For example, when encoding an opaque byte array as a chunk, the count of bytes stays in the Payload stream, while the bytes in the array are removed from the Payload stream and transferred within the chunk ๐Ÿฆ‹.

Individual array elements appear in a chunk in their entirety ๐Ÿ“. For example, when encoding an array of arrays as a chunk, the count of items in the enclosing array stays in the Payload stream, but each enclosed array, including its item count, is transferred as part of the chunk ๐Ÿงš.

3.4.4.2. Optional-Data

If a chunk contains an optional-data data type, the is present field MUST remain in the Payload stream, while the data, if present, MUST be moved to the chunk ๐ŸŒˆ.

3.4.4.3. XDR Unions

A union data type MUST NOT be made DDP-eligible, but one or more of its arms MAY be DDP-eligible, subject to the other requirements in this section ๐Ÿ™…โ€โ™€๏ธ. Don't try to make the whole union eligible, bestie, that's a no-go ๐Ÿ’€.

3.4.4.4. Chunk Roundup

Except in special cases (covered in Section 3.5.3), a chunk MUST contain exactly one XDR data item ๐ŸŽฏ. This makes it straightforward to reduce variable-length data items without affecting the XDR alignment of data items in the Payload stream โœจ.

When a variable-length XDR data item is reduced, the sender MUST remove XDR roundup padding for that data item from the Payload stream so that data items remaining in the Payload stream begin on four-byte alignment ๐Ÿงผ. Alignment is everything, periodt ๐Ÿ’….

3.4.5. Read Chunks

A "Read chunk" represents an XDR data item that is to be pulled from the Requester to the Responder ๐Ÿ“ฅ.

A Read chunk is a list of one or more RDMA read segments. An RDMA read segment consists of a Position field followed by a plain segment. See Section 4.1.2 for details ๐Ÿ—‚๏ธ.

  • Position: The byte offset in the unreduced Payload stream where the receiver reinserts the data item conveyed in a chunk. The Position value MUST be computed from the beginning of the unreduced Payload stream, which begins at Position zero. All RDMA read segments belonging to the same Read chunk have the same value in their Position field ๐Ÿ“.

While constructing an RPC Call message, a Requester registers memory regions that contain data to be transferred via RDMA Read operations ๐Ÿ“. It advertises the coordinates of these regions in the RPC-over-RDMA Transport header of the RPC Call message ๐Ÿ“ฃ.

After receiving an RPC Call message sent via an RDMA Send operation, a Responder transfers the chunk data from the Requester using RDMA Read operations ๐Ÿšš. The Responder reconstructs the transferred chunk data by concatenating the contents of each RDMA segment, in list order, into the received Payload stream at the Position value recorded in that RDMA segment ๐Ÿง .

Put another way, the Responder inserts the first RDMA segment in a Read chunk into the Payload stream at the byte offset indicated by its Position field. RDMA segments whose Position field value match this offset are concatenated afterwards, until there are no more RDMA segments at that Position value ๐Ÿช„.

The Position field in a read segment indicates where the containing Read chunk starts in the Payload stream. The value in this field MUST be a multiple of four. All segments in the same Read chunk share the same Position value, even if one or more of the RDMA segments have a non-four-byte-aligned length ๐ŸŒŸ.

3.4.5.1. Decoding Read Chunks

While decoding a received Payload stream, whenever the XDR offset in the Payload stream matches that of a Read chunk, the Responder initiates an RDMA Read to pull the chunk's data content into registered local memory ๐Ÿ”.

The Responder acknowledges its completion of use of Read chunk source buffers when it sends an RPC Reply message to the Requester ๐Ÿค. The Requester may then release Read chunks advertised in the request ๐ŸŽ‰.

3.4.5.2. Read Chunk Roundup

When reducing a variable-length argument data item, the Requester SHOULD NOT include the data item's XDR roundup padding in the chunk ๐Ÿ™…. The length of a Read chunk is determined as follows:

  • If the Requester chooses to include roundup padding in a Read chunk, the chunk's total length MUST be the sum of the encoded length of the data item and the length of the roundup padding. The length of the data item that was encoded into the Payload stream remains unchanged.

The sender can increase the length of the chunk by adding another RDMA segment containing only the roundup padding, or it can do so by extending the final RDMA segment in the chunk ๐Ÿงฉ.

  • If the sender chooses not to include roundup padding in the chunk, the chunk's total length MUST be the same as the encoded length of the data item ๐ŸŽ€.

3.4.6. Write Chunks

While constructing an RPC Call message, a Requester prepares memory regions in which to receive DDP-eligible result data items ๐Ÿ›๏ธ. A "Write chunk" represents an XDR data item that is to be pushed from a Responder to a Requester. It is made up of an array of zero or more plain segments ๐Ÿ“ค.

Write chunks are provisioned by a Requester long before the Responder has prepared the reply Payload stream โณ. A Requester often does not know the actual length of the result data items to be returned, since the result does not yet exist ๐Ÿคทโ€โ™€๏ธ. Thus, it MUST register Write chunks long enough to accommodate the maximum possible size of each returned data item ๐Ÿ“.

In addition, the XDR position of DDP-eligible data items in the reply's Payload stream is not predictable when a Requester constructs an RPC Call message. Therefore, RDMA segments in a Write chunk do not have a Position field ๐Ÿ”ฎ.

For each Write chunk provided by a Requester, the Responder pushes one data item to the Requester, filling the chunk contiguously and in segment array order until that data item has been completely written to the Requester ๐Ÿ’Œ. The Responder MUST copy the segment count and all segments from the Requester-provided Write chunk into the RPC Reply message's Transport header. As it does so, the Responder updates each segment length field to reflect the actual amount of data that is being returned in that segment. The Responder then sends the RPC Reply message via an RDMA Send operation ๐Ÿš€.

An "empty Write chunk" is a Write chunk with a zero segment count. By definition, the length of an empty Write chunk is zero ๐Ÿซฅ. An "unused Write chunk" has a non-zero segment count, but all of its segments are empty segments ๐Ÿ‘ป.

3.4.6.1. Decoding Write Chunks

After receiving the RPC Reply message, the Requester reconstructs the transferred data by concatenating the contents of each segment, in array order, into the RPC Reply message's XDR stream at the known XDR position of the associated DDP-eligible result data item ๐Ÿงต.

3.4.6.2. Write Chunk Roundup

When provisioning a Write chunk for a variable-length result data item, the Requester SHOULD NOT include additional space for XDR roundup padding. A Responder MUST NOT write XDR roundup padding into a Write chunk, even if the Requester made space available for it. Therefore, when returning a single variable-length result data item, a returned Write chunk's total length MUST be the same as the encoded length of the result data item ๐Ÿซถ.

3.5. Message Size

A receiver of RDMA Send operations is required by RDMA to have previously posted one or more adequately sized buffers ๐Ÿ“ฎ. Memory savings are achieved on both Requesters and Responders by posting small Receive buffers ๐Ÿ’พ. However, not all RPC messages are small ๐Ÿ˜. RPC-over-RDMA version 1 provides several mechanisms that allow messages of any size to be conveyed efficiently ๐ŸŒˆ.

3.5.1. Short Messages

RPC messages are frequently smaller than typical inline thresholds ๐Ÿฃ. For example, the NFS version 3 GETATTR operation is only 56 bytes: 20 bytes of RPC header, a 32-byte file handle argument, and 4 bytes for its length ๐Ÿงฎ. The reply to this common request is about 100 bytes ๐Ÿ“จ.

Since all RPC messages conveyed via RPC-over-RDMA require an RDMA Send operation, the most efficient way to send an RPC message that is smaller than the inline threshold is to append the Payload stream directly to the Transport stream โšก. An RPC-over-RDMA header with a small RPC Call or Reply message immediately following is transferred using a single RDMA Send operation. No other operations are needed ๐Ÿ™Œ.

An RPC-over-RDMA transaction using Short Messages:

           Requester                             Responder
               |        RDMA Send (RDMA_MSG)         |
          Call |   ------------------------------>   |
               |                                     |
               |                                     | Processing
               |                                     |
               |        RDMA Send (RDMA_MSG)         |
               |   <------------------------------   | Reply

3.5.2. Chunked Messages ๐ŸŽ€

Okay so bestie, when a Payload stream has DDP-eligible data items hanging out in it, the sender MAY slim some or all of them down by pulling them out of the Payload stream ๐Ÿ’…. Those items get moved by a separate mechanism, and then the Transport stream with the now-trimmed Payload stream right behind it goes over in one single RDMA Send operation ๐Ÿฆ‹.

After the Responder gets the Transport and Payload streams of an RPC Call message that came with Read chunks, it uses RDMA Read operations to grab those reduced data items out of the Read chunks โœจ. And before it sends the Transport and Payload streams of an RPC Reply message that has Write chunks, the Responder uses RDMA Write operations to push the reduced data items through the Write and Reply chunks ๐Ÿš€. It's giving organized ๐Ÿ’–.

Here's what an RPC-over-RDMA transaction with a Read chunk looks like ๐Ÿ‘€:

        Requester                             Responder
            |        RDMA Send (RDMA_MSG)         |
       Call |   ------------------------------>   |
            |        RDMA Read                    |
            |   <------------------------------   |
            |        RDMA Response (arg data)     |
            |   ------------------------------>   |
            |                                     |
            |                                     | Processing
            |                                     |
            |        RDMA Send (RDMA_MSG)         |
            |   <------------------------------   | Reply

And here's one with a Write chunk ๐Ÿงš:

        Requester                             Responder
            |        RDMA Send (RDMA_MSG)         |
       Call |   ------------------------------>   |
            |                                     |
            |                                     | Processing
            |                                     |
            |        RDMA Write (result data)     |
            |   <------------------------------   |
            |        RDMA Send (RDMA_MSG)         |
            |   <------------------------------   | Reply

3.5.3. Long Messages ๐Ÿ“

Okay so when a Payload stream is bigger than the receiver's inline threshold, the Payload stream gets slimmed down by yanking out the DDP-eligible data items and putting them into chunks that get moved separately ๐ŸŒธ. If there are no DDP-eligible data items in the Payload stream, or it's still too big after getting reduced, the RDMA transport MUST use RDMA Read or Write operations to convey the Payload stream itself ๐Ÿ˜ญ. This is what we call a "Long Message" ๐Ÿ’œ.

To send a Long Message, the sender only conveys the Transport stream with an RDMA Send operation. The Payload stream isn't in the Send buffer this time ๐Ÿ™ˆ. Instead, the Requester hands over chunks that the Responder uses to move the Payload stream around ๐Ÿฆ‹.

Long Call Okay so for a Long Call message, the Requester provides a special Read chunk that holds the RPC Call message's Payload stream. Every RDMA read segment in this chunk MUST contain zero in its Position field ๐Ÿ”ฅ. That's why this chunk is known as a "Position Zero Read chunk" ๐Ÿซถ.

Long Reply For a Long Reply, the Requester provides a single special Write chunk ahead of time, called the "Reply chunk" ๐Ÿ’…, which will hold the RPC Reply message's Payload stream. The Requester sizes the Reply chunk to fit the biggest reply it expects for that upper-layer operation โœจ.

Even though a Long Message is for handling big RPC messages, Requesters MAY use a Long Message at any time to convey an RPC Call message ๐ŸŒˆ.

The Responder picks which form of reply to use based on the chunks the Requester gave it ๐Ÿ‘‘. If Write chunks were provided and the Responder has a DDP-eligible result, it first reduces the reply Payload stream ๐Ÿ’–. If a Reply chunk was provided and the reduced Payload stream is larger than the reply inline threshold, the Responder MUST use the Requester-provided Reply chunk for the reply ๐ŸŽ€.

XDR data items can show up in these special chunks no matter their DDP-eligibility โœจ. Since these chunks hold a Payload stream, such chunks MUST include appropriate XDR roundup padding to keep their contents properly XDR aligned ๐Ÿซถ.

An RPC-over-RDMA transaction using a Long Call:

        Requester                             Responder
            |        RDMA Send (RDMA_NOMSG)       |
       Call |   ------------------------------>   |
            |        RDMA Read                    |
            |   <------------------------------   |
            |        RDMA Response (RPC call)     |
            |   ------------------------------>   |
            |                                     |
            |                                     | Processing
            |                                     |
            |        RDMA Send (RDMA_MSG)         |
            |   <------------------------------   | Reply

An RPC-over-RDMA transaction using a Long Reply:

        Requester                             Responder
            |        RDMA Send (RDMA_MSG)         |
       Call |   ------------------------------>   |
            |                                     |
            |                                     | Processing
            |                                     |
            |        RDMA Write (RPC reply)       |
            |   <------------------------------   |
            |        RDMA Send (RDMA_NOMSG)       |
            |   <------------------------------   | Reply

4. RPC-over-RDMA in Operation ๐ŸŒธ

Every RPC-over-RDMA version 1 message has a header that includes a copy of the message's transaction ID ๐Ÿ†”, data for managing RDMA flow-control credits ๐Ÿšฆ, and lists of RDMA segments describing chunks ๐Ÿงฉ. All RPC-over-RDMA header content lives in the Transport stream, so it MUST be XDR encoded ๐Ÿ’œ.

RPC message layout is unchanged from what's described in [RFC5531] ๐Ÿ“–, except for the possible reduction of data items that get moved by separate operations โœจ.

The RPC-over-RDMA protocol passes RPC messages along without caring about their type (CALL or REPLY) ๐Ÿ’โ€โ™€๏ธ. Apart from restrictions imposed by ULBs, each endpoint of a connection MAY send RDMA_MSG or RDMA_NOMSG message header types at any time (subject to credit limits) ๐Ÿฆ‹.

4.1. XDR Protocol Definition ๐Ÿ“œ

This section has a description of the core features of the RPC-over-RDMA version 1 protocol, written in the XDR language [RFC4506] ๐ŸŽ€.

It's laid out so it's super easy to pull out into ready-to-compile form ๐Ÿ™Œ. The reader can run the following shell script on this document to make a machine-readable XDR description of the RPC-over-RDMA version 1 protocol ๐Ÿค“:

#!/bin/sh
grep '^ *///' | sed 's?^ /// ??' | sed 's?^ *///$??'

So if that script is saved in a file called "extract.sh" and this document is in a file called "spec.txt", the reader can do the following to get an XDR description file ๐Ÿ’–:

sh extract.sh < spec.txt > rpcrdma_corev1.x

4.1.1. Code Component License ๐Ÿชช

Code components pulled out of this document MUST include the license text below ๐Ÿ”. When the extracted XDR code is combined with other complementary XDR code that has an identical license, only a single copy of the license text needs to be kept โœจ.

/// /*
///  * Copyright (c) 2010-2017 IETF Trust and the persons
///  * identified as authors of the code.  All rights reserved.
///  *
///  * The authors of the code are:
///  * B. Callaghan, T. Talpey, and C. Lever
///  *
///  * Redistribution and use in source and binary forms, with
///  * or without modification, are permitted provided that the
///  * following conditions are met:
///  *
///  * - Redistributions of source code must retain the above
///  *   copyright notice, this list of conditions and the
///  *   following disclaimer.
///  *
///  * - Redistributions in binary form must reproduce the above
///  *   copyright notice, this list of conditions and the
///  *   following disclaimer in the documentation and/or other
///  *   materials provided with the distribution.
///  *
///  * - Neither the name of Internet Society, IETF or IETF
///  *   Trust, nor the names of specific contributors, may be
///  *   used to endorse or promote products derived from this
///  *   software without specific prior written permission.
///  *
///  *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
///  *   AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
///  *   WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
///  *   IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
///  *   FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO
///  *   EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
///  *   LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
///  *   EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
///  *   NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
///  *   SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
///  *   INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
///  *   LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
///  *   OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
///  *   IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
///  *   ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
///  */
///

4.1.2. RPC-over-RDMA Version 1 XDR โœจ

okay so this is where the XDR data items live ๐Ÿ’… they encode the Transport Header Stream in every RPC-over-RDMA version 1 message ๐ŸŽ€ The comments are super important, bestie, because they flag which items are locked in and can't change in later versions ๐Ÿ”’

/// /*
///  * Plain RDMA segment (Section 3.4.3)
///  */
/// struct xdr_rdma_segment {
///    uint32 handle;           /* Registered memory handle */
///    uint32 length;           /* Length of the chunk in bytes */
///    uint64 offset;           /* Chunk virtual address or offset */
/// };
///
/// /*
///  * RDMA read segment (Section 3.4.5)
///  */
/// struct xdr_read_chunk {
///    uint32 position;        /* Position in XDR stream */
///    struct xdr_rdma_segment target;
/// };
///
/// /*
///  * Read list (Section 4.3.1)
///  */
/// struct xdr_read_list {
///         struct xdr_read_chunk entry;
///         struct xdr_read_list  *next;
/// };
///
/// /*
///  * Write chunk (Section 3.4.6)
///  */
/// struct xdr_write_chunk {
///         struct xdr_rdma_segment target<>;
/// };
///
/// /*
///  * Write list (Section 4.3.2)
///  */
/// struct xdr_write_list {
///         struct xdr_write_chunk entry;
///         struct xdr_write_list  *next;
/// };
///
/// /*
///  * Chunk lists (Section 4.3)
///  */
/// struct rpc_rdma_header {
///    struct xdr_read_list   *rdma_reads;
///    struct xdr_write_list  *rdma_writes;
///    struct xdr_write_chunk *rdma_reply;
///    /* rpc body follows */
/// };
///
/// struct rpc_rdma_header_nomsg {
///    struct xdr_read_list   *rdma_reads;
///    struct xdr_write_list  *rdma_writes;
///    struct xdr_write_chunk *rdma_reply;
/// };
///
/// /* Not to be used */
/// struct rpc_rdma_header_padded {
///    uint32                 rdma_align;
///    uint32                 rdma_thresh;
///    struct xdr_read_list   *rdma_reads;
///    struct xdr_write_list  *rdma_writes;
///    struct xdr_write_chunk *rdma_reply;
///    /* rpc body follows */
/// };
///
/// /*
///  * Error handling (Section 4.5)
///  */
/// enum rpc_rdma_errcode {
///    ERR_VERS = 1,       /* Value fixed for all versions */
///    ERR_CHUNK = 2
/// };
///
/// /* Structure fixed for all versions */
/// struct rpc_rdma_errvers {
///    uint32 rdma_vers_low;
///    uint32 rdma_vers_high;
/// };
///
/// union rpc_rdma_error switch (rpc_rdma_errcode err) {
///    case ERR_VERS:
///      rpc_rdma_errvers range;
///    case ERR_CHUNK:
///      void;
/// };
///
/// /*
///  * Procedures (Section 4.2.4)
///  */
/// enum rdma_proc {
///    RDMA_MSG = 0,     /* Value fixed for all versions */
///    RDMA_NOMSG = 1,   /* Value fixed for all versions */
///    RDMA_MSGP = 2,    /* Not to be used */
///    RDMA_DONE = 3,    /* Not to be used */
///    RDMA_ERROR = 4    /* Value fixed for all versions */
/// };
///
/// /* The position of the proc discriminator field is
///  * fixed for all versions */
/// union rdma_body switch (rdma_proc proc) {
///    case RDMA_MSG:
///      rpc_rdma_header rdma_msg;
///    case RDMA_NOMSG:
///      rpc_rdma_header_nomsg rdma_nomsg;
///    case RDMA_MSGP:   /* Not to be used */
///      rpc_rdma_header_padded rdma_msgp;
///    case RDMA_DONE:   /* Not to be used */
///      void;
///    case RDMA_ERROR:
///      rpc_rdma_error rdma_error;
/// };
///
/// /*
///  * Fixed header fields (Section 4.2)
///  */
/// struct rdma_msg {
///    uint32    rdma_xid;      /* Position fixed for all versions */
///    uint32    rdma_vers;     /* Position fixed for all versions */
///    uint32    rdma_credit;   /* Position fixed for all versions */
///    rdma_body rdma_body;
/// };

4.2. Fixed Header Fields ๐ŸŒธ

The RPC-over-RDMA header kicks off with four fixed 32-bit fields that run the RDMA interaction ๐Ÿ’–

The first three words are their own individual fields in the rdma_msg structure. The fourth word is the first word of the rdma_body union, and it acts as the discriminator for the switched union (fancy, I know ๐Ÿ™ˆ). What goes in it is covered in Section 4.2.4.

These four fields must remain with the same meanings and in the same positions in all subsequent versions of the RPC-over-RDMA protocol. ๐Ÿ”’

4.2.1. Transaction ID (XID) ๐Ÿฆ‹

The XID is generated for the RPC Call and Reply messages. Having it at a fixed spot in the header means the receiver can get its bearings as soon as each RPC-over-RDMA message arrives โœจ This XID MUST be the same as the XID in the RPC message. A receiver MAY do its processing based solely on the XID in the RPC-over-RDMA header, and thereby ignore the XID in the RPC message, if it so chooses ๐Ÿงš

4.2.2. Version Number ๐Ÿ‘‘

For RPC-over-RDMA version 1, this field MUST contain the value one (1). The rules for changing this transport protocol version number live in Section 7.

4.2.3. Credit Value ๐Ÿ’œ

When it's sent with an RPC Call message, the requested credit value shows up. When it's sent with an RPC Reply message, the granted credit value comes back. More on how the credit value gets decided is in Section 3.3 ๐Ÿ“

4.2.4. Procedure Number ๐ŸŒˆ

Here's the lineup of procedures and what each one means:

RDMA_MSG = 0         indicates that chunk lists and a Payload stream
                     follow.  The format of the chunk lists is
                     discussed below.

RDMA_NOMSG = 1       indicates that after the chunk lists there is no
                     Payload stream.  In this case, the chunk lists
                     provide information to allow the Responder to
                     transfer the Payload stream using explicit RDMA
                     operations.

RDMA_MSGP = 2        is reserved.

RDMA_DONE = 3        is reserved.

RDMA_ERROR = 4       is used to signal an encoding error in the RPC-
                     over-RDMA header.

An RDMA_MSG procedure sends the Transport stream and the Payload stream together through one RDMA Send operation. The Transport stream holds the four fixed fields, then the Read and Write lists and the Reply chunk, though any or all three MAY be marked as not present. The Payload stream comes right after, starting with its XID field. If a Read or Write chunk list is present, part of the Payload stream has been reduced and gets conveyed through separate operations ๐Ÿซถ

An RDMA_NOMSG procedure sends the Transport stream through one RDMA Send operation. That Transport stream holds the four fixed fields, then the Read and Write chunk lists and the Reply chunk. Though any of these MAY be marked as not present, one MUST be present and MUST hold the Payload stream for this RPC-over-RDMA message ๐Ÿ’€ If a Read or Write chunk list is present, part of the Payload stream has been excised and gets conveyed through separate operations.

An RDMA_ERROR procedure sends the Transport stream through one RDMA Send operation. That Transport stream holds the four fixed fields followed by formatted error info. No Payload stream rides along with this type of RPC-over-RDMA message.

A Requester MUST NOT send an RPC-over-RDMA header with the RDMA_ERROR procedure. A Responder MUST silently discard RDMA_ERROR procedures. ๐Ÿ™…โ€โ™€๏ธ

The Transport stream and Payload stream can be built in separate buffers. Just know the total length of the gathered buffers cannot go over the inline threshold โญ


4.3. Chunk Lists ๐Ÿง

The chunk lists in an RPC-over-RDMA version 1 header are three XDR optional-data fields. They follow the fixed header fields in RDMA_MSG and RDMA_NOMSG procedures. Read Section 4.19 of [RFC4506] carefully so you get how optional-data fields work ๐Ÿ“– Examples of XDR-encoded chunk lists are in Section 4.7 if you want a visual.

Often, an RPC-over-RDMA message has no associated chunks at all. In that case, the Read list, Write list, and Reply chunk are all marked "not present" ๐Ÿ˜ด

4.3.1. Read List ๐Ÿ“ฅ

Each RDMA_MSG or RDMA_NOMSG procedure has one "Read list". The Read list is a list of zero or more RDMA read segments, provided by the Requester, grouped by their Position fields into Read chunks. Each Read chunk advertises where the argument data is that the Responder is supposed to pull from the Requester. The Requester has reduced the data items in these chunks out of the call's Payload stream.

A Requester may transmit the Payload stream of an RPC Call message using a Position Zero Read chunk. If the RPC Call message has no argument data that is DDP-eligible and the Position Zero Read chunk isn't being used, the Requester leaves the Read list empty.

Responders MUST leave the Read list empty in all replies. ๐Ÿšซ

4.3.1.1. Matching Read Chunks to Arguments ๐Ÿงฉ

When a Requester reduces a DDP-eligible argument data item, it records the XDR stream offset of that data item in the Read chunk's Position field. That way the Responder can tell exactly where the chunk gets reinserted into the received Payload stream to form a complete RPC Call message. No guessing, periodt ๐Ÿ’…

4.3.2. Write List ๐Ÿ“ค

Each RDMA_MSG or RDMA_NOMSG procedure has one "Write list". The Write list is a list of zero or more Write chunks, provided by the Requester. Each Write chunk is an array of plain segments, so the Write list is basically a list of counted arrays ๐ŸŽ€

If an RPC Reply message has no possible DDP-eligible result data items, the Requester leaves the Write list empty. When a Requester provides a Write list, the Responder MUST push data corresponding to DDP-eligible result data items to Requester memory referenced in the Write list. The Responder removes those data items from the reply's Payload stream ๐ŸŒธ

4.3.2.1. Matching Write Chunks to Results ๐ŸŽฏ

A Requester builds the Write list for an RPC transaction before the Responder has formulated its reply. When there's only one DDP-eligible result data item, the Requester inserts just a single Write chunk into the Write list. If the returned Write chunk isn't an unused Write chunk, the Requester knows for sure which result data item is inside it ๐Ÿฅน

When a Requester has provided multiple Write chunks, the Responder fills in each Write chunk with one DDP-eligible result until there are either no more DDP-eligible results or no more Write chunks.

The Requester might not be able to predict in advance which DDP-eligible data item goes in which chunk. So the Requester is responsible for allocating and registering Write chunks large enough to fit the largest result data item that might be associated with each chunk in the Write list ๐Ÿ’ช

As a Requester decodes a reply Payload stream, it becomes clear from the contents of the RPC Reply message which Write chunk holds which result data item โœจ

4.3.2.2. Unused Write Chunks

There are occasions when a Requester provides a non-empty Write chunk but the Responder is not able to use it. For example, a ULP may define a union result where some arms of the union contain a DDP- eligible data item while other arms do not. The Responder is required to use Requester-provided Write chunks in this case, but if the Responder returns a result that uses an arm of the union that has no DDP-eligible data item, that Write chunk remains unconsumed.

If there is a subsequent DDP-eligible result data item in the RPC Reply message, it MUST be placed in that unconsumed Write chunk. Therefore, the Requester MUST provision each Write chunk so it can be filled with the largest DDP-eligible data item that can be placed in it.

If this is the last or only Write chunk available and it remains unconsumed, the Responder MUST return this Write chunk as an unused Write chunk (see Section 3.4.6). The Responder sets the segment count to a value matching the Requester-provided Write chunk, but returns only empty segments in that Write chunk.

Unused Write chunks, or unused bytes in Write chunk segments, are returned to the RPC consumer as part of RPC completion. Even if a Responder indicates that a Write chunk is not consumed, the Responder may have written data into one or more segments before choosing not to return that data item. The Requester MUST NOT assume that the memory regions backing a Write chunk have not been modified.

4.3.2.3. Empty Write Chunks

To force a Responder to return a DDP-eligible result inline, a Requester employs the following mechanism:

o When there is only one DDP-eligible result item in an RPC Reply message, the Requester provides an empty Write list.

o When there are multiple DDP-eligible result data items and a Requester prefers that a data item is returned inline, the Requester provides an empty Write chunk for that item (see Section 3.4.6). The Responder MUST return the corresponding result data item inline and MUST return an empty Write chunk in that Write list position in the RPC Reply message.

As always, a Requester and Responder must prepare for a Long Reply to be used if the resulting RPC Reply might be too large to be conveyed in an RDMA Send.

4.3.3. Reply Chunk

Each RDMA_MSG or RDMA_NOMSG procedure has one "Reply chunk" slot. A Requester MUST provide a Reply chunk whenever the maximum possible size of the RPC Reply message's Transport and Payload streams is larger than the inline threshold for messages from Responder to Requester. Otherwise, the Requester marks the Reply chunk as not present.

If the Transport stream and Payload stream together are smaller than the reply inline threshold, the Responder MAY return the RPC Reply message as a Short message rather than using the Requester-provided Reply chunk.

When a Requester provides a Reply chunk in an RPC Call message, the Responder MUST copy that chunk into the Transport header of the RPC Reply message. As with Write chunks, the Responder modifies the copied Reply chunk in the RPC Reply message to reflect the actual amount of data that is being returned in the Reply chunk.

4.4. Memory Registration

The cost of registering and invalidating memory can be a significant proportion of the cost of an RPC-over-RDMA transaction. Thus, an important implementation consideration is how to minimize registration activity without exposing system memory needlessly.

4.4.1. Registration Longevity

Data transferred via RDMA Read and Write can reside in a memory allocation not in the control of the RPC-over-RDMA transport. These memory allocations can persist outside the bounds of an RPC transaction. They are registered and invalidated as needed, as part of each RPC transaction.

The Requester endpoint must ensure that memory regions associated with each RPC transaction are protected from Responder access before allowing upper-layer access to the data contained in them. Moreover, the Requester must not access these memory regions while the Responder has access to them.

This includes memory regions that are associated with canceled RPCs. A Responder cannot know that the Requester is no longer waiting for a reply, and it might proceed to read or even update memory that the Requester might have released for other use.

4.4.2. Communicating DDP-Eligibility

The interface by which a ULP implementation communicates the eligibility of a data item locally to its local RPC-over-RDMA endpoint is not described by this specification.

Depending on the implementation and constraints imposed by ULBs, it is possible to implement reduction transparently to upper layers. Such implementations may lead to inefficiencies, either because they require the RPC layer to perform expensive registration and invalidation of memory "on the fly", or they may require using RDMA chunks in RPC Reply messages, along with the resulting additional handshaking with the RPC-over-RDMA peer.

However, these issues are internal and generally confined to the local interface between RPC and its upper layers, one in which implementations are free to innovate. The only requirement, beyond constraints imposed by the ULB, is that the resulting RPC-over-RDMA protocol sent to the peer be valid for the upper layer.

4.4.3. Registration Strategies

The choice of which memory registration strategies to employ is left to Requester and Responder implementers. To support the widest array of RDMA implementations, as well as the most general steering tag scheme, an Offset field is included in each RDMA segment.

While zero-based offset schemes are available in many RDMA implementations, their use by RPC requires individual registration of each memory region. For such implementations, this can be a significant overhead. By providing an offset in each chunk, many pre-registration or region-based registrations can be readily supported.

4.5. Error Handling

A receiver performs basic validity checks on the RPC-over-RDMA header and chunk contents before it passes the RPC message to the RPC layer. If an incoming RPC-over-RDMA message is not as long as a minimal size RPC-over-RDMA header (28 bytes), the receiver cannot trust the value of the XID field; therefore, it MUST silently discard the message before performing any parsing. If other errors are detected in the RPC-over-RDMA header of an RPC Call message, a Responder MUST send an RDMA_ERROR message back to the Requester. If errors are detected in the RPC-over-RDMA header of an RPC Reply message, a Requester MUST silently discard the message.

To form an RDMA_ERROR procedure:

o The rdma_xid field MUST contain the same XID that was in the rdma_xid field in the failing request;

o The rdma_vers field MUST contain the same version that was in the rdma_vers field in the failing request;

o The rdma_proc field MUST contain the value RDMA_ERROR; and

o The rdma_err field contains a value that reflects the type of error that occurred, as described below.

An RDMA_ERROR procedure indicates a permanent error. Receipt of this procedure completes the RPC transaction associated with XID in the rdma_xid field. A receiver MUST silently discard an RDMA_ERROR procedure that it cannot decode.

4.5.1. Header Version Mismatch

When a Responder detects an RPC-over-RDMA header version that it does not support (currently this document defines only version 1), it MUST reply with an RDMA_ERROR procedure and set the rdma_err value to ERR_VERS, also providing the low and high inclusive version numbers it does, in fact, support.

4.5.2. XDR Errors

A receiver might encounter an XDR parsing error that prevents it from processing the incoming Transport stream. Examples of such errors include an invalid value in the rdma_proc field; an RDMA_NOMSG message where the Read list, Write list, and Reply chunk are marked not present; or the value of the rdma_xid field does not match the value of the XID field in the accompanying RPC message. If the rdma_vers field contains a recognized value, but an XDR parsing error occurs, the Responder MUST reply with an RDMA_ERROR procedure and set the rdma_err value to ERR_CHUNK.

When a Responder receives a valid RPC-over-RDMA header but the Responder's ULP implementation cannot parse the RPC arguments in the RPC Call message, the Responder SHOULD return an RPC Reply message with status GARBAGE_ARGS, using an RDMA_MSG procedure. This type of parsing failure might be due to mismatches between chunk sizes or offsets and the contents of the Payload stream, for example.

4.5.3. Responder RDMA Operational Errors

In RPC-over-RDMA version 1, the Responder initiates RDMA Read and Write operations that target the Requester's memory. Problems might arise as the Responder attempts to use Requester-provided resources for RDMA operations. For example:

o Usually, chunks can be validated only by using their contents to perform data transfers. If chunk contents are invalid (e.g., a memory region is no longer registered or a chunk length exceeds the end of the registered memory region), a Remote Access Error occurs.

o If a Requester's Receive buffer is too small, the Responder's Send operation completes with a Local Length Error.

o If the Requester-provided Reply chunk is too small to accommodate a large RPC Reply message, a Remote Access Error occurs. A Responder might detect this problem before attempting to write past the end of the Reply chunk.

RDMA operational errors are typically fatal to the connection. To avoid a retransmission loop and repeated connection loss that deadlocks the connection, once the Requester has re-established a connection, the Responder should send an RDMA_ERROR reply with an rdma_err value of ERR_CHUNK to indicate that no RPC-level reply is possible for that XID.

4.5.4. Other Operational Errors

While a Requester is constructing an RPC Call message, an unrecoverable problem might occur that prevents the Requester from posting further RDMA Work Requests on behalf of that message. As with other transports, if a Requester is unable to construct and transmit an RPC Call message, the associated RPC transaction fails immediately.

After a Requester has received a reply, if it is unable to invalidate a memory region due to an unrecoverable problem, the Requester MUST close the connection to protect that memory from Responder access before the associated RPC transaction is complete.

While a Responder is constructing an RPC Reply message or error message, an unrecoverable problem might occur that prevents the Responder from posting further RDMA Work Requests on behalf of that message. If a Responder is unable to construct and transmit an RPC Reply or RPC-over-RDMA error message, the Responder MUST close the connection to signal to the Requester that a reply was lost.

4.5.5. RDMA Transport Errors โœจ

okay so the RDMA connection and physical link already come with some error detection and retransmission ๐Ÿ›ก๏ธ iWARP's Marker PDU Aligned (MPA) layer (when it runs over TCP), the Stream Control Transmission Protocol (SCTP), and the InfiniBand [IBARCH] link layer all add Cyclic Redundancy Check (CRC) protection to the RDMA payload. CRC-class protection is a general attribute of these transports, so it's giving layered safety net ๐Ÿ’œ

RPC can also take errors from the transport and recover by retransmitting ๐Ÿ” RPC recovery can handle a complete loss and re-establishment of a transport connection. literally a glow-up for resilience ๐Ÿฆ‹

The details of reporting and recovering from RDMA link-layer errors live in specific link-layer APIs and operational specifications. those are outside the scope of this protocol spec, so don't look for them here ๐Ÿ™ˆ See Section 8 for more on using RPC-level integrity schemes to detect errors.

4.6. Protocol Elements No Longer Supported ๐Ÿฅ€

the following protocol elements are no longer supported in RPC-over-RDMA version 1. the related enum values and structure definitions are still in the RPC-over-RDMA version 1 protocol, just for backwards compatibility ๐Ÿงš

4.6.1. RDMA_MSGP

the spec for RDMA_MSGP in Section 3.9 of [RFC5666] is incomplete ๐Ÿ˜ญ to fully specify it, you'd need:

  • Updating the definition of DDP-eligibility to include data items that may be transferred, with padding, via RDMA_MSGP procedures
  • Adding full operational descriptions of the alignment and threshold fields
  • Discussing how alignment preferences are communicated between two peers without using CCP
  • Describing the treatment of RDMA_MSGP procedures that convey Read or Write chunks

the RDMA_MSGP message type only pays off when the padded data payload sits at the end of an RPC message's argument or result list. that's not typical for NFSv4 COMPOUND RPCs, which often put a GETATTR operation as the final element of the compound operation array ๐Ÿ’…

without a full spec, nobody has built a fully implemented prototype of it. and without a complete prototype, it's really hard to tell whether this element has any benefit or can even work interoperably ๐Ÿคทโ€โ™€๏ธ

so, the rules are: senders MUST NOT send RDMA_MSGP procedures. when receiving an RDMA_MSGP procedure, Responders SHOULD reply with an RDMA_ERROR procedure, setting the rdma_err field to ERR_CHUNK. Requesters MUST silently discard the message. ๐Ÿšซ

4.6.2. RDMA_DONE

because no implementation of RPC-over-RDMA version 1 uses the Read-Read transfer model, there is never a need to send an RDMA_DONE procedure ๐Ÿ’€

so, senders MUST NOT send RDMA_DONE messages. Receivers MUST silently discard RDMA_DONE messages. bye bye ๐Ÿ‘‹

4.7. XDR Examples ๐ŸŽ€

RPC-over-RDMA chunk lists are complex data types, not gonna lie ๐Ÿ˜ตโ€๐Ÿ’ซ this section has illustrations to help you see how chunk lists are represented inside an RPC-over-RDMA header.

a plain segment is the simplest piece. it's made up of a 32-bit handle (H), a 32-bit length (L), and 64 bits of offset (OO). once it's flattened into an XDR stream, a plain segment looks like:

HLOO

an RDMA read segment has an extra 32-bit position field (P). RDMA read segments look like:

PHLOO

a Read chunk is a list of RDMA read segments. each RDMA read segment is preceded by a 32-bit word that holds a one if a segment follows, or a zero if there are no more segments in the list. in XDR form, that looks like:

1 PHLOO 1 PHLOO 1 PHLOO 0

where P holds the same value for each RDMA read segment belonging to the same Read chunk ๐Ÿ“

the Read list is also a list of RDMA read segments. in XDR form it looks like a Read chunk, except the P values can vary across the list. an empty Read list is encoded as a single 32-bit zero ๐ŸŒธ

one Write chunk is a counted array of plain segments. in XDR form, the count shows up as the first 32-bit word, followed by an HLOO for each element of the array. for example, a Write chunk with three elements looks like:

3 HLOO HLOO HLOO

the Write list is a list of counted arrays. in XDR form, that's a mix of optional-data and counted arrays. to represent a Write list containing a Write chunk with three segments and a Write chunk with two segments, XDR would encode:

1 3 HLOO HLOO HLOO 1 2 HLOO HLOO 0

an empty Write list is encoded as a single 32-bit zero ๐Ÿ’œ

the Reply chunk is a Write chunk. but since it's an optional-data field, there's a 32-bit field in front of it that holds a one if the Reply chunk is present, or a zero if it isn't. after encoding, a Reply chunk with two segments looks like:

1 2 HLOO HLOO

frequently, a Requester doesn't provide any chunks at all. in that case, after the four fixed fields in the RPC-over-RDMA header, there are simply three 32-bit fields that contain zero โœจ

5. RPC Bind Parameters ๐Ÿ”Œ

when setting up a new RDMA connection, the first thing a Requester does is get a transport address for the Responder. the means used to get that address, and to open an RDMA connection, depend on the type of RDMA transport. that's the job of each RPC protocol binding and its local implementation ๐Ÿงฉ

RPC services normally register with a portmap or rpcbind service [RFC1833], which links an RPC Program number to a service address. this policy is no different with RDMA transports. however, a different and distinct service address (port number) might sometimes be needed for ULP operation with RPC-over-RDMA ๐Ÿฆ‹

when mapped atop the iWARP transport [RFC5040] [RFC5041], which uses IP port addressing because it layers on TCP and/or SCTP, port mapping is trivial. it just means issuing the port in the connection process ๐ŸŒˆ The NFS/RDMA protocol service address has been assigned port 20049 by IANA, for both iWARP/TCP and iWARP/SCTP [RFC5667].

when mapped atop InfiniBand [IBARCH], which uses a service endpoint naming scheme based on a Group Identifier (GID), a translation MUST be employed. one such translation is described in Annexes A3 (Application Specific Identifiers), A4 (Sockets Direct Protocol (SDP)), and A11 (RDMA IP CM Service) of [IBARCH], and it's appropriate for translating IP port addressing to the InfiniBand network. so in this case, IP port addressing may be readily employed by the upper layer ๐Ÿซถ

when a mapping standard or convention exists for IP ports on an RDMA interconnect, each upper layer has a few options to consider:

  • One possibility is to have the Responder register its mapped IP port with the rpcbind service under the netid (or netids) defined here. an RPC-over-RDMA-aware Requester can then resolve its desired service to a mappable port and go ahead and connect. this is the most flexible and compatible approach, for upper layers defined to use the rpcbind service ๐Ÿ”ฅ
  • A second possibility is to have the Responder's portmapper register itself on the RDMA interconnect at a "well-known" service address (on UDP or TCP, this corresponds to port 111). a Requester could connect to this service address and use the portmap protocol to get a service address in response to a program number, e.g., an iWARP port number or an InfiniBand GID ๐Ÿ—บ๏ธ
  • Alternately, the Requester could simply connect to the mapped well-known port for the service itself, if it's appropriately defined. by convention, the NFS/RDMA service, when operating atop such an InfiniBand fabric, uses the same 20049 assignment as for iWARP ๐Ÿ‘‘

historically, different RPC protocols have taken different approaches to port assignment ๐Ÿ™ƒ so the specific method is left to each RPC-over-RDMA-enabled ULB and isn't addressed in this document.

in Section 9, this specification defines two new netid values. they're for registering upper layers atop iWARP [RFC5040] [RFC5041] and (when a suitable port translation service is available) InfiniBand [IBARCH]. Additional RDMA-capable networks MAY define their own netids, or, if they provide a port translation, they MAY share the one defined in this document ๐Ÿ’–

6. ULB Specifications ๐Ÿ“œ

an ULP is typically defined independently of any particular RPC transport. an ULB (ULB) specification gives guidance that helps the ULP interoperate correctly and efficiently over a particular transport ๐ŸŒŸ For RPC-over-RDMA version 1, a ULB may provide:

  • A taxonomy of XDR data items that are eligible for DDP
  • Constraints on which upper-layer procedures may be reduced and on how many chunks may appear in a single RPC request
  • A method for determining the maximum size of the reply Payload stream for all procedures in the ULP
  • An rpcbind port assignment for operation of the RPC Program and Version on an RPC-over-RDMA transport

each RPC Program and Version tuple that uses RPC-over-RDMA version 1 needs to have a ULB specification ๐Ÿญ

6.1. DDP-Eligibility ๐Ÿ’–

okay so an ULB gets to label certain XDR data items as DDP-eligible โœจ. When an RPC-over-RDMA message is being put together, those DDP-eligible items can get pulled out of the Payload stream and dropped straight into the receiver's memory ๐Ÿฆ‹.

An XDR data item should be considered for DDP-eligibility if there's a clear benefit to moving its contents directly from the sender's memory to the receiver's memory ๐Ÿ’…. The criteria for DDP-eligibility include:

  • The XDR data item is frequently sent or received, and its size is often much larger than typical inline thresholds. ๐Ÿ“ฆ
  • If the XDR data item is a result, its maximum size must be predictable in advance by the Requester. ๐Ÿ”ฎ
  • Transport-level processing of the XDR data item is not needed. For example, the data item is an opaque byte array, which requires no XDR encoding and decoding of its content. ๐Ÿซถ
  • The content of the XDR data item is sensitive to address alignment. For example, a data copy operation would be required on the receiver to enable the message to be parsed correctly, or to enable the data item to be accessed. ๐Ÿ™ˆ
  • The XDR data item does not contain DDP-eligible data items. ๐ŸŒธ

In addition to defining the set of data items that are DDP-eligible, a ULB may also limit the use of chunks to particular upper-layer procedures. If more than one data item in a procedure is DDP-eligible, the ULB may also limit the number of chunks that a Requester can provide for a particular upper-layer procedure. โœจ

Senders MUST NOT reduce data items that are not DDP-eligible. Such data items MAY, however, be moved as part of a Position Zero Read chunk or a Reply chunk. โš ๏ธ

The programming interface by which an upper-layer implementation indicates the DDP-eligibility of a data item to the RPC transport is not described by this specification. The only requirements are that the receiver can re-assemble the transmitted RPC-over-RDMA message into a valid XDR stream, and that DDP-eligibility rules specified by the ULB are respected. ๐Ÿงš

There is no provision to express DDP-eligibility within the XDR language. The only definitive specification of DDP-eligibility is a ULB. ๐Ÿ‘‘

In general, a DDP-eligibility violation occurs when:

  • A Requester reduces a non-DDP-eligible argument data item. The Responder MUST NOT process this RPC Call message and MUST report the violation as described in Section 4.5.2. ๐Ÿšซ
  • A Responder reduces a non-DDP-eligible result data item. The Requester MUST terminate the pending RPC transaction and report an appropriate permanent error to the RPC consumer. ๐Ÿ’€
  • A Responder does not reduce a DDP-eligible result data item into an available Write chunk. The Requester MUST terminate the pending RPC transaction and report an appropriate permanent error to the RPC consumer. ๐Ÿ’€

6.2. Maximum Reply Size ๐ŸŽ€

A Requester provides resources for both an RPC Call message and its matching RPC Reply message. A Requester forms the RPC Call message itself; thus, the Requester can compute the exact resources needed. ๐Ÿงฎ

A Requester must allocate resources for the RPC Reply message (an RPC-over-RDMA credit, a Receive buffer, and possibly a Write list and Reply chunk) before the Responder has formed the actual reply. To accommodate all possible replies for the procedure in the RPC Call message, a Requester must allocate reply resources based on the maximum possible size of the expected RPC Reply message. ๐Ÿ“

If there are procedures in the ULP for which there is no clear reply size maximum, the ULB needs to specify a dependable means for determining the maximum. ๐Ÿ”


6.3. Additional Considerations ๐ŸŒˆ

There may be other details provided in a ULB.

  • An ULB may recommend inline threshold values or other transport-related parameters for RPC-over-RDMA version 1 connections bearing that ULP. ๐Ÿ“
  • An ULP may provide a means to communicate these transport-related parameters between peers. Note that RPC-over-RDMA version 1 does not specify any mechanism for changing any transport-related parameter after a connection has been established. ๐Ÿ”’
  • Multiple ULPs may share a single RPC-over-RDMA version 1 connection when their ULBs allow the use of RPC-over-RDMA version 1 and the rpcbind port assignments for the Protocols allow connection sharing. In this case, the same transport parameters (such as inline threshold) apply to all Protocols using that connection. ๐Ÿค

Each ULB needs to be designed to allow correct interoperation without regard to the transport parameters actually in use. Furthermore, implementations of ULPs must be designed to interoperate correctly regardless of the connection parameters in effect on a connection. ๐Ÿ’œ


6.4. ULP Extensions ๐Ÿฆ‹

An RPC Program and Version tuple may be extensible. For instance, there may be a minor versioning scheme that is not reflected in the RPC version number, or the ULP may allow additional features to be specified after the original RPC Program specification was ratified. โœจ

ULBs are provided for interoperable RPC Programs and Versions by extending existing ULBs to reflect the changes made necessary by each addition to the existing XDR. ๐Ÿ› ๏ธ


7. Protocol Extensibility ๐Ÿงš

The RPC-over-RDMA header format is specified using XDR, unlike the message header used with RPC-over-TCP. To maintain a high degree of interoperability among implementations of RPC-over-RDMA, any change to this XDR requires a protocol version number change. New versions of RPC-over-RDMA may be published as separate protocol specifications without updating this document. ๐Ÿ“œ

The first four fields in every RPC-over-RDMA header must remain aligned at the same fixed offsets for all versions of the RPC-over-RDMA protocol. The version number must be in a fixed place to enable implementations to detect protocol version mismatches. ๐Ÿ”ข

For version mismatches to be reported in a fashion that all future version implementations can reliably decode, the rdma_proc field must remain in a fixed place, the value of ERR_VERS must always remain the same, and the field placement in struct rpc_rdma_errvers must always remain the same. ๐ŸŽฏ


7.1. Conventional Extensions ๐ŸŒธ

Introducing new capabilities to RPC-over-RDMA version 1 is limited to the adoption of conventions that make use of existing XDR (defined in this document) and allowed abstract RDMA operations. Because no mechanism for detecting optional features exists in RPC-over-RDMA version 1, implementations must rely on ULPs to communicate the existence of such extensions. ๐Ÿ—ฃ๏ธ

Such extensions must be specified in a Standards Track RFC with appropriate review by the NFSv4 Working Group and the IESG. An example of a conventional extension to RPC-over-RDMA version 1 is the specification of backward direction message support to enable NFSv4.1 callback operations, described in [RFC8167]. ๐Ÿ“š


8. Security Considerations ๐Ÿ”

This section is serious business, bestie, so read it carefully ๐Ÿ˜ญ๐Ÿ”ฅ.

8.1. Memory Protection ๐Ÿ›ก๏ธ

A primary consideration is the protection of the integrity and confidentiality of local memory by an RPC-over-RDMA transport. The use of an RPC-over-RDMA transport protocol MUST NOT introduce vulnerabilities to system memory contents nor to memory owned by user processes. ๐Ÿšจ

It is REQUIRED that any RDMA provider used for RPC transport be conformant to the requirements of [RFC5042] in order to satisfy these protections. These protections are provided by the RDMA layer specifications, and in particular, their security models. ๐Ÿ”’

8.1.1. Protection Domains ๐Ÿฐ

The use of Protection Domains to limit the exposure of memory regions to a single connection is critical. Any attempt by an endpoint not participating in that connection to reuse memory handles needs to result in immediate failure of that connection. Because ULP security mechanisms rely on this aspect of Reliable Connection behavior, strong authentication of remote endpoints is recommended. ๐Ÿชช

8.1.2. Handle Predictability ๐ŸŽฒ

Unpredictable memory handles should be used for any operation requiring advertised memory regions. Advertising a continuously registered memory region allows a remote host to read or write to that region even when an RPC involving that memory is not under way. Therefore, implementations should avoid advertising persistently registered memory. ๐Ÿ™…โ€โ™€๏ธ

8.1.3. Memory Protection ๐Ÿงฑ

Requesters should register memory regions for remote access only when they are about to be the target of an RPC operation that involves an RDMA Read or Write. โฐ

Registered memory regions should be invalidated as soon as related RPC operations are complete. Invalidation and DMA unmapping of memory regions should be complete before message integrity checking is done and before the RPC consumer is allowed to continue execution and use or alter the contents of a memory region. ๐Ÿงน

An RPC transaction on a Requester might be terminated before a reply arrives if the RPC consumer exits unexpectedly (for example, it is signaled or a segmentation fault occurs). When an RPC terminates abnormally, memory regions associated with that RPC should be invalidated appropriately before the regions are released to be reused for other purposes on the Requester. ๐Ÿ’ฅ

8.1.4. Denial of Service ๐Ÿšง

A detailed discussion of denial-of-service exposures that can result from the use of an RDMA transport is found in Section 6.4 of [RFC5042]. ๐Ÿ“–

A Responder is not obliged to pull Read chunks that are unreasonably large. The Responder can use an RDMA_ERROR response to terminate RPCs with unreadable Read chunks. If a Responder transmits more data than a Requester is prepared to receive in a Write or Reply chunk, the RDMA Network Interface Cards (RNICs) typically terminate the connection. For further discussion, see Section 4.5. Such repeated chunk errors can deny service to other users sharing the connection from the errant Requester. ๐Ÿ˜ค

An RPC-over-RDMA transport implementation is not responsible for throttling the RPC request rate, other than to keep the number of concurrent RPC transactions at or under the number of credits granted per connection. This is explained in Section 3.3.1. A sender can trigger a self denial of service by exceeding the credit grant repeatedly. ๐Ÿ™ƒ

When an RPC has been canceled due to a signal or premature exit of an application process, a Requester may invalidate the RPC's Write and Reply chunks. Invalidation prevents the subsequent arrival of the Responder's reply from altering the memory regions associated with those chunks after the memory has been reused. ๐Ÿงฏ

On the Requester, a malfunctioning application or a malicious user can create a situation where RPCs are continuously initiated and then aborted, resulting in Responder replies that terminate the underlying RPC-over-RDMA connection repeatedly. Such situations can deny service to other users sharing the connection from that Requester. ๐Ÿšฉ

8.2. RPC Message Security ๐ŸŽ€

ONC RPC provides cryptographic security via the RPCSEC_GSS framework [RFC7861]. RPCSEC_GSS implements message authentication (rpc_gss_svc_none), per-message integrity checking (rpc_gss_svc_integrity), and per-message confidentiality (rpc_gss_svc_privacy) in the layer above RPC-over-RDMA. The latter two services require significant computation and movement of data on each endpoint host. Some performance benefits enabled by RDMA transports can be lost. ๐Ÿข๐Ÿ’ญ

Okay bestie, let's get into it ๐Ÿ’…๐ŸŽ€


8.2.1. RPC-over-RDMA Protection at Lower Layers โœจ

okay so, for any RPC transport, turning on RPCSEC_GSS integrity or privacy services has real performance costs ๐Ÿ˜ญ That's why protection below the RPC transport is often the move in performance-sensitive setups, especially if it can get offloaded to hardware. Certain IPsec configurations can live right in RDMA hardware, for example, without changing anything for RDMA consumers and with very little loss of data movement efficiency ๐Ÿฆ‹ These arrangements can also give you a higher degree of privacy by hiding endpoint identity or changing how often messages get exchanged, but yeah, that comes with a performance cost too ๐Ÿ’€

The use of protection in a lower layer MAY be negotiated through an RPCSEC_GSS security flavor defined in [RFC7861], together with the Channel Binding mechanism [RFC5056] and IPsec Channel Connection Latching [RFC5660]. Use of such mechanisms is REQUIRED where integrity or confidentiality is desired and where efficiency is required ๐Ÿ”ฅ

Wait, the REQUIRED is the important part here, so yes, it's a must if you want both the security and the speed ๐Ÿซถ

8.2.2. RPCSEC_GSS on RPC-over-RDMA Transports ๐ŸŒˆ

Not every RDMA device and fabric supports the protection mechanisms above ๐Ÿ˜ฌ Also, per-message authentication is still required on NFS clients where multiple users access NFS files. In those cases, RPCSEC_GSS can protect NFS traffic carried on RPC-over-RDMA connections ๐Ÿ’œ

RPCSEC_GSS extends the ONC RPC protocol [RFC5531] without changing the format of RPC messages. So if an RPC-over-RDMA transport follows the conventions in this section, it can carry RPCSEC_GSS-protected RPC messages interoperably โœจ

As part of the ONC RPC protocol, RPCSEC_GSS protocol elements that show up in the Payload stream of an RPC-over-RDMA message MUST NOT be reduced. That includes control messages used to establish or destroy a security context, and data items that are part of the RPCSEC_GSS authentication material ๐Ÿงš

8.2.2.1. RPCSEC_GSS Context Negotiation ๐Ÿ“

Some NFS client implementations use a separate connection to set up a Generic Security Service (GSS) context for NFS operation. These clients use TCP and the standard NFS port (2049) for context establishment. So, to enable RPCSEC_GSS with NFS/RDMA, an NFS server MUST also provide a TCP-based NFS service on port 2049 ๐ŸŒธ

8.2.2.2. RPC-over-RDMA with RPCSEC_GSS Authentication ๐ŸŽ€

The RPCSEC_GSS authentication service has no impact on the DDP-eligibility of data items in a ULP. Iconic ๐Ÿ™Œ

However, RPCSEC_GSS authentication material in an RPC message header can be way bigger than, say, an AUTH_SYS authenticator ๐Ÿ˜ญ Specifically, when an RPCSEC_GSS pseudoflavor is in use, a Requester needs to accommodate a larger RPC credential when marshaling RPC Call messages, and it needs to provide for a maximum-size RPCSEC_GSS verifier when allocating reply buffers and Reply chunks.

Because of that, RPC messages, and therefore Payload streams, get larger ๐Ÿ“ˆ ULP operations that fit in a Short Message under a simpler form of authentication might need to be reduced, or sent via a Long Message, once RPCSEC_GSS authentication is in use. It's also more likely that a Requester provides both a Read list and a Reply chunk in the same RPC-over-RDMA header, to convey a Long Call and set up a receptacle for a Long Reply. And more frequent Long Messages can hit transport efficiency, so keep that in mind ๐Ÿฆ‹

8.2.2.3. RPC-over-RDMA with RPCSEC_GSS Integrity or Privacy ๐Ÿ”

The RPCSEC_GSS integrity service lets endpoints detect modification of RPC messages in flight. The RPCSEC_GSS privacy service stops everyone except the intended recipient from seeing the cleartext content of RPC arguments and results ๐Ÿ‘€ Both integrity and privacy are end-to-end, so they protect RPC arguments and results from the application all the way to the server endpoint, and back ๐Ÿ’–

The integrity and encryption services work on whole RPC messages after they've been XDR encoded for transmit, and before they've been XDR decoded after receipt. Both sender and receiver use intermediate buffers so that encrypted data or unverified cleartext never gets exposed to RPC consumers ๐Ÿ™ˆ After verification, encryption, and message wrapping are done, the transport layer MAY use RDMA data transfer between those intermediate buffers.

Here's the tricky part ๐Ÿ˜ค Reducing a DDP-eligible data item removes the data item and its XDR padding from the encoded XDR stream. The XDR padding of a reduced data item is not transferred in an RPC-over-RDMA message. So after reduction, the Payload stream has fewer octets than the whole XDR stream did beforehand. XDR padding octets are often zero bytes, but they don't have to be. Which means reducing DDP-eligible items affects the result of message integrity verification or encryption ๐Ÿง

So, a sender MUST NOT reduce a Payload stream when RPCSEC_GSS integrity or encryption services are in use. Effectively, no data item is DDP-eligible in this situation, and Chunked Messages cannot be used. In this mode, an RPC-over-RDMA transport operates the same way as a transport that doesn't support DDP ๐Ÿซ 

When an RPCSEC_GSS integrity or privacy service is in use, a Requester provides both a Read list and a Reply chunk in the same RPC-over-RDMA header, to convey a Long Call and provision a receptacle for a Long Reply ๐Ÿ’œ

8.2.2.4. Protecting RPC-over-RDMA Transport Headers ๐Ÿšจ

Like the base fields in an ONC RPC message (XID, call direction, and so on), the contents of an RPC-over-RDMA message's Transport stream are not protected by RPCSEC_GSS. This exposes XIDs, connection credit limits, and chunk lists (though not the content of the data items they refer to) to malicious behavior. An attacker could redirect data transferred by the RPC-over-RDMA message, cause spurious retransmits, or trigger connection loss ๐Ÿ˜ฑ

Specifically, if an attacker alters the information in the chunk lists of an RPC-over-RDMA header, data in those chunks can be redirected to other registered memory regions on Requesters. An attacker might also alter the arguments of RDMA Read and RDMA Write operations on the wire to similar effect. If that happens, the use of RPCSEC_GSS integrity or privacy services lets a Requester detect unexpected material in a received RPC message ๐Ÿ›ก๏ธ

Encryption at lower layers, as described in Section 8.2.1, protects the content of the Transport stream. To address attacks on RDMA protocols themselves, RDMA transport implementations SHOULD conform to [RFC5042].

Hmm, wait, I need to fix that last line: the original says "should conform," and it's lowercase, so it isn't a BCP 14 keyword. Keeping it exactly as written:

To address attacks on RDMA protocols themselves, RDMA transport implementations should conform to [RFC5042] ๐Ÿ’…


9. IANA Considerations ๐Ÿ“‹

A set of RPC netids for resolving RPC-over-RDMA services is specified by this document. This is unchanged from [RFC5666].

The RPC-over-RDMA transport has been assigned an RPC netid, which is an rpcbind [RFC1833] string used to describe the underlying protocol. RPC uses it to select the appropriate transport framing, as well as the format of the service addresses and ports ๐ŸŒท

The following netid registry strings are defined for this purpose:

   NC_RDMA "rdma"
   NC_RDMA6 "rdma6"

The "rdma" netid is used when IPv4 addressing is employed by the underlying transport, and "rdma6" is for IPv6 addressing. The netid assignment policy and registry are defined in [RFC5665].

These netids MAY be used for any RDMA network that satisfies the requirements of Section 2.3.2 and that can identify service endpoints using IP port addressing, possibly through a translation service as described in Section 5 ๐Ÿฆ‹

The use of the RPC-over-RDMA protocol has no effect on RPC Program numbers or existing registered port numbers. However, new port numbers MAY be registered for RPC-over-RDMA-enabled services, as appropriate to the new networks those services will operate over ๐ŸŒˆ

For example, the NFS/RDMA service defined in [RFC5667] has been assigned port 20049 in the "Service Name and Transport Protocol Port Number Registry". That's distinct from the port number defined for NFS on TCP, which is assigned port 2049 in the same registry. NFS clients use the same RPC Program number for NFS (100003) whichever transport they use [RFC5531] (see the "Remote Procedure Call (RPC) Program Numbers" registry) ๐Ÿงš


10. References ๐Ÿ“š

10.1. Normative References ๐Ÿ’–

   [RFC1833]  Srinivasan, R., "Binding Protocols for ONC RPC Version 2",
              RFC 1833, DOI 10.17487/RFC1833, August 1995,
              <http://www.rfc-editor.org/info/rfc1833>.

   [RFC2119]  Bradner, S., "Key words for use in RFCs to Indicate
              Requirement Levels", BCP 14, RFC 2119,
              DOI 10.17487/RFC2119, March 1997,
              <http://www.rfc-editor.org/info/rfc2119>.

   [RFC4506]  Eisler, M., Ed., "XDR: External Data Representation
              Standard", STD 67, RFC 4506, DOI 10.17487/RFC4506, May
              2006, <http://www.rfc-editor.org/info/rfc4506>.

   [RFC5042]  Pinkerton, J. and E. Deleganes, "Direct Data Placement
              Protocol (DDP) / Remote Direct Memory Access Protocol
              (RDMAP) Security", RFC 5042, DOI 10.17487/RFC5042, October
              2007, <http://www.rfc-editor.org/info/rfc5042>.

   [RFC5056]  Williams, N., "On the Use of Channel Bindings to Secure
              Channels", RFC 5056, DOI 10.17487/RFC5056, November 2007,
              <http://www.rfc-editor.org/info/rfc5056>.

   [RFC5531]  Thurlow, R., "RPC: Remote Procedure Call Protocol
              Specification Version 2", RFC 5531, DOI 10.17487/RFC5531,
              May 2009, <http://www.rfc-editor.org/info/rfc5531>.

   [RFC5660]  Williams, N., "IPsec Channels: Connection Latching",
              RFC 5660, DOI 10.17487/RFC5660, October 2009,
              <http://www.rfc-editor.org/info/rfc5660>.

   [RFC5665]  Eisler, M., "IANA Considerations for Remote Procedure Call
              (RPC) Network Identifiers and Universal Address Formats",
              RFC 5665, DOI 10.17487/RFC5665, January 2010,
              <http://www.rfc-editor.org/info/rfc5665>.

   [RFC7861]  Adamson, A. and N. Williams, "Remote Procedure Call (RPC)
              Security Version 3", RFC 7861, DOI 10.17487/RFC7861,
              November 2016, <http://www.rfc-editor.org/info/rfc7861>.

   [RFC8174]  Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC
              2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174,
              May 2017, <http://www.rfc-editor.org/info/rfc8174>.

10.2. Informative References ๐Ÿงšโœจ

okay bestie, these are the informative ones, so they're here for context and background, not the rules ๐Ÿ“š๐Ÿ’–


Appendix A. Changes from RFC 5666 ๐Ÿ’…๐ŸŽ€

A.1. Changes to the Specification ๐ŸŒธ

okay so this is the glow-up list for RPC-over-RDMA version 1 ๐Ÿ’• the section numbers below point back at [RFC5666], so keep that open in another tab ๐Ÿฆ‹

  • Section 2 got expanded to introduce and explain key RPC [RFC5531], XDR [RFC4506], and RDMA [RFC5040] terminology. these terms are now used consistently all the way through, which is so clean ๐Ÿซถ
  • Section 3 was reorganized and split into subsections so readers can find specific requirements and definitions way faster โœจ
  • Sections 4 and 5 got combined to tidy up the organization of that info ๐Ÿงš
  • the optional Connection Configuration Protocol was never implemented, so the CCP spec got deleted from this document ๐Ÿ’€ it's giving "we don't talk about CCP" energy
  • a section that consolidates requirements for ULBs was added ๐Ÿ“
  • an XDR extraction mechanism is provided, along with full copyright, matching the approach used in [RFC5662] ๐Ÿ’œ
  • the "Security Considerations" section got expanded to discuss how RPC-over-RDMA security depends on features of the underlying RDMA transport ๐Ÿ”ฅ this one is lowkey the most important change, bestie, so don't skip it ๐Ÿ˜ญ
  • a subsection about using RPCSEC_GSS [RFC7861] with RPC-over-RDMA version 1 was added ๐ŸŒˆ

A.2. Changes to the Protocol ๐Ÿฆ‹

okay this part is about the protocol itself. it still interoperates with existing [RFC5666] implementations ๐Ÿซถ but these are the changes:

  • Read-Read is gone. the Read-Read transfer model got removed because it's slower than Read-Write, so implementers chose not to support it anyway ๐ŸŒ that makes the explanatory text simpler, and the RDMA_DONE procedure is no longer part of the protocol ๐Ÿ‘‹
  • the RDMA_MSGP spec in [RFC5666] isn't adequate, although some incomplete implementations exist ๐Ÿ™ˆ even with a good spec, the benefit for protocols like NFSv4.0 [RFC7530] is doubtful, so the RDMA_MSGP message type is no longer supported ๐Ÿ’…
  • technical issues with handling RPC-over-RDMA header errors got corrected โœจ
  • specific requirements related to implicit XDR roundup and complex XDR data types were added ๐Ÿงš
  • explicit guidance was added about sizing Write chunks, managing multiple chunks in the Write list, and handling unused Write chunks ๐Ÿ“
  • clear guidance about Send and Receive buffer sizes got introduced, which helps you make better decisions about when a Reply chunk has to be provided ๐ŸŽ€

Acknowledgments ๐Ÿซถ๐Ÿ’–

the editor gratefully acknowledges the work of Brent Callaghan and Tom Talpey on the original RPC-over-RDMA Version 1 specification [RFC5666] ๐ŸŒธ

Dave Noveck gave excellent review, constructive suggestions, and consistent navigational guidance throughout the drafting process ๐Ÿ™Œ Dave also contributed a lot of the organization and content of Section 7 and helped the authors understand the complexities of XDR extensibility ๐Ÿง โœจ

the comments and contributions of Karen Deitke, Dai Ngo, Chunli Zhang, Dominique Martinet, and Mahesh Siddheshwar are accepted with great thanks ๐Ÿ’œ the editor also wants to thank Bill Baker, Greg Marsden, and Matt Benjamin for their support of this work ๐ŸŒˆ

the extract.sh shell script and formatting conventions were first described by the authors of the NFSv4.1 XDR specification [RFC5662] ๐Ÿš

special thanks go to Transport Area Director Spencer Dawkins, NFSV4 Working Group Chair and Document Shepherd Spencer Shepler, and NFSV4 Working Group Secretary Thomas Haynes for their support ๐Ÿ‘‘


Authors' Addresses ๐Ÿ’Œ

Charles Lever (editor) ๐Ÿ‘‘

Charles Lever (editor)
Oracle Corporation
1015 Granger Avenue
Ann Arbor, MI  48104
United States of America

Phone: +1 248 816 6463
Email: chuck.lever@oracle.com

William Allen Simpson ๐Ÿงš

William Allen Simpson
Red Hat
1384 Fontaine
Madison Heights, MI  48071
United States of America

Email: william.allen.simpson@gmail.com

Tom Talpey ๐Ÿฆ‹

Tom Talpey
Microsoft Corp.
One Microsoft Way
Redmond, WA  98052
United States of America

Phone: +1 425 704-9945
Email: ttalpey@microsoft.com
๐Ÿ“ฆ where this page comes from