You are on page 1of 8

Case Study on Network File System

1. What Network File System


 Network File System (NFS) is a distributed file system protocol originally
developed by Sun Microsystems (Sun) in 1984, allowing a user on a client
computer to access files over a computer network much like local storage is
accessed.
 NFS, like many other protocols, builds on the Open Network Computing
Remote Procedure Call (ONC RPC) system. The NFS is an open standard
defined in a Request for Comments (RFC), allowing anyone to implement
the protocol.

2. Versions and Variations


 NFSv1
o Sun used version 1 only for in-house experimental purposes. When
the development team added substantial changes to NFS version 1 and
released it outside of Sun, they decided to release the new version as
v2, so that version interoperation and RPC version fallback could be
tested.

 NFSv2
o Version 2 of the protocol (defined in RFC 1094, March 1989)
originally operated only over User Datagram Protocol (UDP). Its
designers meant to keep the server side stateless, with locking (for
example) implemented outside of the core protocol. People involved
in the creation of NFS version 2 include Russel Sandberg, Bob Lyon,
Bill Joy, Steve Kleiman, and others.
o The Virtual File System interface allows a modular implementation,
reflected in a simple protocol. By February 1986, implementations
were demonstrated for operating systems such as System V release 2,
DOS, and VAX/VMS using Eunice. NFSv2 only allows the first 2 GB
of a file to be read due to 32-bit limitations.

 NFSv3
o Version 3 (RFC 1813, June 1995) added:
 Support for 64-bit file sizes and offsets, to handle files larger
than 2 gigabytes (GB).
 Support for asynchronous writes on the server, to improve write
performance.
 Additional file attributes in many replies, to avoid the need to
re-fetch them.
 A READDIRPLUS operation, to get file handles and attributes
along with file names when scanning a directory.
 Assorted other improvements.

 NFSv4
o Version 4 (RFC 3010, December 2000; revised in RFC 3530, April
2003 and again in RFC 7530, March 2015), influenced by Andrew
File System (AFS) and Server Message Block (SMB, also termed
CIFS), includes performance improvements, mandates strong security,
and introduces a stateful protocol. Version 4 became the first version
developed with the Internet Engineering Task Force (IETF) after Sun
Microsystems handed over the development of the NFS protocols.

 NFSv4.1
o NFS version 4.1 (RFC 5661, January 2010; revised in RFC 8881,
August 2020) aims to provide protocol support to take advantage of
clustered server deployments including the ability to provide scalable
parallel access to files distributed among multiple servers (pNFS
extension). Version 4.1 includes Session trunking mechanism (Also
known as NFS Multipathing) and available in some enterprise
solutions as VMware ESXi.

 NFSv4.2
o NFS version 4.2 (RFC 7862) was published in November 2016 with
new features including: server-side clone and copy, application I/O
advise, sparse files, space reservation, application data block (ADB),
labeled NFS with sec_label that accommodates any MAC security
system, and two new operations for pNFS (LAYOUTERROR and
LAYOUTSTATS).
o One big advantage of NFSv4 over its predecessors is that only one
UDP or TCP port, 2049, is used to run the service, which simplifies
using the protocol across firewalls.

 Other extensions

o WebNFS, an extension to Version 2 and Version 3, allows NFS to


integrate more easily into Web-browsers and to enable operation
through firewalls. In 2007 Sun Microsystems open-sourced their
client-side WebNFS implementation.

3. Explain NFS (Network File System) class in Linux.


The Network File System (NFS) is a way of mounting Linux discs/directories over
a network. An NFS server can export one or more directories that can then be
mounted on a remote Linux machine. Note, that if you need to mount a Linux file
system on a Windows machine.
Why use Network File System (NFS)?

The main use of NFS in the home context, is to share out data on a central server (-
for example, your music collection) to all the PCs in the house. This way, you have
a single copy of data (-hopefully, well backed up) accessible from a central
location.

