DS (MR-22) Short Answers and Questions
DS (MR-22) Short Answers and Questions
A distributed system is a collection of independent computers that appears to its users as a single
coherent system. A distributed system is one in which components located at networked
communicate and coordinate their actions only by passing message.
Openness
Concurrency
Scalability
Transparency
Corporate systems
Mobile computing devices are being carried around. Ubiquitous: little computing devices are all
over the place.
1. Heterogeneity
2. Openness
3. Security
4. Scalability
5. Failure handling
6. Concurrency
7. Transparency
1.Performance
2. Distribution
4. Incremental growth
5. Sharing of data/resources
6. Communication
2. Networking problems
3. Security problems
Software
Little software exists compared to PCs (for example) but the situation is improving with the
cloud.
Networking Still slow and can cause other problems (e.g., when disconnected)
Privacy Data may be accessed securely but without the owner’s consent (significant issue in
modern systems)
8. What are the Applications of Distributed system?
News
Banking system
Messaging
1.Share hardware
2. Software,
Openness
Resource Sharing
Concurrency
Scalability
Fault-Tolerance
Transparency
High-Performance
11. What is Communication in Distributed Systems?
Communication is an essential part of distributed systems - e.g., clients and servers must
communicate for request and response. Communication normally involved - transfer of data
from sender to receiver - synchronization among processes.
Client-Server
Group Multicast
Function Shipping
Inter process communication (IPC) is a set of programming interfaces that allow a programmer
to coordinate activities among different program processes that can run concurrently in an
operating system. This allows a program to handle many user requests at the same time.
Remote invocation;
Indirect communication.
15. What are Software and hardware service layers in distributed systems?
Applications,
Services
Middleware
Operating system
Marshalling is the process of taking a collection of data items and assembling them into a form
suitable for transmission in a message. Unmarshalling is the process of disassembling them on
arrival to produce an equivalent collection of data items at the destination.
Peer-to-peer systems aim to support useful distributed services and applications using data and
computing resources available in the personal computers and workstations that are present in the
Internet and other networks in ever-increasing numbers
The goal of peer-to-peer systems is to enable the sharing of data and resources on a very large
scale by eliminating any requirement for separately managed servers and their associated
infrastructure.
Their design ensures that each user contributes resources to the system.
• Although they may differ in the resources that they contribute, all the nodes in a peer-to-peer
system have the same functional capabilities and responsibilities.
• Their correct operation does not depend on the existence of any centrally administered systems.
• They can be designed to offer a limited degree of anonymity to the providers and users of
resources
A distributed file system enables programs to store and access remote files exactly as they do
local ones, allowing users to access files from any computer on a network.
22. What are the two basic file system used in distributed system?
File systems are responsible for the organization, storage, retrieval, naming, sharing and
protection of files. They provide a programming interface that characterizes the file abstraction,
freeing programmers from concern with the details of storage allocation and layout.
Files contain both data and attributes. The data consist of a sequence of data items (typically 8-
bit bytes), accessible by operations to read and write any portion of the sequence. The attributes
are held as a single record containing information such as the length of the file, timestamps, file
type, owner’s identity and access control lists.
In a distributed system, names are used to refer to a wide variety of resources such as computers,
services, remote objects and files, as well as to users. A name is needed to request a computer
system to act upon a specific resource chosen out of many.
A Global Name Service (GNS) was designed and implemented by Lampson and colleagues at
the DEC Systems Research Center [Lampson 1986] to provide facilities for resource location,
mail addressing and authentication.
An algorithm for choosing a unique process to play a particular role is called an election
algorithm. Ex: In a variant of central server algorithm for mutual exclusion, the server is choosen
from among the process . The different algorithms are
• Ring based election algorithm
• Bully algorithm
Logical time
Lamport proposed a model of logical time that can be used to provide an ordering among the
events at processes running in different computers in a distributed system. Logical time allows
the order in which the messages are presented to be inferred without recourse to clocks.
Logical clocks
Lamport invented a simple mechanism by which the happened before ordering can be captured
numerically, called a logical clock. A Lampport logical clock is a monotonically increasing
software counter, whose value need bear no particular relationship to any physical clock. Each
process pi Keeps its own logical clock, Li , which it uses to apply so-called Lamport timestamps
to events. We denote the timestamp of event e at pi by Li(e) , and by L(e) we denote the
timestamp of event e at whatever process it occurred
31. What is mutual exclusion? How is the performance of algorithms of mutual exclusions
evaluated?
Distributed processes often need to coordinate their activities. If a collection of processes share a
resource or collection of resources, then often mutual exclusion is required to prevent
interference and ensure consistency when accessing the resources.
32. Explain an algorithm using multicast and logical clocks for mutual exclusion.
An algorithm using multicast and logical clocks • An algorithm to implement mutual exclusion
between N peer processes that is based upon multicast. The basic idea is that processes that
require entry to a critical section multicast a request message, and can enter it only when all the
other processes have.
34. What are the two modes of synchronization? Write their format?
The two modes are: External synchronization: In order to Know at what time of day events occur
at the processes in our distributed system – for example, for accountancy purposes – it is
necessary to synchronize the processes’ clocks, Ci , with an authoritative, external source of
time. This is external synchronization For a synchronization bound D>0, and for a source S of
UTC time,|S(t) –Ci(t)|
Internal synchronization: If the clocks Ci are synchronized with one another to a Known degree
of accuracy, then we can measure the interval between two events occurring at different
computers by appealing to their local clocks, even though they are not necessarily synchronized
to an external source of time. This is internal synchronization. For a synchronization bound
D>0,|Ci(t)-Cj(t)|
The BerKeley algorithm eliminates readings from faulty clocks. Such clocks could have a
significant adverse effect if an ordinary average was taken so instead the master takes a fault
tolerant average. That is, a subset is chosen of clocks that do not differ from one another by more
than a specified amount, and the average is taken of readings from only these clocks.
The ‘snapshot’ algorithm of Chandy and Lamport describe a ‘snapshot’ algorithm for
determining global states of distributed systems, which we now present. The goal of the
algorithm is to record a set of process and channel states (a ‘snapshot’) for a set of processes pi( i
= 1,2,.N ) such that, even though the combination of recorded states may never have occurred at
the same time, the recorded global state is consistent
A ring-based election algorithm • The algorithm of Chang and Roberts is suitable for a collection
of processes arranged in a logical ring. Each process pi has a communication channel to the next
process in the ring , and all messages are sent clockwise around the ring. The goal of this
algorithm is to elect a single process called the coordinator, which is the process with the largest
identifier.
MaeKawa’s voting algorithm • MaeKawa observed that in order for a process to enter a critical
section, it is not necessary for all of its peers to grant it access. Processes need only obtain
permission to enter from subsets of their peers, as long as the subsets used by any two processes
overlap
This algorithm allows process to crash during an election. Although it assumes that message
delivery between process is reliable. It assume sthat the system is synchronous – it uses timeouts
to detect a process failure
40. What is a Transaction?
In a flat transaction, a client makes requests to more than one server. Transaction T is a flat
transaction that invokes operations on objects in servers X, Y and Z. A flat client transaction
completes each of its requests before going on to the next one. Therefore, each transaction
accesses servers’ objects sequentially. When servers use locking, a transaction can only be
waiting for one object at a time.
Nested transactions are structured from sets of other transactions. They are particularly useful in
distributed systems because they allow additional concurrency.
Locks are used to order transactions that access the same objects according to the order of
arrival of their operations at the objects.
Optimistic concurrency control allows transactions to proceed until they are ready to commit,
whereupon a check is made to see whether they have performed conflicting operations on
objects.
Timestamp ordering uses timestamps to order transactions that access the same
In a distributed transaction, the locks on an object are held locally (in the same server).The local
lock manager can decide whether to grant a lock or make the requesting transaction wait.
However, it cannot release any locks until it Knows that the transaction has been committed or
aborted at all the servers involved in the transaction. When locking is used for concurrency
control, the objects remain locked and are unavailable
All or nothing: A transaction either completes successfully, in which case the effects of all of its
operations are recorded in the objects, or (if it fails or is deliberately aborted) has no effect at all.
A transaction comes to an end when the client requests that it be committed or aborted. A simple
way to complete the transaction in an atomic manner is for the coordinator to communicate the
commit or abort request to all of the participants in the transaction and to Keep on repeating the
request until all of them have acknowledged that they have carried it out. This is an example of a
one phase atomic commit protocol
47. What are the different ways to control concurrency in distributed transactions?
Explain with examples.
Locking In a distributed transaction, the locks on an object are held locally (in the same server).
The local lock manager can decide whether to grant a lock or make the requesting transaction
wait. However, it cannot release any locks until it Knows that the transaction has been
committed or aborted at all the servers involved in the transaction. When locking is used for
concurrency control, the objects remain locked and are unavailable for other transactions during
the atomic commit protocol, although an aborted transaction releases its locks after phase 1 of
the protocol.
With deadlock detection schemes, a transaction is aborted only when it is involved in a deadlock.
Most deadlock detection schemes operate by finding cycles in the transaction wait for graph. In a
distributed system involving multiple servers being accessed by multiple transactions, a global
wait-for graph can in theory be constructed from the local ones. There can be a cycle in the
global wait-for graph that is not in any single local one – that is, there can be a distributed
deadlock
Atomic property of transactions can be described in two aspects:Durability: objects are saved
in permanent storage and will be available indefinitely thereafter. Acknowledgement of a
client’s commit request implies that all the effects of the transaction have been recorded in
permanent storage as well as in the server’s volatile object.
Failure atomicity: the effects of transactions are atomic even when the server crashes.
Replication is a Key to providing high availability and fault tolerance in distributed systems.
High availability is of increasing interest with the tendency towards mobile computing and
consequently disconnected operation. Fault tolerance is an abiding concern for services provided
in safety-critical and other important systems.
Performance enhancement: The caching of data at clients and servers is by now familiar as a
means of performance enhancement. Increased availability: Users require services to be highly
available. That is, the proportion of time for which a service is accessible with reasonable
response times should be close to 100%. Fault tolerance: Highly available data is not necessarily
strictly correct data. It may be out of date, for example; or two users on opposite sides of a
network partition may make updates that conflict and need to be resolved.
A common requirement when data are replicated is for replication transparency. That is, clients
should not normally have to be aware that multiple physical copies of data exist. As far as clients
are concerned, data are organized as individual logical objects and they identify only one item in
each case when they request an operation to be performed.
Components that contain the replicas on a given computer and perform operations upon them
directly
There are various correctness criteria for replicated objects. The most strictly correct systems are
linearizable, and this property is called linearizability.
In the passive or primary-backup model of replication for fault tolerance, there is at any one time
a single primary replica manager and one or more secondary replica managers – ‘backups’ or
‘slaves’. In the pure form of the model, front ends communicate only with the primary replica
manager to obtain the service. The primary replica manager executes the operations and sends
copies of the updated data to the backups. If the primary fails, one of the backups is promoted to
act as the primary.
In the active model of replication for fault tolerance, the replica managers are state machines that
play equivalent roles and are organized as a group. Front ends multicast their requests to the
group of replica managers and all the replica managers process the request independently but
identically and reply. If any replica manager crashes, this need have no impact upon the
performance of the service, since the remaining replica managers continue to respond in the
normal way.
58. What is a Shared Memory?
Every process has a dedicated address space in order to store data. If a process wants to share some
data with another process, it cannot directly do so since they have different address spaces. In order to
share some data, a process takes up some of the address space as shared memory space. This shared
memory can be accessed by the other process to read/write the shared data.
59. What are the Issues to Design and Implementation of DSM?
Issues to Design and Implementation of DSM:
Granularity
Structure of shared memory space
Memory coherence and access synchronization
Data location and access
Replacement strategy
Thrashing
Heterogeneity
60. What are Consistency models in distributed systems?
In distributed systems, consistency models establish criteria for data synchronization and
specify how users and applications should interpret data changes across several nodes. In a
distributed system, it specifically controls how data is accessed and changed across numerous
nodes and how clients are informed of these updates. These models range from strict to relaxed
approaches.