idnits 2.17.1 draft-ietf-nfsv4-rfc5666bis-09.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- No issues found here. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year == The document seems to contain a disclaimer for pre-RFC5378 work, but was first submitted on or after 10 November 2008. The disclaimer is usually necessary only for documents that revise or obsolete older RFCs, and that take significant amounts of text from those RFCs. If you can contact all authors of the source material and they are willing to grant the BCP78 rights to the IETF Trust, you can and should remove the disclaimer. Otherwise, the disclaimer is needed and you can ignore this comment. (See the Legal Provisions document at https://trustee.ietf.org/license-info for more information.) -- The document date (January 19, 2017) is 2647 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) == Outdated reference: A later version (-08) exists of draft-ietf-nfsv4-rpcrdma-bidirection-05 -- Obsolete informational reference (is this intentional?): RFC 793 (Obsoleted by RFC 9293) -- Obsolete informational reference (is this intentional?): RFC 5661 (Obsoleted by RFC 8881) -- Obsolete informational reference (is this intentional?): RFC 5666 (Obsoleted by RFC 8166) -- Obsolete informational reference (is this intentional?): RFC 5667 (Obsoleted by RFC 8267) Summary: 0 errors (**), 0 flaws (~~), 3 warnings (==), 5 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Network File System Version 4 C. Lever, Ed. 3 Internet-Draft Oracle 4 Obsoletes: 5666 (if approved) W. Simpson 5 Intended status: Standards Track DayDreamer 6 Expires: July 23, 2017 T. Talpey 7 Microsoft 8 January 19, 2017 10 Remote Direct Memory Access Transport for Remote Procedure Call, Version 11 One 12 draft-ietf-nfsv4-rfc5666bis-09 14 Abstract 16 This document specifies a protocol for conveying Remote Procedure 17 Call (RPC) messages on physical transports capable of Remote Direct 18 Memory Access (RDMA). It requires no revision to application RPC 19 protocols or the RPC protocol itself. This document obsoletes RFC 20 5666. 22 Requirements Language 24 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 25 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 26 document are to be interpreted as described in [RFC2119]. 28 Status of This Memo 30 This Internet-Draft is submitted in full conformance with the 31 provisions of BCP 78 and BCP 79. 33 Internet-Drafts are working documents of the Internet Engineering 34 Task Force (IETF). Note that other groups may also distribute 35 working documents as Internet-Drafts. The list of current Internet- 36 Drafts is at http://datatracker.ietf.org/drafts/current/. 38 Internet-Drafts are draft documents valid for a maximum of six months 39 and may be updated, replaced, or obsoleted by other documents at any 40 time. It is inappropriate to use Internet-Drafts as reference 41 material or to cite them other than as "work in progress." 43 This Internet-Draft will expire on July 23, 2017. 45 Copyright Notice 47 Copyright (c) 2017 IETF Trust and the persons identified as the 48 document authors. All rights reserved. 50 This document is subject to BCP 78 and the IETF Trust's Legal 51 Provisions Relating to IETF Documents 52 (http://trustee.ietf.org/license-info) in effect on the date of 53 publication of this document. Please review these documents 54 carefully, as they describe your rights and restrictions with respect 55 to this document. Code Components extracted from this document must 56 include Simplified BSD License text as described in Section 4.e of 57 the Trust Legal Provisions and are provided without warranty as 58 described in the Simplified BSD License. 60 This document may contain material from IETF Documents or IETF 61 Contributions published or made publicly available before November 62 10, 2008. The person(s) controlling the copyright in some of this 63 material may not have granted the IETF Trust the right to allow 64 modifications of such material outside the IETF Standards Process. 65 Without obtaining an adequate license from the person(s) controlling 66 the copyright in such materials, this document may not be modified 67 outside the IETF Standards Process, and derivative works of it may 68 not be created outside the IETF Standards Process, except to format 69 it for publication as an RFC or to translate it into languages other 70 than English. 72 Table of Contents 74 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 75 1.1. Remote Procedure Calls On RDMA Transports . . . . . . . . 3 76 2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 4 77 2.1. Remote Procedure Calls . . . . . . . . . . . . . . . . . 4 78 2.2. Remote Direct Memory Access . . . . . . . . . . . . . . . 7 79 3. RPC-Over-RDMA Protocol Framework . . . . . . . . . . . . . . 9 80 3.1. Transfer Models . . . . . . . . . . . . . . . . . . . . . 9 81 3.2. Message Framing . . . . . . . . . . . . . . . . . . . . . 10 82 3.3. Managing Receiver Resources . . . . . . . . . . . . . . . 11 83 3.4. XDR Encoding With Chunks . . . . . . . . . . . . . . . . 13 84 3.5. Message Size . . . . . . . . . . . . . . . . . . . . . . 18 85 4. RPC-Over-RDMA In Operation . . . . . . . . . . . . . . . . . 22 86 4.1. XDR Protocol Definition . . . . . . . . . . . . . . . . . 22 87 4.2. Fixed Header Fields . . . . . . . . . . . . . . . . . . . 27 88 4.3. Chunk Lists . . . . . . . . . . . . . . . . . . . . . . . 29 89 4.4. Memory Registration . . . . . . . . . . . . . . . . . . . 32 90 4.5. Error Handling . . . . . . . . . . . . . . . . . . . . . 33 91 4.6. Protocol Elements No Longer Supported . . . . . . . . . . 36 92 4.7. XDR Examples . . . . . . . . . . . . . . . . . . . . . . 37 94 5. RPC Bind Parameters . . . . . . . . . . . . . . . . . . . . . 38 95 6. Upper Layer Binding Specifications . . . . . . . . . . . . . 40 96 6.1. DDP-Eligibility . . . . . . . . . . . . . . . . . . . . . 40 97 6.2. Maximum Reply Size . . . . . . . . . . . . . . . . . . . 41 98 6.3. Additional Considerations . . . . . . . . . . . . . . . . 42 99 6.4. Upper Layer Protocol Extensions . . . . . . . . . . . . . 42 100 7. Protocol Extensibility . . . . . . . . . . . . . . . . . . . 43 101 7.1. Conventional Extensions . . . . . . . . . . . . . . . . . 43 102 8. Security Considerations . . . . . . . . . . . . . . . . . . . 43 103 8.1. Memory Protection . . . . . . . . . . . . . . . . . . . . 43 104 8.2. RPC Message Security . . . . . . . . . . . . . . . . . . 44 105 9. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 47 106 10. References . . . . . . . . . . . . . . . . . . . . . . . . . 48 107 10.1. Normative References . . . . . . . . . . . . . . . . . . 48 108 10.2. Informative References . . . . . . . . . . . . . . . . . 49 109 Appendix A. Changes Since RFC 5666 . . . . . . . . . . . . . . . 51 110 A.1. Changes To The Specification . . . . . . . . . . . . . . 51 111 A.2. Changes To The Protocol . . . . . . . . . . . . . . . . . 51 112 Appendix B. Acknowledgments . . . . . . . . . . . . . . . . . . 52 113 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 53 115 1. Introduction 117 This document specifies the RPC-over-RDMA Version One protocol, based 118 on existing implementations of RFC 5666 and experience gained through 119 deployment. This document obsoletes RFC 5666. 121 The new specification clarifies text that is subject to multiple 122 interpretations, and removes support for unimplemented RPC-over-RDMA 123 Version One protocol elements. It clarifies the role of Upper Layer 124 Bindings and describes what they are to contain. 126 In addition, this document describes current practice using 127 RPCSEC_GSS [RFC7861] on RDMA transports. 129 The protocol version number has not been changed because the protocol 130 specified in this document fully interoperates with implementations 131 of the RPC-over-RDMA Version One protocol specified in [RFC5666]. 133 1.1. Remote Procedure Calls On RDMA Transports 135 Remote Direct Memory Access (RDMA) [RFC5040] [RFC5041] [IB] is a 136 technique for moving data efficiently between end nodes. By 137 directing data into destination buffers as it is sent on a network, 138 and placing it via direct memory access by hardware, the benefits of 139 faster transfers and reduced host overhead are obtained. 141 Open Network Computing Remote Procedure Call (ONC RPC, often 142 shortened in NFSv4 documents to RPC) [RFC5531] is a remote procedure 143 call protocol that runs over a variety of transports. Most RPC 144 implementations today use UDP [RFC0768] or TCP [RFC0793]. On UDP, 145 RPC messages are encapsulated inside datagrams, while on a TCP byte 146 stream, RPC messages are delineated by a record marking protocol. An 147 RDMA transport also conveys RPC messages in a specific fashion that 148 must be fully described if RPC implementations are to interoperate. 150 RDMA transports present semantics different from either UDP or TCP. 151 They retain message delineations like UDP, but provide reliable and 152 sequenced data transfer like TCP. They also provide an offloaded 153 bulk transfer service not provided by UDP or TCP. RDMA transports 154 are therefore appropriately viewed as a new transport type by RPC. 156 In this context, the Network File System (NFS) protocols as described 157 in [RFC1094], [RFC1813], [RFC7530], [RFC5661], and future NFSv4 minor 158 verions are all obvious beneficiaries of RDMA transports. A complete 159 problem statement is presented in [RFC5532]. Many other RPC-based 160 protocols can also benefit. 162 Although the RDMA transport described herein can provide relatively 163 transparent support for any RPC application, this document also 164 describes mechanisms that can optimize data transfer even further, 165 when RPC applications are willing to exploit awareness of RDMA as the 166 transport. 168 2. Terminology 170 2.1. Remote Procedure Calls 172 This section highlights key elements of the Remote Procedure Call 173 [RFC5531] and External Data Representation [RFC4506] protocols, upon 174 which RPC-over-RDMA Version One is constructed. Strong grounding 175 with these protocols is recommended before reading this document. 177 2.1.1. Upper Layer Protocols 179 Remote Procedure Calls are an abstraction used to implement the 180 operations of an "Upper Layer Protocol," or ULP. The term Upper 181 Layer Protocol refers to an RPC Program and Version tuple, which is a 182 versioned set of procedure calls that comprise a single well-defined 183 API. One example of an Upper Layer Protocol is the Network File 184 System Version 4.0 [RFC7530]. 186 In this document, the term "RPC consumer" refers to an implementation 187 of an Upper Layer Protocol running on a client. 189 2.1.2. Requesters And Responders 191 Like a local procedure call, every Remote Procedure Call (RPC) has a 192 set of "arguments" and a set of "results". A calling context is not 193 allowed to proceed until the procedure's results are available to it. 194 Unlike a local procedure call, the called procedure is executed 195 remotely rather than in the local application's context. 197 The RPC protocol as described in [RFC5531] is fundamentally a 198 message-passing protocol between one or more clients (where RPC 199 consumers are running) and a server (where a remote execution context 200 is available to process RPC transactions on behalf of those 201 consumers). 203 ONC RPC transactions are made up of two types of messages: 205 CALL Message 206 A CALL message, or "Call", requests that work be done. A Call is 207 designated by the value zero (0) in the message's msg_type field. 208 An arbitrary unique value is placed in the message's xid field in 209 order to match this CALL message to a corresponding REPLY message. 211 REPLY Message 212 A REPLY message, or "Reply", reports the results of work requested 213 by a Call. A Reply is designated by the value one (1) in the 214 message's msg_type field. The value contained in the message's 215 xid field is copied from the Call whose results are being 216 reported. 218 The RPC client endpoint acts as a "requester". It serializes an RPC 219 Call's arguments and conveys them to a server endpoint via an RPC 220 Call message. This message contains an RPC protocol header, a header 221 describing the requested upper layer operation, and all arguments. 223 The RPC server endpoint acts as a "responder". It deserializes Call 224 arguments, and processes the requested operation. It then serializes 225 the operation's results into another byte stream. This byte stream 226 is conveyed back to the requester via an RPC Reply message. This 227 message contains an RPC protocol header, a header describing the 228 upper layer reply, and all results. 230 The requester deserializes the results and allows the original caller 231 to proceed. At this point the RPC transaction designated by the xid 232 in the Call message is complete, and the xid is retired. 234 In summary, CALL messages are sent by requesters to responders to 235 initiate RPC transactions. REPLY messages are sent by responders to 236 requesters to complete the processing on an RPC transaction. 238 2.1.3. RPC Transports 240 The role of an "RPC transport" is to mediate the exchange of RPC 241 messages between requesters and responders. An RPC transport bridges 242 the gap between the RPC message abstraction and the native operations 243 of a particular network transport. 245 RPC-over-RDMA is a connection-oriented RPC transport. When a 246 connection-oriented transport is used, clients initiate transport 247 connections, while servers wait passively for incoming connection 248 requests. 250 2.1.4. External Data Representation 252 One cannot assume that all requesters and responders represent data 253 objects the same way internally. RPC uses eXternal Data 254 Representation, or XDR, to translate native data types and serialize 255 arguments and results [RFC4506]. 257 The XDR protocol encodes data independent of the endianness or size 258 of host-native data types, allowing unambiguous decoding of data on 259 the receiving end. RPC Programs are specified by writing an XDR 260 definition of their procedures, argument data types, and result data 261 types. 263 XDR assumes that the number of bits in a byte (octet) and their order 264 are the same on both endpoints and on the physical network. The 265 smallest indivisible unit of XDR encoding is a group of four octets 266 in little-endian order. XDR also flattens lists, arrays, and other 267 complex data types so they can be conveyed as a stream of bytes. 269 A serialized stream of bytes that is the result of XDR encoding is 270 referred to as an "XDR stream." A sending endpoint encodes native 271 data into an XDR stream and then transmits that stream to a receiver. 272 A receiving endpoint decodes incoming XDR byte streams into its 273 native data representation format. 275 2.1.4.1. XDR Opaque Data 277 Sometimes a data item must be transferred as-is, without encoding or 278 decoding. The contents of such a data item are referred to as 279 "opaque data." XDR encoding places the content of opaque data items 280 directly into an XDR stream without altering it in any way. Upper 281 Layer Protocols or applications perform any needed data translation 282 in this case. Examples of opaque data items include the content of 283 files, or generic byte strings. 285 2.1.4.2. XDR Round-up 287 The number of octets in a variable-length data item precedes that 288 item in an XDR stream. If the size of an encoded data item is not a 289 multiple of four octets, octets containing zero are added after the 290 end of the item as it is encoded so that the next encoded data item 291 in the XDR stream starts on a four-octet boundary. The encoded size 292 of the item is not changed by the addition of the extra octets. 293 These extra octets are never exposed to Upper Layer Protocols. 295 This technique is referred to as "XDR round-up," and the extra octets 296 are referred to as "XDR round-up padding". 298 2.2. Remote Direct Memory Access 300 RPC requesters and responders can be made more efficient if large RPC 301 messages are transferred by a third party such as intelligent network 302 interface hardware (data movement offload), and placed in the 303 receiver's memory so that no additional adjustment of data alignment 304 has to be made (direct data placement). Remote Direct Memory Access 305 (RDMA) transports enable both optimizations. 307 2.2.1. Direct Data Placement 309 Typically, RPC implementations copy the contents of RPC messages into 310 a buffer before being sent. An efficient RPC implementation sends 311 bulk data without copying it into a separate send buffer first. 313 However, socket-based RPC implementations are often unable to receive 314 data directly into its final place in memory. Receivers often need 315 to copy incoming data to finish an RPC operation; sometimes, only to 316 adjust data alignment. 318 In this document, "RDMA" refers to the physical mechanism an RDMA 319 transport utilizes when moving data. Although this may not be 320 efficient, before an RDMA transfer a sender may copy data into an 321 intermediate buffer before an RDMA transfer. After an RDMA transfer, 322 a receiver may copy that data again to its final destination. 324 This document uses the term "direct data placement" (or DDP) to refer 325 to any optimized data transfer where it is unnecessary for a 326 receiving host's CPU to copy transferred data to another location 327 after it has been received. 329 Just as [RFC5666] did, this document focuses on the use of RDMA Read 330 and Write operations to achieve both data movement offload and Direct 331 Data Placement. However, not all RDMA-based data transfer qualifies 332 as Direct Data Placement, and DDP can be achieved using non-RDMA 333 mechanisms. 335 2.2.2. RDMA Transport Requirements 337 To achieve good performance during receive operations, RDMA 338 transports require that RDMA consumers provision resources in advance 339 to receive incoming messages. 341 An RDMA consumer might provide receive buffers in advance by posting 342 an RDMA Receive Work Request for every expected RDMA Send from a 343 remote peer. These buffers are provided before the remote peer posts 344 RDMA Send Work Requests, thus this is often referred to as "pre- 345 posting" buffers. 347 An RDMA Receive Work Request remains outstanding until hardware 348 matches it to an in-bound Send operation. The resources associated 349 with that Receive must be retained in host memory, or "pinned," until 350 the Receive completes. 352 Given these basic tenets of RDMA transport operation, the RPC-over- 353 RDMA Version One protocol assumes each transport provides the 354 following abstract operations. A more complete discussion of these 355 operations is found in [RFC5040]. 357 Registered Memory 358 Registered memory is a region of memory that is assigned a 359 steering tag that temporarily permits access by the RDMA provider 360 to perform data transfer operations. The RPC-over-RDMA Version 361 One protocol assumes that each region of registered memory MUST be 362 identified with a steering tag of no more than 32 bits and memory 363 addresses of up to 64 bits in length. 365 RDMA Send 366 The RDMA provider supports an RDMA Send operation, with completion 367 signaled on the receiving peer after data has been placed in a 368 pre-posted buffer. Sends complete at the receiver in the order 369 they were issued at the sender. The amount of data transferred by 370 a single RDMA Send operation is limited by the size of the remote 371 peer's pre-posted buffers. 373 RDMA Receive 374 The RDMA provider supports an RDMA Receive operation to receive 375 data conveyed by incoming RDMA Send operations. To reduce the 376 amount of memory that must remain pinned awaiting incoming Sends, 377 the amount of pre-posted memory is limited. Flow-control to 378 prevent overrunning receiver resources is provided by the RDMA 379 consumer (in this case, the RPC-over-RDMA Version One protocol). 381 RDMA Write 382 The RDMA provider supports an RDMA Write operation to place data 383 directly into a remote memory region. The local host initiates an 384 RDMA Write, and completion is signaled there. No completion is 385 signaled on the remote peer. The local host provides a steering 386 tag, memory address, and length of the remote peer's memory 387 region. 389 RDMA Writes are not ordered with respect to one another, but are 390 ordered with respect to RDMA Sends. A subsequent RDMA Send 391 completion obtained at the write initiator guarantees that prior 392 RDMA Write data has been successfully placed in the remote peer's 393 memory. 395 RDMA Read 396 The RDMA provider supports an RDMA Read operation to place peer 397 source data directly into the read initiator's memory. The local 398 host initiates an RDMA Read, and completion is signaled there. No 399 completion is signaled on the remote peer. The local host 400 provides steering tags, memory addresses, and a length for the 401 remote source and local destination memory region. 403 The local host signals Read completion to the remote peer as part 404 of a subsequent RDMA Send message. The remote peer can then 405 release steering tags and subsequently free associated source 406 memory regions. 408 The RPC-over-RDMA Version One protocol is designed to be carried over 409 RDMA transports that support the above abstract operations. This 410 protocol conveys information sufficient for an RPC peer to direct an 411 RDMA provider to perform transfers containing RPC data and to 412 communicate their result(s). 414 3. RPC-Over-RDMA Protocol Framework 416 3.1. Transfer Models 418 A "transfer model" designates which endpoint exposes its memory, and 419 which is responsible for initiating transfer of data. To enable RDMA 420 Read and Write operations, for example, an endpoint first exposes 421 regions of its memory to a remote endpoint, which initiates these 422 operations against the exposed memory. 424 Read-Read 425 Requesters expose their memory to the responder, and the responder 426 exposes its memory to requesters. The responder reads, or pulls, 427 RPC arguments or whole RPC calls from each requester. Requesters 428 pull RPC results or whole RPC relies from the responder. 430 Write-Write 431 Requesters expose their memory to the responder, and the responder 432 exposes its memory to requesters. Requesters write, or push, RPC 433 arguments or whole RPC calls to the responder. The responder 434 pushes RPC results or whole RPC relies to each requester. 436 Read-Write 437 Requesters expose their memory to the responder, but the responder 438 does not expose its memory. The responder pulls RPC arguments or 439 whole RPC calls from each requester. The responder pushes RPC 440 results or whole RPC relies to each requester. 442 Write-Read 443 The responder exposes its memory to requesters, but requesters do 444 not expose their memory. Requesters push RPC arguments or whole 445 RPC calls to the responder. Requesters pull RPC results or whole 446 RPC relies from the responder. 448 [RFC5666] specifies the use of both the Read-Read and the Read-Write 449 Transfer Model. All current RPC-over-RDMA Version One 450 implementations use only the Read-Write Transfer Model. Therefore, 451 protocol elements that enable the Read-Read Transfer Model have been 452 removed from the RPC-over-RDMA Version One specification in this 453 document. Transfer Models other than the Read-Write model may be 454 used in future versions of RPC-over-RDMA. 456 3.2. Message Framing 458 On an RPC-over-RDMA transport, each RPC message is encapsulated by an 459 RPC-over-RDMA message. An RPC-over-RDMA message consists of two XDR 460 streams. 462 RPC Payload Stream 463 The "Payload stream" contains the encapsulated RPC message being 464 transferred by this RPC-over-RDMA message. This stream always 465 begins with the XID field of the encapsulated RPC message. 467 Transport Stream 468 The "Transport stream" contains a header that describes and 469 controls the transfer of the Payload stream in this RPC-over-RDMA 470 message. This header is analogous to the record marking used for 471 RPC over TCP but is more extensive, since RDMA transports support 472 several modes of data transfer. 474 In its simplest form, an RPC-over-RDMA message consists of a 475 Transport stream followed immediately by a Payload stream conveyed 476 together in a single RDMA Send. To transmit large RPC messages, a 477 combination of one RDMA Send operation and one or more other RDMA 478 operations is employed. 480 RPC-over-RDMA framing replaces all other RPC framing (such as TCP 481 record marking) when used atop an RPC-over-RDMA association, even 482 when the underlying RDMA protocol may itself be layered atop a 483 transport with a defined RPC framing (such as TCP). 485 It is however possible for RPC-over-RDMA to be dynamically enabled in 486 the course of negotiating the use of RDMA via an Upper Layer Protocol 487 exchange. Because RPC framing delimits an entire RPC request or 488 reply, the resulting shift in framing must occur between distinct RPC 489 messages, and in concert with the underlying transport. 491 3.3. Managing Receiver Resources 493 It is critical to provide RDMA Send flow control for an RDMA 494 connection. If any pre-posted receive buffer on the connection is 495 not large enough to accept an incoming RDMA Send, or if a pre-posted 496 receive buffer is not available to accept an incoming RDMA Send, the 497 RDMA connection can be terminated. This is different than 498 conventional TCP/IP networking, in which buffers are allocated 499 dynamically as messages are received. 501 The longevity of an RDMA connection mandates that sending endpoints 502 respect the resource limits of peer receivers. To ensure messages 503 can be sent and received reliably, there are two operational 504 parameters for each connection. 506 3.3.1. RPC-over-RDMA Credits 508 Flow control for RDMA Send operations directed to the responder is 509 implemented as a simple request/grant protocol in the RPC-over-RDMA 510 header associated with each RPC message. 512 An RPC-over-RDMA Version One credit is the capability to handle one 513 RPC-over-RDMA transaction. Each RPC-over-RDMA message sent from 514 requester to responder requests a number of credits from the 515 responder. Each RPC-over-RDMA message sent from responder to 516 requester informs the requester how many credits the responder has 517 granted. The requested and granted values are carried in each RPC- 518 over-RDMA message's rdma_credit field (see Section 4.2.3). 520 Practically speaking, the critical value is the granted value. A 521 requester MUST NOT send unacknowledged requests in excess of the 522 responder's granted credit limit. If the granted value is exceeded, 523 the RDMA layer may signal an error, possibly terminating the 524 connection. The granted value MUST NOT be zero, since such a value 525 would result in deadlock. 527 RPC calls complete in any order, but the current granted credit limit 528 at the responder is known to the requester from RDMA Send ordering 529 properties. The number of allowed new requests the requester may 530 send is then the lower of the current requested and granted credit 531 values, minus the number of requests in flight. Advertised credit 532 values are not altered when individual RPCs are started or completed. 534 The requested and granted credit values MAY be adjusted to match the 535 needs or policies in effect on either peer. For instance, a 536 responder may reduce the granted credit value to accommodate the 537 available resources in a Shared Receive Queue. The responder MUST 538 ensure that an increase in receive resources is effected before the 539 next reply message is sent. 541 A requester MUST maintain enough receive resources to accommodate 542 expected replies. Responders have to be prepared for there to be no 543 receive resources available on requesters with no pending RPC 544 transactions. 546 Certain RDMA implementations may impose additional flow control 547 restrictions, such as limits on RDMA Read operations in progress at 548 the responder. Accommodation of such restrictions is considered the 549 responsibility of each RPC-over-RDMA Version One implementation. 551 3.3.2. Inline Threshold 553 An "inline threshold" value is the largest message size (in octets) 554 that can be conveyed in one direction between peer implementations 555 using RDMA Send and Receive. The inline threshold value is the 556 minimum of how large a message the sender can post via an RDMA Send 557 operation, and how large a message the receiver can accept via an 558 RDMA Receive operation. Each connection has two inline threshold 559 values: one for messages flowing from requester-to-responder 560 (referred to as the "call inline threshold"), and one for messages 561 flowing from responder-to-requester (referred to as the "reply inline 562 threshold"). 564 Unlike credit limits, inline threshold values are not advertised to 565 peers via the RPC-over-RDMA Version One protocol, and there is no 566 provision for inline threshold values to change during the lifetime 567 of an RPC-over-RDMA Version One connection. 569 3.3.3. Initial Connection State 571 When a connection is first established, peers might not know how many 572 receive resources the other has, nor how large the other peer's 573 inline thresholds are. 575 As a basis for an initial exchange of RPC requests, each RPC-over- 576 RDMA Version One connection provides the ability to exchange at least 577 one RPC message at a time, whose Call and Reply messages are no more 578 1024 bytes in size. A responder MAY exceed this basic level of 579 configuration, but a requester MUST NOT assume more than one credit 580 is available, and MUST receive a valid reply from the responder 581 carrying the actual number of available credits, prior to sending its 582 next request. 584 Receiver implementations MUST support inline thresholds of 1024 585 bytes, but MAY support larger inline thresholds values. An 586 indepedent mechanism for discovering a peer's inline thresholds 587 before a connection is established may be used to optimize the use of 588 RDMA Send and Receive operations. In the absense of such a 589 mechanism, senders and receives MUST assume the inline thresholds are 590 1024 bytes. 592 3.4. XDR Encoding With Chunks 594 When a Direct Data Placement capability is available, the transport 595 places the contents of one or more XDR data items directly into the 596 receiver's memory, separately from the transfer of other parts of the 597 containing XDR stream. 599 3.4.1. Reducing An XDR Stream 601 RPC-over-RDMA Version One provides a mechanism for moving part of an 602 RPC message via a data transfer distinct from an RDMA Send/Receive 603 pair. The sender removes one or more XDR data items from the Payload 604 stream. They are conveyed via other mechanisms, such as one or more 605 RDMA Read or Write operations. As the receiver decodes an incoming 606 message, it skips over directly placed data items. 608 The portion of an XDR stream that is split out and moved separately 609 is referred to as a "chunk". In some contexts, data in an RPC-over- 610 RDMA header that describes these split out regions of memory may also 611 be referred to as a "chunk". 613 A Payload stream after chunks have been removed is referred to as a 614 "reduced" Payload stream. Likewise, a data item that has been 615 removed from a Payload stream to be transferred separately is 616 referred to as a "reduced" data item. 618 3.4.2. DDP-Eligibility 620 Not all XDR data items benefit from Direct Data Placement. For 621 example, small data items or data items that require XDR unmarshaling 622 by the receiver do not benefit from DDP. In addition, it is 623 impractical for receivers to prepare for every possible XDR data item 624 in a protocol to be transferred in a chunk. 626 To maintain interoperability on an RPC-over-RDMA transport, a 627 determination must be made of which few XDR data items in each Upper 628 Layer Protocol are allowed to use Direct Data Placement. 630 This is done by additional specifications that describe how Upper 631 Layer Protocols employ Direct Data Placement. An "Upper Layer 632 Binding specification," or ULB, identifies which specific individual 633 XDR data items in an Upper Layer Protocol MAY be transferred via 634 Direct Data Placement. Such data items are referred to as "DDP- 635 eligible." All other XDR data items MUST NOT be reduced. 637 Detailed requirements for Upper Layer Bindings are provided in 638 Section 6. 640 3.4.3. RDMA Segments 642 When encoding a Payload stream that contains a DDP-eligible data 643 item, a sender may choose to reduce that data item. When it chooses 644 to do so, the sender does not place the item into the Payload stream. 645 Instead, the sender records in the RPC-over-RDMA header the location 646 and size of the memory region containing that data item. 648 The requester provides location information for DDP-eligible data 649 items in both RPC Calls and Replies. The responder uses this 650 information to retrieve arguments contained in the specified region 651 of the requester's memory, or place results in that memory region. 653 An "RDMA segment," or "plain segment," is an RPC-over-RDMA Transport 654 header data object that contains the precise co-ordinates of a 655 contiguous memory region that is to be conveyed separately from the 656 Payload stream. Plain segments contain the following information: 658 Handle 659 Steering tag (STag) or R_key generated by registering this memory 660 with the RDMA provider. 662 Length 663 The length of the RDMA segment's memory region, in octets. An 664 "empty segment" is an RDMA segment with the value zero (0) in its 665 length field. 667 Offset 668 The offset or beginning memory address of the RDMA segment's 669 memory region. 671 See [RFC5040] for further discussion of the meaning and use of these 672 fields. 674 3.4.4. Chunks 676 In RPC-over-RDMA Version One, a "chunk" refers to a portion of the 677 Payload stream that is moved independently of the the RPC-over-RDMA 678 Transport header and Payload stream. Chunk data is removed from the 679 sender's Payload stream, transferred via separate operations, and 680 then re-inserted into the receiver's Payload stream to form a 681 complete RPC message. 683 Each chunk consists of one or more RDMA segments. Each RDMA segment 684 represents a single contiguous piece of that chunk. A requester MAY 685 divide a chunk into RDMA segments using any boundaries that are 686 convenient. The length of a chunk is the sum of the lengths of the 687 RDMA segments that comprise it. 689 3.4.4.1. Counted Arrays 691 If a chunk contains a counted array data type, the count of array 692 elements MUST remain in the Payload stream, while the array elements 693 MUST be moved to the chunk. For example, when encoding an opaque 694 byte array as a chunk, the count of bytes stays in the Payload 695 stream, while the bytes in the array are removed from the Payload 696 stream and transferred within the chunk. 698 Individual array elements appear in a chunk in their entirety. For 699 example, when encoding an array of arrays as a chunk, the count of 700 items in the enclosing array stays in the Payload stream, but each 701 enclosed array, including its item count, is transferred as part of 702 the chunk. 704 3.4.4.2. Optional-data 706 If a chunk contains an optional-data data type, the "is present" 707 field MUST remain in the Payload stream, while the data, if present, 708 MUST be moved to the chunk. 710 3.4.4.3. XDR Unions 712 A union data type should never be made DDP-eligible, but one or more 713 of its arms may be DDP-eligible. 715 3.4.4.4. Chunk Round-up 717 Except in special cases (covered in Section 3.5.3), a chunk MUST 718 contain exactly one XDR data item. This makes it straightforward to 719 reduce variable-length data items without affecting the XDR alignment 720 of data items in the Payload stream. 722 When a variable-length XDR data item is reduced, the sender MUST 723 remove XDR round-up padding for that data item from the Payload 724 stream, so that data items remaining in the Payload stream begin on 725 four-byte alignment. 727 3.4.5. Read Chunks 729 A "Read chunk" represents an XDR data item that is to be pulled from 730 the requester to the responder. 732 A Read chunk is a list of one or more RDMA read segments. An RDMA 733 read segment consists of a Position field followed by a plain 734 segment. See Section 4.1.2 for details. 736 Position 737 The byte offset in the unreduced Payload stream where the receiver 738 re-inserts the data item conveyed in a chunk. The Position value 739 MUST be computed from the beginning of the unreduced Payload 740 stream, which begins at Position zero. All RDMA read segments 741 belonging to the same Read chunk have the same value in their 742 Position field. 744 While constructing an RPC-over-RDMA Call message, a requester 745 registers memory regions that contain data to be transferred via RDMA 746 Read operations. It advertises the co-ordinates of these regions in 747 the RPC-over-RDMA Transport header of the RPC Call. 749 After receiving an RPC Call sent via an RDMA Send operation, a 750 responder transfers the chunk data from the requester using RDMA Read 751 operations. The responder reconstructs the transferred chunk data by 752 concatenating the contents of each RDMA segment, in list order, into 753 the received Payload stream at the Position value recorded in that 754 RDMA segment. 756 Put another way, the responder inserts the first RDMA segment in a 757 Read chunk into the Payload stream at the byte offset indicated by 758 its Position field. RDMA segments whose Position field value match 759 this offset are concatenated afterwards, until there are no more RDMA 760 segments at that Position value. 762 The Position field in a read segment indicates where the containing 763 Read chunk starts in the Payload stream. The value in this field 764 MUST be a multiple of four. All segments in the same Read chunk 765 share the same Position value, even if one or more of the RDMA 766 segments have a non-four-byte aligned length. 768 3.4.5.1. Decoding Read Chunks 770 While decoding a received Payload stream, whenever the XDR offset in 771 the Payload stream matches that of a Read chunk, the responder 772 initiates an RDMA Read to pull the chunk's data content into 773 registered local memory. 775 The responder acknowledges its completion of use of Read chunk source 776 buffers when it sends an RPC Reply to the requester. The requester 777 may then release Read chunks advertised in the request. 779 3.4.5.2. Read Chunk Round-up 781 When reducing a variable-length argument data item, the requester 782 SHOULD NOT include the data item's XDR round-up padding in the chunk. 783 The length of a Read chunk is determined as follows: 785 o If the requester chooses to include round-up padding in a Read 786 chunk, the chunk's total length MUST be the sum of the encoded 787 length of the data item and the length of the round-up padding. 788 The length of the data item that was encoded into the Payload 789 stream remains unchanged. 791 The sender can increase the length of the chunk by adding another 792 RDMA segment containing only the round-up padding, or it can do so 793 by extending the final RDMA segment in the chunk. 795 o If the sender chooses not to include round-up padding in the 796 chunk, the chunk's total length MUST be the same as the encoded 797 length of the data item. 799 3.4.6. Write Chunks 801 While constructing an RPC Call message, a requester prepares memory 802 regions in which to receive DDP-eligible result data items. A "Write 803 chunk" represents an XDR data item that is to be pushed from a 804 responder to a requester. It is made up of an array of one or more 805 plain segments. 807 Write chunks are provisioned by a requester long before the responder 808 has prepared the reply Payload stream. A requester often does not 809 know the actual length of the result data items to be returned, since 810 the result does not yet exist. Thus it MUST register Write chunks 811 long enough to accommodate the maximum possible size of each returned 812 data item. 814 In addition, the XDR position of DDP-eligible data items in the 815 reply's Payload stream is not predictable when a requester constructs 816 a Call message. Therefore RDMA segments in a Write chunk do not have 817 a Position field. 819 For each Write chunk provided by a requester, the responder pushes 820 data to the requester, contiguously and in segment array order, until 821 the result data item has been completely written to the requester. 822 The responder MUST copy the segment count and all segments from the 823 requester-provided Write chunk into the Reply's Transport header. As 824 it does so, the responder updates each segment length field to 825 reflect the actual amount of data that is being returned in that 826 segment. The responder then sends the RPC Reply via an RDMA Send 827 operation. 829 An "empty Write chunk" is a Write chunk with a zero segment count. 830 By definition, the length of an empty Write chunk is zero. An 831 "unused Write chunk" has a non-zero segment count, but all of its 832 segments are empty segments. 834 3.4.6.1. Decoding Write Chunks 836 After receiving the RPC Reply, the requester reconstructs the 837 transferred data by concatenating the contents of each segment, in 838 array order, into RPC Reply XDR stream at the known XDR position of 839 the associated DDP-eligible result data item. 841 3.4.6.2. Write Chunk Round-up 843 When provisioning a Write chunk for a variable-length result data 844 item, the requester SHOULD NOT include additional space for XDR 845 round-up padding. A responder MUST NOT write XDR round-up padding 846 into a Write chunk, even if the requester made space available for 847 it. Therefore, when returning a single variable-length result data 848 item, a returned Write chunk's total length MUST be the same as the 849 encoded length of the result data item. 851 3.5. Message Size 853 A receiver of RDMA Send operations is required by RDMA to have 854 previously posted one or more adequately sized buffers. Memory 855 savings are achieved on both requesters and responders by posting 856 small Receive buffers. However, not all RPC messages are small. 858 3.5.1. Short Messages 860 RPC messages are frequently smaller than typical inline thresholds. 861 For example, the NFS version 3 GETATTR operation is only 56 bytes: 20 862 bytes of RPC header, plus a 32-byte file handle argument and 4 bytes 863 for its length. The reply to this common request is about 100 bytes. 865 Since all RPC messages conveyed via RPC-over-RDMA require an RDMA 866 Send operation, the most efficient way to send an RPC message that is 867 smaller than the inline threshold is to append the Payload stream 868 directly to the Transport stream. An RPC-over-RDMA header with a 869 small RPC Call or Reply message immediately following is transferred 870 using a single RDMA Send operation. No other operations are needed. 872 An RPC-over-RDMA transaction using Short Messages: 874 Requester Responder 875 | RDMA Send (RDMA_MSG) | 876 Call | ------------------------------> | 877 | | 878 | | Processing 879 | | 880 | RDMA Send (RDMA_MSG) | 881 | <------------------------------ | Reply 883 3.5.2. Chunked Messages 885 If DDP-eligible data items are present in a Payload stream, a sender 886 MAY reduce some or all of these items by removing them from the 887 Payload stream. The sender uses a separate mechanism to transfer the 888 reduced data items. The Transport stream with the reduced Payload 889 stream immediately following is then transferred using a single RDMA 890 Send operation 892 After receiving the Transport and Payload streams of a Chunked RPC- 893 over-RDMA Call message, the responder uses RDMA Read operations to 894 move reduced data items in Read chunks. Before sending the Transport 895 and Payload streams of a Chunked RPC-over-RDMA Reply message, the 896 responder uses RDMA Write operations to move reduced data items in 897 Write and Reply chunks. 899 An RPC-over-RDMA transaction with a Read chunk: 901 Requester Responder 902 | RDMA Send (RDMA_MSG) | 903 Call | ------------------------------> | 904 | RDMA Read | 905 | <------------------------------ | 906 | RDMA Response (arg data) | 907 | ------------------------------> | 908 | | 909 | | Processing 910 | | 911 | RDMA Send (RDMA_MSG) | 912 | <------------------------------ | Reply 914 An RPC-over-RDMA transaction with a Write chunk: 916 Requester Responder 917 | RDMA Send (RDMA_MSG) | 918 Call | ------------------------------> | 919 | | 920 | | Processing 921 | | 922 | RDMA Write (result data) | 923 | <------------------------------ | 924 | RDMA Send (RDMA_MSG) | 925 | <------------------------------ | Reply 927 3.5.3. Long Messages 929 When a Payload stream is larger than the receiver's inline threshold, 930 the Payload stream is reduced by removing DDP-eligible data items and 931 placing them in chunks to be moved separately. If there are no DDP- 932 eligible data items in the Payload stream, or the Payload stream is 933 still too large after it has been reduced, the RDMA transport MUST 934 use RDMA Read or Write operations to convey the Payload stream 935 itself. This mechanism is referred to as a "Long Message." 937 To transmit a Long Message, the sender conveys only the Transport 938 stream with an RDMA Send operation. The Payload stream is not 939 included in the Send buffer in this instance. Instead, the requester 940 provides chunks that the responder uses to move the Payload stream. 942 Long RPC Call 943 To send a Long RPC-over-RDMA Call message, the requester provides 944 a special Read chunk that contains the RPC Call's Payload stream. 945 Every RDMA segment in this Read chunk MUST contain zero in its 946 Position field. Thus this chunk is known as a "Position Zero Read 947 chunk." 949 Long RPC Reply 950 To send a Long RPC-over-RDMA Reply message, the requester provides 951 a single special Write chunk in advance, known as the "Reply 952 chunk", that will contain the RPC Reply's Payload stream. The 953 requester sizes the Reply chunk to accommodate the maximum 954 expected reply size for that Upper Layer operation. 956 Though the purpose of a Long Message is to handle large RPC messages, 957 requesters MAY use a Long Message at any time to convey an RPC Call. 959 A responder chooses which form of reply to use based on the chunks 960 provided by the requester. If Write chunks were provided and the 961 responder has a DDP-eligible result, it first reduces the reply 962 Payload stream. If a Reply chunk was provided and the reduced 963 Payload stream is larger than the reply inline threshold, the 964 responder MUST use the requester-provided Reply chunk for the reply. 966 XDR data items may appear in these special chunks without regard to 967 their DDP-eligibility. As these chunks contain a Payload stream, 968 such chunks MUST include appropriate XDR round-up padding to maintain 969 proper XDR alignment of their contents. 971 An RPC-over-RDMA transaction using a Long Call: 973 Requester Responder 974 | RDMA Send (RDMA_NOMSG) | 975 Call | ------------------------------> | 976 | RDMA Read | 977 | <------------------------------ | 978 | RDMA Response (RPC call) | 979 | ------------------------------> | 980 | | 981 | | Processing 982 | | 983 | RDMA Send (RDMA_MSG) | 984 | <------------------------------ | Reply 986 An RPC-over-RDMA transaction using a Long Reply: 988 Requester Responder 989 | RDMA Send (RDMA_MSG) | 990 Call | ------------------------------> | 991 | | 992 | | Processing 993 | | 994 | RDMA Write (RPC reply) | 995 | <------------------------------ | 996 | RDMA Send (RDMA_NOMSG) | 997 | <------------------------------ | Reply 999 4. RPC-Over-RDMA In Operation 1001 Every RPC-over-RDMA Version One message has a header that includes a 1002 copy of the message's transaction ID, data for managing RDMA flow 1003 control credits, and lists of RDMA segments describing chunks. All 1004 RPC-over-RDMA header content is contained in the Transport stream, 1005 and thus MUST be XDR encoded. 1007 RPC message layout is unchanged from that described in [RFC5531] 1008 except for the possible reduction of data items that are moved by 1009 separate operations. 1011 The RPC-over-RDMA protocol passes RPC messages without regard to 1012 their type (CALL or REPLY). Apart from restrictions imposed by 1013 upper-layer bindings, each endpoint of a connection MAY send RDMA_MSG 1014 or RDMA_NOMSG message header types at any time (subject to credit 1015 limits). 1017 4.1. XDR Protocol Definition 1019 This section contains a description of the core features of the RPC- 1020 over-RDMA Version One protocol, expressed in the XDR language 1021 [RFC4506]. 1023 This description is provided in a way that makes it simple to extract 1024 into ready-to-compile form. The reader can apply the following shell 1025 script to this document to produce a machine-readable XDR description 1026 of the RPC-over-RDMA Version One protocol. 1028 1030 #!/bin/sh 1031 grep '^ *///' | sed 's?^ /// ??' | sed 's?^ *///$??' 1033 1035 That is, if the above script is stored in a file called "extract.sh" 1036 and this document is in a file called "spec.txt" then the reader can 1037 do the following to extract an XDR description file: 1039 1041 sh extract.sh < spec.txt > rpcrdma_corev1.x 1043 1045 4.1.1. Code Component License 1047 Code components extracted from this document must include the 1048 following license text. When the extracted XDR code is combined with 1049 other complementary XDR code which itself has an identical license, 1050 only a single copy of the license text need be preserved. 1052 1054 /// /* 1055 /// * Copyright (c) 2010, 2016 IETF Trust and the persons 1056 /// * identified as authors of the code. All rights reserved. 1057 /// * 1058 /// * The authors of the code are: 1059 /// * B. Callaghan, T. Talpey, and C. Lever 1060 /// * 1061 /// * Redistribution and use in source and binary forms, with 1062 /// * or without modification, are permitted provided that the 1063 /// * following conditions are met: 1064 /// * 1065 /// * - Redistributions of source code must retain the above 1066 /// * copyright notice, this list of conditions and the 1067 /// * following disclaimer. 1068 /// * 1069 /// * - Redistributions in binary form must reproduce the above 1070 /// * copyright notice, this list of conditions and the 1071 /// * following disclaimer in the documentation and/or other 1072 /// * materials provided with the distribution. 1073 /// * 1074 /// * - Neither the name of Internet Society, IETF or IETF 1075 /// * Trust, nor the names of specific contributors, may be 1076 /// * used to endorse or promote products derived from this 1077 /// * software without specific prior written permission. 1078 /// * 1079 /// * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 1080 /// * AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED 1081 /// * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 1082 /// * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 1083 /// * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO 1084 /// * EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 1085 /// * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 1086 /// * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 1087 /// * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 1088 /// * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 1089 /// * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 1090 /// * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 1091 /// * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 1092 /// * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 1093 /// * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 1094 /// */ 1095 /// 1097 1099 4.1.2. RPC-Over-RDMA Version One XDR 1101 XDR data items defined in this section encodes the Transport Header 1102 Stream in each RPC-over-RDMA Version One message. Comments identify 1103 items that cannot be changed in subsequent versions. 1105 1107 /// /* 1108 /// * Plain RDMA segment (Section 3.4.3) 1109 /// */ 1110 /// struct xdr_rdma_segment { 1111 /// uint32 handle; /* Registered memory handle */ 1112 /// uint32 length; /* Length of the chunk in bytes */ 1113 /// uint64 offset; /* Chunk virtual address or offset */ 1114 /// }; 1115 /// 1116 /// /* 1117 /// * RDMA read segment (Section 3.4.5) 1118 /// */ 1119 /// struct xdr_read_chunk { 1120 /// uint32 position; /* Position in XDR stream */ 1121 /// struct xdr_rdma_segment target; 1122 /// }; 1123 /// 1124 /// /* 1125 /// * Read list (Section 4.3.1) 1126 /// */ 1127 /// struct xdr_read_list { 1128 /// struct xdr_read_chunk entry; 1129 /// struct xdr_read_list *next; 1130 /// }; 1131 /// 1132 /// /* 1133 /// * Write chunk (Section 3.4.6) 1134 /// */ 1135 /// struct xdr_write_chunk { 1136 /// struct xdr_rdma_segment target<>; 1137 /// }; 1138 /// 1139 /// /* 1140 /// * Write list (Section 4.3.2) 1141 /// */ 1142 /// struct xdr_write_list { 1143 /// struct xdr_write_chunk entry; 1144 /// struct xdr_write_list *next; 1145 /// }; 1146 /// 1147 /// /* 1148 /// * Chunk lists (Section 4.3) 1149 /// */ 1150 /// struct rpc_rdma_header { 1151 /// struct xdr_read_list *rdma_reads; 1152 /// struct xdr_write_list *rdma_writes; 1153 /// struct xdr_write_chunk *rdma_reply; 1154 /// /* rpc body follows */ 1155 /// }; 1156 /// 1157 /// struct rpc_rdma_header_nomsg { 1158 /// struct xdr_read_list *rdma_reads; 1159 /// struct xdr_write_list *rdma_writes; 1160 /// struct xdr_write_chunk *rdma_reply; 1161 /// }; 1162 /// 1163 /// /* Not to be used */ 1164 /// struct rpc_rdma_header_padded { 1165 /// uint32 rdma_align; 1166 /// uint32 rdma_thresh; 1167 /// struct xdr_read_list *rdma_reads; 1168 /// struct xdr_write_list *rdma_writes; 1169 /// struct xdr_write_chunk *rdma_reply; 1170 /// /* rpc body follows */ 1171 /// }; 1172 /// 1173 /// /* 1174 /// * Error handling (Section 4.5) 1175 /// */ 1176 /// enum rpc_rdma_errcode { 1177 /// ERR_VERS = 1, /* Value fixed for all versions */ 1178 /// ERR_CHUNK = 2 1179 /// }; 1180 /// 1181 /// /* Structure fixed for all versions */ 1182 /// struct rpc_rdma_errvers { 1183 /// uint32 rdma_vers_low; 1184 /// uint32 rdma_vers_high; 1185 /// }; 1186 /// 1187 /// union rpc_rdma_error switch (rpc_rdma_errcode err) { 1188 /// case ERR_VERS: 1189 /// rpc_rdma_errvers range; 1190 /// case ERR_CHUNK: 1191 /// void; 1192 /// }; 1193 /// 1194 /// /* 1195 /// * Procedures (Section 4.2.4) 1196 /// */ 1197 /// enum rdma_proc { 1198 /// RDMA_MSG = 0, /* Value fixed for all versions */ 1199 /// RDMA_NOMSG = 1, /* Value fixed for all versions */ 1200 /// RDMA_MSGP = 2, /* Not to be used */ 1201 /// RDMA_DONE = 3, /* Not to be used */ 1202 /// RDMA_ERROR = 4 /* Value fixed for all versions */ 1203 /// }; 1204 /// 1205 /// /* The position of the proc discriminator field is 1206 /// * fixed for all versions */ 1207 /// union rdma_body switch (rdma_proc proc) { 1208 /// case RDMA_MSG: 1209 /// rpc_rdma_header rdma_msg; 1210 /// case RDMA_NOMSG: 1211 /// rpc_rdma_header_nomsg rdma_nomsg; 1212 /// case RDMA_MSGP: /* Not to be used */ 1213 /// rpc_rdma_header_padded rdma_msgp; 1214 /// case RDMA_DONE: /* Not to be used */ 1215 /// void; 1216 /// case RDMA_ERROR: 1217 /// rpc_rdma_error rdma_error; 1218 /// }; 1219 /// 1220 /// /* 1221 /// * Fixed header fields (Section 4.2) 1222 /// */ 1223 /// struct rdma_msg { 1224 /// uint32 rdma_xid; /* Position fixed for all versions */ 1225 /// uint32 rdma_vers; /* Position fixed for all versions */ 1226 /// uint32 rdma_credit; /* Position fixed for all versions */ 1227 /// rdma_body rdma_body; 1228 /// }; 1230 1232 4.2. Fixed Header Fields 1234 The RPC-over-RDMA header begins with four fixed 32-bit fields that 1235 control the RDMA interaction. 1237 The first three words are individual fields in the rdma_msg 1238 structure. The fourth word is the first word of the rdma_body union 1239 which acts as the discriminator for the switched union. The contents 1240 of this field are described in Section 4.2.4. 1242 These four fields must remain with the same meanings and in the same 1243 positions in all subsequent versions of the RPC-over-RDMA protocol. 1245 4.2.1. Transaction ID (XID) 1247 The XID generated for the RPC Call and Reply. Having the XID at a 1248 fixed location in the header makes it easy for the receiver to 1249 establish context as soon as each RPC-over-RDMA message arrives. 1250 This XID MUST be the same as the XID in the RPC message. The 1251 receiver MAY perform its processing based solely on the XID in the 1252 RPC-over-RDMA header, and thereby ignore the XID in the RPC message, 1253 if it so chooses. 1255 4.2.2. Version Number 1257 For RPC-over-RDMA Version One, this field MUST contain the value one 1258 (1). Rules regarding changes to this transport protocol version 1259 number can be found in Section 7. 1261 4.2.3. Credit Value 1263 When sent with an RPC Call message, the requested credit value is 1264 provided. When sent with an RPC Reply message, the granted credit 1265 value is returned. Further discussion of how the credit value is 1266 determined can be found in Section 3.3. 1268 4.2.4. Procedure Number 1270 o RDMA_MSG = 0 indicates that chunk lists and a Payload stream 1271 follow. The format of the chunk lists is discussed below. 1273 o RDMA_NOMSG = 1 indicates that after the chunk lists there is no 1274 Payload stream. In this case, the chunk lists provide information 1275 to allow the responder to transfer the Payload stream using 1276 explicit RDMA operations. 1278 o RDMA_MSGP = 2 is reserved. 1280 o RDMA_DONE = 3 is reserved. 1282 o RDMA_ERROR = 4 is used to signal an encoding error in the RPC- 1283 over-RDMA header. 1285 An RDMA_MSG procedure conveys the Transport stream and the Payload 1286 stream via an RDMA Send operation. The Transport stream contains the 1287 four fixed fields, followed by the Read and Write lists and the Reply 1288 chunk, though any or all three MAY be marked as not present. The 1289 Payload stream then follows, beginning with its XID field. If a Read 1290 or Write chunk list is present, a portion of the Payload stream has 1291 been excised and is conveyed via separate operations. 1293 An RDMA_NOMSG procedure conveys the Transport stream via an RDMA Send 1294 operation. The Transport stream contains the four fixed fields, 1295 followed by the Read and Write chunk lists and the Reply chunk. 1296 Though any of these MAY be marked as not present, one MUST be present 1297 and MUST hold the Payload stream for this RPC-over-RDMA message. If 1298 a Read or Write chunk list is present, a portion of the Payload 1299 stream has been excised and is conveyed via separate operations. 1301 An RDMA_ERROR procedure conveys the Transport stream via an RDMA Send 1302 operation. The Transport stream contains the four fixed fields, 1303 followed by formatted error information. No Payload stream is 1304 conveyed in this type of RPC-over-RDMA message. 1306 A requester MUST NOT send an RPC-over-RDMA header with the RDMA_ERROR 1307 procedure. A responder MUST silently discard RDMA_ERROR procedures. 1309 A gather operation on each RDMA Send operation can be used to combine 1310 the Transport and Payload streams, which might have been constructed 1311 in separate buffers. However, the total length of the gathered send 1312 buffers MUST NOT exceed the inline threshold. 1314 4.3. Chunk Lists 1316 The chunk lists in an RPC-over-RDMA Version One header are three XDR 1317 optional-data fields that follow the fixed header fields in RDMA_MSG 1318 and RDMA_NOMSG procedures. Read Section 4.19 of [RFC4506] carefully 1319 to understand how optional-data fields work. Examples of XDR encoded 1320 chunk lists are provided in Section 4.7 as an aid to understanding. 1322 Often, an RPC-over-RDMA message has no associated chunks. In this 1323 case, all three chunk lists are marked empty (not present). 1325 4.3.1. Read List 1327 Each RDMA_MSG or RDMA_NOMSG procedure has one "Read list." The Read 1328 list is a list of zero or more RDMA Read segments, provided by the 1329 requester, that are grouped by their Position fields into Read 1330 chunks. Each Read chunk advertises the location of argument data the 1331 responder is to pull from the requester. The requester has removed 1332 the data items in these chunks from the call's Payload stream. 1334 A requester may transmit the Payload stream of an RPC Call message 1335 using a Position Zero Read chunk. If the RPC Call has no argument 1336 data that is DDP-eligible and the Position Zero Read chunk is not 1337 being used, the requester leaves the Read list empty. 1339 Responders MUST leave the Read list empty in all replies. 1341 4.3.1.1. Matching Read Chunks to Arguments 1343 When reducing a DDP-eligible argument data item, a requester records 1344 the XDR stream offset of that data item in the Read chunk's Position 1345 field. The responder can then tell unambiguously where that chunk is 1346 to be re-inserted into the received Payload stream to form a complete 1347 RPC Call. 1349 4.3.2. Write List 1351 Each RDMA_MSG or RDMA_NOMSG procedure has one "Write list." The 1352 Write list is a list of zero or more Write chunks, provided by the 1353 requester. Each Write chunk is an array of plain segments, thus the 1354 Write list is a list of counted arrays. 1356 If an RPC Reply has no possible DDP-eligible result data items, the 1357 requester leaves the Write list empty. When a requester provides a 1358 Write list, the responder MUST push data corresponding to DDP- 1359 eligible result data items to requester memory referenced in the 1360 Write list. The responder removes these data items from the reply's 1361 Payload stream. 1363 4.3.2.1. Matching Write Chunks To Results 1365 A requester constructs the Write list for an RPC transaction before 1366 the responder has formulated its reply. When there is only one DDP- 1367 eligible result data item, the requester inserts only a single Write 1368 chunk in the Write list. If the returned Write chunk is not an 1369 unused Write chunk, the requester knows with certainty which result 1370 data item is contained in it. 1372 When a requester has provided multiple Write chunks, the responder 1373 fills in each Write chunk with one DDP-eligible result until either 1374 there are no more DDP-eligible results, or no more Write chunks. 1376 The requester might not be able to predict in advance which DDP- 1377 eligible data item goes in which chunk. Thus the requester is 1378 responsible for allocating and registering Write chunks large enough 1379 to accommodate the largest result data item that might be associated 1380 with each chunk in the Write list. 1382 As a requester decodes a reply Payload stream, it is clear from the 1383 contents of the Reply which Write chunk contains which result data 1384 item. 1386 4.3.2.2. Unused Write Chunks 1388 There are occasions when a requester provides a non-empty Write chunk 1389 but the responder is not able to use it. For example, an Upper Layer 1390 Protocol may define a union result where some arms of the union 1391 contain a DDP-eligible data item while other arms do not. The 1392 responder is required to use requester-provided Write chunks in this 1393 case, but if the responder returns a result that uses an arm of the 1394 union that has no DDP-eligible data item, that Write chunk remains 1395 unconsumed. 1397 If there is a subsequent DDP-eligible result data item in the Reply, 1398 it MUST be placed in that unconsumed Write chunk. Therefore the 1399 requester MUST provision each Write chunk so it can be filled with 1400 the largest DDP-eligible data item that can be placed in it. 1402 If this is the last or only Write chunk available and it remains 1403 unconsumed, the responder MUST return this Write chunk as an unused 1404 Write chunk (see Section 3.4.6). The responder sets the segment 1405 count to a value matching the requester-provided Write chunk, but 1406 returns only empty segments in that Write chunk. 1408 Unused Write chunks, or unused bytes in Write chunk segments, are 1409 returned to the RPC consumer as part of RPC completion. Even if a 1410 responder indicates that a Write chunk is not consumed, the responder 1411 may have written data into one or more segments before choosing not 1412 to return that data item. The requester MUST NOT assume that the 1413 memory regions backing a Write chunk have not been modified. 1415 4.3.2.3. Empty Write Chunks 1417 To force a responder to return a DDP-eligible result inline, a 1418 requester employs the following mechanism: 1420 o When there is only one DDP-eligible result item in a Reply, the 1421 requester provides an empty Write list. 1423 o When there are multiple DDP-eligible result data items and a 1424 requester prefers that a data item is returned inline, the 1425 requester provides an empty Write chunk for that item (see xref 1426 target="sec:write-chunks" />). The responder MUST return the 1427 corresponding result data item inline, and must return an empty 1428 Write chunk in that Write list position in the Reply. 1430 As always, a requester and responder must prepare for a Long Reply to 1431 be used if the resulting RPC Reply might be too large to be conveyed 1432 in an RDMA Send. 1434 4.3.3. Reply Chunk 1436 Each RDMA_MSG or RDMA_NOMSG procedure has one "Reply chunk." The 1437 Reply chunk is a Write chunk, provided by the requester. The Reply 1438 chunk is a single counted array of plain segments. 1440 A requester MUST provide a Reply chunk whenever the maximum possible 1441 size of the reply message is larger than the inline threshold for 1442 messages from responder to requester. The Reply chunk MUST be large 1443 enough to contain a Payload stream (RPC message) of this maximum 1444 size. If the Transport stream and reply Payload stream together are 1445 smaller than the reply inline threshold, the responder MAY return it 1446 as a Short message rather than using the requester-provided Reply 1447 chunk. 1449 When a requester has provided a Reply chunk in a Call message, the 1450 responder MUST copy that chunk into the associated Reply. The copied 1451 Reply chunk in the Reply is modified to reflect the actual amount of 1452 data that is being returned in the Reply chunk. 1454 4.4. Memory Registration 1456 RDMA requires that data is transferred between only registered memory 1457 regions at the source and destination. All protocol headers as well 1458 as separately transferred data chunks must reside in registered 1459 memory. 1461 Since the cost of registering and de-registering memory can be a 1462 significant proportion of the cost of an RPC-over-RDMA transaction, 1463 it is important to minimize registration activity. For memory that 1464 is targeted by RDMA Send and Receive operations, a local-only 1465 registration is sufficient and can be left in place during the life 1466 of a connection without any risk of data exposure. 1468 4.4.1. Registration Longevity 1470 Data transferred via RDMA Read and Write can reside in a memory 1471 allocation not in the control of the RPC-over-RDMA transport. These 1472 memory allocations can persist outside the bounds of an RPC 1473 transaction. They are registered and invalidated as needed, as part 1474 of each RPC transaction. 1476 The requester endpoint must ensure that memory regions associated 1477 with each RPC transaction are properly fenced from responders before 1478 allowing Upper Layer access to the data contained in them. Moreover, 1479 the requester must not access these memory regions while the 1480 responder has access to them. 1482 This includes memory regions that are associated with canceled RPCs. 1483 A responder cannot know that the requester is no longer waiting for a 1484 reply, and might proceed to read or even update memory that the 1485 requester might have released for other use. 1487 4.4.2. Communicating DDP-Eligibility 1489 The interface by which an Upper Layer Protocol implementation 1490 communicates the eligibility of a data item locally to its local RPC- 1491 over-RDMA endpoint is not described by this specification. 1493 Depending on the implementation and constraints imposed by Upper 1494 Layer Bindings, it is possible to implement reduction transparently 1495 to upper layers. Such implementations may lead to inefficiencies, 1496 either because they require the RPC layer to perform expensive 1497 registration and de-registration of memory "on the fly", or they may 1498 require using RDMA chunks in reply messages, along with the resulting 1499 additional handshaking with the RPC-over-RDMA peer. 1501 However, these issues are internal and generally confined to the 1502 local interface between RPC and its upper layers, one in which 1503 implementations are free to innovate. The only requirement, beyond 1504 constraints imposed by the Upper Layer Binding, is that the resulting 1505 RPC-over-RDMA protocol sent to the peer is valid for the upper layer. 1507 4.4.3. Registration Strategies 1509 The choice of which memory registration strategies to employ is left 1510 to requester and responder implementers. To support the widest array 1511 of RDMA implementations, as well as the most general steering tag 1512 scheme, an Offset field is included in each RDMA segment. 1514 While zero-based offset schemes are available in many RDMA 1515 implementations, their use by RPC requires individual registration of 1516 each memory region. For such implementations, this can be a 1517 significant overhead. By providing an offset in each chunk, many 1518 pre-registration or region-based registrations can be readily 1519 supported. 1521 4.5. Error Handling 1523 A receiver performs basic validity checks on the RPC-over-RDMA header 1524 and chunk contents before it passes the RPC message to the RPC layer. 1525 If an incoming RPC-over-RDMA message is not as long as a minimal size 1526 RPC-over-RDMA header (28 bytes), the receiver cannot trust the value 1527 of the XID field, and therefore MUST silently discard the message 1528 before performing any parsing. If other errors are detected in the 1529 RPC-over-RDMA header of a Call message, a responder MUST send an 1530 RDMA_ERROR message back to the requester. If errors are detected in 1531 the RPC-over-RDMA header of a Reply message, a requester MUST 1532 silently discard the message. 1534 To form an RDMA_ERROR procedure: The rdma_xid field MUST contain the 1535 same XID that was in the rdma_xid field in the failing request; The 1536 rdma_vers field MUST contain the same version that was in the 1537 rdma_vers field in the failing request; The rdma_proc field MUST 1538 contain the value RDMA_ERROR; The rdma_err field contains a value 1539 that reflects the type of error that occurred, as described below. 1541 An RDMA_ERROR procedure indicates a permanent error. Receipt of this 1542 procedure completes the RPC transaction associated with XID in the 1543 rdma_xid field. A receiver MUST silently discard an RDMA_ERROR 1544 procedure that it cannot decode. 1546 4.5.1. Header Version Mismatch 1548 When a responder detects an RPC-over-RDMA header version that it does 1549 not support (currently this document defines only Version One), it 1550 MUST reply with an RDMA_ERROR procedure and set the rdma_err value to 1551 ERR_VERS, also providing the low and high inclusive version numbers 1552 it does, in fact, support. 1554 4.5.2. XDR Errors 1556 A receiver might encounter an XDR parsing error that prevents it from 1557 processing the incoming Transport stream. Examples of such errors 1558 include an invalid value in the rdma_proc field, an RDMA_NOMSG 1559 message that has no chunk lists, or the contents of the rdma_xid 1560 field might not match the contents of the XID field in the 1561 accompanying RPC message. If the rdma_vers field contains a 1562 recognized value, but an XDR parsing error occurs, the responder MUST 1563 reply with an RDMA_ERROR procedure and set the rdma_err value to 1564 ERR_CHUNK. 1566 When a responder receives a valid RPC-over-RDMA header but the 1567 responder's Upper Layer Protocol implementation cannot parse the RPC 1568 arguments in the RPC Call message, the responder SHOULD return an RPC 1569 Reply with status GARBAGE_ARGS, using an RDMA_MSG procedure. This 1570 type of parsing failure might be due to mismatches between chunk 1571 sizes or offsets and the contents of the Payload stream, for example. 1573 4.5.3. Responder RDMA Operational Errors 1575 In RPC-over-RDMA Version One, the responder initiates RDMA Read and 1576 Write operations that target the requester's memory. Problems might 1577 arise as the responder attempts to use requester-provided resources 1578 for RDMA operations. For example: 1580 o Usually, chunks can be validated only by using their contents to 1581 perform data transfers. If chunk contents are invalid (say, a 1582 memory region is no longer registered, or a chunk length exceeds 1583 the end of the registered memory region), a Remote Access Error 1584 occurs. 1586 o If a requester's receive buffer is too small, the responder's Send 1587 operation completes with a Local Length Error. 1589 o If the requester-provided Reply chunk is too small to accommodate 1590 a large RPC Reply, a Remote Access error occurs. A responder 1591 might detect this problem before attempting to write past the end 1592 of the Reply chunk. 1594 RDMA operational errors are typically fatal to the connection. To 1595 avoid a retransmission loop and repeated connection loss that 1596 deadlocks the connection, once the requester has re-established a 1597 connection, the responder should send an RDMA_ERROR reply with an 1598 rdma_err value of ERR_CHUNK to indicate that no RPC-level reply is 1599 possible for that XID. 1601 4.5.4. Other Operational Errors 1603 While a requester is constructing a Call message, an unrecoverable 1604 problem might occur that prevents the requester from posting further 1605 RDMA Work Requests on behalf of that message. As with other 1606 transports, if a requester is unable to construct and transmit a Call 1607 message, the associated RPC transaction fails immediately. 1609 After a requester has received a reply, if it is unable to invalidate 1610 a memory region due to an unrecoverable problem, the requester MUST 1611 close the connection to fence that memory from the responder before 1612 the associated RPC transaction is complete. 1614 While a responder is constructing a Reply message or error message, 1615 an unrecoverable problem might occur that prevents the responder from 1616 posting further RDMA Work Requests on behalf of that message. If a 1617 responder is unable to construct and transmit a Reply or error 1618 message, the responder MUST close the connection to signal to the 1619 requester that a reply was lost. 1621 4.5.5. RDMA Transport Errors 1623 The RDMA connection and physical link provide some degree of error 1624 detection and retransmission. iWARP's Marker PDU Aligned (MPA) layer 1625 (when used over TCP), Stream Control Transmission Protocol (SCTP), as 1626 well as the InfiniBand link layer all provide Cyclic Redundancy Check 1627 (CRC) protection of the RDMA payload, and CRC-class protection is a 1628 general attribute of such transports. 1630 Additionally, the RPC layer itself can accept errors from the 1631 transport, and recover via retransmission. RPC recovery can handle 1632 complete loss and re-establishment of a transport connection. 1634 The details of reporting and recovery from RDMA link layer errors are 1635 described in specific link layer APIs and operational specifications, 1636 and are outside the scope of this protocol specification. See 1637 Section 8 for further discussion of the use of RPC-level integrity 1638 schemes to detect errors. 1640 4.6. Protocol Elements No Longer Supported 1642 The following protocol elements are no longer supported in RPC-over- 1643 RDMA Version One. Related enum values and structure definitions 1644 remain in the RPC-over-RDMA Version One protocol for backwards 1645 compatibility. 1647 4.6.1. RDMA_MSGP 1649 The specification of RDMA_MSGP in Section 3.9 of [RFC5666] is 1650 incomplete. To fully specify RDMA_MSGP would require: 1652 o Updating the definition of DDP-eligibility to include data items 1653 that may be transferred, with padding, via RDMA_MSGP procedures 1655 o Adding full operational descriptions of the alignment and 1656 threshold fields 1658 o Discussing how alignment preferences are communicated between two 1659 peers without using CCP 1661 o Describing the treatment of RDMA_MSGP procedures that convey Read 1662 or Write chunks 1664 The RDMA_MSGP message type is beneficial only when the padded data 1665 payload is at the end of an RPC message's argument or result list. 1666 This is not typical for NFSv4 COMPOUND RPCs, which often include a 1667 GETATTR operation as the final element of the compound operation 1668 array. 1670 Without a full specification of RDMA_MSGP, there has been no fully 1671 implemented prototype of it. Without a complete prototype of 1672 RDMA_MSGP support, it is difficult to assess whether this protocol 1673 element has benefit, or can even be made to work interoperably. 1675 Therefore, senders MUST NOT send RDMA_MSGP procedures. When 1676 receiving an RDMA_MSGP procedure, responders SHOULD reply with an 1677 RDMA_ERROR procedure, setting the rdma_err field to ERR_CHUNK; 1678 requesters MUST silently discard the message. 1680 4.6.2. RDMA_DONE 1682 Because no implementation of RPC-over-RDMA Version One uses the Read- 1683 Read transfer model, there is never a need to send an RDMA_DONE 1684 procedure. 1686 Therefore, senders MUST NOT send RDMA_DONE messages. Receivers MUST 1687 silently discard RDMA_DONE messages. 1689 4.7. XDR Examples 1691 RPC-over-RDMA chunk lists are complex data types. In this section, 1692 illustrations are provided to help readers grasp how chunk lists are 1693 represented inside an RPC-over-RDMA header. 1695 A plain segment is the simplest component, being made up of a 32-bit 1696 handle (H), a 32-bit length (L), and 64-bits of offset (OO). Once 1697 flattened into an XDR stream, plain segments appear as 1699 HLOO 1701 An RDMA read segment has an additional 32-bit position field. RDMA 1702 read segments appear as 1704 PHLOO 1706 A Read chunk is a list of RDMA read segments. Each RDMA read segment 1707 is preceded by a 32-bit word containing a one if a segment follows, 1708 or a zero if there are no more segments in the list. In XDR form, 1709 this would look like 1711 1 PHLOO 1 PHLOO 1 PHLOO 0 1713 where P would hold the same value for each RDMA read segment 1714 belonging to the same Read chunk. 1716 The Read List is also a list of RDMA read segments. In XDR form, 1717 this would look like a Read chunk, except that the P values could 1718 vary across the list. An empty Read List is encoded as a single 1719 32-bit zero. 1721 One Write chunk is a counted array of plain segments. In XDR form, 1722 the count would appear as the first 32-bit word, followed by an HLOO 1723 for each element of the array. For instance, a Write chunk with 1724 three elements would look like 1726 3 HLOO HLOO HLOO 1728 The Write List is a list of counted arrays. In XDR form, this is a 1729 combination of optional-data and counted arrays. To represent a 1730 Write List containing a Write chunk with three segments and a Write 1731 chunk with two segments, XDR would encode 1733 1 3 HLOO HLOO HLOO 1 2 HLOO HLOO 0 1735 An empty Write List is encoded as a single 32-bit zero. 1737 The Reply chunk is a Write chunk. Since it is an optional-data 1738 field, however, there is a 32-bit field in front of it that contains 1739 a one if the Reply chunk is present, or a zero if it is not. After 1740 encoding, a Reply chunk with 2 segments would look like 1742 1 2 HLOO HLOO 1744 Frequently a requester does not provide any chunks. In that case, 1745 after the four fixed fields in the RPC-over-RDMA header, there are 1746 simply three 32-bit fields that contain zero. 1748 5. RPC Bind Parameters 1750 In setting up a new RDMA connection, the first action by a requester 1751 is to obtain a transport address for the responder. The means used 1752 to obtain this address, and to open an RDMA connection, is dependent 1753 on the type of RDMA transport, and is the responsibility of each RPC 1754 protocol binding and its local implementation. 1756 RPC services normally register with a portmap or rpcbind service 1757 [RFC1833], which associates an RPC Program number with a service 1758 address. This policy is no different with RDMA transports. However, 1759 a different and distinct service address (port number) might 1760 sometimes be required for Upper Layer Protocol operation with RPC- 1761 over-RDMA. 1763 When mapped atop the iWARP transport [RFC5040] [RFC5041], which uses 1764 IP port addressing due to its layering on TCP and/or SCTP, port 1765 mapping is trivial and consists merely of issuing the port in the 1766 connection process. The NFS/RDMA protocol service address has been 1767 assigned port 20049 by IANA, for both iWARP/TCP and iWARP/SCTP. 1769 When mapped atop InfiniBand [IB], which uses a Group Identifier 1770 (GID)-based service endpoint naming scheme, a translation MUST be 1771 employed. One such translation is defined in the InfiniBand Port 1772 Addressing Annex [IBPORT], which is appropriate for translating IP 1773 port addressing to the InfiniBand network. Therefore, in this case, 1774 IP port addressing may be readily employed by the upper layer. 1776 When a mapping standard or convention exists for IP ports on an RDMA 1777 interconnect, there are several possibilities for each upper layer to 1778 consider: 1780 o One possibility is to have the responder register its mapped IP 1781 port with the rpcbind service under the netid (or netids) defined 1782 here. An RPC-over-RDMA-aware requester can then resolve its 1783 desired service to a mappable port, and proceed to connect. This 1784 is the most flexible and compatible approach, for those upper 1785 layers that are defined to use the rpcbind service. 1787 o A second possibility is to have the responder's portmapper 1788 register itself on the RDMA interconnect at a "well known" service 1789 address (on UDP or TCP, this corresponds to port 111). A 1790 requester could connect to this service address and use the 1791 portmap protocol to obtain a service address in response to a 1792 program number, e.g., an iWARP port number, or an InfiniBand GID. 1794 o Alternately, the requester could simply connect to the mapped 1795 well-known port for the service itself, if it is appropriately 1796 defined. By convention, the NFS/RDMA service, when operating atop 1797 such an InfiniBand fabric, uses the same 20049 assignment as for 1798 iWARP. 1800 Historically, different RPC protocols have taken different approaches 1801 to their port assignment. Therefore, the specific method is left to 1802 each RPC-over-RDMA-enabled Upper Layer Binding, and not addressed in 1803 this document. 1805 In Section 9, this specification defines two new "netid" values, to 1806 be used for registration of upper layers atop iWARP [RFC5040] 1807 [RFC5041] and (when a suitable port translation service is available) 1808 InfiniBand [IB]. Additional RDMA-capable networks MAY define their 1809 own netids, or if they provide a port translation, MAY share the one 1810 defined in this document. 1812 6. Upper Layer Binding Specifications 1814 An Upper Layer Protocol is typically defined independently of any 1815 particular RPC transport. An Upper Layer Binding specification (ULB) 1816 provides guidance that helps the Upper Layer Protocol interoperate 1817 correctly and efficiently over a particular transport. For RPC-over- 1818 RDMA Version One, an Upper Layer Binding may provide: 1820 o A taxonomy of XDR data items that are eligible for Direct Data 1821 Placement 1823 o Constraints on which Upper Layer procedures may be reduced, and on 1824 how many chunks may appear in a single RPC request 1826 o A method for determining the maximum size of the reply Payload 1827 stream for all procedures in the Upper Layer Protocol 1829 o An rpcbind port assignment for operation of the RPC Program and 1830 Version on an RPC-over-RDMA transport 1832 Each RPC Program and Version tuple that utilizes RPC-over-RDMA 1833 Version One needs to have an Upper Layer Binding specification. 1835 6.1. DDP-Eligibility 1837 An Upper Layer Binding designates some XDR data items as eligible for 1838 Direct Data Placement. As an RPC-over-RDMA message is formed, DDP- 1839 eligible data items can be removed from the Payload stream and placed 1840 directly in the receiver's memory. 1842 An XDR data item should be considered for DDP-eligibility if there is 1843 a clear benefit to moving the contents of the item directly from the 1844 sender's memory to the receiver's memory. Criteria for DDP- 1845 eligibility include: 1847 o The XDR data item is frequently sent or received, and its size is 1848 often much larger than typical inline thresholds. 1850 o Transport-level processing of the XDR data item is not needed. 1851 For example, the data item is an opaque byte array, which requires 1852 no XDR encoding and decoding of its content. 1854 o The content of the XDR data item is sensitive to address 1855 alignment. For example, pullup would be required on the receiver 1856 before the content of the item can be used. 1858 o The XDR data item does not contain DDP-eligible data items. 1860 In addition to defining the set of data items that are DDP-eligible, 1861 an Upper Layer Binding may also limit the use of chunks to particular 1862 Upper Layer procedures. If more than one data item in a procedure is 1863 DDP-eligible, the Upper Layer Binding may also limit the number of 1864 chunks that a requester can provide for a particular Upper Layer 1865 procedure. 1867 Senders MUST NOT reduce data items that are not DDP-eligible. Such 1868 data items MAY, however, be moved as part of a Position Zero Read 1869 chunk or a Reply chunk. 1871 The programming interface by which an Upper Layer implementation 1872 indicates the DDP-eligibility of a data item to the RPC transport is 1873 not described by this specification. The only requirements are that 1874 the receiver can re-assemble the transmitted RPC-over-RDMA message 1875 into a valid XDR stream, and that DDP-eligibility rules specified by 1876 the Upper Layer Binding are respected. 1878 There is no provision to express DDP-eligibility within the XDR 1879 language. The only definitive specification of DDP-eligibility is an 1880 Upper Layer Binding. 1882 In general a DDP-eligibility violation occurs when: 1884 o A requester reduces a non-DDP-eligible argument data item. The 1885 responder MUST NOT process this Call message, and MUST report the 1886 violation as described in Section 4.5.2. 1888 o A responder reduces a non-DDP-eligible result data item. The 1889 requester MUST terminate the pending RPC transaction and report an 1890 appropriate permanent error to the RPC consumer. 1892 o A responder does not reduce a DDP-eligible result data item into 1893 an available Write chunk. The requester MUST terminate the 1894 pending RPC transaction and report an appropriate permanent error 1895 to the RPC consumer. 1897 6.2. Maximum Reply Size 1899 A requester provides resources for both a Call message and its 1900 matching Reply message. A requester forms the Call message itself, 1901 thus can compute the exact resources needed for it. 1903 A requester must allocate resources for the Reply message (an RPC- 1904 over-RDMA credit, a Receive buffer, and possibly a Write list and 1905 Reply chunk) before the responder has formed the actual reply. To 1906 accommodate all possible replies for the procedure in the Call 1907 message, a requester must allocate reply resources based on the 1908 maximum possible size of the expected Reply message. 1910 If there are procedures in the Upper Layer Protocol for which there 1911 is no clear reply size maximum, the Upper Layer Binding needs to 1912 specify a dependable means for determining the maximum. 1914 6.3. Additional Considerations 1916 There may be other details provided in an Upper Layer Binding. 1918 o An Upper Layer Binding may recommend inline threshold values or 1919 other transport-related parameters for RPC-over-RDMA Version One 1920 connections bearing that Upper Layer Protocol. 1922 o An Upper Layer Protocol may provide a means to communicate these 1923 transport-related parameters between peers. Note that RPC-over- 1924 RDMA Version One does not specify any mechanism for changing any 1925 transport-related parameter after a connection has been 1926 established. 1928 o Multiple Upper Layer Protocols may share a single RPC-over-RDMA 1929 Version One connection when their Upper Layer Bindings allow the 1930 use of RPC-over-RDMA Version One and the rpcbind port assignments 1931 for the Protocols allow connection sharing. In this case, the 1932 same transport parameters (such as inline threshold) apply to all 1933 Protocols using that connection. 1935 Each Upper Layer Binding needs to be designed to allow correct 1936 interoperation without regard to the transport parameters actually in 1937 use. Furthermore, implementations of Upper Layer Protocols must be 1938 designed to interoperate correctly regardless of the connection 1939 parameters in effect on a connection. 1941 6.4. Upper Layer Protocol Extensions 1943 An RPC Program and Version tuple may be extensible. For instance, 1944 there may be a minor versioning scheme that is not reflected in the 1945 RPC version number. Or, the Upper Layer Protocol may allow 1946 additional features to be specified after the original RPC program 1947 specification was ratified. 1949 Upper Layer Bindings are provided for interoperable RPC Programs and 1950 Versions by extending existing Upper Layer Bindings to reflect the 1951 changes made necessary by each addition to the existing XDR. 1953 7. Protocol Extensibility 1955 The RPC-over-RDMA header format is specified using XDR, unlike the 1956 message header used with RPC over TCP. To maintain a high degree of 1957 interoperability among implementations of RPC-over-RDMA, any change 1958 to this XDR requires a protocol version number change. New versions 1959 of RPC-over-RDMA may be published as separate protocol specifications 1960 without updating this document. 1962 The first four fields in every RPC-over-RDMA header must remain 1963 aligned at the same fixed offsets for all versions of the RPC-over- 1964 RDMA protocol. The version number must be in a fixed place to enable 1965 implementations to detect protocol version mismatches. 1967 For version mismatches to be reported in a fashion that all future 1968 version implementations can reliably decode, the rdma_proc field must 1969 remain in a fixed place, the value of ERR_VERS must always remain the 1970 same, and the field placement in struct rpc_rdma_errvers must always 1971 remain the same. 1973 7.1. Conventional Extensions 1975 Introducing new capabilities to RPC-over-RDMA Version One is limited 1976 to the adoption of conventions that make use of existing XDR (defined 1977 in this document) and allowed abstract RDMA operations. Because no 1978 mechanism for detecting optional features exists in RPC-over-RDMA 1979 Version One, implementations must rely on Upper Layer Protocols to 1980 communicate the existence of such extensions. 1982 Such extensions must be specified in a Standards Track document with 1983 appropriate review by the nfsv4 Working Group and the IESG. An 1984 example of a conventional extension to RPC-over-RDMA Version One is 1985 the specification of backward direction message support to enable 1986 NFSv4.1 callback operations, described in 1987 [I-D.ietf-nfsv4-rpcrdma-bidirection]. 1989 8. Security Considerations 1991 8.1. Memory Protection 1993 A primary consideration is the protection of the integrity and 1994 privacy of local memory by an RPC-over-RDMA transport. The use of 1995 RPC-over-RDMA MUST NOT introduce any vulnerabilities to system memory 1996 contents, nor to memory owned by user processes. 1998 It is REQUIRED that any RDMA provider used for RPC transport be 1999 conformant to the requirements of [RFC5042] in order to satisfy these 2000 protections. These protections are provided by the RDMA layer 2001 specifications, and in particular, their security models. 2003 8.1.1. Protection Domains 2005 The use of Protection Domains to limit the exposure of memory regions 2006 to a single connection is critical. Any attempt by an endpoint not 2007 participating in that connection to re-use memory handles needs to 2008 result in immediate failure of that connection. Because Upper Layer 2009 Protocol security mechanisms rely on this aspect of Reliable 2010 Connection behavior, strong authentication of remote endpoints is 2011 recommended. 2013 8.1.2. Handle Predictability 2015 Unpredictable memory handles should be used for any operation 2016 requiring advertised memory regions. Advertising a continuously 2017 registered memory region allows a remote host to read or write to 2018 that region even when an RPC involving that memory is not under way. 2019 Therefore implementations should avoid advertising persistently 2020 registered memory. 2022 8.1.3. Memory Fencing 2024 Requesters should register memory regions for remote access only when 2025 they are about to be the target of an RPC operation that involves an 2026 RDMA Read or Write. 2028 Registered memory regions should be invalidated as soon as related 2029 RPC operations are complete. Invalidation and DMA unmapping of 2030 memory regions should be complete before message integrity checking 2031 is done, and before the RPC consumer is allowed to continue execution 2032 and use or alter the contents of a memory region. 2034 An RPC transaction on a requester might be terminated before a reply 2035 arrives if the RPC consumer exits unexpectedly (for example it is 2036 signaled or a segmentation fault occurs). When an RPC terminates 2037 abnormally, memory regions associated with that RPC should be 2038 invalidated appropriately before the regions are released to be 2039 reused for other purposes on the requester. 2041 8.2. RPC Message Security 2043 ONC RPC provides cryptographic security via the RPCSEC_GSS framework 2044 [RFC7861]. RPCSEC_GSS implements message authentication, per-message 2045 integrity checking, and per-message confidentiality. However, 2046 integrity and privacy services require significant movement of data 2047 on each endpoint host. Some performance benefits enabled by RDMA 2048 transports can be lost. 2050 8.2.1. RPC-Over-RDMA Protection At Lower Layers 2052 Note that performance loss is expected when RPCSEC_GSS integrity or 2053 privacy is in use on any RPC transport. Protection below the RDMA 2054 layer is a more appropriate security mechanism for RDMA transports in 2055 performance-sensitive deployments. Certain configurations of IPsec 2056 can be co-located in RDMA hardware, for example, without any change 2057 to RDMA consumers or loss of data movement efficiency. 2059 The use of protection in a lower layer MAY be negotiated through the 2060 use of an RPCSEC_GSS security flavor defined in [RFC7861] in 2061 conjunction with the Channel Binding mechanism [RFC5056] and IPsec 2062 Channel Connection Latching [RFC5660]. Use of such mechanisms is 2063 REQUIRED where integrity and/or privacy is desired and where 2064 efficiency is required. 2066 8.2.2. RPCSEC_GSS On RPC-Over-RDMA Transports 2068 Not all RDMA devices and fabrics support the above protection 2069 mechanisms. Also, per-message authentication is still required on 2070 NFS clients where multiple users access NFS files. In these cases, 2071 RPCSEC_GSS can protect NFS traffic conveyed on RPC-over-RDMA 2072 connections. 2074 RPCSEC_GSS extends the ONC RPC protocol [RFC5531] without changing 2075 the format of RPC messages. By observing the conventions described 2076 in this section, an RPC-over-RDMA transport can convey RPCSEC_GSS- 2077 protected RPC messages interoperably. 2079 As part of the ONC RPC protocol, protocol elements of RPCSEC_GSS that 2080 appear in the Payload stream of an RPC-over-RDMA message (such as 2081 control messages exchanged as part of establishing or destroying a 2082 security context, or data items that are part of RPCSEC_GSS 2083 authentication material) MUST NOT be reduced. 2085 8.2.2.1. RPCSEC_GSS Context Negotiation 2087 Some NFS client implementations use a separate connection to 2088 establish a GSS context for NFS operation. These clients use TCP and 2089 the standard NFS port (2049) for context establishment. However 2090 there is no guarantee that an NFS/RDMA server provides a TCP-based 2091 NFS server on port 2049. 2093 8.2.2.2. RPC-Over-RDMA With RPCSEC_GSS Authentication 2095 The RPCSEC_GSS authentication service has no impact on the DDP- 2096 eligibity of data items in an Upper Layer Protocol. 2098 However, RPCSEC_GSS authentication material appearing in an RPC 2099 message header can be larger than, say, an AUTH_SYS authenticator. 2100 In particular, when an RPCSEC_GSS pseudoflavor is in use, a requester 2101 needs to accommodate a larger RPC credential when marshaling Call 2102 messages, and to provide for a maximum size RPCSEC_GSS verifier when 2103 allocating reply buffers and Reply chunks. 2105 RPC messages, and thus Payload streams, are made larger as a result. 2106 Upper Layer Protocol operations that fit in a Short Message when a 2107 simpler form of authentication is in use might need to be reduced, or 2108 conveyed via a Long Message, when RPCSEC_GSS authentication is in 2109 use. It is more likely that a requester provides both a Read list 2110 and a Reply chunk in the same RPC-over-RDMA header to convey a Long 2111 call and provision a receptacle for a Long reply. More frequent use 2112 of Long messages can impact transport efficiency. 2114 8.2.2.3. RPC-Over-RDMA With RPCSEC_GSS Integrity Or Privacy 2116 The RPCSEC_GSS integrity service enables endpoints to detect 2117 modification of RPC messages in flight. The RPCSEC_GSS privacy 2118 service prevents all but the intended recipient from viewing the 2119 cleartext content of RPC arguments and results. RPCSEC_GSS integrity 2120 and privacy are end-to-end. They protect RPC arguments and results 2121 from application to server endpoint, and back. 2123 The RPCSEC_GSS integrity and encryption services operate on whole RPC 2124 messages after they have been XDR encoded for transmit, and before 2125 they have been XDR decoded after receipt. Both sender and receiver 2126 endpoints use intermediate buffers to prevent exposure of encrypted 2127 data or unverified cleartext data to RPC consumers. After 2128 verification, encryption, and message wrapping has been performed, 2129 the transport layer MAY use RDMA data transfer between these 2130 intermediate buffers. 2132 The process of reducing a DDP-eligible data item removes the data 2133 item and its XDR padding from the encoded XDR stream. XDR padding of 2134 a reduced data item is not transferred in an RPC-over-RDMA message. 2135 After reduction, the Payload stream contains fewer octets then the 2136 whole XDR stream did beforehand. XDR padding octets are often zero 2137 bytes, but they don't have to be. Thus reducing DDP-eligible items 2138 affects the result of message integrity verification or encryption. 2140 Therefore a sender MUST NOT reduce a Payload stream when RPCSEC_GSS 2141 integrity or encryption services are in use. Effectively, no data 2142 item is DDP-eligible in this situation, and Chunked Messages cannot 2143 be used. In this mode, an RPC-over-RDMA transport operates in the 2144 same manner as a transport that does not support direct data 2145 placement. 2147 When RPCSEC_GSS integrity or privacy is in use, a requester provides 2148 both a Read list and a Reply chunk in the same RPC-over-RDMA header 2149 to convey a Long call and provision a receptacle for a Long reply. 2151 8.2.2.4. Protecting RPC-Over-RDMA Transport Headers 2153 Like the base fields in an ONC RPC message (XID, call direction, and 2154 so on), the contents of an RPC-over-RDMA message's Transport stream 2155 are not protected by RPCSEC_GSS. This exposes XIDs, connection 2156 credit limits, and chunk lists (but not the content of the data items 2157 they refer to) to malicious behavior, which could redirect data that 2158 is transferred by the RPC-over-RDMA message, result in spurious 2159 retransmits, or trigger connection loss. 2161 In particular, if an attacker alters the information contained in the 2162 chunk lists of an RPC-over-RDMA header, data contained in those 2163 chunks can be redirected to other registered memory regions on 2164 requesters. An attacker might alter the arguments of RDMA Read and 2165 RDMA Write operations on the wire to similar effect. The use of 2166 RPCSEC_GSS integrity or privacy services enable the requester to 2167 detect if such tampering has been done and reject the RPC message. 2169 Encryption at lower layers, as described in Section 8.2.1, protects 2170 the content of the Transport stream. To address attacks on RDMA 2171 protocols themselves, RDMA transport implementations should conform 2172 to [RFC5042]. 2174 9. IANA Considerations 2176 Three assignments are specified by this document. These are 2177 unchanged from [RFC5666]: 2179 o A set of RPC "netids" for resolving RPC-over-RDMA services 2181 o Optional service port assignments for Upper Layer Bindings 2183 o An RPC program number assignment for the configuration protocol 2185 These assignments have been established, as below. 2187 The new RPC transport has been assigned an RPC "netid", which is an 2188 rpcbind [RFC1833] string used to describe the underlying protocol in 2189 order for RPC to select the appropriate transport framing, as well as 2190 the format of the service addresses and ports. 2192 The following "Netid" registry strings are defined for this purpose: 2194 NC_RDMA "rdma" 2195 NC_RDMA6 "rdma6" 2197 These netids MAY be used for any RDMA network satisfying the 2198 requirements of Section 2.2.2, and able to identify service endpoints 2199 using IP port addressing, possibly through use of a translation 2200 service as described above in Section 5. The "rdma" netid is to be 2201 used when IPv4 addressing is employed by the underlying transport, 2202 and "rdma6" for IPv6 addressing. 2204 The netid assignment policy and registry are defined in [RFC5665]. 2206 As a new RPC transport, this protocol has no effect on RPC Program 2207 numbers or existing registered port numbers. However, new port 2208 numbers MAY be registered for use by RPC-over-RDMA-enabled services, 2209 as appropriate to the new networks over which the services will 2210 operate. 2212 For example, the NFS/RDMA service defined in [RFC5667] has been 2213 assigned the port 20049, in the IANA registry: 2215 nfsrdma 20049/tcp Network File System (NFS) over RDMA 2216 nfsrdma 20049/udp Network File System (NFS) over RDMA 2217 nfsrdma 20049/sctp Network File System (NFS) over RDMA 2219 The RPC program number assignment policy and registry are defined in 2220 [RFC5531]. 2222 10. References 2224 10.1. Normative References 2226 [RFC1833] Srinivasan, R., "Binding Protocols for ONC RPC Version 2", 2227 RFC 1833, DOI 10.17487/RFC1833, August 1995, 2228 . 2230 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 2231 Requirement Levels", BCP 14, RFC 2119, 2232 DOI 10.17487/RFC2119, March 1997, 2233 . 2235 [RFC4506] Eisler, M., Ed., "XDR: External Data Representation 2236 Standard", STD 67, RFC 4506, DOI 10.17487/RFC4506, May 2237 2006, . 2239 [RFC5042] Pinkerton, J. and E. Deleganes, "Direct Data Placement 2240 Protocol (DDP) / Remote Direct Memory Access Protocol 2241 (RDMAP) Security", RFC 5042, DOI 10.17487/RFC5042, October 2242 2007, . 2244 [RFC5056] Williams, N., "On the Use of Channel Bindings to Secure 2245 Channels", RFC 5056, DOI 10.17487/RFC5056, November 2007, 2246 . 2248 [RFC5531] Thurlow, R., "RPC: Remote Procedure Call Protocol 2249 Specification Version 2", RFC 5531, DOI 10.17487/RFC5531, 2250 May 2009, . 2252 [RFC5660] Williams, N., "IPsec Channels: Connection Latching", 2253 RFC 5660, DOI 10.17487/RFC5660, October 2009, 2254 . 2256 [RFC5665] Eisler, M., "IANA Considerations for Remote Procedure Call 2257 (RPC) Network Identifiers and Universal Address Formats", 2258 RFC 5665, DOI 10.17487/RFC5665, January 2010, 2259 . 2261 [RFC7861] Adamson, A. and N. Williams, "Remote Procedure Call (RPC) 2262 Security Version 3", RFC 7861, DOI 10.17487/RFC7861, 2263 November 2016, . 2265 10.2. Informative References 2267 [I-D.ietf-nfsv4-rpcrdma-bidirection] 2268 Lever, C., "Bi-directional Remote Procedure Call On RPC- 2269 over-RDMA Transports", draft-ietf-nfsv4-rpcrdma- 2270 bidirection-05 (work in progress), June 2016. 2272 [IB] InfiniBand Trade Association, "InfiniBand Architecture 2273 Specifications", . 2275 [IBPORT] InfiniBand Trade Association, "IP Addressing Annex", 2276 . 2278 [RFC0768] Postel, J., "User Datagram Protocol", STD 6, RFC 768, 2279 DOI 10.17487/RFC0768, August 1980, 2280 . 2282 [RFC0793] Postel, J., "Transmission Control Protocol", STD 7, 2283 RFC 793, DOI 10.17487/RFC0793, September 1981, 2284 . 2286 [RFC1094] Nowicki, B., "NFS: Network File System Protocol 2287 specification", RFC 1094, DOI 10.17487/RFC1094, March 2288 1989, . 2290 [RFC1813] Callaghan, B., Pawlowski, B., and P. Staubach, "NFS 2291 Version 3 Protocol Specification", RFC 1813, 2292 DOI 10.17487/RFC1813, June 1995, 2293 . 2295 [RFC5040] Recio, R., Metzler, B., Culley, P., Hilland, J., and D. 2296 Garcia, "A Remote Direct Memory Access Protocol 2297 Specification", RFC 5040, DOI 10.17487/RFC5040, October 2298 2007, . 2300 [RFC5041] Shah, H., Pinkerton, J., Recio, R., and P. Culley, "Direct 2301 Data Placement over Reliable Transports", RFC 5041, 2302 DOI 10.17487/RFC5041, October 2007, 2303 . 2305 [RFC5532] Talpey, T. and C. Juszczak, "Network File System (NFS) 2306 Remote Direct Memory Access (RDMA) Problem Statement", 2307 RFC 5532, DOI 10.17487/RFC5532, May 2009, 2308 . 2310 [RFC5661] Shepler, S., Ed., Eisler, M., Ed., and D. Noveck, Ed., 2311 "Network File System (NFS) Version 4 Minor Version 1 2312 Protocol", RFC 5661, DOI 10.17487/RFC5661, January 2010, 2313 . 2315 [RFC5662] Shepler, S., Ed., Eisler, M., Ed., and D. Noveck, Ed., 2316 "Network File System (NFS) Version 4 Minor Version 1 2317 External Data Representation Standard (XDR) Description", 2318 RFC 5662, DOI 10.17487/RFC5662, January 2010, 2319 . 2321 [RFC5666] Talpey, T. and B. Callaghan, "Remote Direct Memory Access 2322 Transport for Remote Procedure Call", RFC 5666, 2323 DOI 10.17487/RFC5666, January 2010, 2324 . 2326 [RFC5667] Talpey, T. and B. Callaghan, "Network File System (NFS) 2327 Direct Data Placement", RFC 5667, DOI 10.17487/RFC5667, 2328 January 2010, . 2330 [RFC7530] Haynes, T., Ed. and D. Noveck, Ed., "Network File System 2331 (NFS) Version 4 Protocol", RFC 7530, DOI 10.17487/RFC7530, 2332 March 2015, . 2334 Appendix A. Changes Since RFC 5666 2336 A.1. Changes To The Specification 2338 The following alterations have been made to the RPC-over-RDMA Version 2339 One specification. The section numbers below refer to [RFC5666]. 2341 o Section 2 has been expanded to introduce and explain key RPC 2342 [RFC5531], XDR [RFC4506], and RDMA [RFC5040] terminology. These 2343 terms are now used consistently throughout the specification. 2345 o Section 3 has been re-organized and split into sub-sections to 2346 help readers locate specific requirements and definitions. 2348 o Sections 4 and 5 have been combined to improve the organization of 2349 this information. 2351 o The optional Connection Configuration Protocol has never been 2352 implemented. The specification of CCP has been deleted from this 2353 specification. 2355 o A section consolidating requirements for Upper Layer Bindings has 2356 been added. 2358 o An XDR extraction mechanism is provided, along with full 2359 copyright, matching the approach used in [RFC5662]. 2361 o The "Security Considerations" section has been expanded to include 2362 a discussion of how RPC-over-RDMA security depends on features of 2363 the underlying RDMA transport. 2365 o A subsection describing the use of RPCSEC_GSS [RFC7861] with RPC- 2366 over-RDMA Version One has been added. 2368 A.2. Changes To The Protocol 2370 Although the protocol described herein interoperates with existing 2371 implementations of [RFC5666], the following changes have been made 2372 relative to the protocol described in that document: 2374 o Support for the Read-Read transfer model has been removed. Read- 2375 Read is a slower transfer model than Read-Write. As a result, 2376 implementers have chosen not to support it. Removal of Read-Read 2377 simplifies explanatory text, and the RDMA_DONE procedure is no 2378 longer part of the protocol. 2380 o The specification of RDMA_MSGP in [RFC5666] is not adequate, 2381 although some incomplete implementations exist. Even if an 2382 adequate specification were provided and an implementation was 2383 produced, benefit for protocols such as NFSv4.0 [RFC7530] is 2384 doubtful. Therefore the RDMA_MSGP message type is no longer 2385 supported. 2387 o Technical issues with regard to handling RPC-over-RDMA header 2388 errors have been corrected. 2390 o Specific requirements related to implicit XDR round-up and complex 2391 XDR data types have been added. 2393 o Explicit guidance is provided related to sizing Write chunks, 2394 managing multiple chunks in the Write list, and handling unused 2395 Write chunks. 2397 o Clear guidance about Send and Receive buffer sizes has been 2398 introduced. This enables better decisions about when a Reply 2399 chunk must be provided. 2401 Appendix B. Acknowledgments 2403 The editor gratefully acknowledges the work of Brent Callaghan and 2404 Tom Talpey on the original RPC-over-RDMA Version One specification 2405 [RFC5666]. 2407 Dave Noveck provided excellent review, constructive suggestions, and 2408 consistent navigational guidance throughout the process of drafting 2409 this document. Dave also contributed much of the organization and 2410 content of Section 7 and helped the authors understand the 2411 complexities of XDR extensibility. 2413 The comments and contributions of Karen Deitke, Dai Ngo, Chunli 2414 Zhang, Dominique Martinet, and Mahesh Siddheshwar are accepted with 2415 great thanks. The editor also wishes to thank Bill Baker, Greg 2416 Marsden, and Matt Benjamin for their support of this work. 2418 The extract.sh shell script and formatting conventions were first 2419 described by the authors of the NFSv4.1 XDR specification [RFC5662]. 2421 Special thanks go to Transport Area Director Spencer Dawkins, nfsv4 2422 Working Group Chair and document shepherd Spencer Shepler, and nfsv4 2423 Working Group Secretary Thomas Haynes for their support. 2425 Authors' Addresses 2427 Charles Lever (editor) 2428 Oracle Corporation 2429 1015 Granger Avenue 2430 Ann Arbor, MI 48104 2431 USA 2433 Phone: +1 248 816 6463 2434 Email: chuck.lever@oracle.com 2436 William Allen Simpson 2437 DayDreamer 2438 1384 Fontaine 2439 Madison Heights, MI 48071 2440 USA 2442 Email: william.allen.simpson@gmail.com 2444 Tom Talpey 2445 Microsoft Corp. 2446 One Microsoft Way 2447 Redmond, WA 98052 2448 USA 2450 Phone: +1 425 704-9945 2451 Email: ttalpey@microsoft.com