tech-invite   World Map     

IETF     RFCs     Groups     SIP     ABNFs    |    3GPP     Specs     Gloss.     Arch.     IMS     UICC    |    Misc.    |    search     info

RFC 3530


Network File System (NFS) version 4 Protocol

Part 2 of 8, p. 16 to 46
Prev RFC Part       Next RFC Part


prevText      Top      Up      ToC       Page 16 
2.  Protocol Data Types

   The syntax and semantics to describe the data types of the NFS
   version 4 protocol are defined in the XDR [RFC1832] and RPC [RFC1831]
   documents.  The next sections build upon the XDR data types to define
   types and structures specific to this protocol.

2.1.  Basic Data Types

   Data Type       Definition
   int32_t         typedef int             int32_t;

   uint32_t        typedef unsigned int    uint32_t;

   int64_t         typedef hyper           int64_t;

   uint64_t        typedef unsigned hyper  uint64_t;

   attrlist4       typedef opaque        attrlist4<>;
                   Used for file/directory attributes

   bitmap4         typedef uint32_t        bitmap4<>;
                   Used in attribute array encoding.

   changeid4       typedef       uint64_t        changeid4;
                   Used in definition of change_info

   clientid4       typedef uint64_t        clientid4;
                   Shorthand reference to client identification

   component4      typedef utf8str_cs      component4;
                   Represents path name components

   count4          typedef uint32_t        count4;
                   Various count parameters (READ, WRITE, COMMIT)

   length4         typedef uint64_t        length4;
                   Describes LOCK lengths

Top      Up      ToC       Page 17 
   linktext4       typedef utf8str_cs      linktext4;
                   Symbolic link contents

   mode4           typedef uint32_t        mode4;
                   Mode attribute data type

   nfs_cookie4     typedef uint64_t        nfs_cookie4;
                   Opaque cookie value for READDIR

   nfs_fh4         typedef opaque          nfs_fh4<NFS4_FHSIZE>;
                   Filehandle definition; NFS4_FHSIZE is defined as 128

   nfs_ftype4      enum nfs_ftype4;
                   Various defined file types

   nfsstat4        enum nfsstat4;
                   Return value for operations

   offset4         typedef uint64_t        offset4;
                   Various offset designations (READ, WRITE,
                   LOCK, COMMIT)

   pathname4       typedef component4      pathname4<>;
                   Represents path name for LOOKUP, OPEN and others

   qop4            typedef uint32_t        qop4;
                   Quality of protection designation in SECINFO

   sec_oid4        typedef opaque          sec_oid4<>;
                   Security Object Identifier
                   The sec_oid4 data type is not really opaque.
                   Instead contains an ASN.1 OBJECT IDENTIFIER as used
                   by GSS-API in the mech_type argument to
                   GSS_Init_sec_context.  See [RFC2743] for details.

   seqid4          typedef uint32_t        seqid4;
                   Sequence identifier used for file locking

   utf8string      typedef opaque          utf8string<>;
                   UTF-8 encoding for strings

   utf8str_cis     typedef opaque          utf8str_cis;
                   Case-insensitive UTF-8 string

   utf8str_cs      typedef opaque          utf8str_cs;
                   Case-sensitive UTF-8 string

