Distributed Systems U4
Distributed Systems U4
asia
UNIT-4
DISTRIBUTED FILE SYSTEM
A file system is responsible for the organization, storage, retrieval, naming, sharing, and
protection of files. File systems provide directory services, which convert a file name
(possibly a hierarchical one) into an internal identifier (e.g. inode, FAT index). They
contain a representation of the file data itself and methods for accessing it (read/write).
The file system is responsible for controlling access to the data and for performing low-
level operations such as buffering frequently used data and issuing disk I/O requests.
A distributed file system is to present certain degrees of transparency to the user and the
system: Access transparency: Clients are unaware that files are distributed and can
access them in the same way as local files are accessed.
Location transparency: A consistent name space exists encompassing local as well as
remote files. The name of a file does not give it location.
Concurrency transparency: All clients have the same view of the state of the file system.
This means that if one process is modifying a file, any other processes on the same system
or remote systems that are accessing the files will see the modifications in a coherent
manner.
Failure transparency: The client and client programs should operate correctly after a
server failure.
Heterogeneity: File service should be provided across different hardware and operating
system platforms.
Scalability: The file system should work well in small environments (1 machine, a dozen
machines) and also scale gracefully to huge ones (hundreds through tens of thousands of
systems).
Replication transparency: To support scalability, we may wish to replicate files across
multiple servers. Clients should be unaware of this.
Migration transparency: Files should be able to move around without the client's
knowledge. Support fine-grained distribution of data: To optimize performance, we may
wish to locate individual objects near the processes that use them.
Tolerance for network partitioning: The entire network or certain segments of it may be
unavailable to a client during certain periods (e.g. disconnected operation of a laptop). The
file system should be tolerant of this.
File service types: To provide a remote system with file service, we will have to select one of
two models of operation. One of these is the upload/download model. In this model, there are
two fundamental operations: read file transfers an entire file from the server to the requesting
client, and write file copies the file back to the server. It is a simple model and efficient in that it
provides local access to the file when it is being used. Three problems are evident. It can be
wasteful if the client needs access to only a small amount of the file data. It can be problematic if
the client doesn't have enough space to cache the entire file. Finally, what happens if others need
to modify the same file?
The second model is a remote access model. The file service provides remote operations such as
open, close, read bytes, write bytes, get attributes, etc. The file system itself runs on servers. The
drawback in this approach is the servers are accessed for the duration of file access rather than
once to download the file and again to upload it.
Another important distinction in providing file service is that of understanding the difference
between directory service and file service. A directory service, in the context of file systems,
maps human-friendly textual names for files to their internal locations, which can be used by the
jntuworldupdates.org Specworld.in
file service. The file service itself provides the file interface (this is mentioned above). Another
Smartzworld.com Smartworld.asia
component of file distributed file systems is the client module. This is the client-side interface for
file and directory service. It provides a local file system interface to client software (for example,
the node file system layer of a UNIX kernel).
File service architecture • This is an abstract architectural model that underpins both NFS and
AFS. It is based upon a division of responsibilities between three modules – a client module that
emulates a conventional file system interface for application programs, and server modules, that
perform operations for clients on directories and on files. The architecture is designed to enable a
stateless implementation of the server module.
SUN NFS • Sun Microsystems’s Network File System (NFS) has been widely adopted in
industry and in academic environments since its introduction in 1985. The design and
development of NFS were undertaken by staff at Sun Microsystems in 1984. Although several
distributed file services had already been developed and used in universities and research
laboratories, NFS was the first file service that was designed as a product. The design and
implementation of NFS have achieved success both technically and commercially.
Directory
service:
Provides mapping between text names for the files and their UFIDs. Clients may obtain the
UFID of a file by quoting its text name to directory service. Directory service supports functions
needed generate directories, to add new files to directories.
Client
module:
It runs on each computer and provides integrated service (flat file and directory) as a single API
to application programs. For example, in UNIX hosts, a client module emulates the full set of
Unix file operations.It holds information about the network locations of flat-file and directory
server processes; and achieve better performance through implementation of a cache of recently
used file blocks at the client.
Flat
file service interface:
Access control:
In distributed implementations, access rights checks have to be performed at the server because the
server RPC interface is an otherwise unprotected point of access to files.
Hierarchic file system:
A file system such as the one that UNIX provides consists of a number of directories arranged in a tree
hierarchic
structure.
File Group
A
file group is a collectionof files that can be located on any server or moved between servers while
maintaining the same names.
A similar construct is used in a UNIX file system.
–
– It helps with distributing the load of file serving between several servers.
– File groups have identifiers which are unique throughout the system (and hence for an
open system, they must be globally unique).
To construct globally unique ID we use some unique attribute of the machine on which it is
created. E.g: IP number, even though the file group may move subsequently.
jntuworldupdates.org
NFS access control and authentication: Specworld.in
Smartzworld.com
The NFSserver is stateless server, so the user's identity and access rights must be checked by the server onSmartworld.asia
each
request.
In the local file system they are checked only on the file’s access permission attribute.
Every client request is accompanied by the userID and groupID
It
is not shown in the Figure 8.9 because they are inserted by the RPC system.
Kerberos has been integrated with NFS to provide a stronger and more
comprehensive security solution.
Mount service
Mount operation:
mount( remotehost, remotedirectory, localdirectory)
AFS differs markedly from NFS in its design and implementation. The differences are
primarily attributable to the identification of scalability as the most important design goal.
AFS is designed to perform well with larger numbers of active users than other distributed
file systems. The key strategy for achieving scalability is the caching of whole files in
client nodes. AFS has two unusual design characteristics:
Whole-file serving: The entire contents of directories and files are transmitted to client
computers by AFS servers (in AFS-3, files larger than 64 kbytes are transferred in 64-
kbyte chunks).
Whole-file caching: Once a copy of a file or a chunk has been transferred to a client
computer it is stored in a cache on the local disk. The cache contains several hundred of
the files most recently used on that computer. The cache is permanent, surviving reboots
of the client computer. Local copies of files are used to satisfy clients’ open requests in
preference to remote copies whenever possible.
Scenario • Here is a simple scenario illustrating the operation of AFS:
When a user process in a client computer issues an open system call for a file in the shared
file space and there is not a current copy of the file in the local cache, the server holding
the file is located and is sent a request for a copy of the file. The copy is stored in the local
UNIX file system in the client computer. The copy is then opened and the resulting UNIX
file descriptor is returned to the client.
jntuworldupdates.org Specworld.in
Smartzworld.com Smartworld.asia
Naming Services
Key benefits:
– Resource localization
– Uniform naming
– Device independent address (e.g., you can move domain name/web site from one server to
another server seamlessly).
The DNS maps domain names to the attributes of a host computer: its IP address, the type of
entry (for example, a reference to a mail server or another host) and, for example, the length of
time the host’s entry will remain valid. The X500 directory service can be used to map a person’s
name onto attributes including their email address and telephone number. The CORBA Naming
Service maps the name of a remote object onto its remote object reference, whereas the Trading
Service maps the name of a remote object onto its remote object reference, together with an
arbitrary number of attributes describing the object in terms understandable by human users.
Uniform Resource Identifiers (URIs) came about from the need to identify resources on the Web,
and other Internet resources such as electronic mailboxes. An important goal was to identify
resources in a coherent way, so that they could all be processed by common software such as
browsers. URIs are ‘uniform’ in that their syntax incorporates that of indefinitely many
individual types of resource identifiers (that is, URI schemes), and there are procedures for
managing the global namespace of schemes. The advantage of uniformity is that it eases the
process of introducing new types of identifier, as well as using existing types of identifier in new
contexts, without disrupting existing usage.
Uniform Resource Locators: Some URIs contain information that can be used to locate and
access a resource; others are pure resource names. The familiar term Uniform Resource Locator
(URL) is often used for URIs that provide location information and specify the method for
accessing the resource.
Uniform Resource Names (URNs) are URIs that are used as pure resource names rather than
locators. For example, the URI:
mid:[email protected]
Navigation
Navigation is the act of chaining multiple Naming Services in order to resolve a single name to
the corresponding resource.
Namespaces allows for structure in names.
This decomposition facilitates the resolution of the name into the corresponding resource
Moreover, structured namespaces allows for iterative navigation…
Iterative navigation
Reason for NFS iterative name resolution
This is because the file service may encounter a symbolic link (i.e. an alias) when resolving a
name. A symbolic link must be interpreted in the client’s file system name space because it may
point to a file in a directory stored at another server. The client computer must determine which
server this is, because only the client knows its mount points
– Recursive: it is performed by the naming server the server becomes like a client for the next
server this is necessary in case of client connectivity constraints
– Non recursive: it is performed by the client or the first server the server bounces back the
jntuworldupdates.org
next hop to its client Specworld.in
Smartzworld.com Smartworld.asia
Non-recursive and recursive server-controlled navigation
DNS offers recursive navigation as an option, but iterative is the standard technique. Recursive
navigation must be used in domains that limit client access to their DNS information for security
reasons.
The Domain Name System is a name service design whose main naming database is used across
the Internet.
This original scheme was soon seen to suffer from three major shortcomings:
It did not scale to large numbers of computers. Local organizations wished to administer their
own naming systems. A general name service was needed – not one that serves only for looking
up computer addresses.
Domain names • The DNS is designed for use in multiple implementations, each of which may
have its own name space. In practice, however, only one is in widespread use, and that is the one
used for naming across the Internet. The Internet DNS name space is partitioned both
organizationally and according to geography. The names are written with the highest-level
domain on the right. The original top-level organizational domains (also called generic domains)
in use across the Internet were:
The DNS architecture allows for recursive navigation as well as iterative navigation. The
resolver specifies which type of navigation is required when contacting a name server. However,
name servers are not bound to implement recursive navigation. As was pointed out above,
recursive navigation may tie up server threads, meaning that other requests might be delayed.
Consensus Process
Each process pi begins in an undecided state and proposes a single value vi, drawn from a set
D (i=1…N)
Processes communicate with each other, exchanging values
Each process then sets the value of a decision variable di and enters the decided state
Requirements for Consensus
• Problem description
– Three or more generals must agree to attack or to retreat
– One general, the commander, issues the order
– Other generals, the lieutenants, must decide to attack or retreat
– One or more generals may be treacherous
A treacherous general tells one general to attack and another to retreat
Difference from consensus is that a single process supplies the value to agree on
Requirements
– Termination: eventually each correct process sets its decision variable
– Agreement: the decision variable of all correct processes is the same
– Integrity: if the commander is correct, then all correct processes agree on the value that the
commander has proposed (but the commander need not be correct)
Interactive consistency: all correct processes agree on a vector of values, one for each process.
This is called the decision vector
– Another variant of consensus
jntuworldupdates.org Specworld.in
Smartzworld.com Smartworld.asia
Requirements
– Termination: eventually each correct process sets its decision variable
– Agreement: the decision vector of all correct processes is the same
– Integrity: if any process is correct, then all correct processes decide the correct value for that
process
Thrashing
It can be argued that it is the programmer’s responsibility to avoid thrashing. The programmer
could annotate data items in order to assist the DSM runtime in minimizing page copying and
ownership transfers. The latter approach is discussed in the next section in the context of the
Munin DSM system.
jntuworldupdates.org Specworld.in