SUN Network File System
- The basic idea behind SUN Network File System is that each file server provides a standardized view of its local file system.
- A client accesses the file system using the system calls provided by its local operating system.
- However, the local UNIX file system interface is replaced by an interface to the Virtual File System (VFS).
- With NFS, operations on the VFS interface are either passed to a local file system or passed to a separate component known as the SUN Network File System client, which takes care of handling access to files stored at a remote server.
- In NFS, all client-server communication is done through RPCs.
- The NFS client implements the NFS file system operations as RPC to the server.
- On the server side, the NFS server is responsible for handling incoming client requests.
- The RPC stub unmarshals requests and the NFS server converts them to regular VFS file operations that are subsequently passed to the VFS layer.
- Again, the VFS is responsible for implementing a local file system in which the actual files are stored.
- The file system model offered by NFS is almost the same as the one offered by UNIX-based systems.
- Files are treated as uninterpreted sequences of bytes.
- They are hierarchically organized into a naming graph in which nodes represent directories and files.
- NFS also supports hard links as well as symbolic links, like any UNIX file system.
- To access a file, a client must first look up its name in a naming service and obtain the associated file handle.
- Each file has a number of attributes whose values can be looked up and changed.
RPC’s in SUN Network File System
- Every NFS operation can be implemented as a single remote procedure call to a file server.
- In order to read data from a file for the first time, a client normally first had to look up the file handle using the lookup operation, after which it could issue a read request.
- This approach required two successive RPCs.
- The drawback became apparent when considering the use of NFS in a wide-area system.
- To overcome such problems, NFSv4 supports compound procedures by which several RPCs can be grouped into a single request.
- In the case of version 4, it is also necessary to open the file before reading can take place.
- After the file handle has been looked up, it is passed to the open operation, after which the server continues with the read operation.
- The overall effect in this example is that only two messages need to be exchanged between the client and server.