Pages

Thursday, November 19, 2009

NFSˆSquare

NFSˆSquare

Introduction

        NFS was originally designed and implemented by Sun Microsystems for use on its UNIX based workstations. Other manufacturers now support it as well, for many operating systems including MS-DOS. NFS supports heterogeneous systems, for example, MS-DOS clients making use of UNIX servers. It is not even required that all machines use the same hardware. It is common to find MS-DOS clients running Intel 386 CPUs getting service from UNIX file servers running on Motorola 68030 or Sun SPARC CPUs. Three aspects of NFS are of interest: the architecture, the protocol, and the implementation. Let us look at these in turn.
The basic idea behind NFS is to allow an arbitrary collection of clients and servers to share a common file system. In most cases, all the clients and servers are on the same LAN, but this is not required. It is possible to run NFS over a wide-area network. For simplicity we will speak of clients and servers as though they were on distinct machines, but in fact NFS allows every machine to be both client and a server at the same time.
              Each NFS server exports one or more of its directories for access by remote clients. When a directory is made available, so are its subdirectories, so in fact, entire directory trees are normally exported as a unit. The list of subdirectories a server exports is maintained in the /etc/exports file, so these directories can be exported automatically whenever the server is booted. Client access exported directories by mounting them. When a client mounts a (remote) directory, it becomes part of its directory hierarchy.
               Many workstations are diskless. If it so desires, a diskless client can mount a remote file system on its root directory, resulting in a file system that is supported entirely on a remote server.  Those workstations that do have local disks can mount remote directories anywhere they wish on top of their local directory hierarchy, resulting in a file system that is partially local and partially remote. To programs running on the client machine, there s almost no difference between a file located on a remote file server and a file located on a local disk.
              Thus the basic architectural characteristic of NFS is that servers export directories and clients mount them remotely. If two or more clients mount the same directory at the same time, they can communicate by sharing files in their common directories. A program on one client can create a file, and program on a different one can read the file. Once mounts have been done, nothing special has to be done to achieve sharing. The shared files are just there in the directory hierarchy of multiple machines and can be read and written the usual way. This simplicity is one of the great attractions of NFS.

No comments:

Post a Comment