NFS Protocol Family

 
The NFS protocol suite includes the following protocols:
MNTV1 Mount protocol version 1, for NFS version 2
Mntv3 Mount protocol version 3, for NFS version 3
NFS2 Sun Network File system version 2
NFS3 Sun Network File system version 3
NFSv4 Sun Network File system version 4
NLMv4 Network Lock Manager version 4
NSMv1 Network Status Monitor protocol

 

MNTV1

ftp://ftp.rfc-editor.org/in-notes/rfc1094.txt.
.
The Mount protocol version 1 for NFS version 2 (MNTv1) is separate from, but related to, the NFS protocol. It provides operating system specific services to get the NFS off the ground -- looks up server path names, validates user identity, and checks access permissions. Clients use the Mount protocol to get the first file handle, which allows them entry into a remote filesystem.
The Mount protocol is kept separate from the NFS protocol to make it easy to plug in new access checking and validation methods without changing the NFS server protocol.
Notice that the protocol definition implies stateful servers because the server maintains a list of client's mount requests. The Mount list information is not critical for the correct functioning of either the client or the server. It is intended for advisory use only, for example, to warn possible clients when a server is going down.
Version one of the Mount protocol is used with version two of the NFS protocol. The only information communicated between these two protocols is the "fhandle" structure. The header structure is as follows:

8
7
6
5
4
3
2
1
Octets
Directory Path Length
1
2
3
4
Directory Path Name
5-N

Directory Path Length
The directory path length.

Directory Path Name
The directory path name.

Interested in more details about testing this protocol? click here

 

Mntv3

ftp://ftp.rfc-editor.org/in-notes/rfc1813.txt.

The supporting Mount protocol version 3 for NFS version 3 protocol performs the operating system-specific functions that allow clients to attach remote directory trees to a point within the local file system. The Mount process also allows the server to grant remote access privileges to a restricted set of clients via export control.

The Lock Manager provides support for file locking when used in the NFS environment. The Network Lock Manager (NLM) protocol isolates the inherently stateful aspects of file locking into a separate protocol. A complete description of the above protocols and their implementation is to be found in [X/OpenNFS].

The normative text is the description of the RPC procedures and arguments and results, which defines the over-the-wire protocol, and the semantics of those procedures. The material describing implementation practice aids the understanding of the protocol specification and describes some possible implementation issues and solutions. It is not possible to describe all implementations and the UNIX operating system implementation of the NFS version 3 protocol is most often used to provide examples. The structure of the protocol is as follows.

8
7
6
5
4
3
2
1
Octets
Directory Path Length
1
2
3
4
Directory Path Name
5-N

Directory path length
The directory path length.

Directory Path Name
The directory path name


Interested in more details about testing this protocol? click here

 

NFS2

ftp://ftp.rfc-editor.org/in-notes/rfc1094.txt.

The Sun Network File system (NFS version 2) protocol provides transparent remote access to shared files across networks. The NFS protocol is designed to be portable across different machines, operating systems, network architectures, and transport protocols. This portability is achieved through the use of Remote Procedure Call (RPC) primitives built on top of an eXternal Data Representation (XDR). Implementations already exist for a variety of machines, from personal computers to supercomputers.

The supporting Mount protocol allows the server to hand out remote access privileges to a restricted set of clients. It performs the operating system-specific functions that allow, for example, to attach remote directory trees to some local file systems. The protocol header is as follows:

8
7
6
5
4
3
2
1
Octets
File info/Directory info
1
.
.
.
.
.
N

File info/Directory info
The File info or directory info.

Interested in more details about testing this protocol? click here

 

NFS3

ftp://ftp.rfc-editor.org/in-notes/rfc1813.txt.

Version 3 of the NFS protocol addresses new requirements, for instance; the need to support larger files and file systems has prompted extensions to allow 64 bit file sizes and offsets. The revision enhances security by adding support for an access check to be done on the server. Performance modifications are of three types:

  1. The number of over-the-wire packets for a given set of file operations is reduced by returning file attributes on every operation, thus decreasing the number of calls to get modified attributes.
  2. The write throughput bottleneck caused by the synchronous definition of write in the NFS version 2 protocol has been addressed by adding support so that the NFS server can do unsafe writes. Unsafe writes are writes which have not been committed to stable storage before the operation returns.
  3. Limitations on transfer sizes have been relaxed.

The ability to support multiple versions of a protocol in RPC will allow implementors of the NFS version 3 protocol to define clients and servers that provide backward compatibility with the existing installed base of NFS version 2 protocol implementations.
The extensions described here represent an evolution of the existing NFS protocol and most of the design features of the NFS protocol previsouly persist. The protocol header structure is as follows:

8
7
6
5
4
3
2
1
Octets
Object info/ File info/ Directory info Length
1
2
3
4
Object info/ File info/ Directory info Name
5-N

Object info/ File info/ Directory info Length
The information length in octets

Object info/ File info/ Directory info Name
The information value (string).
Interested in more details about testing this protocol? click here

 

NFSv4

ftp://ftp.rfc-editor.org/in-notes/rfc3010.txt

