sem_pres1_056

Upload: nirav-tank

Post on 10-Apr-2018

221 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/8/2019 sem_pres1_056

    1/18

    NETWORK FILE SYSTEM

    Nisarg Patel

    08BCE056

    Guided by:

    Mr. Tejas Mehta

  • 8/8/2019 sem_pres1_056

    2/18

    TOPICS COVERED

    1. NFS Introduction

    2. Versions of NFS

    3. Overview of NFSv2, NFSv3, NFSv4

    4. NFSv2 detailed study

  • 8/8/2019 sem_pres1_056

    3/18

    INTRODUCTION

    Network File System (NFS) is a network file system protocoloriginally developed by Sun Microsystems in 1984, allowing a

    user on a client computer to access files over a network in amanner similar to how local storage is accessed.

    NFS, like many other protocols and it works with RemoteProcedure Call.

    The Network File System is an open standard defined in RFCs,allowing anyone to implement the protocol.

  • 8/8/2019 sem_pres1_056

    4/18

    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.

  • 8/8/2019 sem_pres1_056

    5/18

    REMOTE PROCEDURE CALL

    Remote Procedure Callspecification provides a procedure-oriented interface to remote services.

    Each consists of a program that is a set of procedures. NFS isone 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 anyunderlying transport protocol.

  • 8/8/2019 sem_pres1_056

    6/18

    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 torelease the new version as version 2.

    Well study version 3 & 4 later in detail

  • 8/8/2019 sem_pres1_056

    7/18

    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

  • 8/8/2019 sem_pres1_056

    8/18

    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 RemoteProcedure Call (RPC) primitives built on top of an eXternalData Representation (XDR).

    It performs the operating system-specific functions that allow,

    for example, to attach remote directory trees to some local filesystem.

  • 8/8/2019 sem_pres1_056

    9/18

    XDR & RPC

    The External Data Representation (XDR) standard provides acommon way of representing a set of data types over a

    network.

    Sun provides implementations of XDR & RPC, but NFS doesnot require their use.

    Any software that provides equivalent functionality can be used,

    and if the encoding is exactly the same it can interoperate withother implementations of NFS.

  • 8/8/2019 sem_pres1_056

    10/18

    STATELESS SERVERS

    The NFS protocol is stateless. That is, a server does not needto 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 untilthe server responds; it does not even need to know that theserver has crashed, or the network temporarily went down.

    The client of a stateful server, on the other hand, needs toeither detect a server crash and rebuild the servers state whenit comes back up, or cause client operations to fail.

  • 8/8/2019 sem_pres1_056

    11/18

    FILE SYSTEM MODEL

    NFS assumes a file system that is hierarchical, with directoriesas all but the bottom-level files.

    Each entry in a directory (file, directory, device, etc.) has astring 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 diskor physical partition) with a specified "root".

  • 8/8/2019 sem_pres1_056

    12/18

    RPC Information

    Authentication

    The NFS service usesAUTH_UNIX,AUTH_DES, or

    AUTH_SHORTstyle authentication, except in the NULLprocedure whereAUTH_NONEis also allowed.

    Transport Protocols

    NFS currently is supported on UDP/IP.

    Port NumberThe NFS protocol currently uses the UDP port number 2049.

  • 8/8/2019 sem_pres1_056

    13/18

    Size OfXDR Structures

    These are the sizes, given in decimal bytes, of various XDR structuresused 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;

  • 8/8/2019 sem_pres1_056

    14/18

    BASIC DATA TYPES

    enum stat;

    The stattype is returned with every procedures 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.

  • 8/8/2019 sem_pres1_056

    15/18

    BASIC DATA TYPES

    struct timeval

    The timevalstructure is used to pass the time and date

    information.

    struct fattr

    The fattrstructure contains the attributes of a file like -"type,

    "nlink, "uid, "gid, "size, "rdev, etc.

    struct sattr

    The sattrstructure contains the file attributes which can be set

    from the client.

  • 8/8/2019 sem_pres1_056

    16/18

    BASIC DATA TYPES

    typedef string filename;

    The type filename is used for passing file names or pathname

    components.

    typedef stringpath;

    The typepath is a pathname.

    struct diropargs

    The diropargs structure is used in directory operations.

  • 8/8/2019 sem_pres1_056

    17/18

    CONCLUSIONS

  • 8/8/2019 sem_pres1_056

    18/18

    TOPICS THAT WILL BE COVERED

    NFSv3 Detailed Study

    NFSv4 Detailed Study