You are on page 1of 19

Distributed Systems Chapter One

Distributed Systems

Lecturer: Dr. Nadia Tarik Saleh


Email: nadia.tarik.saleh@gmail.com

Mosul University
College of Computer Science and Mathematics
Dept. of Computer Science

2019-2020
1
Distributed Systems Chapter One

Distributed Systems
Syllabus

• Introduction
 Definition of a distributed system
 Goals
 Hardware concepts
 The client server model
• Communication
 Layered protocols
 Remote procedure call
 Remote object invocation
 Message oriented communication
 Steam oriented communication
• Processes
 Threads
 Clients
 Servers
 Code migration
 Software agents
• Naming
• Synchronization
• Consistency & Replication

Evaluation
•Exams (monthly and semester)
•Home Works
•Course Report

2
Distributed Systems Chapter One

References
- Andrew S. Tanenbaum and Maarten Van Steen, Distributed Systems:
Principals and Paradigms, 2nd ed., Upper Saddle River, New Jersey,
USA: Prentice Hall, 2007.
- Marten Van Steen and Andrew S. Tanenbaum, Distributed System,
3rd Edition 2017.
- George Coulouris, Jean Dollimore, Tim Kindberg and Gordon Blair,
Distributed Systems: Concepts and Design, 5th ed., Addison-Wesley,
2012.
- Andrew S. Tanenbaum, Modern Operating Systems, 3rd Ed., USA:
Prentice-Hall, Inc., 2008.
- A. Silberschatz, P. B. Galvin, and G. Gagne, Operating System
Concepts, 9th ed., USA: John Wiley & Sons, Inc., 2013.

3
Distributed Systems Chapter One

Distributed System (DS)


A distributed system is a collection of independent computers that
appears to the users as a single coherent system.
The computers in a distributed system may vary in size and function.
They may include microprocessors, personal computers, and large general-
purpose computer systems. A general structure of a distributed system is
shown in Figure below.
Site C
Site A
server

network resources

communication

client

Site B

General Structure of a Distributed System

 Characteristics of Distributed Systems


• The distributed system consists of components (i.e., computers) that
are independent.
• The users (either people or programs) are dealing with a single
system.
• This components need to collaborate.
• Computers types could range from high-performance mainframe
computers to small nodes in sensor networks.
• No assumptions are made on the way that computers are
interconnected.
• The differences between the various computers and the ways in which
they communicate are mostly hidden from users.

4
Distributed Systems Chapter One

• Distributed systems should also be relatively easy to expand or scale.


• A distributed system will normally be continuously available,
although perhaps some parts may be temporarily out of control.
• Users and applications should not notice that parts are being replaced,
fixed, or that new parts are added.

 The Organization of Distributed System


 The distributed systems are often organized as a layer of
software -that is, logically placed between a higher-level layer
consisting of users and applications, and a layer underneath
consisting of operating systems and basic communication networks.
Such distributed system is called Middleware.
 The middleware layer extends over multiple machines.
 The distributed system provides the means for components of a single
application to be distributed over number of computers and
communicate with each other. Also, DS lets different applications to
communicate.

The Organization of Distributed System

5
Distributed Systems Chapter One

 Goals
1. Making Resource Accessible
The main goal of DS is to make it easy for the users (and applications)
to access remote resources, and to share them in a controlled and
efficient way.
Resources can be printers, computers, storage facilities, data,
files, Web pages, and networks.
 Reasons to Share Resources
 Economics: it is cheaper to share costly resources such as printers,
supercomputers, high-performance storage systems, imagesetters,
and other expensive peripherals.
 Collaboration: connecting users and resources makes it easier to
collaborate and exchange information, like when using the
Internet.
2. Distribution Transparency
 Transparent system is a distributed system that is able to present itself
to users and applications as if it was only a single computer system.
 This means hiding the fact that its processes and resources are
physically distributed across multiple computers.
The concept of transparency can be applied to the following aspects
of a distributed system:

Different forms of transparency in a distributed system

6
Distributed Systems Chapter One

3. Openness
 An open distributed system is a system that offers components
that can be easily be used by, or integrated into other systems. At
the same time, an open DS itself will often consist of components
that originate from elsewhere.
 To be open means that component should be constrained with
standard rule that describe the syntax and semantics of those
components. For example, in computer networks, standard rules
control the format, contents, and meaning of messages sent and
received. Such rules are formalized in protocols.
An open distributed system should:
 Portable: Portability describes the ability of one distributed system
application that can be executed without modification, on a different
distributed system.
 Flexible: the system is organized as a collection of relatively small and
easily replaceable or adaptable components. Such system is called
Extensible System, where it is easy to add parts that run on a different
operating system or even to replace an entire file system.