NFS (Network File System) version 4 is a distributed file system protocol based on NFS protocol versions 2 [RFC1094] and 3 [RFC1813]. Unlike earlier versions, the NFS version 4 protocol supports traditional file access while integrating support for file locking and the mount protocol. In addition, support for strong security (and its negotiation), compound operations, client caching, and internationalization have been added. Attention has also been applied to making NFS version 4 operate well in an Internet environment.
The goals of the NFS version 4 revision are as follows:

  • Improved access and good performance on the Internet.
  • Strong security with negotiation built into the protocol.
  • Good cross-platform interoperability.
  • Designed for protocol extensions.

The general file system model used for the NFS version 4 protocol is the same as previous versions. The server file system is hierarchical with the regular files contained within being treated as opaque byte streams. In a slight departure, file and directory names are encoded with UTF-8 to deal with the basics of internationalization.
A separate protocol to provide for the initial mapping between path name and filehandle is no longer required. Instead of using the older MOUNT protocol for this mapping, the
server provides a ROOT filehandle that represents the logical root or
top of the file system tree provided by the server.
The protocol header is as follows:

8
7
6
5
4
3
2
1
Octets
Tag Length
1-4
 
Tag (depends on Tag length)
5-N
Minor Version
N+1-N+4
Operation Argument
N+5-N+8

Tag Length
The length in bytes of the tag

Tag
Defined by the implementor

Minor Version
Each minor version number will correspond to an RFC. Minor version zero corresponds to NFSv4

Operation Argument
Operation to be executed by the protocol

Operaton Argument Values:
The operation arg value, can be one of the following:

Value Name
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
ACCESS
CLOSE
COMMIT
CREATE
DELEGPURGE
DELEGRETURN
GETATTR
GETFH
LINK
LOCK
LOCKT
LOCKU
LOOKUP
LOOKUPP
NVERIFY
OPEN
OPENATTR
OPEN_CONFIRM
OPEN_DOWNGRADE
PUTFH
PUTPUBFH
PUTROOTFH
READ
READDIR
READLINK
REMOVE
RENAME
RENEW
RESTOREFH
SAVEFH
SECINFO
SETATTR
SETCLIENTID
SETCLIENTID_CONFIRM
VERIFY
WRITE

Interested in more details about testing this protocol? click here

 

NLMv4

ftp://ftp.rfc-editor.org/in-notes/rfc1813.txt.

Since the NFS versions 2 and 3 are stateless, an additional Network Lock Manager (NLM) protocol is required to support locking of NFS-mounted files. As a result of the changes in version 3 of the NFS protocol version 4 of the NLM protocol is required.

In this version 4, almost all the names in the NLM version 4 protocol have been changed to include a version number. The procedures in the NLM version 4 protocol are semantically the same as those in the NLM version 3 protocol. The only semantic difference is the addition of a NULL procedure that can be used to test for server responsiveness.
The structure of the NLMv4 heading is as follows:

8
7
6
5
4
3
2
1
Octet
Cookie Length
1
2
3
4
Cookie
5-N

Cookie Length
The cookie length.

Cookie
The cookie string itself.

Interested in more details about testing this protocol? click here

 

NSMv1

http://www.opengroup.org/onlinepubs/009629799/chap11.htm.

The Network Status Monitor (NSM) protocol is related to, but separate from, the Network Lock Manager (NLM) protocol.The NLM uses the NSM (Network Status Monitor Protocol V1) to enable it to recover from crashes of either the client or server host. To do this, the NSM and NLM protocols on both the client and server hosts must cooperate.

The NSM is a service that provides applications with information on the status of network hosts. Each NSM keeps track of its own "state" and notifies any interested party of a change in this state to any other NSM upon request. The state is merely a number which increases monotonically each time the state of the host changes; an even number indicates the host is down, while an odd number indicates the host is up.

Applications register the network hosts they are interested in with the local NSM. If one of these hosts crashes, the NSM on the crashed host, after a reboot, will notify the NSM on the local host that the state changed. The local NSM can then, in turn, notify the interested application of this state change.

The NSM is used heavily by the Network Lock Manager (NLM). The local NLM registers with the local NSM all server hosts on which the NLM has currently active locks. In parallel, the NLM on the remote (server) host registers all of its client hosts with its local NSM. If the server host crashes and reboots, the server NSM will inform the NSM on the client hosts of this event. The local NLM can then take steps to re-establish the locks when the server is rebooted. Low-end systems that do not run an NSM, due to memory or speed constraints, are restricted to using non-monitored locks.
The structure of the protocol is as follows:

8
7
6
5
4
3
2
1
Octet
Name Length
1
2
3
4
Mon Name /Host Name
5-N

Name Length
The mon name or host name length.

Mon Name
The name of the host to be monitored by the NSM.

Host Name
The host name.

Interested in more details about testing this protocol? click here

1 2 3 4

SUN Protocols Information
MNTV1 | Mntv3 | MOUNT | NFS | NFS2 | NFS3 | NFSv4 | NLMv4 | NSMv1 | PMAP | RPC | RPCBv3 | RPCBV4 | RPCmap | RPCSEC GSS | YP (NIS)


 
Additional Information