0% found this document useful (0 votes)
38 views

OS-Chap-17 Distributed-Systems

Uploaded by

earthlinggamer
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
38 views

OS-Chap-17 Distributed-Systems

Uploaded by

earthlinggamer
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 19

Chapter 17:

Distributed Systems

Operating System Concepts – 9th Edition Silberschatz, Galvin and Gagne ©2013
Chapter 17: Distributed Systems

n Advantages of Distributed Systems


n Distributed File System

Operating System Concepts – 9th Edition 17.2 Silberschatz, Galvin and Gagne ©2013
Chapter Objectives

n To provide a high-level overview of distributed systems and the


networks that interconnect them.
n To discuss the general structure of distributed operating systems.
n To describe issues concerning the design of distributed systems.

Operating System Concepts – 9th Edition 17.3 Silberschatz, Galvin and Gagne ©2013
Overview
n Distributed system is a collection of loosely coupled processors
interconnected by a communications network.
n Processors variously called nodes, computers, machines, hosts.
l Site is the location of the processor.
l Generally, a server has a resource a client node at a different site
wants to use.

Tightly coupled processors: Processors in the same machine.


Loosely coupled processors: Processors in several machines.
Operating System Concepts – 9th Edition 17.4 Silberschatz, Galvin and Gagne ©2013
Reasons for Distributed Systems
n Reasons for distributed systems:
l Resource sharing:
 Sharing and printing files at remote sites.
 Processing information in a distributed database.
 Using remote specialized hardware devices.
l Computation speedup – load sharing or job migration.
l Reliability – detect and recover from site failure, function transfer,
reintegrate failed site.
l Communication – message passing:
 All higher-level functions of a standalone system can be expanded
to encompass a distributed system.
l Computers can be downsized, more flexibility, better user interfaces,
and easier maintenance by moving from large systems to multiple
smaller systems performing distributed computing.
Job Migration: moving a job from one node to another node.

Operating System Concepts – 9th Edition 17.5 Silberschatz, Galvin and Gagne ©2013
Types of Distributed Operating Systems

n Network Operating Systems


n Distributed Operating Systems

Operating System Concepts – 9th Edition 17.6 Silberschatz, Galvin and Gagne ©2013
Network-Operating Systems
n Users are aware of the multiplicity of machines.
n Access to resources of various machines is done explicitly by:
l Remote logging into the appropriate remote machine (telnet, ssh).
l Remote Desktop (Microsoft Windows).
l Transferring data from remote machines to local machines via the File
Transfer Protocol (FTP) mechanism.
n Users must change paradigms – establish a session, give network-based
commands.
l More difficult for users.

Operating System Concepts – 9th Edition 17.7 Silberschatz, Galvin and Gagne ©2013
Distributed-Operating Systems

n Users not aware of the multiplicity of machines:


l Access to remote resources similar to access to local resources.
n Data Migration – transfer data by transferring the entire file or transferring
only those portions of the file necessary for the immediate task.
n Computation Migration – transfer the computation, rather than the data,
across the system:
l Via remote procedure calls (RPCs).
l or via messaging system.

Data Migration: when you have the same operation to be executed on large
amount of data (e.g., arrays). Then, each node gets part of the data and
execute the operation.

Computation Migration: when you have the several operations to be


executed on the same data. Then, each node gets one operation and execute
it on the data.

Operating System Concepts – 9th Edition 17.8 Silberschatz, Galvin and Gagne ©2013
Distributed-Operating Systems (Cont.)
n Process Migration – execute an entire process, or parts of it, at different
sites:
l Load balancing – distribute processes across the network to even the
workload.
l Computation speedup – subprocesses can run concurrently on
different sites.
l Hardware preference – process execution may require specialized
processor.
l Software preference – required software may be available at only a
particular site.
l Data access – run process remotely rather than transfer all data locally
n Consider the World Wide Web.
Process Migration: Simply several tasks (Processes). So, why execute
all of them in one local node. Each node gets a process and execute.

Data access: send a process to be executed where the data is located.


This might consume less time than transferring (possibly large) data to
where the process is.
Operating System Concepts – 9th Edition 17.9 Silberschatz, Galvin and Gagne ©2013
Distributed File System

n Distributed file system (DFS) – a distributed implementation of the


classical time-sharing model of a file system, where multiple users share
files and storage resources.
n A DFS manages a set of dispersed storage devices.
n Overall storage space managed by a DFS is composed of different,
remotely located, smaller storage spaces.
n There is usually a correspondence between constituent storage spaces and
sets of files .
n Challenges include:
l Naming and Transparency.
l Remote File Access.

Operating System Concepts – 9th Edition 17.10 Silberschatz, Galvin and Gagne ©2013
DFS Structure

n Service – software entity running on one or more machines and providing


a particular type of function to a priori unknown clients.
n Server – service software running on a single machine.
n Client – process that can invoke a service using a set of operations that
forms its client interface.
n A client interface for a file service is formed by a set of primitive file
operations (create, delete, read, write).
n Client interface of a DFS should be transparent, i.e., not distinguish
between local and remote files.
n Sometimes lower, level intermachine interfaces need for cross-machine
interaction.