4. Scalability
Scalability of a system can be measured in three different
dimensions:
1. Size: meaning that we can easily add more users and resources to the
system.
2. Geographical: in which the users and resources may lie far apart.
3. Administrative: meaning that it can still be easy to manage the system
even if it spans many independent administrative organizations.

7
Distributed Systems Chapter One

 Scalability Limitations
1. Centralized Services: many services are centralized where they are
implemented by means of only a single server running on a specific
machine in the distributed system. The problem is that the server
can become a bottleneck as the number of users and applications
grows.
2. Centralized Data: having a single database would certainly
saturate all the communication lines into and out of it.
3. Centralized Algorithm: a large number of messages have to be
routed over many lines, and then run an algorithm to compute all
the optimal routes.

Examples of Scalability Limitations

 Decentralized Algorithms: only these types of algorithms should be


used. These algorithms generally have the following characteristics,
which distinguish them from centralized algorithms:
1. No machine has complete information about the system state.
2. Machines make decisions based only on local information.
3. Failure of one machine does not ruin the algorithm.
4. There is no implicit assumption that a global clock exists.

8
Distributed Systems Chapter One

 Scaling Techniques
 Hiding communication latencies: is important to achieve
geographical scalability. The basic idea is simple: try to avoid waiting
for responses to remote service requests as much as possible.
 Partitioning and Distribution: involves taking a component,
splitting it into smaller parts, and subsequently spreading those parts
across the system.
 Replication of the components across a distributed system.
Replication increases availability and helps to balance the load
between components leading to better performance.

 Pitfalls
The following false assumptions are made by every developer when
developing a distributed application for the first time:
 The network is reliable.
 The network is secure.
 The network is homogeneous.
 The topology does not change.
 Latency is zero.
 Bandwidth is infinite.
 Transport cost is zero.
 There is one administrator.

9
Distributed Systems Chapter One

 Hardware Concepts
Even though all distributed systems consist of multiple CPUs, there
are several different ways of organizing hardware, in terms of how they are
interconnected and how they communicate. Computers are divided into two
groups:
1. Multiprocessors (Shared-memory): computers that are supplied
with several processors that share one or more modules of memory
(RAM). The processors may also have their own private memory.

Bus-based Multiprocessor (shared memory)

2. Multicomputer: (Distributed-memory multiprocessors): the


processors do not share memory but are connected by a very high
speed network. These systems can have greater numbers of processors
than shared-memory multiprocessors.

 Distributed systems can be further classified into two types:


1. Homogeneous Systems: where connected computers are
the same with identical processors. All computers have the same
operating system, and are all connected through the same network.
2. Heterogeneous Systems: may contain different
independent computers, each has its own operating system and
machine architecture and is connected through different networks.

10
Distributed Systems Chapter One

 Operating Systems for Distributed Systems


Operating systems for distributed computers is classified into:
1. Distributed Operating Systems: The functionality of distributed
operating systems is essentially the same as that of traditional
operating systems for uniprocessor systems except that they handle
multiple CPUs.

 There are two types of distributed operating systems:


 A multiprocessor operating system: manages the resources of a
multiprocessor. It supports multiple processors and could access
shared memory. An important goal is to make the number of CPUs
transparent to the application
 A multicomputer operating system: is developed for homogeneous
multicomputers. Communication is performed through message
passing between nodes. Each node has its own kernel for managing
local resources such as memory, local CPU, local disk, etc. Above
each local kernel is a common layer of software that implements the
operating system as a virtual machine and supports parallel execution
of different tasks.
Machine A Machine B Machine C

Distributed applications

Distributed operating system services

Kernel Kernel Kernel

Network
Multicomputer Operating System

11
Distributed Systems Chapter One

2. Network Operating Systems: network operating systems do not


assume that the underlying hardware is homogeneous. The machines
and their operating systems may be different, but they are all
connected to each other in a computer network.
Machine A Machine B Machine C

Distributed applications

Network OS Network OS Network OS


services services services

Kernel Kernel Kernel

Network
Network Operating System

3. Middleware: an additional layer of software that is used in network


operating systems to hide the heterogeneity of the collection of
underlying platforms and to improve distribution transparency.

General Structure of a Distributed System as Middleware

12
Distributed Systems Chapter One

 A Comparison between Systems


A brief comparison between distributed operating systems, network
operating systems, and (middleware-based) distributed systems is given in
table below:

Distributed OS Network Middleware-


Item
Multiproc. Multicomp. OS based OS
Degree of
Very High High Low High
transparency
Same OS on all
Yes Yes No No
nodes
Number of
1 N N N
copies of OS
Basis for Model
Shared memory Messages Files
communication specific
Resource Global,
Global, central Per node Per node
management distributed
Scalability No Moderately Yes Varies
Openness Closed Closed Open Open

 Common Types of Distributed Systems


