DFS Architecture
DFS Architecture
By
Sreedevi T R
Assistant Professor
Dept of CSE
RSET
File service architecture
• Providing access to files is obtained by structuring the file
service as three components:
Client module
3
Client module
• Processes that invoke a service using set of operations that
forms its client interface
• Run on each client computer
• API for file access, one per client computer
• Client module also holds information about network location of
flat file & directory server.
• Client module can play an important role in achieving
satisfactory performance through the implementation of a
cache of recently used file blocks at the client.
• Clients talk to server using RPC:
• Use RPC to forward every file system request; remote server executes
each request as a local request; server responds back with result
Flat File Service
• Concerned with implementing operations on the concepts of
files.
What operations should be provided?
• create a file and allocate a file identifier
• delete a file
• read from a file identified by a file identifier
• write a number of bytes to a file identified by a file identifier
6
Contd..
• Unique File Identifiers (UFIDs) are used to refer to files in all
requests for flat file service operations.
• Responsibilities of file and directory service is based upon UFID
(long sequence of bits so each file has UFID which is unique in DS).
• UFIDs are long sequences of bits chosen so that each file has a
UFID that is unique among all of the files in a distributed system.
• When the flat file service receives a request to create a file, it
generates a new UFID for it and returns the UFID to the requester.
Contd..
• This is the RPC interface used by client modules.
• A FileId is invalid if the file that it refers to is not present in the
server processing the request or if its access permissions are
inappropriate for the operation requested.
• All of the procedures in the interface except Create throw
exceptions if the FileId argument contains an invalid UFID or the
user doesn’t have sufficient access rights.
Flat file service operations
Lookup(Dir, Name) -> FileId Locates the text name in the directory and returns the
— throwsNotFound relevant UFID. If Name is not in the directory, throws an
exception.
AddName(Dir, Name, FileId) If Name is not in the directory, adds (Name, File) to the
— throwsNameDuplicate directory and updates the file’s attribute record.
If Name is already in the directory: throws an exception.
UnName(Dir, Name) If Name is in the directory: the entry containing Name is
— throwsNotFound removed from the directory.
If Name is not in the directory: throws an exception.
GetNames(Dir, Pattern) -> NameSeq
Returns all the text names in the directory that match the
regular expression Pattern.
Directory service operations
• lookup a file identifier(UFID) given a name and directory
• link a name to a file identifier in a directory
• remove a link
• list all names in a directory
• A hierarchic file system such as the one that UNIX provides consists of
a number of directories arranged in a tree structure.
• A UNIX-like file-naming system can be implemented by the client
module using the flat file and directory services that we have defined.
• A tree-structured network of directories is constructed with files at the
leaves and directories at the other nodes of the tree.
• The root of the tree is a directory with a ‘well-known’ UFID.
• A function can be provided in the client module that gets the UFID of a
file given its pathname.
• The function interprets the pathname starting from the root, using
Lookup to obtain the UFID of each directory in the path.
File group