Operating System Concepts – 9th Edition 17.11 Silberschatz, Galvin and Gagne ©2013
Naming and Transparency
n Naming – mapping between logical and physical objects.
n Multilevel mapping – abstraction of a file that hides the details of how and
where on the disk the file is actually stored.
n A Transparent DFS hides the location where in the network the file is stored.
n For a file being replicated in several sites, the mapping returns a set of the
locations of this file’s replicas; both the existence of multiple copies and their
location are hidden.

Multilevel mapping in DFS: user access a file by its name, then file
name is mapped to a numerical identifier on server, then the identifier is
mapped to actual disk blocks where the file is stored.

The only thing user aware of is the simple file name, the rest of details are
abstract (hidden) in the DFS implementation.

Transparency in DFS:
- Access Transparency: User access remote file the same way as local file.
- Location Transparency: User access remote file without being aware of
its location.

Operating System Concepts – 9th Edition 17.12 Silberschatz, Galvin and Gagne ©2013
Naming Structures

n Location transparency – file name does not reveal the file’s physical
storage location.
n Location independence – file name does not need to be changed
when the file’s physical storage location changes.

Operating System Concepts – 9th Edition 17.13 Silberschatz, Galvin and Gagne ©2013
Naming Schemes — Three Main Approaches

n Approach1: Files named by a combination of their hostname and local


name; guarantees a unique system-wide name.
n Approach2: Attach remote directories to local directories, giving the
appearance of a coherent directory tree; only previously mounted remote
directories can be accessed transparently.
n Approach3: Total integration of the component file systems:
l A single global name structure spans all the files in the system.
l If a server is unavailable, some arbitrary set of directories on different
machines also becomes unavailable.
n In practice, most DFSs use static, location-transparent mapping for user-
level names:
l Some support file migration.
l Hadoop supports file migration but without following POSIX standards.

Operating System Concepts – 9th Edition 17.14 Silberschatz, Galvin and Gagne ©2013
Remote File Access

n Remote-service mechanism is one transfer approach.


n Reduce network traffic by retaining recently accessed disk blocks in a
cache, so that repeated accesses to the same information can be
handled locally:
l If needed data not already cached, a copy of data is brought from the
server to the user.
l Accesses are performed on the cached copy.
l Files identified with one master copy residing at the server machine,
but copies of (parts of) the file are scattered in different caches.
l Cache-consistency problem – keeping the cached copies consistent
with the master file:
 Could be called network virtual memory.

Operating System Concepts – 9th Edition 17.15 Silberschatz, Galvin and Gagne ©2013
Cache Location – Disk vs. Main Memory

n Advantages of disk caches:


l More reliable.
l Cached data kept on disk are still there during recovery and don’t need
to be fetched again.
n Advantages of main-memory caches:
l Permit workstations to be diskless.
l Data can be accessed more quickly.
l Performance speedup in bigger memories.
l Server caches (used to speed up disk I/O) are in main memory
regardless of where user caches are located; using main-memory
caches on the user machine permits a single caching mechanism for
servers and users.

Operating System Concepts – 9th Edition 17.16 Silberschatz, Galvin and Gagne ©2013
Cache Update Policy
Server has master copy and client has a cached copy. If the cached copy at client is changed,
then we need to write it back to server master copy so that they remain consistent? What are
the ways to do that?
n Write-through – write data through to disk as soon as they are placed on any
cache:
l Reliable, but poor performance.
n Delayed-write (write-back) – modifications written to the cache and then written
through to the server later:
l Write accesses complete quickly; some data may be overwritten before they are
written back, and so need never be written at all.
l Poor reliability; unwritten data will be lost whenever a user machine crashes.
l Variation – scan cache at regular intervals and flush blocks that have been modified
since the last scan.
l Variation – write-on-close, writes data back to the server when the file is closed.
 Best for files that are open for long periods and frequently modified.
Write-through: As soon as a cached copy is changed, send changes to server
master copy immediately.

Delayed-write: When a cached copy is changed, don’t send changes to server


master copy immediately because may be several updates happening soon.
Operating System Concepts – 9th Edition 17.17 Silberschatz, Galvin and Gagne ©2013
Consistency

n Is the locally cached copy of the data consistent with the master copy?
n Client-initiated approach:
l Client initiates a validity check.
l Server checks whether the local data are consistent with the master copy.
n Server-initiated approach:
l Server records, for each client, the (parts of) files it caches.
l When the server detects a potential inconsistency, it must react.

Client-initiated: Clients keeps checking with server to check if the


master file is changed.

Server-initiated: Suppose client1 have client 2 have a copy of the


master file. If master file changed at server, then server sends new
copies to clients.

Operating System Concepts – 9th Edition 17.18 Silberschatz, Galvin and Gagne ©2013
End of Chapter 17

Operating System Concepts – 9th Edition Silberschatz, Galvin and Gagne ©2013

You might also like