What
is NFS?
Network File System (NFS) is a protocol originally developed
by Sun Microsystems in 1984.
“A distributed file system where data is held
on a central server and served to end users so it appears
as if it is on the local system”.
This allows data sharing across multiple platforms without
copying.
It is the most common distributed file system in use
on Unix/Linux systems.
Why
NFS?
Machine and Operating System Independence
Fast Crash Recovery
o When a server crashes, client just resends request
until it gets an answer from the rebooted server
o Client cannot tell difference between a server that
has crashed and recovered and a slow server
Transparent Access
o Remote files should be accessed in exactly the same
way as local files
UNIX semantics should be maintained on client
“Reasonable” performance.
Platforms
Though the use of NFS occurs most commonly with UNIX
systems, other software platforms such as the classic
Mac OS, Microsoft Windows, Novell NetWare, and IBM AS/400
operating systems can also use the protocol. (Alternative
remote file access protocols include the Server Message
Block (SMB, also known as CIFS) protocol, Apple Filing
Protocol (AFP), NetWare Core Protocol (NCP), and OS/400
File Server file system (QFileSvr.400). SMB and NetWare
Core Protocol (NCP) occur more commonly than NFS on
systems running Microsoft Windows; AFP occurs more commonly
than NFS in Macintosh systems; and QFileSvr.400 occurs
more commonly in AS/400 systems.)
NFS Architecture:
Basic
design For NFS:
Three important parts
o The protocol
o The server side
o The client side
The protocol
Uses the Sun RPC mechanism and Sun eXternal Data Representation
(XDR) standard
Defined as a set of remote procedures
Protocol is stateless
o Each procedure call contains all the information necessary
to complete the call
o Server maintains no “between call” information
Server side
The server side is represented by the local VFS actually
storing the data
Plus Various daemons (as shown in Table 1)
NFS is stateless—servers do not keep track of
clients
Each NFS operation must be self-contained
o From server’s point of view
Daemon
Description
nfsd The NFS daemon which services requests from the
NFS clients.
mountd The NFS mount daemon which carries out the requests
that nfsd(8) passes on to it.
rpcbind This daemon allows NFS clients to discover which
port the NFS server is using.
biod biod daemon does readahead for clients
rpc.lockd rpc.lockd provides locking.rpc.lockd handles
lock recovery when server crashes
Daemon |
Description |
|
The
NFS daemon which services requests from the
NFS clients. |
|
The
NFS mount daemon which carries out the requests
that nfsd(8) passes on to it. |
|
This
daemon allows NFS clients to discover which
port the NFS server is using |
|
biod
daemon does readahead for clients |
|
rpc.lockd
provides locking.rpc.lockd handles lock recovery
when server crashes |
[Table
1]
Client Side
Provides transparent interface to NFS
Mapping between remote file names and remote file addresses
is done a server boot time through remote mount
o Extension of UNIX mounts
o Specified in a mount table
o Makes a remote subtree appear part of a local subtree
Practical Uses
Set several machines to share a CDROM or other media
among them. This is cheaper and often a more convenient
method to install software on multiple machines.
On large networks, it might be more convenient to configure
a central NFS server in which to store all the user
home directories. These home directories can then be
exported to the network so that users would always have
the same home directory, regardless of which workstation
they log in to.
Several machines could have a common /usr/ports/distfiles
directory. That way, when you need to install a port
on several machines, you can quickly access the source
without downloading it on each machine.
Operations
supported by NFS
Hard
Issues
Performance is average at best and doesn’t scale
well.
Maintaining a truly distributed file system can be
omplicated if many machines supply data.
Locking is not good and can cause problems when used
simultaneously by multiple applications.
NFS root file systems cannot be shared
NFS tries to preserve UNIX open file semantics but does
not always succeed
Not Secure.
|