11.07.2015 Views

NFS Protocol Sequence Diagram - EventHelix.com

NFS Protocol Sequence Diagram - EventHelix.com

NFS Protocol Sequence Diagram - EventHelix.com

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Network File System <strong>Protocol</strong> (<strong>NFS</strong> <strong>Protocol</strong> <strong>Sequence</strong> <strong>Diagram</strong>)ClientServer<strong>NFS</strong> Client<strong>NFS</strong> ServerApplication Client Shell Port Mapper Mountd Daemon <strong>NFS</strong>D DaemonEventStudio System Designer 4.011-Aug-07 22:47 (Page 1)This diagram was generated with EventStudio System Designer 4.0. (http://www.<strong>EventHelix</strong>.<strong>com</strong>/EventStudio)Copyright © 2000-2007 <strong>EventHelix</strong>.<strong>com</strong> Inc. All Rights Reserved.This sequence diagram describes mounting, opening and reading of a file via the <strong>NFS</strong> (Network File System).Server StartupOpen Port 111 for UDP and TCP1:RegisterProgram Number = 100005,Mount Port NumberThe port mapper starts listening on UDP and TCPport 111 for program number to port mappingrequests from <strong>NFS</strong> clients.Mountd, the daemon handling <strong>NFS</strong> mounts,registers its port number for receiving mountrequests (Program number 1000005).2:RegisterProgram Number = 100003,<strong>NFS</strong> Port NumberThe <strong>NFS</strong> server registers its port number for <strong>NFS</strong>(Program number 1000003).<strong>NFS</strong> MountMount server:/user/bill as/nfs/bill1:mount()server:/user/bill,/nfs/bill2:RPC get_port requestport_num = 111,Program Number = 1000053:RPC get_port replyMount Port NumberInvoke the mount system call toassociate the <strong>NFS</strong> handle with alocal mount point6:returnsSUCCESS4:RPC MOUNT requestport_num = 111,Mount Port Number,server:/user/bill,/nfs/bill5:RPC MOUNT replyFile Handle for the File SystemAuthenticate ClientPerform a local mount for therequested file system.Application initiates mounting of a file system.The mount API for the OS is invoked.The mount applications port number on theserver is determined from the port mapper. Therequest includes the program number for mount.Remote Procedure Call (RPC) is used as theunderlying protocol for this access. All messageinteractions in <strong>NFS</strong> are performed as remoteprocedure calls.Request the <strong>NFS</strong> server to mount the file system.Mountd uses the client IP address to authenticatethe client.The server performs a local mount. The results ofthis mount <strong>com</strong>mand will be passed back to the<strong>NFS</strong> client.Communicate the mount results to the <strong>NFS</strong> client.The remote mount information is saved alongwith the local mount point.Report a successful mount to the application.Opening a FileRead file: /nfs/bill/public/nfs_tutorial.txt1:open()file = /nfs/bill/public/ nfs_tutorial.txt,mode = read only


Network File System <strong>Protocol</strong> (<strong>NFS</strong> <strong>Protocol</strong> <strong>Sequence</strong> <strong>Diagram</strong>)ClientServer<strong>NFS</strong> Client<strong>NFS</strong> ServerApplication Client Shell Port Mapper Mountd Daemon <strong>NFS</strong>D DaemonProcess file name to find that /nfs/billis <strong>NFS</strong> mounted2:RPC get_port requestport_num = 111,Program Number = 100003EventStudio System Designer 4.011-Aug-07 22:47 (Page 2)Application uses the OS API to open a file. Theapplication is not aware that the requested file isremotely located and needs to accessed via <strong>NFS</strong>.The OS parses the file to find that the file /nfs/billis a <strong>NFS</strong> mounted file system. This initiates the<strong>NFS</strong> file open processing.Since the file is located on an <strong>NFS</strong> Server, theclient initiates access by requesting the portnumber for the <strong>NFS</strong> service.3:RPC get_port reply<strong>NFS</strong> Port NumberThe client hierarchically parses the path and obtains a file handle. <strong>NFS</strong> <strong>com</strong>mands GETATTR and LOOKUP are used toperform these operations. GETATTR returns the attributes of a file, for example permissions, file size, file owner. LOOKUPlooks up the file and returns a file handle to the file.4:RPC GETATTR Request/user/bill5:RPC GETATTR Replystatus = OKGet the file attributes for the /user/bill directory.6:RPC LOOKUP Request/user/bill/publicCheck if the public directory is available.7:RPC LOOKUP Replystatus = OK8:RPC LOOKUP Request/user/bill/public/ nfs_tutorial.txtCheck if the requested file exists.9:RPC LOOKUP Replystatus = OK10:RPC GETATTR Request/user/bill/public/ nfs_tutorial.txtObtain the attributes about the requested file.11:RPC GETATTR Replystatus = OK12:returnsFile PointerReading File Contents1:read()The application initiates a read for the file.This file is on a <strong>NFS</strong> mounted file system, so the read <strong>com</strong>mand is performed via <strong>NFS</strong> READ RPC calls. The READ callsspecify the file name, the starting offset in each request. The <strong>NFS</strong> server reads the standard block size and returns to the client.Note that the <strong>NFS</strong> server itself is stateless and handles each request independently. The client maintains the application andperforms multiple reads to <strong>com</strong>plete the file read.The following interaction shows how the client performs multiple reads to <strong>com</strong>plete the file reading operation.2:RPC READ Request/user/bill/public/ nfs_tutorial.txt,start_offset = 03:RPC READ Replystatus = OK,read_bytes = 1024Read from the file start (offset 0)


Network File System <strong>Protocol</strong> (<strong>NFS</strong> <strong>Protocol</strong> <strong>Sequence</strong> <strong>Diagram</strong>)ClientServer<strong>NFS</strong> Client<strong>NFS</strong> ServerApplication Client Shell Port Mapper Mountd Daemon <strong>NFS</strong>D Daemon4:RPC READ Request/user/bill/public/ nfs_tutorial.txt,start_offset = 1024EventStudio System Designer 4.011-Aug-07 22:47 (Page 3)Initiate the read from the offset 1024 (0 to 1023byte offsets have already been read).5:RPC READ Replystatus = OK,read_bytes = 20486:RPC READ Request/user/bill/public/ nfs_tutorial.txt,start_offset = 2048Read the remaining part of the file.7:RPC READ Replystatus = OK,read_bytes = 208:returns

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!