Top      Up      ToC       Page 18 
   utf8str_mixed   typedef opaque          utf8str_mixed;
                   UTF-8 strings with a case sensitive prefix and
                   a case insensitive suffix.

   verifier4       typedef opaque        verifier4[NFS4_VERIFIER_SIZE];
                   Verifier used for various operations (COMMIT,
                   defined as 8.

2.2.  Structured Data Types

                  struct nfstime4 {
                          int64_t seconds;
                          uint32_t nseconds;

   The nfstime4 structure gives the number of seconds and nanoseconds
   since midnight or 0 hour January 1, 1970 Coordinated Universal Time
   (UTC).  Values greater than zero for the seconds field denote dates
   after the 0 hour January 1, 1970.  Values less than zero for the
   seconds field denote dates before the 0 hour January 1, 1970.  In
   both cases, the nseconds field is to be added to the seconds field
   for the final time representation.  For example, if the time to be
   represented is one-half second before 0 hour January 1, 1970, the
   seconds field would have a value of negative one (-1) and the
   nseconds fields would have a value of one-half second (500000000).
   Values greater than 999,999,999 for nseconds are considered invalid.

   This data type is used to pass time and date information.  A server
   converts to and from its local representation of time when processing
   time values, preserving as much accuracy as possible.  If the
   precision of timestamps stored for a filesystem object is less than
   defined, loss of precision can occur.  An adjunct time maintenance
   protocol is recommended to reduce client and server time skew.


                  enum time_how4 {
                          SET_TO_SERVER_TIME4 = 0,
                          SET_TO_CLIENT_TIME4 = 1

Top      Up      ToC       Page 19 

                  union settime4 switch (time_how4 set_it) {
                   case SET_TO_CLIENT_TIME4:
                           nfstime4       time;

   The above definitions are used as the attribute definitions to set
   time values.  If set_it is SET_TO_SERVER_TIME4, then the server uses
   its local representation of time for the time value.


                  struct specdata4 {
                          uint32_t specdata1; /* major device number */
                          uint32_t specdata2; /* minor device number */

   This data type represents additional information for the device file
   types NF4CHR and NF4BLK.


                  struct fsid4 {
                    uint64_t        major;
                    uint64_t        minor;

   This type is the filesystem identifier that is used as a mandatory


                  struct fs_location4 {
                          utf8str_cis    server<>;
                          pathname4     rootpath;


                  struct fs_locations4 {
                          pathname4     fs_root;
                          fs_location4  locations<>;

Top      Up      ToC       Page 20 
   The fs_location4 and fs_locations4 data types are used for the
   fs_locations recommended attribute which is used for migration and
   replication support.


                  struct fattr4 {
                          bitmap4       attrmask;
                          attrlist4     attr_vals;

   The fattr4 structure is used to represent file and directory

   The bitmap is a counted array of 32 bit integers used to contain bit
   values.  The position of the integer in the array that contains bit n
   can be computed from the expression (n / 32) and its bit within that
   integer is (n mod 32).

                           0            1
         |  count    | 31  ..  0 | 63  .. 32 |


                  struct change_info4 {
                          bool          atomic;
                          changeid4     before;
                          changeid4     after;

   This structure is used with the CREATE, LINK, REMOVE, RENAME
   operations to let the client know the value of the change attribute
   for the directory in which the target filesystem object resides.


                  struct clientaddr4 {
                          /* see struct rpcb in RFC 1833 */
                          string r_netid<>;    /* network id */
                          string r_addr<>;     /* universal address */

   The clientaddr4 structure is used as part of the SETCLIENTID
   operation to either specify the address of the client that is using a
   clientid or as part of the callback registration.  The

Top      Up      ToC       Page 21 
   r_netid and r_addr fields are specified in [RFC1833], but they are
   underspecified in [RFC1833] as far as what they should look like for
   specific protocols.

   For TCP over IPv4 and for UDP over IPv4, the format of r_addr is the
   US-ASCII string:


   The prefix, "h1.h2.h3.h4", is the standard textual form for
   representing an IPv4 address, which is always four octets long.
   Assuming big-endian ordering, h1, h2, h3, and h4, are respectively,
   the first through fourth octets each converted to ASCII-decimal.
   Assuming big-endian ordering, p1 and p2 are, respectively, the first
   and second octets each converted to ASCII-decimal.  For example, if a
   host, in big-endian order, has an address of 0x0A010307 and there is
   a service listening on, in big endian order, port 0x020F (decimal
   527), then the complete universal address is "".

   For TCP over IPv4 the value of r_netid is the string "tcp".  For UDP
   over IPv4 the value of r_netid is the string "udp".

   For TCP over IPv6 and for UDP over IPv6, the format of r_addr is the
   US-ASCII string:


   The suffix "p1.p2" is the service port, and is computed the same way
   as with universal addresses for TCP and UDP over IPv4.  The prefix,
   "x1:x2:x3:x4:x5:x6:x7:x8", is the standard textual form for
   representing an IPv6 address as defined in Section 2.2 of [RFC2373].
   Additionally, the two alternative forms specified in Section 2.2 of
   [RFC2373] are also acceptable.

   For TCP over IPv6 the value of r_netid is the string "tcp6".  For UDP
   over IPv6 the value of r_netid is the string "udp6".


                  struct cb_client4 {
                          unsigned int  cb_program;
                          clientaddr4   cb_location;

   This structure is used by the client to inform the server of its call
   back address; includes the program number and client address.

Top      Up      ToC       Page 22 

                  struct nfs_client_id4 {
                          verifier4     verifier;
                          opaque        id<NFS4_OPAQUE_LIMIT>;

   This structure is part of the arguments to the SETCLIENTID operation.
   NFS4_OPAQUE_LIMIT is defined as 1024.


                  struct open_owner4 {
                          clientid4     clientid;
                          opaque        owner<NFS4_OPAQUE_LIMIT>;

   This structure is used to identify the owner of open state.
   NFS4_OPAQUE_LIMIT is defined as 1024.


                  struct lock_owner4 {
                          clientid4     clientid;
                          opaque        owner<NFS4_OPAQUE_LIMIT>;

   This structure is used to identify the owner of file locking state.
   NFS4_OPAQUE_LIMIT is defined as 1024.


                  struct open_to_lock_owner4 {
                          seqid4          open_seqid;
                          stateid4        open_stateid;
                          seqid4          lock_seqid;
                          lock_owner4     lock_owner;

   This structure is used for the first LOCK operation done for an
   open_owner4.  It provides both the open_stateid and lock_owner such
   that the transition is made from a valid open_stateid sequence to
   that of the new lock_stateid sequence.  Using this mechanism avoids
   the confirmation of the lock_owner/lock_seqid pair since it is tied
   to established state in the form of the open_stateid/open_seqid.

Top      Up      ToC       Page 23 

                  struct stateid4 {
                    uint32_t        seqid;
                    opaque          other[12];

   This structure is used for the various state sharing mechanisms
   between the client and server.  For the client, this data structure
   is read-only.  The starting value of the seqid field is undefined.
   The server is required to increment the seqid field monotonically at
   each transition of the stateid.  This is important since the client
   will inspect the seqid in OPEN stateids to determine the order of
   OPEN processing done by the server.

3.  RPC and Security Flavor

   The NFS version 4 protocol is a Remote Procedure Call (RPC)
   application that uses RPC version 2 and the corresponding eXternal
   Data Representation (XDR) as defined in [RFC1831] and [RFC1832].  The
   RPCSEC_GSS security flavor as defined in [RFC2203] MUST be used as
   the mechanism to deliver stronger security for the NFS version 4

3.1.  Ports and Transports

   Historically, NFS version 2 and version 3 servers have resided on
   port 2049.  The registered port 2049 [RFC3232] for the NFS protocol
   should be the default configuration.  Using the registered port for
   NFS services means the NFS client will not need to use the RPC
   binding protocols as described in [RFC1833]; this will allow NFS to
   transit firewalls.

   Where an NFS version 4 implementation supports operation over the IP
   network protocol, the supported transports between NFS and IP MUST be
   among the IETF-approved congestion control transport protocols, which
   include TCP and SCTP.  To enhance the possibilities for
   interoperability, an NFS version 4 implementation MUST support
   operation over the TCP transport protocol, at least until such time
   as a standards track RFC revises this requirement to use a different
   IETF-approved congestion control transport protocol.

   If TCP is used as the transport, the client and server SHOULD use
   persistent connections.  This will prevent the weakening of TCP's
   congestion control via short lived connections and will improve
   performance for the WAN environment by eliminating the need for SYN

Top      Up      ToC       Page 24 
   As noted in the Security Considerations section, the authentication
   model for NFS version 4 has moved from machine-based to principal-
   based.  However, this modification of the authentication model does
   not imply a technical requirement to move the TCP connection
   management model from whole machine-based to one based on a per user
   model.  In particular, NFS over TCP client implementations have
   traditionally multiplexed traffic for multiple users over a common
   TCP connection between an NFS client and server.  This has been true,
   regardless whether the NFS client is using AUTH_SYS, AUTH_DH,
   RPCSEC_GSS or any other flavor.  Similarly, NFS over TCP server
   implementations have assumed such a model and thus scale the
   implementation of TCP connection management in proportion to the
   number of expected client machines.  It is intended that NFS version
   4 will not modify this connection management model.  NFS version 4
   clients that violate this assumption can expect scaling issues on the
   server and hence reduced service.

   Note that for various timers, the client and server should avoid
   inadvertent synchronization of those timers.  For further discussion
   of the general issue refer to [Floyd].

3.1.1.  Client Retransmission Behavior

   When processing a request received over a reliable transport such as
   TCP, the NFS version 4 server MUST NOT silently drop the request,
   except if the transport connection has been broken.  Given such a
   contract between NFS version 4 clients and servers, clients MUST NOT
   retry a request unless one or both of the following are true:

   o  The transport connection has been broken

   o  The procedure being retried is the NULL procedure

   Since reliable transports, such as TCP, do not always synchronously
   inform a peer when the other peer has broken the connection (for
   example, when an NFS server reboots), the NFS version 4 client may
   want to actively "probe" the connection to see if has been broken.
   Use of the NULL procedure is one recommended way to do so.  So, when
   a client experiences a remote procedure call timeout (of some
   arbitrary implementation specific amount), rather than retrying the
   remote procedure call, it could instead issue a NULL procedure call
   to the server.  If the server has died, the transport connection
   break will eventually be indicated to the NFS version 4 client.  The
   client can then reconnect, and then retry the original request.  If
   the NULL procedure call gets a response, the connection has not
   broken.  The client can decide to wait longer for the original
   request's response, or it can break the transport connection and
   reconnect before re-sending the original request.

Top      Up      ToC       Page 25 
   For callbacks from the server to the client, the same rules apply,
   but the server doing the callback becomes the client, and the client
   receiving the callback becomes the server.

3.2.  Security Flavors

   Traditional RPC implementations have included AUTH_NONE, AUTH_SYS,
   AUTH_DH, and AUTH_KRB4 as security flavors.  With [RFC2203] an
   additional security flavor of RPCSEC_GSS has been introduced which
   uses the functionality of GSS-API [RFC2743].  This allows for the use
   of various security mechanisms by the RPC layer without the
   additional implementation overhead of adding RPC security flavors.
   For NFS version 4, the RPCSEC_GSS security flavor MUST be used to
   enable the mandatory security mechanism.  Other flavors, such as,
   AUTH_NONE, AUTH_SYS, and AUTH_DH MAY be implemented as well.

3.2.1.  Security mechanisms for NFS version 4

   The use of RPCSEC_GSS requires selection of: mechanism, quality of
   protection, and service (authentication, integrity, privacy).  The
   remainder of this document will refer to these three parameters of
   the RPCSEC_GSS security as the security triple.  Kerberos V5 as a security triple

   The Kerberos V5 GSS-API mechanism as described in [RFC1964] MUST be
   implemented and provide the following security triples.

   column descriptions:

   1 == number of pseudo flavor
   2 == name of pseudo flavor
   3 == mechanism's OID
   4 == mechanism's algorithm(s)
   5 == RPCSEC_GSS service

   1      2     3                    4             5
   390003 krb5  1.2.840.113554.1.2.2 DES MAC MD5   rpc_gss_svc_none
   390004 krb5i 1.2.840.113554.1.2.2 DES MAC MD5   rpc_gss_svc_integrity
   390005 krb5p 1.2.840.113554.1.2.2 DES MAC MD5   rpc_gss_svc_privacy
                                     for integrity,
                                     and 56 bit DES
                                     for privacy.

   Note that the pseudo flavor is presented here as a mapping aid to the
   implementor.  Because this NFS protocol includes a method to
   negotiate security and it understands the GSS-API mechanism, the

Top      Up      ToC       Page 26 
   pseudo flavor is not needed.  The pseudo flavor is needed for NFS
   version 3 since the security negotiation is done via the MOUNT

   For a discussion of NFS' use of RPCSEC_GSS and Kerberos V5, please
   see [RFC2623].

   Users and implementors are warned that 56 bit DES is no longer
   considered state of the art in terms of resistance to brute force
   attacks.  Once a revision to [RFC1964] is available that adds support
   for AES, implementors are urged to incorporate AES into their NFSv4
   over Kerberos V5 protocol stacks, and users are similarly urged to
   migrate to the use of AES.  LIPKEY as a security triple

   The LIPKEY GSS-API mechanism as described in [RFC2847] MUST be
   implemented and provide the following security triples.  The
   definition of the columns matches the previous subsection "Kerberos
   V5 as security triple"

   1      2        3                   4              5
   390006 lipkey       negotiated  rpc_gss_svc_none
   390007 lipkey-i       negotiated  rpc_gss_svc_integrity
   390008 lipkey-p       negotiated  rpc_gss_svc_privacy

   The mechanism algorithm is listed as "negotiated".  This is because
   LIPKEY is layered on SPKM-3 and in SPKM-3 [RFC2847] the
   confidentiality and integrity algorithms are negotiated.  Since
   SPKM-3 specifies HMAC-MD5 for integrity as MANDATORY, 128 bit
   cast5CBC for confidentiality for privacy as MANDATORY, and further
   specifies that HMAC-MD5 and cast5CBC MUST be listed first before
   weaker algorithms, specifying "negotiated" in column 4 does not
   impair interoperability.  In the event an SPKM-3 peer does not
   support the mandatory algorithms, the other peer is free to accept or
   reject the GSS-API context creation.

   Because SPKM-3 negotiates the algorithms, subsequent calls to
   LIPKEY's GSS_Wrap() and GSS_GetMIC() by RPCSEC_GSS will use a quality
   of protection value of 0 (zero).  See section 5.2 of [RFC2025] for an

   LIPKEY uses SPKM-3 to create a secure channel in which to pass a user
   name and password from the client to the server.  Once the user name
   and password have been accepted by the server, calls to the LIPKEY
   context are redirected to the SPKM-3 context.  See [RFC2847] for more

Top      Up      ToC       Page 27  SPKM-3 as a security triple

   The SPKM-3 GSS-API mechanism as described in [RFC2847] MUST be
   implemented and provide the following security triples.  The
   definition of the columns matches the previous subsection "Kerberos
   V5 as security triple".

   1      2        3                   4              5
   390009 spkm3     negotiated  rpc_gss_svc_none
   390010 spkm3i     negotiated  rpc_gss_svc_integrity
   390011 spkm3p     negotiated  rpc_gss_svc_privacy

   For a discussion as to why the mechanism algorithm is listed as
   "negotiated", see the previous section "LIPKEY as a security triple."

   Because SPKM-3 negotiates the algorithms, subsequent calls to SPKM-
   3's GSS_Wrap() and GSS_GetMIC() by RPCSEC_GSS will use a quality of
   protection value of 0 (zero).  See section 5.2 of [RFC2025] for an

   Even though LIPKEY is layered over SPKM-3, SPKM-3 is specified as a
   mandatory set of triples to handle the situations where the initiator
   (the client) is anonymous or where the initiator has its own
   certificate.  If the initiator is anonymous, there will not be a user
   name and password to send to the target (the server).  If the
   initiator has its own certificate, then using passwords is

3.3.  Security Negotiation

   With the NFS version 4 server potentially offering multiple security
   mechanisms, the client needs a method to determine or negotiate which
   mechanism is to be used for its communication with the server.  The
   NFS server may have multiple points within its filesystem name space
   that are available for use by NFS clients.  In turn the NFS server
   may be configured such that each of these entry points may have
   different or multiple security mechanisms in use.

   The security negotiation between client and server must be done with
   a secure channel to eliminate the possibility of a third party
   intercepting the negotiation sequence and forcing the client and
   server to choose a lower level of security than required or desired.
   See the section "Security Considerations" for further discussion.

Top      Up      ToC       Page 28 
3.3.1.  SECINFO

   The new SECINFO operation will allow the client to determine, on a
   per filehandle basis, what security triple is to be used for server
   access.  In general, the client will not have to use the SECINFO
   operation except during initial communication with the server or when
   the client crosses policy boundaries at the server.  It is possible
   that the server's policies change during the client's interaction
   therefore forcing the client to negotiate a new security triple.

3.3.2.  Security Error

   Based on the assumption that each NFS version 4 client and server
   must support a minimum set of security (i.e., LIPKEY, SPKM-3, and
   Kerberos-V5 all under RPCSEC_GSS), the NFS client will start its
   communication with the server with one of the minimal security
   triples.  During communication with the server, the client may
   receive an NFS error of NFS4ERR_WRONGSEC.  This error allows the
   server to notify the client that the security triple currently being
   used is not appropriate for access to the server's filesystem
   resources.  The client is then responsible for determining what
   security triples are available at the server and choose one which is
   appropriate for the client.  See the section for the "SECINFO"
   operation for further discussion of how the client will respond to
   the NFS4ERR_WRONGSEC error and use SECINFO.

3.4.  Callback RPC Authentication

   Except as noted elsewhere in this section, the callback RPC
   (described later) MUST mutually authenticate the NFS server to the
   principal that acquired the clientid (also described later), using
   the security flavor the original SETCLIENTID operation used.

   For AUTH_NONE, there are no principals, so this is a non-issue.

   AUTH_SYS has no notions of mutual authentication or a server
   principal, so the callback from the server simply uses the AUTH_SYS
   credential that the user used when he set up the delegation.

   For AUTH_DH, one commonly used convention is that the server uses the
   credential corresponding to this AUTH_DH principal:

   where host and domain are variables corresponding to the name of
   server host and directory services domain in which it lives such as a
   Network Information System domain or a DNS domain.

Top      Up      ToC       Page 29 
   Because LIPKEY is layered over SPKM-3, it is permissible for the
   server to use SPKM-3 and not LIPKEY for the callback even if the
   client used LIPKEY for SETCLIENTID.

   Regardless of what security mechanism under RPCSEC_GSS is being used,
   the NFS server, MUST identify itself in GSS-API via a
   names are of the form:


   For NFS, the "service" element is


   Implementations of security mechanisms will convert nfs@hostname to
   various different forms.  For Kerberos V5 and LIPKEY, the following
   form is RECOMMENDED:


   For Kerberos V5, nfs/hostname would be a server principal in the
   Kerberos Key Distribution Center database.  This is the same
   principal the client acquired a GSS-API context for when it issued
   the SETCLIENTID operation, therefore, the realm name for the server
   principal must be the same for the callback as it was for the

   For LIPKEY, this would be the username passed to the target (the NFS
   version 4 client that receives the callback).

   It should be noted that LIPKEY may not work for callbacks, since the
   LIPKEY client uses a user id/password.  If the NFS client receiving
   the callback can authenticate the NFS server's user name/password
   pair, and if the user that the NFS server is authenticating to has a
   public key certificate, then it works.

   In situations where the NFS client uses LIPKEY and uses a per-host
   principal for the SETCLIENTID operation, instead of using LIPKEY for
   SETCLIENTID, it is RECOMMENDED that SPKM-3 with mutual authentication
   be used.  This effectively means that the client will use a
   certificate to authenticate and identify the initiator to the target
   on the NFS server.  Using SPKM-3 and not LIPKEY has the following

   o  When the server does a callback, it must authenticate to the
      principal used in the SETCLIENTID.  Even if LIPKEY is used,
      because LIPKEY is layered over SPKM-3, the NFS client will need to

Top      Up      ToC       Page 30 
      have a certificate that corresponds to the principal used in the
      SETCLIENTID operation.  From an administrative perspective, having
      a user name, password, and certificate for both the client and
      server is redundant.

   o  LIPKEY was intended to minimize additional infrastructure
      requirements beyond a certificate for the target, and the
      expectation is that existing password infrastructure can be
      leveraged for the initiator.  In some environments, a per-host
      password does not exist yet.  If certificates are used for any
      per-host principals, then additional password infrastructure is
      not needed.

   o  In cases when a host is both an NFS client and server, it can
      share the same per-host certificate.

4.  Filehandles

   The filehandle in the NFS protocol is a per server unique identifier
   for a filesystem object.  The contents of the filehandle are opaque
   to the client.  Therefore, the server is responsible for translating
   the filehandle to an internal representation of the filesystem

4.1.  Obtaining the First Filehandle

   The operations of the NFS protocol are defined in terms of one or
   more filehandles.  Therefore, the client needs a filehandle to
   initiate communication with the server.  With the NFS version 2
   protocol [RFC1094] and the NFS version 3 protocol [RFC1813], there
   exists an ancillary protocol to obtain this first filehandle.  The
   MOUNT protocol, RPC program number 100005, provides the mechanism of
   translating a string based filesystem path name to a filehandle which
   can then be used by the NFS protocols.

   The MOUNT protocol has deficiencies in the area of security and use
   via firewalls.  This is one reason that the use of the public
   filehandle was introduced in [RFC2054] and [RFC2055].  With the use
   of the public filehandle in combination with the LOOKUP operation in
   the NFS version 2 and 3 protocols, it has been demonstrated that the
   MOUNT protocol is unnecessary for viable interaction between NFS
   client and server.

   Therefore, the NFS version 4 protocol will not use an ancillary
   protocol for translation from string based path names to a
   filehandle.  Two special filehandles will be used as starting points
   for the NFS client.

Top      Up      ToC       Page 31 
4.1.1.  Root Filehandle

   The first of the special filehandles is the ROOT filehandle.  The
   ROOT filehandle is the "conceptual" root of the filesystem name space
   at the NFS server.  The client uses or starts with the ROOT
   filehandle by employing the PUTROOTFH operation.  The PUTROOTFH
   operation instructs the server to set the "current" filehandle to the
   ROOT of the server's file tree.  Once this PUTROOTFH operation is
   used, the client can then traverse the entirety of the server's file
   tree with the LOOKUP operation.  A complete discussion of the server
   name space is in the section "NFS Server Name Space".

4.1.2.  Public Filehandle

   The second special filehandle is the PUBLIC filehandle.  Unlike the
   ROOT filehandle, the PUBLIC filehandle may be bound or represent an
   arbitrary filesystem object at the server.  The server is responsible
   for this binding.  It may be that the PUBLIC filehandle and the ROOT
   filehandle refer to the same filesystem object.  However, it is up to
   the administrative software at the server and the policies of the
   server administrator to define the binding of the PUBLIC filehandle
   and server filesystem object.  The client may not make any
   assumptions about this binding.  The client uses the PUBLIC
   filehandle via the PUTPUBFH operation.

4.2.  Filehandle Types

   In the NFS version 2 and 3 protocols, there was one type of
   filehandle with a single set of semantics.  This type of filehandle
   is termed "persistent" in NFS Version 4.  The semantics of a
   persistent filehandle remain the same as before.  A new type of
   filehandle introduced in NFS Version 4 is the "volatile" filehandle,
   which attempts to accommodate certain server environments.

   The volatile filehandle type was introduced to address server
   functionality or implementation issues which make correct
   implementation of a persistent filehandle infeasible.  Some server
   environments do not provide a filesystem level invariant that can be
   used to construct a persistent filehandle.  The underlying server
   filesystem may not provide the invariant or the server's filesystem
   programming interfaces may not provide access to the needed
   invariant.  Volatile filehandles may ease the implementation of
   server functionality such as hierarchical storage management or
   filesystem reorganization or migration.  However, the volatile
   filehandle increases the implementation burden for the client.

Top      Up      ToC       Page 32 
   Since the client will need to handle persistent and volatile
   filehandles differently, a file attribute is defined which may be
   used by the client to determine the filehandle types being returned
   by the server.

4.2.1.  General Properties of a Filehandle

   The filehandle contains all the information the server needs to
   distinguish an individual file.  To the client, the filehandle is
   opaque.  The client stores filehandles for use in a later request and
   can compare two filehandles from the same server for equality by
   doing a byte-by-byte comparison.  However, the client MUST NOT
   otherwise interpret the contents of filehandles.  If two filehandles
   from the same server are equal, they MUST refer to the same file.
   Servers SHOULD try to maintain a one-to-one correspondence between
   filehandles and files but this is not required.  Clients MUST use
   filehandle comparisons only to improve performance, not for correct
   behavior.  All clients need to be prepared for situations in which it
   cannot be determined whether two filehandles denote the same object
   and in such cases, avoid making invalid assumptions which might cause
   incorrect behavior.  Further discussion of filehandle and attribute
   comparison in the context of data caching is presented in the section
   "Data Caching and File Identity".

   As an example, in the case that two different path names when
   traversed at the server terminate at the same filesystem object, the
   server SHOULD return the same filehandle for each path.  This can
   occur if a hard link is used to create two file names which refer to
   the same underlying file object and associated data.  For example, if
   paths /a/b/c and /a/d/c refer to the same file, the server SHOULD
   return the same filehandle for both path names traversals.

4.2.2.  Persistent Filehandle

   A persistent filehandle is defined as having a fixed value for the
   lifetime of the filesystem object to which it refers.  Once the
   server creates the filehandle for a filesystem object, the server
   MUST accept the same filehandle for the object for the lifetime of
   the object.  If the server restarts or reboots the NFS server must
   honor the same filehandle value as it did in the server's previous
   instantiation.  Similarly, if the filesystem is migrated, the new NFS
   server must honor the same filehandle as the old NFS server.

   The persistent filehandle will be become stale or invalid when the
   filesystem object is removed.  When the server is presented with a
   persistent filehandle that refers to a deleted object, it MUST return
   an error of NFS4ERR_STALE.  A filehandle may become stale when the
   filesystem containing the object is no longer available.  The file

Top      Up      ToC       Page 33 
   system may become unavailable if it exists on removable media and the
   media is no longer available at the server or the filesystem in whole
   has been destroyed or the filesystem has simply been removed from the
   server's name space (i.e., unmounted in a UNIX environment).

4.2.3.  Volatile Filehandle

   A volatile filehandle does not share the same longevity
   characteristics of a persistent filehandle.  The server may determine
   that a volatile filehandle is no longer valid at many different
   points in time.  If the server can definitively determine that a
   volatile filehandle refers to an object that has been removed, the
   server should return NFS4ERR_STALE to the client (as is the case for
   persistent filehandles).  In all other cases where the server
   determines that a volatile filehandle can no longer be used, it
   should return an error of NFS4ERR_FHEXPIRED.

   The mandatory attribute "fh_expire_type" is used by the client to
   determine what type of filehandle the server is providing for a
   particular filesystem.  This attribute is a bitmask with the
   following values:

             The value of FH4_PERSISTENT is used to indicate a
             persistent filehandle, which is valid until the object is
             removed from the filesystem.  The server will not return
             NFS4ERR_FHEXPIRED for this filehandle.  FH4_PERSISTENT is
             defined as a value in which none of the bits specified
             below are set.

             The filehandle may expire at any time, except as
             specifically excluded (i.e., FH4_NO_EXPIRE_WITH_OPEN).

             May only be set when FH4_VOLATILE_ANY is set.  If this bit
             is set, then the meaning of FH4_VOLATILE_ANY is qualified
             to exclude any expiration of the filehandle when it is

             The filehandle will expire as a result of migration.  If
             FH4_VOL_ANY is set, FH4_VOL_MIGRATION is redundant.

Top      Up      ToC       Page 34 
             The filehandle will expire during rename.  This includes a
             rename by the requesting client or a rename by any other
             client.  If FH4_VOL_ANY is set, FH4_VOL_RENAME is

   Servers which provide volatile filehandles that may expire while open
   (i.e., if FH4_VOL_MIGRATION or FH4_VOL_RENAME is set or if
   FH4_VOLATILE_ANY is set and FH4_NOEXPIRE_WITH_OPEN not set), should
   deny a RENAME or REMOVE that would affect an OPEN file of any of the
   components leading to the OPEN file.  In addition, the server should
   deny all RENAME or REMOVE requests during the grace period upon
   server restart.

   Note that the bits FH4_VOL_MIGRATION and FH4_VOL_RENAME allow the
   client to determine that expiration has occurred whenever a specific
   event occurs, without an explicit filehandle expiration error from
   the server.  FH4_VOL_ANY does not provide this form of information.
   In situations where the server will expire many, but not all
   filehandles upon migration (e.g., all but those that are open),
   FH4_VOLATILE_ANY (in this case with FH4_NOEXPIRE_WITH_OPEN) is a
   better choice since the client may not assume that all filehandles
   will expire when migration occurs, and it is likely that additional
   expirations will occur (as a result of file CLOSE) that are separated
   in time from the migration event itself.

4.2.4.  One Method of Constructing a Volatile Filehandle

   A volatile filehandle, while opaque to the client could contain:

   [volatile bit = 1 | server boot time | slot | generation number]

   o  slot is an index in the server volatile filehandle table

   o  generation number is the generation number for the table

   When the client presents a volatile filehandle, the server makes the
   following checks, which assume that the check for the volatile bit
   has passed.  If the server boot time is less than the current server
   boot time, return NFS4ERR_FHEXPIRED.  If slot is out of range, return
   NFS4ERR_BADHANDLE.  If the generation number does not match, return

   When the server reboots, the table is gone (it is volatile).

   If volatile bit is 0, then it is a persistent filehandle with a
   different structure following it.

Top      Up      ToC       Page 35 
4.3.  Client Recovery from Filehandle Expiration

   If possible, the client SHOULD recover from the receipt of an
   NFS4ERR_FHEXPIRED error.  The client must take on additional
   responsibility so that it may prepare itself to recover from the
   expiration of a volatile filehandle.  If the server returns
   persistent filehandles, the client does not need these additional

   For volatile filehandles, most commonly the client will need to store
   the component names leading up to and including the filesystem object
   in question.  With these names, the client should be able to recover
   by finding a filehandle in the name space that is still available or
   by starting at the root of the server's filesystem name space.

   If the expired filehandle refers to an object that has been removed
   from the filesystem, obviously the client will not be able to recover
   from the expired filehandle.

   It is also possible that the expired filehandle refers to a file that
   has been renamed.  If the file was renamed by another client, again
   it is possible that the original client will not be able to recover.
   However, in the case that the client itself is renaming the file and
   the file is open, it is possible that the client may be able to
   recover.  The client can determine the new path name based on the
   processing of the rename request.  The client can then regenerate the
   new filehandle based on the new path name.  The client could also use
   the compound operation mechanism to construct a set of operations
           RENAME A B
           LOOKUP B

   Note that the COMPOUND procedure does not provide atomicity.  This
   example only reduces the overhead of recovering from an expired

5.  File Attributes

   To meet the requirements of extensibility and increased
   interoperability with non-UNIX platforms, attributes must be handled
   in a flexible manner.  The NFS version 3 fattr3 structure contains a
   fixed list of attributes that not all clients and servers are able to
   support or care about.  The fattr3 structure can not be extended as
   new needs arise and it provides no way to indicate non-support.  With
   the NFS version 4 protocol, the client is able query what attributes
   the server supports and construct requests with only those supported
   attributes (or a subset thereof).

Top      Up      ToC       Page 36 
   To this end, attributes are divided into three groups: mandatory,
   recommended, and named.  Both mandatory and recommended attributes
   are supported in the NFS version 4 protocol by a specific and well-
   defined encoding and are identified by number.  They are requested by
   setting a bit in the bit vector sent in the GETATTR request; the
   server response includes a bit vector to list what attributes were
   returned in the response.  New mandatory or recommended attributes
   may be added to the NFS protocol between major revisions by
   publishing a standards-track RFC which allocates a new attribute
   number value and defines the encoding for the attribute.  See the
   section "Minor Versioning" for further discussion.

   Named attributes are accessed by the new OPENATTR operation, which
   accesses a hidden directory of attributes associated with a file
   system object.  OPENATTR takes a filehandle for the object and
   returns the filehandle for the attribute hierarchy.  The filehandle
   for the named attributes is a directory object accessible by LOOKUP
   or READDIR and contains files whose names represent the named
   attributes and whose data bytes are the value of the attribute.  For

      LOOKUP     "foo"       ; look up file
      GETATTR    attrbits
      OPENATTR               ; access foo's named attributes
      LOOKUP     "x11icon"   ; look up specific attribute
      READ       0,4096      ; read stream of bytes

   Named attributes are intended for data needed by applications rather
   than by an NFS client implementation.  NFS implementors are strongly
   encouraged to define their new attributes as recommended attributes
   by bringing them to the IETF standards-track process.

   The set of attributes which are classified as mandatory is
   deliberately small since servers must do whatever it takes to support
   them.  A server should support as many of the recommended attributes
   as possible but by their definition, the server is not required to
   support all of them.  Attributes are deemed mandatory if the data is
   both needed by a large number of clients and is not otherwise
   reasonably computable by the client when support is not provided on
   the server.

   Note that the hidden directory returned by OPENATTR is a convenience
   for protocol processing.  The client should not make any assumptions
   about the server's implementation of named attributes and whether the
   underlying filesystem at the server has a named attribute directory
   or not.  Therefore, operations such as SETATTR and GETATTR on the
   named attribute directory are undefined.

Top      Up      ToC       Page 37 
5.1.  Mandatory Attributes

   These MUST be supported by every NFS version 4 client and server in
   order to ensure a minimum level of interoperability.  The server must
   store and return these attributes and the client must be able to
   function with an attribute set limited to these attributes.  With
   just the mandatory attributes some client functionality may be
   impaired or limited in some ways.  A client may ask for any of these
   attributes to be returned by setting a bit in the GETATTR request and
   the server must return their value.

5.2.  Recommended Attributes

   These attributes are understood well enough to warrant support in the
   NFS version 4 protocol.  However, they may not be supported on all
   clients and servers.  A client may ask for any of these attributes to
   be returned by setting a bit in the GETATTR request but must handle
   the case where the server does not return them.  A client may ask for
   the set of attributes the server supports and should not request
   attributes the server does not support.  A server should be tolerant
   of requests for unsupported attributes and simply not return them
   rather than considering the request an error.  It is expected that
   servers will support all attributes they comfortably can and only
   fail to support attributes which are difficult to support in their
   operating environments.  A server should provide attributes whenever
   they don't have to "tell lies" to the client.  For example, a file
   modification time should be either an accurate time or should not be
   supported by the server.  This will not always be comfortable to
   clients but the client is better positioned decide whether and how to
   fabricate or construct an attribute or whether to do without the

5.3.  Named Attributes

   These attributes are not supported by direct encoding in the NFS
   Version 4 protocol but are accessed by string names rather than
   numbers and correspond to an uninterpreted stream of bytes which are
   stored with the filesystem object.  The name space for these
   attributes may be accessed by using the OPENATTR operation.  The
   OPENATTR operation returns a filehandle for a virtual "attribute
   directory" and further perusal of the name space may be done using
   READDIR and LOOKUP operations on this filehandle.  Named attributes
   may then be examined or changed by normal READ and WRITE and CREATE
   operations on the filehandles returned from READDIR and LOOKUP.
   Named attributes may have attributes.

Top      Up      ToC       Page 38 
   It is recommended that servers support arbitrary named attributes.  A
   client should not depend on the ability to store any named attributes
   in the server's filesystem.  If a server does support named
   attributes, a client which is also able to handle them should be able
   to copy a file's data and meta-data with complete transparency from
   one location to another; this would imply that names allowed for
   regular directory entries are valid for named attribute names as

   Names of attributes will not be controlled by this document or other
   IETF standards track documents.  See the section "IANA
   Considerations" for further discussion.

5.4.  Classification of Attributes

   Each of the Mandatory and Recommended attributes can be classified in
   one of three categories: per server, per filesystem, or per
   filesystem object.  Note that it is possible that some per filesystem
   attributes may vary within the filesystem.  See the "homogeneous"
   attribute for its definition.  Note that the attributes
   time_access_set and time_modify_set are not listed in this section
   because they are write-only attributes corresponding to time_access
   and time_modify, and are used in a special instance of SETATTR.

   o  The per server attribute is:


   o  The per filesystem attributes are:

      supp_attr, fh_expire_type, link_support, symlink_support,
      unique_handles, aclsupport, cansettime, case_insensitive,
      case_preserving, chown_restricted, files_avail, files_free,
      files_total, fs_locations, homogeneous, maxfilesize, maxname,
      maxread, maxwrite, no_trunc, space_avail, space_free, space_total,

   o  The per filesystem object attributes are:

      type, change, size, named_attr, fsid, rdattr_error, filehandle,
      ACL, archive, fileid, hidden, maxlink, mimetype, mode, numlinks,
      owner, owner_group, rawdev, space_used, system, time_access,
      time_backup, time_create, time_metadata, time_modify,

   For quota_avail_hard, quota_avail_soft, and quota_used see their
   definitions below for the appropriate classification.

Top      Up      ToC       Page 39 
5.5.  Mandatory Attributes - Definitions

   Name              #    DataType     Access   Description
   supp_attr         0    bitmap       READ     The bit vector which
                                                would retrieve all
                                                mandatory and
                                                recommended attributes
                                                that are supported for
                                                this object.  The
                                                scope of this
                                                attribute applies to
                                                all objects with a
                                                matching fsid.

   type              1    nfs4_ftype   READ     The type of the object
                                                (file, directory,
                                                symlink, etc.)

   fh_expire_type    2    uint32       READ     Server uses this to
                                                specify filehandle
                                                expiration behavior to
                                                the client.  See the
                                                section "Filehandles"
                                                for additional

   change            3    uint64       READ     A value created by the
                                                server that the client
                                                can use to determine
                                                if file data,
                                                directory contents or
                                                attributes of the
                                                object have been
                                                modified.  The server
                                                may return the
                                                object's time_metadata
                                                attribute for this
                                                attribute's value but
                                                only if the filesystem
                                                object can not be
                                                updated more
                                                frequently than the
                                                resolution of

   size              4    uint64       R/W      The size of the object
                                                in bytes.

Top      Up      ToC       Page 40 
   link_support      5    bool         READ     True, if the object's
                                                filesystem supports
                                                hard links.

   symlink_support   6    bool         READ     True, if the object's
                                                filesystem supports
                                                symbolic links.

   named_attr        7    bool         READ     True, if this object
                                                has named attributes.
                                                In other words, object
                                                has a non-empty named
                                                attribute directory.

   fsid              8    fsid4        READ     Unique filesystem
                                                identifier for the
                                                filesystem holding
                                                this object.  fsid
                                                contains major and
                                                minor components each
                                                of which are uint64.

   unique_handles    9    bool         READ     True, if two distinct
                                                filehandles guaranteed
                                                to refer to two
                                                different filesystem

   lease_time        10   nfs_lease4   READ     Duration of leases at
                                                server in seconds.

   rdattr_error      11   enum         READ     Error returned from
                                                getattr during

   filehandle        19   nfs_fh4      READ     The filehandle of this
                                                object (primarily for
                                                readdir requests).

Top      Up      ToC       Page 41 
5.6.  Recommended Attributes - Definitions

   Name                #    Data Type      Access   Description
   ACL                 12   nfsace4<>      R/W      The access control
                                                    list for the object.

   aclsupport          13   uint32         READ     Indicates what types
                                                    of ACLs are
                                                    supported on the
                                                    current filesystem.

   archive             14   bool           R/W      True, if this file
                                                    has been archived
                                                    since the time of
                                                    last modification
                                                    (deprecated in favor
                                                    of time_backup).

   cansettime          15   bool           READ     True, if the server
                                                    is able to change
                                                    the times for a
                                                    filesystem object as
                                                    specified in a
                                                    SETATTR operation.

   case_insensitive    16   bool           READ     True, if filename
                                                    comparisons on this
                                                    filesystem are case

   case_preserving     17   bool           READ     True, if filename
                                                    case on this
                                                    filesystem are

   chown_restricted    18   bool           READ     If TRUE, the server
                                                    will reject any
                                                    request to change
                                                    either the owner or
                                                    the group associated
                                                    with a file if the
                                                    caller is not a
                                                    privileged user (for
                                                    example, "root" in
                                                    UNIX operating
                                                    environments or in
                                                    Windows 2000 the

Top      Up      ToC       Page 42 
                                                    "Take Ownership"

   fileid              20   uint64         READ     A number uniquely
                                                    identifying the file
                                                    within the

   files_avail         21   uint64         READ     File slots available
                                                    to this user on the
                                                    containing this
                                                    object - this should
                                                    be the smallest
                                                    relevant limit.

   files_free          22   uint64         READ     Free file slots on
                                                    the filesystem
                                                    containing this
                                                    object - this should
                                                    be the smallest
                                                    relevant limit.

   files_total         23   uint64         READ     Total file slots on
                                                    the filesystem
                                                    containing this

   fs_locations        24   fs_locations   READ     Locations where this
                                                    filesystem may be
                                                    found.  If the
                                                    server returns
                                                    as an error, this
                                                    attribute MUST be

   hidden              25   bool           R/W      True, if the file is
                                                    considered hidden
                                                    with respect to the
                                                    Windows API.

   homogeneous         26   bool           READ     True, if this
                                                    object's filesystem
                                                    is homogeneous,
                                                    i.e., are per
                                                    attributes the same

Top      Up      ToC       Page 43 
                                                    for all filesystem's

   maxfilesize         27   uint64         READ     Maximum supported
                                                    file size for the
                                                    filesystem of this

   maxlink             28   uint32         READ     Maximum number of
                                                    links for this

   maxname             29   uint32         READ     Maximum filename
                                                    size supported for
                                                    this object.

   maxread             30   uint64         READ     Maximum read size
                                                    supported for this

   maxwrite            31   uint64         READ     Maximum write size
                                                    supported for this
                                                    object.  This
                                                    attribute SHOULD be
                                                    supported if the
                                                    file is writable.
                                                    Lack of this
                                                    attribute can
                                                    lead to the client
                                                    either wasting
                                                    bandwidth or not
                                                    receiving the best

   mimetype            32   utf8<>         R/W      MIME body
                                                    type/subtype of this

   mode                33   mode4          R/W      UNIX-style mode and
                                                    permission bits for
                                                    this object.

   no_trunc            34   bool           READ     True, if a name
                                                    longer than name_max
                                                    is used, an error be
                                                    returned and name is
                                                    not truncated.

Top      Up      ToC       Page 44 
   numlinks            35   uint32         READ     Number of hard links
                                                    to this object.

   owner               36   utf8<>         R/W      The string name of
                                                    the owner of this

   owner_group         37   utf8<>         R/W      The string name of
                                                    the group ownership
                                                    of this object.

   quota_avail_hard    38   uint64         READ     For definition see
                                                    "Quota Attributes"
                                                    section below.

   quota_avail_soft    39   uint64         READ     For definition see
                                                    "Quota Attributes"
                                                    section below.

   quota_used          40   uint64         READ     For definition see
                                                    "Quota Attributes"
                                                    section below.

   rawdev              41   specdata4      READ     Raw device
                                                    identifier.  UNIX
                                                    device major/minor
                                                    node information.
                                                    If the value of
                                                    type is not
                                                    NF4BLK or NF4CHR,
                                                    the value return
                                                    SHOULD NOT be
                                                    considered useful.

   space_avail         42   uint64         READ     Disk space in bytes
                                                    available to this
                                                    user on the
                                                    containing this
                                                    object - this should
                                                    be the smallest
                                                    relevant limit.

   space_free          43   uint64         READ     Free disk space in
                                                    bytes on the
                                                    containing this
                                                    object - this should

Top      Up      ToC       Page 45 
                                                    be the smallest
                                                    relevant limit.

   space_total         44   uint64         READ     Total disk space in
                                                    bytes on the
                                                    containing this

   space_used          45   uint64         READ     Number of filesystem
                                                    bytes allocated to
                                                    this object.

   system              46   bool           R/W      True, if this file
                                                    is a "system" file
                                                    with respect to the
                                                    Windows API.

   time_access         47   nfstime4       READ     The time of last
                                                    access to the object
                                                    by a read that was
                                                    satisfied by the

   time_access_set     48   settime4       WRITE    Set the time of last
                                                    access to the
                                                    object.  SETATTR
                                                    use only.

   time_backup         49   nfstime4       R/W      The time of last
                                                    backup of the

   time_create         50   nfstime4       R/W      The time of creation
                                                    of the object.  This
                                                    attribute does not
                                                    have any relation to
                                                    the traditional UNIX
                                                    file attribute
                                                    "ctime" or "change

   time_delta          51   nfstime4       READ     Smallest useful
                                                    server time

Top      Up      ToC       Page 46 
   time_metadata       52   nfstime4       READ     The time of last
                                                    modification of the

   time_modify         53   nfstime4       READ     The time of last
                                                    modification to the

   time_modify_set     54   settime4       WRITE    Set the time of last
                                                    modification to the
                                                    object.  SETATTR use

   mounted_on_fileid   55   uint64         READ     Like fileid, but if
                                                    the target
                                                    filehandle is the
                                                    root of a filesystem
                                                    return the fileid of
                                                    the underlying

5.7.  Time Access

   As defined above, the time_access attribute represents the time of
   last access to the object by a read that was satisfied by the server.
   The notion of what is an "access" depends on server's operating
   environment and/or the server's filesystem semantics.  For example,
   for servers obeying POSIX semantics, time_access would be updated
   only by the READLINK, READ, and READDIR operations and not any of the
   operations that modify the content of the object.  Of course, setting
   the corresponding time_access_set attribute is another way to modify
   the time_access attribute.

   Whenever the file object resides on a writable filesystem, the server
   should make best efforts to record time_access into stable storage.
   However, to mitigate the performance effects of doing so, and most
   especially whenever the server is satisfying the read of the object's
   content from its cache, the server MAY cache access time updates and
   lazily write them to stable storage.  It is also acceptable to give
   administrators of the server the option to disable time_access

Next RFC Part