DistributedNetworks DistributedNetworks


Network File Services  «Prev 

Network File System

A (NFS) Network File System allows remote hosts to mount file systems over a network and interact with those file systems as though they are mounted locally. This enables system administrators to consolidate resources onto centralized servers on the network.
This module focuses on fundamental NFS concepts and supplemental information. For specific instructions regarding the configuration and operation of NFS server and client software, refer to the module titled (NFS) Network File System Redhatlinuxsysadmin.
Currently, there are two versions of NFS. NFS version 2 is older and is widely supported. (NFSv3) NFS version 3 has more features, including variable size file handling and better error reporting, but is not fully compatible with NFSv2 clients. Red Hat Enterprise Linux serves both
  1. NFSv2 and
  2. NFSv3
clients, and when mounting a file system via NFS, Red Hat Enterprise Linux uses NFSv3 by default, if server the supports it.
NFSv2 uses the (UDP) User Datagram Protocol to provide a stateless network connection between the client and server. NFSv3 can use either UDP or (TCP) Transmission Control Protocol running over an IP network.
The stateless UDP connection under normal conditions minimizes network traffic, as the NFS server sends the client a cookie after the client is authorized to access the shared volume. This cookie is a random value stored on the server's side and is passed along with RPC requests from the client. The NFS server can be restarted without affecting the clients and the cookie remains intact. However, because UDP is stateless, if the server goes down unexpectedly, UDP clients continue to saturate the network with requests for the server. For this reason, TCP is the preferred protocol when connecting to an NFSv3 server.

Red Hat Reference

Remote procedure call process

First, mount asks the local portmapper program, portmap, to establish a connection to the NFS mount service on the remote computer

portmap takes care of all the networking details and establishes a connection to the remote server

The NFS server's portmapper program (also referred to simply as portmap) receives the mount request and forwards it to the NFS mounter, rpc.mountd

rpc.mountd checks the mount request against the list of exported filesystems and checks the client's access privileges to the filesystem

rpc.mountd opens the filesystem and returns an access handle to the client

When the client accesses a file on the NFS server, it sends the access request and the handle through portmap to the server

The server's portmap recognizes that this is not a mount request but a general NFS request, so it forwards the requests to rpc.nfsd

rpc.nfsd services the request and returns a result back to the client . All other general NFS requests happen like this.