Difference between NFS v2, v3, v4, v4.1 and v4.2.

In this post we will look at the differences between NFS v2, v3, v4 and the subversions of V4 i.e. v4.1 and v4.2.

Difference between NFS v2, v3 and v4

Option NFS v2 NFS v3 NFS v4 Description
1. Authentication AUTH_SYS AUTH_SYS Kerberos Auth_sys is traditional authentication mechanim and used to send uid and gid is plain text which can be read in network. Hence kerberos is recommended for security.
2. Protocol UDP UDP(default), or TCP TCP NFS v3+ can use TCP. However by default UDP is used on NFS v2, and v3 and TCP is used in NFS v4.
3. RHEL Support RHEL 5, RHEL 6 RHEL 5, RHEL 6, RHEL 7 RHEL 5, RHEL 6, RHEL 7 RHEL7 doesn’t support NFS v2.
4. Year Introduced RFC 1094, March 1989 RFC 1813, June 1995 (RFC 3010, December 2000; revised in RFC 3530, April 2003 and again in RFC 7530, March 2015)
5. State Stateless Stateless Statefull NFS v2 and V3 works on UDP, hence stateless. NFS v4 works on TCP and supports ACLs. Efficient caching can be done in V4 and useful in concurrent transactions by updating user in case someone else changed the file during the same time.
6. RPC Call Type Single Single Compound NFS v2 & v3 used to send separate RPC call for each transaction on wire.For example:- a lookup, open, read, write, and close all operations are sent separately in different RPC calls. However with NFS v4 all calls can be sent as a single command and also executed in one go. It increased the speed of transaction.
7. Exports All exports can be mounted together in a directory tree structure as part of a pseudo-filesystem In NFS v4, we can create a single pseudo filesystem containing all shares from that particular server. It makes easy for client to browse.
8. Locking NLM NLM Inbuilt in NFSv4 Protocol Network Lock Manager was required in NFS v2 and V3 to lock a file over NFS and make changes. In NFS v4, this separate protocol is removed and this functionality in inherited into the main NFS package.
9. Parallel NFS NO No Yes Parallel NFS is a new feature introduced in NFS v4 which starts the transfer multi-threaded and increases the speed.
10. Read Dir Plus Operation No Yes Yes NFSv3 includes READDIRPLUS operation, which helps to get directory listing with file attributes in one go – a major performance improvement.
11. File Size Values 32 bit value limits to 4GB files. However due to bug, its limit is set to 2GB. 64 bitsize can handle files larger than 2GB. 64 bit offset is even larger than 16TB size. 64 bit offset. NFS v3 and V4 can handle any amount of filesize in practical, it all depends on the client. NFS v2 limits the file transfer to 2GB.


Advancements in NFS v4 v4.1 and v4.2

NFS v4 NFS v4.1 NFS v4.2
Stateful Protocol Introduced pNFS extension introduced. New Features Introduced: server-side clone and copy, application I/O advise, sparse files, space reservation, application data block (ADB), labeled NFS with sec_label that accommodates any MAC security system, and two new operations for pNFS (LAYOUTERROR and LAYOUTSTATS). Ref: https://en.wikipedia.org/wiki/Network_File_System#NFSv4

One Reply to “Difference between NFS v2, v3, v4, v4.1 and v4.2.”

Leave a Reply

Your email address will not be published.