---
title: "UNIX goals; NFS protocol and structure"
subject: "Operating System"
chapter: 5
key: "semester_6/operating_system:unix-goals-nfs"
source: https://www.bctengineer.com/q/semester_6/operating_system/unix-goals-nfs
site: BCT Engineering
---

# UNIX goals; NFS protocol and structure

Operating System · Chapter 5: File Systems

- Asked in: 2068 Bhadra, 2+6 marks
- Video: [NFS Overview](https://www.youtube.com/watch?v=AyYswNc4zFY) — Ekeeda
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_6/operating_system/unix-goals-nfs
- Whole chapter: https://www.bctengineer.com/md/semester_6/operating_system/chapter-5

## Question

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

## 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.

## Answer

#### 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):**
```text
  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.

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. Why is UNIX portable?
   A. Written in assembly
   B. Written in C
   C. It has no kernel
   D. It uses NFS
   Answer: B. Being written in C lets it move to different hardware easily. (Key point: Portability)

2. What does the NFS mounting protocol return when a directory is exported?
   A. A file handle
   B. A password
   C. A shell
   D. The i-node table
   Answer: A. The server returns a file handle (filesystem ID, i-node number, security info). (Key point: Mounting protocol)

3. Why can NFS (v2/v3) servers crash and restart without losing client state?
   A. They are stateless: each request carries file handle, offset and count
   B. Clients keep no data
   C. All writes are cached
   D. They use FAT
   Answer: A. Statelessness and idempotent requests make recovery simple. (Key point: Stateless server)

4. What does the VFS layer do in NFS structure?
   A. Uses v-nodes to tell if a file is local or remote
   B. Encrypts data
   C. Allocates blocks
   D. Replaces RPC
   Answer: A. VFS routes a system call to the local FS or the NFS client. (Key point: VFS)

## Related in Operating System

- [Advantages and structure of UNIX](https://www.bctengineer.com/question.md?key=semester_6%2Foperating_system%3Aunix-advantages-structure) — Operating System, chapter 1

## Related in other subjects

- [SS7 protocol structure](https://www.bctengineer.com/question.md?key=semester_8%2Ftelecommunications%3Ass7-protocol-structure) — Telecommunications, chapter 5
