Q7Distributed System
Question
4 marks
Discuss the architecture of the Sun Network File System (NFS).
Answer
An architectural review of the Sun Network File System (NFS), explaining its use of VFS abstraction, strict Stateless server design, and RPC communication to mathematically project remote hard drives onto local mount points.
Engineered by Sun Microsystems in 1984, NFS is the absolute foundational architecture for distributed file sharing in UNIX/Linux environments. Its primary goal is massive Location Transparency: a user opening a file on their laptop has absolutely no idea that the physical magnetic platter spinning to fetch the data is actually in a server rack 500 miles away.
The Three-Tier Architecture
- 1. Virtual File System (VFS) Layer: The absolute genius of NFS. The UNIX kernel utilizes a VFS layer that intercepts all
open(),read(), andwrite()system calls. The VFS mathematically abstracts the underlying file system. If the file is local, VFS routes the call to the local Ext4 driver. If the file is remote, VFS violently routes the call to the NFS Client layer. - 2. The RPC / XDR Layer: NFS does not use raw TCP sockets. It strictly utilizes Remote Procedure Calls (RPC) to communicate. Because a Linux client might talk to a Solaris server (which has different CPU Endianness), the data is mathematically serialized using eXternal Data Representation (XDR) to guarantee binary compatibility across heterogeneous hardware.
- 3. The Stateless Server: Unlike Windows SMB, NFS (prior to v4) is rigidly Stateless. The massive NFS server mathematically refuses to remember anything about the clients. It does not track who has files open. Every single
read()request must explicitly contain the exact File Handle, Offset, and Byte Count. This provides catastrophic resilience; if the NFS server violently loses power and reboots, the clients simply re-send the RPC packet, experiencing a slight lag but absolutely zero system crashes.