Skip to main content

UNIX goals; NFS protocol and structure

Short answer

UNIX goals: simple kernel, multi-user, portability via C, hierarchical file system, uniform I/O, powerful shell. NFS allows transparent remote file access via stateless RPC protocols; clients mount exported directories using file handles, with a VFS layer routing local and remote calls.

What are the goals of UNIX? Explain about NFS protocol and draw the structure of NFS.

Goals of UNIX

UNIX was designed at Bell Labs (Thompson and Ritchie) as a simple, powerful, interactive system. Its goals are:

  • Simple and clean design: a small kernel with a few powerful concepts (everything is a file, a process, pipes).
  • Multi-user and multitasking: time-sharing for many users and programs at once.
  • Portability: written in C, so it can be moved to different hardware easily.
  • Hierarchical file system with protection by user/group/other permissions.
  • Uniform I/O: devices are treated as files, same system calls for files and devices.
  • Powerful command interpreter (shell) that is a user program and supports pipes, redirection and scripting; many small tools that can be combined.
  • Modularity and extensibility, free of unnecessary features; good for programmers.

NFS (Network File System)

NFS, developed by Sun Microsystems, allows a client to access files on a remote server transparently as if they were local. Machines can be clients, servers or both; each server exports directories and clients mount them in their own tree.

Protocols (two client-server protocols, built on RPC):

  1. Mounting protocol: the client sends a path name to the server; if the directory is exported, the server returns a file handle (file system identifier, i-node number, security info). Mounting can be static (at boot) or automounted.
  2. Directory and file access protocol: the client sends RPCs such as LOOKUP, READ, WRITE, GETATTR, CREATE, REMOVE, READDIR using file handles. NFS servers (v2/v3) are stateless: every request carries all the information needed (file handle, offset, count), so the server can crash and restart without losing client state. Reads are idempotent. Data is cached on the client for speed (consistency is weak).

Structure (layered implementation):

  CLIENT                           SERVER
 +--------------+               +----------------+
 | User program |               | NFS server     |
 |  (syscalls)  |               | (handles RPCs) |
 +------+-------+               +-------+--------+
        v                               v
 +--------------+               +----------------+
 | VFS layer    |               | VFS layer      |
 +---+------+---+               +--------+-------+
     v      v                            v
 +-------+ +------------+       +----------------+
 | Local | | NFS client |==RPC=>| Local file     |
 | FS    | |            |  net  | system         |
 +-------+ +------------+       +----------------+

The VFS (virtual file system) layer uses v-nodes to tell whether a file is local or remote. A system call such as read goes to VFS; for a remote file, the NFS client builds an RPC to the server, whose NFS server module calls its VFS and local file system and returns the result.

✓ Answer checked by Claude Opus 5.5 (high effort)

All Operating System chapter 5 questions →