0% found this document useful (0 votes)
48 views18 pages

Network File System: Nisarg Patel 08BCE056 Guided By: Mr. Tejas Mehta

The document discusses Network File System (NFS) which allows users to access and manipulate files over a computer network much like local storage. It operates over Remote Procedure Call (RPC). The document covers versions of NFS including NFSv2, NFSv3, and NFSv4. It also discusses how NFS works with a client-server model, RPC, stateless servers, file system model, data types used in NFS, and procedures. The next topics to be covered are detailed studies of NFSv3 and NFSv4.

Uploaded by

Nirav Tank
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
48 views18 pages

Network File System: Nisarg Patel 08BCE056 Guided By: Mr. Tejas Mehta

The document discusses Network File System (NFS) which allows users to access and manipulate files over a computer network much like local storage. It operates over Remote Procedure Call (RPC). The document covers versions of NFS including NFSv2, NFSv3, and NFSv4. It also discusses how NFS works with a client-server model, RPC, stateless servers, file system model, data types used in NFS, and procedures. The next topics to be covered are detailed studies of NFSv3 and NFSv4.

Uploaded by

Nirav Tank
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 18

NETWORK FILE SYSTEM

 Nisarg Patel
08BCE056

Guided by:
Mr. Tejas Mehta
TOPICS COVERED

1. NFS – Introduction
2. Versions of NFS
3. Overview of NFSv2, NFSv3, NFSv4
4. NFSv2 detailed study
INTRODUCTION
 Network File System (NFS) is a network file system protocol
originally developed by Sun Microsystems in 1984, allowing a
user on a client computer to access files over a network in a
manner similar to how local storage is accessed.

 NFS, like many other protocols and it works with Remote


Procedure Call.

 The Network File System is an open standard defined in RFCs,


allowing anyone to implement the protocol.
HOW AN NFS WORKS?

 A Network File System has mainly two parts- a client & a


server. A client is a remote user who has a directory on a
server, which is connected through a network.

 Every user makes an Remote Procedure Call from their local


machine to the network server. This call is processed by
various daemons loaded on the server, and an appropriate
response is given to the client.

 Thus a user can access their files & directories stored on the
server.
REMOTE PROCEDURE CALL
 Remote Procedure Call specification provides a procedure-
oriented interface to remote services.

 Each consists of a program that is a set of procedures. NFS is


one such "program".

 The combination of host address, program number, and


procedure number specifies one remote service procedure.

 RPC is Protocol Independent, so it can be used with any


underlying transport protocol.
VERSIONS OF NFS

 Mainly there are three versions of Network File Systems used


till date – version 2, version 3 & version 4.

 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 version 2.

 We’ll study version 3 & 4 later in detail


NFSv2 Detailed Study

 Following topics are discussed under NFSv2:

 External Data Representation & Remote Procedure Call


 Stateless Servers
 File System Model
 RPC Information
 Size Of XDR Structures
 Basic Data Types
 Server Procedures
OVERVIEW
 The NFS protocol is designed to be machine, operating
system, network architecture, and transport protocol
independent.

 This independence is achieved through the use of Remote


Procedure Call (RPC) primitives built on top of an eXternal
Data Representation (XDR).

 It performs the operating system-specific functions that allow,


for example, to attach remote directory trees to some local file
system.
XDR & RPC
 The External Data Representation (XDR) standard provides a
common way of representing a set of data types over a
network.

 Sun provides implementations of XDR & RPC, but NFS does


not require their use.

 Any software that provides equivalent functionality can be


used, and if the encoding is exactly the same it can
interoperate with other implementations of NFS.
STATELESS SERVERS
 The NFS protocol is stateless. That is, a server does not need
to maintain any extra state information about any of its clients
in order to function correctly.

 With stateless servers, a client need only retry a request until


the server responds; it does not even need to know that the
server has crashed, or the network temporarily went down.

 The client of a stateful server, on the other hand, needs to


either detect a server crash and rebuild the server’s state when
it comes back up, or cause client operations to fail.
FILE SYSTEM MODEL
 NFS assumes a file system that is hierarchical, with directories
as all but the bottom-level files.

 Each entry in a directory (file, directory, device, etc.) has a


string name. Pathname is the concatenation of all the
"components" (directory and file names) in the name.

 A "filesystem" is a tree on a single server (usually a single disk


or physical partition) with a specified "root".
RPC Information
 Authentication
The NFS service uses AUTH_UNIX, AUTH_DES, or
AUTH_SHORT style authentication, except in the NULL
procedure where AUTH_NONE is also allowed.

 Transport Protocols
NFS currently is supported on UDP/IP.

 Port Number
The NFS protocol currently uses the UDP port number 2049.
Size Of XDR Structures
 These are the sizes, given in decimal bytes, of various XDR structures
used in the protocol:

 //The maximum number of bytes of data in a READ or WRITE request


const MAXDATA = 8192;
 // The maximum number of bytes in a pathname argument
const MAXPATHLEN = 1024;
 // The maximum number of bytes in a file name argument
const MAXNAMLEN = 255;
 // The size in bytes of the opaque "cookie" passed by READDIR
const COOKIESIZE = 4;
 // The size in bytes of the opaque file handle
const FHSIZE = 32;
BASIC DATA TYPES

 enum stat;
The stat type is returned with every procedure’s results & it
indicates the state of procedure.

 enum ftype;
The enumeration ftype gives the type of a file.

 typedef opaque fhandle[FHSIZE];


The fhandle is the file handle passed between the server and
the client.
BASIC DATA TYPES

 struct timeval
The timeval structure is used to pass the time and date
information.

 struct fattr
The fattr structure contains the attributes of a file like -"type“,
"nlink“, "uid“, "gid“, "size“, "rdev“, etc.

 struct sattr
The sattr structure contains the file attributes which can be set
from the client.
BASIC DATA TYPES

 typedef string filename<MAXNAMLEN>;


The type filename is used for passing file names or pathname
components.

 typedef string path<MAXPATHLEN>;


The type path is a pathname.

 struct diropargs
The diropargs structure is used in directory operations.
CONCLUSIONS
TOPICS THAT WILL BE COVERED

 NFSv3 Detailed Study


 NFSv4 Detailed Study

You might also like