Network File System (NFS) Version 4 Minor Version 1 External Data Representation Standard (XDR) Description
Extracted elements (28)
EXCLUSIVE4_1 was introduced to replace EXCLUSIVE4 in non-persistent sessions because EXCLUSIVE4_1 combines the creation verifier with initial attribute setting in a single creatverfattr structure, avoiding a separate SETATTR round-trip while still providing exactly-once create semantics.
The XDR description intentionally includes NFSv4.0 operations (SETCLIENTID, SETCLIENTID_CONFIRM, OPEN_CONFIRM, RENEW, RELEASE_LOCKOWNER) that are obsolete in NFSv4.1, so that a single .x file can be used to build implementations supporting both minor versions without maintaining two separate files.
NFS4ERR_RESOURCE (value 10018) is retained in the nfsstat4 enum for XDR compatibility with NFSv4.0 but is not a valid error code in NFSv4.1. Error value 19 is deliberately left unallocated because it carried a meaning in NFSv3 and reuse would create cross-version ambiguity.
When a session is persistent, GUARDED4 MUST be used for exclusive file creation; EXCLUSIVE4_1 is used instead of EXCLUSIVE4 only for non-persistent sessions. EXCLUSIVE4 itself is deprecated in NFSv4.1.
NFSv4.1 introduces new RECOMMENDED attributes: FATTR4_SUPPATTR_EXCLCREAT=75 (attributes settable at exclusive create), FATTR4_DIR_NOTIF_DELAY=56, FATTR4_DIRENT_NOTIF_DELAY=57, FATTR4_DACL=58, FATTR4_SACL=59, FATTR4_CHANGE_POLICY=60, FATTR4_FS_STATUS=61, FATTR4_FS_LAYOUT_TYPES=62 through FATTR4_FS_CHARSET_CAP=76.
The BIND_CONN_TO_SESSION operation binds a transport connection to a session, specifying session ID, channel direction (CDFC4_FORE, CDFC4_BACK, CDFC4_FORE_OR_BOTH, CDFC4_BACK_OR_BOTH), and whether RDMA mode is requested. The server response confirms the direction actually bound.
The change_policy4 structure (FATTR4_CHANGE_POLICY=60) carries cp_major and cp_minor (both uint64_t) to allow clients to detect when a server's change attribute semantics have shifted, enabling cache invalidation decisions independent of the change value itself.
The CREATE_SESSION operation establishes a session. The request carries clientid4, a sequence number, flags (PERSIST, CONN_BACK_CHAN, CONN_RDMA), fore/back channel_attrs4 (header pad, max request/response sizes, max operations, max requests, optional RDMA IRD), callback program, and security parameters. The response echoes the sessionid4 and confirmed channel attributes.
The createmode4 enumeration governs exclusive-create semantics: UNCHECKED4=0 and GUARDED4=1 are shared with NFSv4.0; EXCLUSIVE4=2 is deprecated in NFSv4.1; EXCLUSIVE4_1=3 is new and combines a verifier with settable attributes (creatverfattr), replacing EXCLUSIVE4 for non-persistent sessions.
The EXCHANGE_ID operation negotiates client and server identity. The request carries client_owner4 (co_verifier + co_ownerid), flags, state-protection parameters (SP4_NONE, SP4_MACH_CRED, or SP4_SSV), and an optional implementation identifier. The response returns a clientid4, sequenceid4, server_owner4, server scope, and negotiated state-protection info.
The fattr4 structure encodes file attributes as a pair of (bitmap4 attrmask, attrlist4 attr_vals), where the bitmap selects which attributes are present and the opaque list encodes their values in attribute-number order. REQUIRED attributes span IDs 0–11 and 19, 75; RECOMMENDED attributes span IDs 12–74 and 76.
The fs_locations_info4 attribute extends fs_locations4 with per-server replica metadata: fls_currency (staleness indicator), a byte-indexed fls_info array carrying consistency class numbers (simultaneous use, handle, fileid, write-verifier, change, readdir) and read/write ranks and orders, plus transport flags (FSLI4TF_RDMA).
The layouttype4 enumeration defines three pNFS layout types: LAYOUT4_NFSV4_1_FILES=1, LAYOUT4_OSD2_OBJECTS=2, and LAYOUT4_BLOCK_VOLUME=3. The layout4 structure carries offset, length, I/O mode (layoutiomode4), and a type-specific layout_content4 body.
The mdsthreshold4 attribute (FATTR4_MDSTHRESHOLD=68) advises clients on I/O size thresholds below which MDS I/O is preferred over direct pNFS I/O, encoded as an array of threshold_item4 records each containing a layout type, hint bitmap, and hint list.
The nfs_ftype4 enumeration defines nine file types: NF4REG (regular file), NF4DIR (directory), NF4BLK (block device), NF4CHR (character device), NF4LNK (symbolic link), NF4SOCK (socket), NF4FIFO (fifo), NF4ATTRDIR (named attribute directory), and NF4NAMEDATTR (named attribute).
The nfs_impl_id4 structure (new to NFSv4.1) carries an implementation identifier consisting of nii_domain (UTF-8 case-insensitive string), nii_name (UTF-8 case-sensitive string), and nii_date (nfstime4), allowing diagnostic identification of client and server implementations during EXCHANGE_ID.
The nfsacl41 structure, new to NFSv4.1, pairs an aclflag4 bitmask (na41_flag) with a variable-length array of nfsace4 entries (na41_aces). ACL flags include ACL4_AUTO_INHERIT=0x01, ACL4_PROTECTED=0x02, and ACL4_DEFAULTED=0x04.
The nfsstat4 enumeration defines all NFS error codes. NFSv4.0 errors run from NFS4_OK=0 through NFS4ERR_CB_PATH_DOWN=10048; NFSv4.1-specific errors begin at NFS4ERR_BADIOMODE=10049 and extend through NFS4ERR_DELEG_REVOKED=10087. Error value 10073 is explicitly unused, and NFS4ERR_RESOURCE (10018) is not valid in NFSv4.1.
The open_claim_type4 enumeration adds three new claim types in NFSv4.1: CLAIM_FH=4 (ordinary open by current filehandle, no special rights), CLAIM_DELEG_CUR_FH=5 (delegation-backed open by filehandle), and CLAIM_DELEG_PREV_FH=6 (previous-delegation open by filehandle), supplementing the four NFSv4.0 claim types.
The open_delegation_type4 enumeration adds OPEN_DELEGATE_NONE_EXT=3 in NFSv4.1 to carry a why_no_delegation4 reason (WND4_NOT_WANTED through WND4_IS_DIR=8) with optional hints indicating whether the server will push or signal delegation availability.
The ssv_subkey4 enumeration defines four subkey derivation inputs for SSV: SSV4_SUBKEY_MIC_I2T=1 (initiator-to-target MIC), SSV4_SUBKEY_MIC_T2I=2, SSV4_SUBKEY_SEAL_I2T=3, and SSV4_SUBKEY_SEAL_T2I=4, enabling directional key separation.
The state_protect_how4 enumeration defines three state-protection modes for EXCHANGE_ID: SP4_NONE (no special protection), SP4_MACH_CRED (machine-credential-protected operations specified via must-enforce/must-allow bitmaps), and SP4_SSV (SSV-GSS protected with negotiated hash and encryption algorithms).
Security considerations for this XDR description document are discussed entirely in the NFSv4.1 protocol specification (RFC 5661); this document introduces no additional security considerations beyond providing the machine-extractable XDR encoding of that protocol.
The channel_attrs4 structure negotiates per-channel capacity: ca_headerpadsize, ca_maxrequestsize, ca_maxresponsesize, ca_maxresponsesize_cached, ca_maxoperations, and ca_maxrequests are all count4 (uint32_t), plus an optional ca_rdma_ird (uint32_t) for RDMA inbound read queue depth.
The filehandle type nfs_fh4 is encoded as variable-length opaque with a maximum size of NFS4_FHSIZE=128 bytes. The verifier type verifier4 is a fixed 8-byte opaque (NFS4_VERIFIER_SIZE=8). The sessionid4 is a fixed 16-byte opaque (NFS4_SESSIONID_SIZE=16).
The nfsv4_1_file_layout4 structure encodes the files-layout body: a 16-byte deviceid4 (nfl_deviceid), a nfl_util4 flags/stripe-unit word, a first-stripe index, a pattern offset, and a variable-length list of file handles (nfl_fh_list). The companion nfsv4_1_file_layout_ds_addr4 encodes stripe indices and a multipath data-server address list.
The SSV sealed-message token (ssv_seal_cipher_tkn4) encodes: ssct_ssv_seq (uint32_t sequence), ssct_iv (variable opaque IV), ssct_encr_data (variable opaque ciphertext), and ssct_hmac (variable opaque HMAC). The corresponding plaintext input (ssv_seal_plain_tkn4) includes a confounder, sequence number, original plaintext, and padding.
The stateid4 structure encodes a 32-bit sequence number (seqid) followed by a fixed 12-byte opaque field (other). This compact format allows servers to embed internal state identifiers while clients track sequence for ordering.