1. Clustered Computing System: is a collection of relatively simple
computers (Homogeneous resources) connected in a high-speed
network. This type of DS has the following features:
 The underlying hardware consists of a collection of similar
workstations or PCs;
 Closely connected by means of a same high-speed local-area network;
 Each node runs the same operating system.
Cluster computing is used for parallel programming in which a single
(compute intensive) program is run in parallel on multiple machines.

13
Distributed Systems Chapter One

Cluster Computing System

The cluster consists of a collection of compute nodes that are


controlled and accessed by means of a single master node.
 The master node manages the cluster and performs:
 the allocation of nodes to a particular parallel program;
 maintains a queue of submitted jobs;
 provides an interface for the users of the system;
 runs the middleware needed for the execution of programs.
 The compute nodes often need a standard operating system
and execute a particular parallel program.

2. Grid Computing System: a system in which the computers from


different organizations (Heterogeneous resources) are brought
together to allow the collaboration of a group of people or institutions.
 In this system, there is no assumption about the type of hardware,
operating systems and networks.
 The resources consist of Compute servers, storage facilities, databases
and special networked devices.
 The software for Grid computing providing access to resources from
different administrative domains, and to only those users belongs to a
specific organization.

14
Distributed Systems Chapter One

The Architecture of Grid Computing

 The architecture consists of four layers:


1. The lowest fabric layer provides interfaces to local resources at a
specific site.
2. The connectivity layer consists of communication protocols for
supporting grid transactions that span the usage of multiple
resources. For example, protocols are needed to transfer data
between resources, or to simply access a resource from a remote
location.
3. The resource layer is responsible for managing a single resource. It
uses the functions provided by the connectivity layer and calls
directly the interfaces made available by the fabric layer.
4. The collective layer deals with handling access to multiple resources
and typically consists of services for resource discovery, allocation
and scheduling of tasks onto multiple resources.
5. The application layer consists of the applications that operate within
an organization and make use of the grid computing environment.

3. Cloud Computing: is the delivery of computing services—servers,


storage, databases, networking, software, analytics and more—over
the Internet (“the cloud”).

15
Distributed Systems Chapter One

 The companies that offer the computing services are called cloud
providers and typically charge for cloud computing services based on
usage.
 Cloud computing enables companies and users to consume a compute
resource, such as a virtual machine (VM), storage or an application, as
a utility —just like electricity— rather than having to build and
maintain computing infrastructures in house.

Organization of Cloud Computing

 Clouds are organized into four layers:


1- Hardware: the lowest layer manages the necessary hardware:
processors, routers, power and cooling system. It is implemented at
data centers and contains the resources that customers cannot see
actually.
2- Infrastructure: It deploys virtualization techniques to provide
customers an infrastructure consisting of virtual storage and
computing resources.
3- Platform: provides the services and means to easily develop and
deploy applications that needed to run in the cloud. These platforms
are installed in the cloud.

16
Distributed Systems Chapter One

4- Application: in this layer, actual applications are offered to customers


for use and customization. These applications are executed in the
cloud.

 Cloud computing providers offer these layers to the users through


various interfaces (command line, programming interfaces (API) and
web interfaces), which results three types of services:
1. Infrastructure-as-a-Service (IaaS): covering the hardware and
infrastructure layers.
2. Platform-as-a-Service (PaaS): covering platform layer.
3. Software-as-a-Service (SaaS): covering application layer.

 Client-Server Model
The most commonly applied model for distributed system architecture.
a) Simple Client-Server Architecture
Processes in a distributed system are divided into two
groups:
1. Server: is a process implementing a specific service and containing
the data, e.g.: a file system service or database service.
2. Client: is a process that requests a service from a server by sending it
a request and subsequently waiting for the server’s reply.

17
Distributed Systems Chapter One

The communication between the client and server is implemented as


follows:
1. The client requests a service by simply packaging a message for the
server, identifying the service it wants with the input data.
2. The message is sent to the server, which always is waiting for the
incoming request.
3. Starting the process of the received message by the server.
4. Packaging the results in a reply message to be sent to the client.

b) Multitiered Architecture
In this architecture the client-server system is distributed across several
machines and the application is distributed into three layers:
(1) User interface layer.
(2) Processing layer.
(3) Data layer.

Client-Server Organization in Multi-tier Architecture

18
Distributed Systems Chapter One

General Organization of an Internet Search Engine into Three Different Layers

c) A Server Acts as a Client


In this architecture, a program that form a part of the processing layer are
executed in a separate machine (Database server) and the essential of the
processing (Application server) reside in another machine.

19

You might also like