The Network File System (NFS) is a client/server application that lets a computer user view and optionally store and update files on a remote computer as though they were on the user's own computer. The NFS protocol is one of several distributed file system standards for network-attached storage (NAS).
NFS allows the user or system administrator to mount (designate as accessible) all or a portion of a file system on a server. The portion of the file system that is mounted can be accessed by clients with whatever privileges are assigned to each file (read-only or read-write). NFS uses Remote Procedure Calls (RPCs) to route requests between clients and servers.
NFS was originally developed by Sun Microsystems in the 1980's and is now managed by the Internet Engineering Task Force (IETF). NFSv4.2 (RFC-7862) was ratified in November 2016 as a set of extensions to NFSv4 (RFC-3530).
Network File System versions 2 and 3 allow the User Datagram Protocol (UDP) running over an IP network to provide stateless network connections between clients and server, but NFSv4.2 requires use of the Transmission Control Protocol (TCP).
Versions of NFS
NFSv2 -- March 1989
NFS Version 2 (RFC-1094) operates over UDP, keeping the server side stateless, with locking implemented outside of the core protocol. NFSv2 limits file offsets to 32-bit quantity, making the maximum size of files accessible by clients 4.2 GB. Version 2 also limits data transfer size to 8 KB, and requires that NFS servers commit data written by a client to a disk or non-volatile random-access memory (NVRAM) before responding. NFS version 2 is now considered obsolete.
NFSv3 -- June 1995
A stateless file system, NFS version 3 (RFC-1813) extends file offsets from 32- to 64-bits, and relaxes the 8 KB data transfer limitation rule to allow larger read and write transfers. Sun Microsystems added TCP as a transport option in this version. TCP transport makes it possible to use NFS over a wide area network (WAN) and enhances read and write transfer capabilities. NFSv3 supports both TCP and UDP. Version 3 also added a COMMIT operation allowing for reliable asynchronous writes, and an ACCESS RPC that improves support for access control lists (ACLs) and power-users. In NFSv3, the server replies to WRITE RPCs instantly, without syncing to a disk or NVRAM. To ensure that data is on stable storage, the client only need send a COMMIT RPC. Despite the release of versions 4, 4.1 and 4.2., NFSv3 remains the most widely used version of NFS.
NFSv4 -- April 2003
NFS version 4 (RFC-3530) is a stateful file system offering strong authentication, advanced file caching, improved internationalization capability, and better support for Microsoft Windows filesharing. Rather than mounted separately, exports in this version can be mounted together in a directory tree structure. Additionally, NFSv4 employs integrated locking that is lease based within the same protocol rather than permanent as in NFSv3. Communication is handled with compound RPCs for improved performance while the mandated use of TCP enhances reliability.
NFSv4.1 -- January 2010
A minor version protocol, NFSv4.1 (RFC-5661) adds features that enable the use of NFS on global WANs. This update standardizes parallel NFS (pNFS) to address bandwidth and scalability issues, and because the ASCII character set no longer provides the descriptive capabilities needed for languages with large alphabets, this update adds internationalization support using UTF-8 for file names, directories, and other identifiers. UTF-8 is a variable width character encoding that is as compact as ASCII but can also contain Unicode characters. NFSv4.1 also includes a new session model (to maintain the server's state relative to the connections belonging to the client) and directory delegation (the ability to delegate file operations to the accessing client).
NFSv4.2 -- November 2016
The latest minor version update, NFSv4.2 (RFC-7862) adds features to enhance modern scale-out storage architectures. Updates include: server-side copy (SSC enables cloning and snapshots of files by any NFSv4.2 storage server), application Input/Output (I/O) advise, space reservations (ensures a file will have storage available), sparse files (a file containing large blocks of zero data that are transferred as zeros when read from the file), application data block support (ADB allows definition of the format of a file), and labeled NFS which allows partial Security-Enhanced Linux (SELinux) support.
NFS is a low-cost solution for network file sharing that is easy to setup as it uses the existing IP infrastructure. A significant advantage of NFS is that it allows for central management, decreasing the need for added software and disk space on individual user systems. NFS is user-friendly, allowing users to access files on remote hosts in the same way they access local files. This reduces the need for removable media storage devices and increases security as fewer CDs, DVDs, Blu-Ray disks, diskettes and USB drives are in circulation.
NFS is based on RPCs which are inherently insecure and should only be used on a trusted network behind a firewall. Otherwise, NFS will be vulnerable to internet threats. Some reviews of NFSv4 and NFSv4.1 suggest that these versions have limited bandwidth and scalability (improved with NFSv4.2) and that NFS slows down during heavy network traffic.