Open System Services NFS Overview

Variable-Length array
Variable-length arrays of homogeneous elements are encoded as the element count n (an
unsigned integer), followed by the encoding of each of the array’s elements, starting with
element 0 and progressing through element n-1.
Structure
The components of a structure are encoded in the order of their declaration in the structure.
Void
An XDR void is a 0-byte quantity. Voids are useful for describing operations that take no data
as input or output.
Constant
Constants are used to set an identifier to a constant value.
Typedef
Typedefs are used to define derived types.
XDR Language
The XDR language is similar to the C language. Its specification uses an extended Backus-Naur
form (BNF) notation.
NFS Protocol
This subsection describes the structures and functions defined by the NFS protocol.
The details of the protocol function arguments and data structure members are omitted. The purpose
of this subsection is not to provide programming information but to give an overview of the services
offered by the Network File System.
The NFS interface itself is open and can be used by anyone wishing to implement an NFS client
or server for the network. The interface defines traditional file-system operations for reading
directories, creating and destroying files, reading and writing files, and reading and setting file
attributes. The interface is designed so that file operations address files with an uninterpreted
identifier, a starting byte address, and a length in bytes.
Stateless Servers
The NFS protocol is stateless. That is, a server does not need to maintain any extra state information
about any of its clients in order to function correctly. Stateless servers have a distinct advantage
over servers that must maintain state information in the event of a failure. With stateless servers, a
client need only retry a request until the server responds; the client does not even need to know
that the server has crashed or that the network temporarily went down. The client of a server that
must maintain state information, on the other hand, needs to either detect a server crash and rebuild
the server’s state when it comes back up, or cause client operations to fail.
The Network File System also deals with objects such as files and directories that inherently have
state information (the contents of a file must be kept intact). The goal is to not introduce any extra
state information in the protocol itself.
File-System Model
The Network File System is based on the assumption that a file system is hierarchical, with directories
at all but the bottom level. Each entry in a directory (file, directory, device, and so on) has a string
name. A “file system” is a tree on a single server (usually a single disk or physical partition) with
a specified “root.
Although files and directories are similar objects in many ways, different procedures are used to
read directories and files. Such procedures provide a network-standard format for representing
directories.
24 NFS Protocol Description