450 likes | 1.19k Views
NETWORK FILE SYSTEM (NFS). By Ameeta.Jakate. NFS. NFS was introduced in 1985 as a means of providing transparent access to remote file systems. NFS Architecture is based on a client-server model. Clients and Servers communicate via remote procedure calls.
E N D
NETWORKFILE SYSTEM (NFS) By Ameeta.Jakate
NFS • NFS was introduced in 1985 as a means of providing transparent access to remote file systems. • NFS Architecture is based on a client-server model. • Clients and Servers communicate via remote procedure calls. • Servers export set of files while clients access such files .
NFS- Design Goals • NFS should not be restricted to UNIX. • Protocol should not be dependant on any particular hardware. • There should be simple recovery mechanisms from server or client crashes. • Applications should be able to access remote files transparently. • NFS performance must be comparable to that of a local disk.
NFS Components • The NFS protocol • The Remote Procedure Call (RPC protocol) defines the format of all interactions between client and server. • The Extended Data Representation (XDR) provides a machine independent method of encoding data to send over the network. • The NFS server code is responsible for processing all client requests and providing access to to the exported file systems. • NFS client code implements all client system calls on remote files by sending one or more RPC requests to the server.
NFS Components • The Mount protocol defines the semantics for mounting and unmounting NFS file systems. • Daemon processes. • On the server a set of nfsd daemons listen for and respond to the client NFS requests and mountd daemon handles the mount requests. • On the client a set of biod daemons handle asynchronous I/O for blocks of NFS files. • Lockd and Statd though not in base protocol are used to provide facilities for locking files over a network.
NFS Security • NFS performs access control when file system is mounted and also on every NFS request. • Servers maintain a “exports” list . • When a client tries to mount a file system ,the server mountd checks the list and denies access to ineligible users. • On each NFS request client sends authentication information. • Any given UID must belong to the same person on all machines sharing NFS file system.
NFS Security • To prevent intrusions into NFS we use UID remapping. • The server maintains a translation map for for each client. • Map defines translation from credentials received over the network to an identity to be used on a server. • Root remapping is used as it is dangerous to allow superusers on all clients to have root access to files on the server. • Root remapping means the server maps the superuser from any client to the user “nobody”.
Server-Side NFS. • A server is usually said to “export” a directory when it makes the directory available for use by other other machines. • Process to mount a file system and the process to access the files is totally different. • Mountd-handles mount requests • Nfsd-handles actual file service • Access control databse is a binary file called”xtab” • Exportfs is the helper command used . • /etc/exports is the human-readable format of xtab.
Server-Side NFS • Whenever we make changes to the “exports” file,for the changes to take effect we should use the command “exportfs –a”. • After a clients mount request has been validated by “mountd” the various file operationrequests are handled by “nfsd”. • Nfsd takes a numeric argument that specifies the number of copies of itself that it should fork.
Client-Side NFS • “mount” command is used to establish temporary network mounts. • Mounts that are part of a system’s permanent configuration should be listed in “/etc/fstab” so that they are mounted automatically at boot time. • When we add entries to “/etc/fstab” we must createmount point directories with “mkdir”. • Alternatively mounts can be handled by automatic mounting service such as “automount” or “amd”.
Client-Side NFS • File systems can be either mounted hard or soft. • If the file system is hard-mounted then the client keeps retrying the request until a reply is received. • If the file system is soft-mounted then the client gives up after a while and returns an error. • biod/nfsiod provide client-side caching .
NFS • “nfsstat” is a commandused to display the various statistics kept by the NFS system. • “nfsstat -s” displays statistics for NFS server processes. • “nfsstat –c” shows information related to the client-side operations.