RFC 5667
Network File System (NFS) Direct Data Placement
Network File System (NFS) Direct Data Placement β¨
okay bestie, this is RFC 5667 π It's a Standards Track doc from the IETF, so it's an official, actually-implemented spec. Here's the tea:
- RFC number: 5667
- Title: Network File System (NFS) Direct Data Placement
- Authors: T. Talpey (Unaffiliated) and B. Callaghan (Apple)
- Category: Standards Track
- ISSN: 2070-1721
- Date: January 2010
- Obsoletes / Updates: the title block doesn't list anything it obsoletes or updates π
Abstract
okay so the abstract is giving "here's the whole vibe" π¦ It defines how the different versions of NFS get bound to the RDMA operations that the RPC/RDMA transport protocol supports. The big idea is direct data placement: the server starts RDMA operations that put data straight into buffers the client supplied, and this works for NFS versions 2, 3, 4, and 4.1 running over that RDMA transport. πΈ
Status of This Memo
This is an Internet Standards Track document. π
This document is a product of the Internet Engineering Task Force (IETF). It represents the consensus of the IETF community. It has received public review and has been approved for publication by the Internet Engineering Steering Group (IESG). More info on Internet Standards is in Section 2 of RFC 5741. π
Info about the current status of this document, any errata, and how to give feedback on it is at http://www.rfc-editor.org/info/rfc5667. β¨
Copyright Notice
Copyright (c) 2010 IETF Trust and the persons identified as the document authors. All rights reserved. π
This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info) as they stand on the date this document was published. Please read these carefully, because they describe your rights and restrictions for this document. Code Components pulled out of this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions, and they come without warranty as described in the Simplified BSD License. π§
This document may contain material from IETF Documents or IETF Contributions that were published or made publicly available before November 10, 2008. The person or people who control the copyright in some of that material may not have granted the IETF Trust the right to allow modifications outside the IETF Standards Process. Unless you get an adequate license from the people who control the copyright in those materials, this document may not be modified outside the IETF Standards Process, and derivative works of it may not be created outside the IETF Standards Process. The only exceptions are formatting it for publication as an RFC or translating it into languages other than English. π
Table of Contents
1. Introduction ....................................................2
1.1. Requirements Language ......................................2
2. Transfers from NFS Client to NFS Server .........................3
3. Transfers from NFS Server to NFS Client .........................3
4. NFS Versions 2 and 3 Mapping ....................................4
5. NFS Version 4 Mapping ...........................................6
5.1. NFS Version 4 Callbacks ....................................7
6. Port Usage Considerations .......................................8
7. Security Considerations .........................................9
8. Acknowledgments .................................................9
9. References ......................................................9
9.1. Normative References .......................................9
9.2. Informative References ....................................10
1. Introduction π¦
okay so the RDMA Transport for RPC [RFC5666] lets an RPC client app post buffers in a Chunk list for specific arguments and results from an RPC call. π The RDMA transport header carries that list of client buffer addresses over to the server, which can tie them to client data and use RDMA operations to move the results straight into and out of those posted buffers on the client. The client and server must agree on a consistent mapping of posted buffers to RPC. π This doc spells out that mapping for every version of the NFS protocol [RFC1094] [RFC1813] [RFC3530] [RFC5661]. It's giving organisation, bestie. π«Ά
1.1. Requirements Language
okay the key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be read as described in [RFC2119]. π
2. Transfers from NFS Client to NFS Server πΈ
so the RDMA Read list, which lives in the RDMA transport header, lets an RPC client marshal RPC call data selectively. Big chunks of data, like the file data in an NFS WRITE request, MAY be referenced by an RDMA Read list and then moved efficiently and directly placed by an RDMA Read operation that the server starts. π
Figuring out which chunks go on the RDMA Read list can happen entirely inside the RPC layer. It's invisible to the upper-level protocol, like NFS. For example, the file data part of an NFS WRITE request can be picked out as an RDMA "chunk" inside the eXternal Data Representation (XDR) marshaling code of RPC, based on a size criterion, all without the NFS layer knowing. π The XDR unmarshaling on the receiving side can match Read chunks back to protocol elements using the XDR position value encoded in each Read chunk entry. π§
RPC RDMA Read chunks are how this NFS mapping sends specific NFS data to the server in a way that can be directly placed. The following sections describe this mapping for each version of the NFS protocol. β¨
3. Transfers from NFS Server to NFS Client π
the RDMA Write list, in the RDMA transport header, lets the client post one or more buffers, and the server will RDMA Write its designated result chunks straight into them. π«§ If the client sends a null Write list, results from the RPC call come back either as an inline reply, as chunks in an RDMA Read list of server-posted buffers, or in a client-posted reply buffer. π
Each posted buffer in a Write list is represented as an array of memory segments. That gives the client some flexibility to submit discontiguous memory segments for the server to scatter the result into. Each segment is described by a triplet: the segment handle or steering tag (STag), the segment length, and the memory address or offset. π¦
struct xdr_rdma_segment {
uint32 handle; /* Registered memory handle */
uint32 length; /* Length of the chunk in bytes */
uint64 offset; /* Chunk virtual address or offset */
};
struct xdr_write_chunk {
struct xdr_rdma_segment target<>;
};
struct xdr_write_list {
struct xdr_write_chunk entry;
struct xdr_write_list *next;
};
Add up the segment lengths and you get the total size of the buffer. That buffer MUST be large enough to accept the result. If it's too small, the server MUST return an XDR encode error. π The server MUST return the result data for a posted buffer by progressively filling its segments. It might leave some trailing segments unfilled or partly full if the result is smaller than the total size of the buffer segments. π
The server sends the RDMA Write list back to the client with the segment length fields overwritten to show how much data was RDMA written into each segment. Results returned by direct placement MUST NOT be returned by other methods, for example by Read chunk list or inline. π ββοΈ If there's no result data at all for an element, the server puts no data in the buffer(s), but it does return zeros in the segment length fields for that result. π
The RDMA Write list lets the client provide multiple result buffers, and each buffer maps to a specific result in the reply. The NFS client and server implementations agree on how results map to buffers for each RPC procedure. The following sections describe this mapping for each version of the NFS protocol. π
Using RDMA Write lists in NFS requests means you don't need RDMA Read lists in the NFS replies, as described in the RPC/RDMA protocol. That's more efficient, because the server doesn't have to expose buffers for RDMA, and it also skips the "RDMA_DONE" exchanges. π Clients MAY additionally employ RDMA Reply chunks to receive entire messages, as described in [RFC5666]. π
4. NFS Versions 2 and 3 Mapping β¨
okay bestie, so for NFS versions 2 and 3, the client can post a single RDMA Write list entry π (it MAY be posted, so it's the client's call π). That one entry can catch either the opaque file data from a READ request or the pathname from a READLINK request. The server MUST ignore a Write list for any other NFS procedure, as well as any Write list entries beyond the first in the list π . Only the first one counts, main character energy!
Similarly, a single RDMA Read list entry MAY be posted by the client to supply the opaque file data for a WRITE request or the pathname for a SYMLINK request. The server MUST ignore any Read list for other NFS procedures, as well as additional Read list entries beyond the first in the list π¦.
Because there are no NFS version 2 or 3 requests that transfer bulk data in both directions, it is not necessary to post requests containing both Write and Read lists πΈ. Any unneeded Read or Write lists are ignored by the server, so no drama there π.
In the case where the outgoing request or expected incoming reply is larger than the maximum size supported on the connection, it is possible for the RPC layer to post the entire message, or to result in a special "RDMA_NOMSG" message type that is transferred entirely by RDMA β¨. This is implemented in RPC, below NFS, and therefore has no effect on the message contents π§.
Non-RDMA (inline) WRITE transfers MAY OPTIONALLY employ the "RDMA_MSGP" padding method described in the RPC/RDMA protocol, if the appropriate value for the server is known to the client π. Padding lets the opaque file data arrive at the server in an aligned fashion, which may improve server performance π₯.
The NFS version 2 and 3 protocols are frequently limited in practice to requests containing less than or equal to 8 kilobytes and 32 kilobytes of data, respectively π . In these cases, it is often practical to support basic operation without employing a configuration exchange as discussed in [RFC5666] π. The server MUST post buffers large enough to receive the largest possible incoming message (approximately 12 KB for NFS version 2, or 36 KB for NFS version 3, would be vastly sufficient) π. The client can post buffers large enough to receive replies based on the "rsize" it is using to the server, plus a fixed overhead for the RPC and NFS headers π. Because the server MUST NOT return data in excess of this size, the client can be assured of the adequacy of its posted buffer sizes π«Ά.
Flow control is handled dynamically by the RPC RDMA protocol, and write padding is OPTIONAL and therefore MAY remain unused π¦.
Alternatively, if the server is administratively configured to values appropriate for all its clients, the same assurance of interoperability within the domain can be made πΈ.
The use of a configuration protocol with NFS v2 and v3 is therefore OPTIONAL π. Employing a configuration exchange may allow some advantage to server resource management through accurately sizing buffers, enabling the server to know exactly how many RDMA Reads may be in progress at once on the client connection, and enabling client write padding, which may be desirable for certain servers when RDMA Read is impractical β¨.
5. NFS Version 4 Mapping π
This specification applies to the first minor version of NFS version 4 (NFSv4.0) and any subsequent minor versions that do not override this mapping π.
The Write list MUST be considered only for the COMPOUND procedure. This procedure returns results from a sequence of operations π₯. Only the opaque file data from an NFS READ operation and the pathname from a READLINK operation MUST utilize entries from the Write list π .
If there is no Write list, i.e., the list is null, then any READ or READLINK operations in the COMPOUND MUST return their data inline π. The NFSv4.0 client MUST ensure in this case that any result of its READ and READLINK requests will fit within its receive buffers, in order to avoid a resulting RDMA transport error upon transfer π. The server is not required to detect this π«Ά.
The first entry in the Write list MUST be used by the first READ or READLINK in the COMPOUND request. The next Write list entry is used by the next READ or READLINK, and so on π¦. If there are more READ or READLINK operations than Write list entries, then any remaining operations MUST return their results inline πΈ.
If a Write list entry is presented, then the corresponding READ or READLINK MUST return its data via an RDMA Write to the buffer indicated by the Write list entry β¨. If the Write list entry has zero RDMA segments, or if the total size of the segments is zero, then the corresponding READ or READLINK operation MUST return its result inline π§.
The following example shows an RDMA Write list with three posted buffers A, B, and C. The designated operations in the compound request, READ and READLINK, consume the posted buffers by writing their results back to each buffer π.
RDMA Write list:
A --> B --> C
Compound request:
PUTFH LOOKUP READ PUTFH LOOKUP READLINK PUTFH LOOKUP READ
| | |
v v v
A B C
If the client does not want to have the READLINK result returned directly, then it provides a zero-length array of segment triplets for buffer B, or sets the values in the segment triplet for buffer B to zeros, so that the READLINK result MUST be returned inline π .
The situation is similar for RDMA Read lists sent by the client, and applies to the NFSv4.0 WRITE and SYMLINK procedures as for v3 π. Additionally, inline segments too large to fit in posted buffers MAY be transferred in special "RDMA_NOMSG" messages π¦.
Non-RDMA (inline) WRITE transfers MAY OPTIONALLY employ the "RDMA_MSGP" padding method described in the RPC/RDMA protocol, if the appropriate value for the server is known to the client π. Padding allows the opaque file data to arrive at the server in an aligned fashion, which may improve server performance. In order to ensure accurate alignment for all data, it is likely that the client will restrict its use of OPTIONAL padding to COMPOUND requests containing only a single WRITE operation π.
Unlike NFS versions 2 and 3, the maximum size of an NFS version 4 COMPOUND is not bounded, even when RDMA chunks are in use π. While it might appear that a configuration protocol exchange (such as the one described in [RFC5666]) would help, in fact the layering issues involved in building COMPOUNDs by NFS make such a mechanism unworkable π.
However, typical NFS version 4 clients rarely issue such problematic requests πΈ. In practice, they behave in much more predictable ways; in fact, most still support the traditional rsize/wsize mount parameters π. Therefore, most NFS version 4 clients function over RPC/RDMA in the same way as NFS versions 2 and 3, operationally β¨.
There are, however, advantages to allowing both client and server to operate with prearranged size constraints, for example, use of the sizes to better manage the server's response cache π§. An extension to NFS version 4 supporting a more comprehensive exchange of upper-layer parameters is part of [RFC5661] π.
5.1. NFS Version 4 Callbacks
The NFS version 4 protocols support server-initiated callbacks to selected clients, in order to notify them of events such as recalled delegations, etc. π These callbacks present no particular issue to being framed over RPC/RDMA, since such callbacks do not carry bulk data such as NFS READ or NFS WRITE π. They MAY be transmitted inline via RDMA_MSG, or, if the callback message or its reply overflow the negotiated buffer sizes for a callback connection, they MAY be transferred via the RDMA_NOMSG method as described above for other exchanges π¦.
One special case is noteworthy π: in NFS version 4.1, the callback channel is optionally negotiated to be on the same connection as one used for client requests. In this case, and because the transaction ID (XID) is present in the RPC/RDMA header, the client MUST ascertain whether the message is in fact an RPC REPLY, and therefore a reply to a prior request and carrying its XID, before processing it as such π . By the same token, the server MUST ascertain whether an incoming message on such a callback-eligible connection is an RPC CALL, before optionally processing the XID π«Ά.
In the callback case, the XID present in the RPC/RDMA header will potentially have any value, which may (or may not) collide with an XID used by the client for a previous or future request π±. The client and server MUST inspect the RPC component of the message to determine its potential disposition as either an RPC CALL or RPC REPLY, prior to processing this XID, and MUST NOT reject or accept it without also determining the proper context π₯.
6. Port Usage Considerations π
NFS use of direct data placement introduces a need for an additional NFS port number assignment for networks that share traditional UDP and TCP port spaces with RDMA services. The iWARP [RFC5041] [RFC5040] protocol is such an example (InfiniBand is not) πΈ.
NFS servers for versions 2 and 3 [RFC1094] [RFC1813] traditionally listen for clients on UDP and TCP port 2049, and additionally, they register these with the portmapper and/or rpcbind [RFC1833] service π. However, [RFC3530] requires NFS servers for version 4 to listen on TCP port 2049, and they are not required to register π§.
An NFS version 2 or version 3 server supporting RPC/RDMA on such a network and registering itself with the RPC portmapper MAY choose an arbitrary port, or MAY use the alternative well-known port number for its RPC/RDMA service β¨. The chosen port MAY be registered with the RPC portmapper under the netid assigned by the requirement in [RFC5666] π.
An NFS version 4 server supporting RPC/RDMA on such a network MUST use the alternative well-known port number for its RPC/RDMA service π¨. Clients SHOULD connect to this well-known port without consulting the RPC portmapper (as for NFSv4/TCP) π«Ά.
The port number assigned to an NFS service over an RPC/RDMA transport is available from the IANA port registry [RFC3232] π.
7. Security Considerations π¨
This part is serious, bestie. Read it carefully ππ
The RDMA transport for RPC [RFC5666] supports all RPC [RFC5531] security models, including RPCSEC_GSS [RFC2203] security and link-level security. The choice of RDMA Read and RDMA Write to return RPC argument and results, respectively, does not affect this, since it only changes the method of data transfer. Specifically, the requirements of [RFC5666] ensure that this choice does not introduce new vulnerabilities π‘οΈ.
Because this document defines only the binding of the NFS protocols atop [RFC5666], all relevant security considerations are therefore to be described at that layer π.
8. Acknowledgments π«Ά
The authors would like to thank Dave Noveck and Chet Juszczak for their contributions to this document πβ¨.
9. References π
9.1. Normative References β¨
okay so these are the RFCs this one leans on hardcore, bestie π
[RFC1094]Sun Microsystems, "NFS: Network File System Protocol specification", RFC 1094, March 1989.[RFC1813]Callaghan, B., Pawlowski, B., and P. Staubach, "NFS Version 3 Protocol Specification", RFC 1813, June 1995.[RFC1833]Srinivasan, R., "Binding Protocols for ONC RPC Version 2", RFC 1833, August 1995.[RFC2119]Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997.[RFC2203]Eisler, M., Chiu, A., and L. Ling, "RPCSEC_GSS Protocol Specification", RFC 2203, September 1997.[RFC3530]Shepler, S., Callaghan, B., Robinson, D., Thurlow, R., Beame, C., Eisler, M., and D. Noveck, "Network File System (NFS) version 4 Protocol", RFC 3530, April 2003.[RFC5531]Thurlow, R., "RPC: Remote Procedure Call Protocol Specification Version 2", RFC 5531, May 2009.[RFC5661]Shepler, S., Ed., Eisler, M., Ed., and D. Noveck, Ed., "Network File System (NFS) Version 4 Minor Version 1 Protocol", RFC 5661, January 2010.
9.2. Informative References πΈ
these ones are more like bonus reading, the good stuff to peek at if you're curious π§
[RFC3232]Reynolds, J., Ed., "Assigned Numbers: RFC 1700 is Replaced by an On-line Database", RFC 3232, January 2002.[RFC5040]Recio, R., Metzler, B., Culley, P., Hilland, J., and D. Garcia, "A Remote Direct Memory Access Protocol Specification", RFC 5040, October 2007.[RFC5041]Shah, H., Pinkerton, J., Recio, R., and P. Culley, "Direct Data Placement over Reliable Transports", RFC 5041, October 2007.[RFC5666]Talpey, T. and B. Callaghan, "Remote Direct Memory Access Transport for Remote Procedure Call", RFC 5666, January 2010.
Authors' Addresses π
and here's where you can find the people who wrote this π
Tom Talpey
170 Whitman St.
Stow, MA 01775 USA
EMail: tmtalpey@gmail.com
Brent Callaghan
Apple Computer, Inc.
MS: 302-4K
2 Infinite Loop
Cupertino, CA 95014 USA
EMail: brentc@apple.com
π¦ where this page comes from
- ietf: rfc5667 2010-01
- π girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms