Unit - I - Chapter - 1 - Notes-Distributed Systems
Unit - I - Chapter - 1 - Notes-Distributed Systems
Unit I
1.1 Definition:
A distributed system is one in which components located at networked computers communicate
and coordinate their actions only by passing messages. This definition leads to the following
especially significant characteristics of distributed systems: concurrency of components, lack of
a global clock and independent failures of components.
Features
No common physical clock
No shared memory
Geographical separation- Recently, the network/cluster of workstations (NOW/COW)
configuration connecting processors on a LAN is also being increasingly regarded as a
small distributed system. The Google search engine is based on the NOW architecture.
Autonomy and heterogeneity
A typical distributed system is shown in Figure 1.1. Each computer has a memory-processing
unit and the computers are connected by a communication network. Figure 1.2 shows the
relationships of the software components that run on each of the computers and use the local
operating system and network protocol stack for functioning. The distributed software is also
termed as middleware. A distributed execution is the execution of processes across the
distributed system to collaboratively achieve a common goal. An execution is also sometimes
termed a computation or a run.
The distributed system uses a layered architecture to break down the complexity of system
design. The middleware is the distributed software that drives the distributed system, while
providing transparency of heterogeneity at the platform level. Figure 1.2 schematically shows the
interaction of this software with these system components at each processor. There are several
middleware standards such as Object Management Group’s (OMG) common object request
broker architecture (CORBA), and the remote procedure call (RPC) mechanism.
1.3 Motivation
Inherently distributed computations
Resource sharing
Access to geographically remote data and resources
Enhanced reliability
o availability
o integrity
o fault-tolerance
Increased performance/cost ratio
Scalability
Modularity and incremental expandability
1.4 Relation to parallel multiprocessor/multicomputer systems
Multiprocessor Operating System refers to the use of two or more central processing
units (CPU) within a single computer system. These multiple CPUs are in a close
communication sharing the computer bus, memory and other peripheral devices. These systems
are referred as tightly coupled systems.
Parallel Processing Systems are designed to speed up the execution of programs by
dividing the program into multiple fragments and processing these fragments simultaneously.
Such systems are multiprocessor systems also known as tightly coupled systems.
1.4.1 Characteristics of parallel systems
A parallel system may be broadly classified as belonging to one of three types:
Figure 1.4 shows two popular interconnection networks – the Omega network [4] and the
Butterfly network [10], each of which is a multi-stage network formed of 2×2 switching
elements. Each 2×2 switch allows data on either of the two input wires to be switched to the
upper or the lower output wire. In a single step, however, only one data unit can be sent on an
output wire. So if the data from both the input wires is to be routed to the same output wire in a
single step, there is a collision. Various techniques such as buffering or more elaborate
interconnection designs can address collisions.
Destination-tag routing
In destination-tag routing, switch settings are determined solely by the message destination. The
most significant bit of the destination address is used to select the output of the switch in the first
stage; if the most significant bit is 0, the upper output is selected, and if it is 1, the lower output is
selected. The next-most significant bit of the destination address is used to select the output of
the switch in the next stage, and so on until the final output has been selected.
For example, if a message's destination is PE 001, the switch settings are: upper, upper, lower. If
a message's destination is PE 101, the switch settings are: lower, upper, lower. These switch
settings hold regardless of the PE sending the message
XOR-tag routing
In XOR-tag routing, switch settings are based on (source PE) XOR (destination PE). This XOR-
tag contains 1s in the bit positions that must be swapped and 0s in the bit positions that both
source and destination have in common. The most significant bit of the XOR-tag is used to select
the setting of the switch in the first stage; if the most significant bit is 0, the switch is set to pass-
through, and if it is 1, the switch is crossed. The next-most significant bit of the tag is used to set
the switch in the next stage, and so on until the final output has been selected.
For example, if PE 001 wishes to send a message to PE 010, the XOR-tag will be 011 and the
appropriate switch settings are: A2 straight, B3 crossed, C2 crossed.
A butterfly network is a technique to link multiple computers into a high-speed network. This
form of multistage interconnection network topology can be used to connect different nodes in a
multiprocessor system.
In fig 1.5 b Thus, the processors are labelled such that the shortest path between any two
processors is the Hamming distance (defined as the number of bit positions in which the
two equal sized bit strings differ) between the processor labels.
2. A multicomputer parallel system is a parallel system in which the multiple processors
do not have direct access to shared memory. The memory of the multiple processors may
or may not form a common address space. Such computers usually do not have a
common clock. The architecture is shown in Figure 1.3(b).
3. Array processors belong to a class of parallel computers that are physically co-located,
are very tightly coupled, and have a common system clock (but may not share memory
and communicate by passing data using messages). Array processors and systolic arrays
that perform tightly synchronized processing and data exchange in lock-step for
applications such as DSP and image processing belong to this category. These
applications usually involve a large number of iterations on the data. This class of parallel
systems has a very niche market.
In parallel computing, granularity (or grain size) of a task is a measure of the amount of
work (or computation) which is performed by that task.
Another definition of granularity takes into account the communication overhead between
multiple processors or processing elements. It defines granularity as the ratio of computation
time to communication time, wherein, computation time is the time required to perform the
computation of a task and communication time is the time required to exchange data between
processors.
If Tcomp is the computation time and Tcomm denotes the communication time, then the
Granularity G of a task can be calculated as:
G= Tcomp/ Tcomm
Granularity is usually measured in terms of the number of instructions executed in a particular
task. Alternately, granularity can also be specified in terms of the execution time of a program,
combining the computation time and communication time.
Shared memory systems are those in which there is a (common) shared address space
throughout the system. Communication among processors takes place via shared data variables,
and control variables for synchronization among the processors. Semaphores and monitors that
were originally designed for shared memory uniprocessors and multiprocessors are examples of
how synchronization can be achieved in shared memory systems. For a distributed system, this
abstraction is called distributed shared memory.
1.5.1 Emulating message-passing on a shared memory system (MP →SM)
The shared address space can be partitioned into disjoint parts, one part being assigned to
each processor. “Send” and “receive” operations can be implemented by writing to and reading
from the destination/sender processor’s address space, respectively,
1.5.2 Emulating shared memory on a message-passing system (SM →MP)
This involves the use of “send” and “receive” operations for “write” and “read”
operations. Each shared location can be modeled as a separate process; “write” to a shared
location is emulated by sending an update message to the corresponding owner process; a “read”
to a shared location is emulated by sending a query message to the owner process. As accessing
another processor’s memory requires send and receives operations, this emulation is expensive.
1.6 Primitives for distributed communication
1.6.1 Blocking/non-blocking, synchronous/asynchronous primitives
Message send and message receive communication primitives are denoted Send() and
Receive(), respectively. A Send primitive has at least two parameters – the destination, and the
buffer in the user space, containing the data to be sent. Similarly, a Receive primitive has at least
two parameters – the source from which the data is to be received (this could be a wildcard), and
the user buffer into which the data is to be received.
There are two ways of sending data when the Send primitive is invoked – the buffered option and
the unbuffered option. The buffered option which is the standard option copies the data from the
user buffer to the kernel buffer. The data later gets copied from the kernel buffer onto the
network. In the unbuffered option, the data gets copied directly from the user buffer onto the
network. For the Receive primitive, the buffered option is usually required because the data may
already have arrived when the primitive is invoked, and needs storage place in the kernel.
The following are some definitions of blocking/non-blocking and synchronous/asynchronous
primitives
Synchronous primitives
Asynchronous primitives
Blocking primitives
Non-blocking primitives
Blocking synchronous Send
non-blocking synchronous Send
Blocking asynchronous Send
non-blocking asynchronous Send
Blocking Receive
non-blocking Receive
Communication
Processes
Naming
Synchronization
Data storage and access
Consistency and replication
Fault tolerance
Detecting failures
Masking failures
Tolerating failures:
Recovery from failures
Redundancy
Security
Access transparency
Location transparency
Concurrency transparency
Replication transparency
Failure transparency
Mobility transparency
Performance transparency
Scaling transparency
Scalability and modularity
Synchronization/coordination mechanisms
Wait-free algorithms
Mutual exclusion
Register constructions
Consistency models
Consensus algorithms
Replication and replica management
Voting and quorum systems
Distributed databases and distributed commit
Self-stabilizing systems
Checkpointing and recovery algorithms
Failure detectors
Load balancing
Data migration
Computation migration
Distributed scheduling
Real-time scheduling
Performance
Metrics
Measurement methods/tools
Mobile systems
The portability of many of these devices, together with their ability to connect conveniently to
networks in different places, makes mobile computing possible. Mobile computing is the
performance of computing tasks while the user is on the move, or visiting places other than their
usual environment. In mobile computing, users who are away from their ‘home’ intranet (the
intranet at work, or their residence) are still provided with access to resources via the devices
they carry with them. They can continue to access the Internet; they can continue to access
resources in their home intranet; and there is increasing provision for users to utilize resources
such as printers or even sales points that are conveniently nearby as they move around. The latter
is also known as location-aware or context-aware computing. Mobility introduces a number of
challenges for distributed systems, including the need to deal with variable connectivity and
indeed disconnection, and the need to maintain operation in the face of device mobility
Sensor networks
The Internet of Things (IoT) refers to a network comprised of physical objects capable of
gathering and sharing electronic information. The Internet of Things includes a wide variety of
“smart” devices, from industrial machines that transmit data about the production process to
sensors that track information about the human body.
Peer-to-peer computing
A peer-to-peer network allows computer hardware and software to communicate without the
need for a server. Unlike client-server architecture, there is no central server for processing
requests in a P2P architecture. The peers directly interact with one another without the
requirement of a central server.
Distributed agents
Grid computing
Cloud computing is a general term for anything that involves delivering hosted services
over the Internet. These services are broadly divided into three categories: Infrastructure-as-a-
Service (IaaS), Platform-as-a-Service (PaaS) and Software-as-a-Service (SaaS). The name cloud
computing was inspired by the cloud symbol that's often used to represent the Internet in
flowcharts and diagrams.