A network file system is a network abstraction over a file system that allows a
remote client to access it over a network in a similar way to a local file system.
Although not the first such system, NFS has grown and evolved into the most
powerful and widely used network file system in UNIX. NFS permits sharing of a
common file system among a multitude of users and provides the benefit of
centralizing data to minimize needed storage.

The NFS architecture

NFS follows the client-server model of computing (see Figure). The server
implements the shared file system and storage to which clients attach. The clients
implement the user interface to the shared file system, mounted within the client's
local file space. Figure. The client-server architecture of NFS

Within Linux, the virtual file system switch (VFS) provides the means to support
multiple file systems concurrently on a host (such as International Organization for
Standardization [ISO] 9660 on a CD-ROM and ext3fs on the local hard disk). The
VFS determines which storage a request is intended for, then which file system
must be used to satisfy the request. For this reason, NFS is a pluggable file system
just like any other. The only difference with NFS is that input/output (I/O) requests
may not be satisfied locally, instead having to traverse the network for completion.

Once a request is found to be destined for NFS, VFS passes it to the NFS instance
within the kernel. NFS interprets the I/O request and translates it into an NFS
procedure (OPEN, ACCESS, CREATE, READ, CLOSE, REMOVE, and so on).

4. How to implement NFS in Linux?


NFS (Network File System) is basically developed for sharing of files and folders
between Linux/Unix systems bySunMicrosystemsin1980. It allows you to mount
your local file systems over a network and remote hosts to interact with them as
they are mounted locally on the same system. With the help of NFS, we can set up
file sharing between Unix to Linux system and Linux to Unix system.

Benefits of NFS

 NFSallows local access to remote files.

 It uses standard client/server architecture for file sharing between all *nix
based machines.

 With NFS it is not necessary that both machines run on the same OS.

 With the help of NFS we can configure centralized storage solutions.

 Users get their data irrespective of physical location.

 No manual refresh needed for new files. Newer version of NFS also supports
acl, pseudo root mounts.

 Can be secured with Firewalls and Kerberos.

Important commands for NFS

Some more important commands for NFS.

 Showmount -e: Shows the available shares on your local machine.


 Showmount –e <server-ip or hostname>: Lists the available shares at the
remote server.

 showmount-d: Lists all the sub directories

 exportfs-v: Displays a list of shares files and options on a server

 exportfs-a: Exports all shares listed in/etc./exports, or given name

 exportfs-u: Unexports all shares listed in/etc./exports, or given name

 exportfs-r: Refresh the server’s list after modifying/etc./exports

NFS Architecture and Main Components

The operation of NFS is defined in the form of three main components that can be
viewed as logically residing at each of the three OSI model layers corresponding to
the TCP/IP application layer. These components are:
 Remote Procedure Call (RPC): RPC is a generic session layer service used
to implement client/server internetworking functionality. It extends the
notion of a program calling a local procedure on a particular host computer,
to the calling of a procedure on a remote device across a network.

 External Data Representation (XDR): XDR is a descriptive language that


allows data types to be defined in a consistent manner. XDR conceptually
resides at the presentation layer; its universal representations allow data to
be exchanged using NFS between computers that may use very different
internal methods of storing data.

 NFS Procedures and Operations: The actual functionality of NFS is


implemented in the form of procedures and operations that conceptually
function at layer seven of the OSI model. These procedures specify
particular tasks to be carried out on files over the network, using XDR to
represent data and RPC to carry the commands across an internetwork.

These three key “sub protocols” if you will, comprise the bulk of the NFS protocol.
Each is described in more detail in a separate topic of this section on NFS.
Architectural Components

NFS resides architecturally at the TCP/IP application layer. Even though in


the TCP/IP model no clear distinction is made generally between the
functions of layers five through seven of the OSI Reference Model, NFS’s
three sub protocols correspond well to those three layers as shown.

You might also like