0% found this document useful (0 votes)
56 views15 pages

Assignment-1: Scalability: The Uncertain Trend in Distributed Systems Is Towards

The document discusses distributed systems and related concepts. It defines distributed systems and describes their important goals like connecting users and resources, transparency, openness, scalability, and reliability. It also compares centralized and distributed computing models and explains client-server model. It further compares OSI and TCP/IP networking models and describes distributed mutual exclusion and approaches to achieve it. The document also defines deadlock and starvation conditions in distributed systems and explains various deadlock handling strategies.

Uploaded by

Pratham Nishad
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
56 views15 pages

Assignment-1: Scalability: The Uncertain Trend in Distributed Systems Is Towards

The document discusses distributed systems and related concepts. It defines distributed systems and describes their important goals like connecting users and resources, transparency, openness, scalability, and reliability. It also compares centralized and distributed computing models and explains client-server model. It further compares OSI and TCP/IP networking models and describes distributed mutual exclusion and approaches to achieve it. The document also defines deadlock and starvation conditions in distributed systems and explains various deadlock handling strategies.

Uploaded by

Pratham Nishad
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

ASSIGNMENT-1

Q1. What is distributed system? Give the important goals to build the
distributed system.
A1. A distributed system contains multiple nodes that are physically separate
but linked together using the network. All the nodes in this system
communicate with each other and handle processes in tandem. There are two
general ways that distributed systems function:

1. Each machine works toward a common goal and the end-user views
results as one cohesive unit.
2. Each machine has its own end-user and the distributed system facilitates
sharing resources or communication services.

Distributed systems have endless use cases, a few being electronic banking
systems, massive multiplayer online games, and sensor networks.

There are various important goals that must be met to build a distributed
system worth the effort.

1. Connecting Users and Resources : The main goal of a distributed


system is to make it easy for users to access remote resources, and to
share them with other users in a controlled manner.
2. Transparency : An important goal of a distributed system is to hide the
fact that its process and resources are physically distributed across
multiple computers. A distributed system that is capable of presenting
itself to users and applications such that it is only a single computer
system is called transparent.
3. Openness : Another important goal of distributed systems is openness.
An open distributed system is a system that offers services in standards
that describable the syntax and semantics of those service instances,
standard rules in computer networks control the format, content, and
meaning of messages sent and received.

4. Scalability : The uncertain trend in distributed systems is towards


larger systems. This observation has implications for distributed file
system design. The centralized algorithm does not scale well. If opening

LALIT KUMAR 1704310034


a file requires contacting a single centralized server to record the fact
that the file is open then the server will eventually become a bottleneck
as the system grows.

5. Reliability : The main goal of building distributed systems was to


make them more reliable than single processor systems. The idea is
that if some machine goes down, some other machine gets used to it.

6. Performance : Building a transparent, flexible, reliable distributed


system is useless if it is slow like molasses. In particular application on
a distributed system, it should not deteriorate better than running some
application on a single processor.

Q2. What is client server model? Compare centralized and distributed


computing.
A2. The Client-server model is a distributed application structure that
partitions task or workload between the providers of a resource or service,
called servers, and service requesters called clients. In the client-server
architecture, when the client computer sends a request for data to the server
through the internet, the server accepts the requested process and deliver
the data packets requested back to the client. Clients do not share any of
their resources. Examples of Client-Server Model are Email, World Wide Web,
etc.
Centralized computing : In a centralized scenario, client machines connect to
the server computer, otherwise known as the master computer, and submit
their request. NFS Client intercepts file system requests corresponding to NFS
mount and uses RPC to send them across the network to NFS file server.

Figure – Centralised system visualisation

LALIT KUMAR 1704310034


Distributed Computing : In a distributed computing system, multiple client
machines work together to solve a task. Instead of a master computer that
outperforms and subordinates all client machines, the distributed system
possesses multiple client machines, which are typically equipped with
lightweight software agents. In this scenario, all the client machines work
autonomously although sharing the information necessary to achieve the
goals.

Figure – Distributed system visualisation

Q3. Compare and contrast the OSI and TCP/IP model.


A3. Similarities between TCP/IP model and OSI model

 Both define standards for networking.


 Both provide a framework for creating and implementing networking
standards and devices.
 Both divide the network communication process in layers.
 In both models, a single layer defines a particular functionality and set
standards for that functionality only.
 Both models allow a manufacturer to make devices and network
components that can coexist and work with the devices and components
made by other manufacturers.
 Both models simplify troubleshooting process by dividing complex
functions into simpler components.

Differences between OSI model and TCP/IP model

 OSI Layer model has seven layers while TCP/IP model has four layers.
 OSI Layer model is no longer used while TCP/IP is still used in computer
networking.
 To define the functionality of upper layers, OSI uses three separate
layers (application, presentation and session) while TCP/IP uses a single
layer (application).

LALIT KUMAR 1704310034


 Just like upper layers, OSI uses two separate layers (Physical and Data
link) to define the functionality of bottom layers while TCP/IP uses a
single layer (Link) for the same.
 To define the routing protocols and standards, OSI uses Network layer
while TCP/IP uses Internet layer.
 In comparison of TCP/IP model, OSI model is well documented and
explains standards and protocols in more details.

Q4. What is distributed mutual exclusion?

A4. Mutual exclusion is a concurrency control property which is introduced to


prevent race conditions. It is the requirement that a process can not enter its
critical section while another concurrent process is currently present or
executing in its critical section.

In Distributed systems, we neither have shared memory nor a common


physical clock and there for we can not solve mutual exclusion problem using
shared variables. To eliminate the mutual exclusion problem in distributed
system approach based on message passing is used. Below are the three
approaches based on message passing to implement mutual exclusion in
distributed systems:
Token Based Algorithm:
 A unique token is shared among all the sites.
 If a site possesses the unique token, it is allowed to enter
its critical section
 This approach uses sequence number to order requests for
the critical section.
 Each requests for critical section contains a sequence
number. This sequence number is used to distinguish old
and current requests.

Non-token based approach:


 A site communicates with other sites in order to determine which
sites should execute critical section next. This requires exchange of
two or more successive round of messages among sites.

 All algorithm which follows non-token based approach


maintains a logical clock. Logical clocks get updated according
to Lamport’s scheme.

Quorum based approach:


LALIT KUMAR 1704310034
 Instead of requesting permission to execute the critical section from
all other sites, Each site requests only a subset of sites which is
called a quorum.
 Any two subsets of sites or Quorum contains a common site.
 This common site is responsible to ensure mutual exclusion

LALIT KUMAR 1704310034


ASSIGNMENT-2

Q1. What is Deadlock and Starvation?


A1. Deadlock : A deadlock occurs when two or more processes need some
resource to complete their execution that is held by the other process. These
conditions are not necessarily mutually exclusive. They are given as follows −

 Mutual Exclusion
Mutual exclusion implies there should be a resource that can only be held by
one process at a time. This means that the resources should be non-sharable.

 Hold and Wait


A process can hold multiple resources and still request more resources from
other processes which are holding them.

 No preemption
A resource cannot be preempted from a process by force. A process can only
release a resource voluntarily.

 Circular wait
A process is waiting for the resource held by the second process, which is
waiting for the resource held by the third process and so on, till the last process
is waiting for a resource held by the first process. This forms a circular chain.

Starvation: Starvation occurs if a process is indefinitely postponed. This may


happen if the process requires a resource for execution that it is never allotted
or if the process is never provided the processor for some reason. Some of the
common causes of starvation are as follows −

 If a process is never provided the resources it requires for execution


because of faulty resource allocation decisions, then starvation can
occur.
 A lower priority process may wait forever if higher priority processes
constantly monopolize the processor.
 Starvation may occur if there are not enough resources to provide to
every process as required.

Q2. Explain the various handling strategies for Deadlock.


A2. Strategies for handling Deadlock are -

LALIT KUMAR 1704310034


 Deadlock Ignorance - Deadlock Ignorance is the most widely used
approach among all the mechanism. This is being used by many operating
systems mainly for end user uses. In this approach, the Operating system
assumes that deadlock never occurs. It simply ignores deadlock. This
approach is best suitable for a single end user system where User uses the
system only for browsing and all other normal stuff.
 Deadlock Prevention - Deadlock happens only when Mutual Exclusion,
hold and wait, No preemption and circular wait holds simultaneously. If
it is possible to violate one of the four conditions at any time then the
deadlock can never occur in the system. The idea behind the approach is
very simple that we have to fail one of the four conditions but its
physical implementation in the system is not feasible.

 Deadlock Avoidance - In deadlock avoidance, the operating system


checks whether the system is in safe state or in unsafe state at every
step which the operating system performs. The process continues until
the system is in safe state. Once the system moves to unsafe state, the
OS has to backtrack one step.
 Deadlock Detection and Recovery - This approach let the processes fall
in deadlock and then periodically check whether deadlock occur in the
system or not.

Q3. What do you mean by distributed deadlock?

A3. The same conditions for deadlock in uniprocessors apply to distributed


systems. Unfortunately, as in many other aspects of distributed systems, they
are harder to detect, avoid, and prevent. Four strategies can be used to handle
deadlock:

 Ignorance -ignore the problem; assume that a deadlock will never occur.
This is a common approach.

 Detection - let a deadlock occur, detect it, and then deal with it by
aborting and later restarting a process that causes deadlock.

 Prevention - make a deadlock impossible by granting requests so that


one of the necessary conditions for deadlock does not hold.

LALIT KUMAR 1704310034


 Avoidance -choose resource allocation carefully so that deadlock will not
occur. Resource requests can be honored as long as the system remains
in a safe (non-deadlock) state after resources are allocated.

The last of these, deadlock avoidance through resource allocation is difficult


and requires the ability to predict precisely the resources that will be needed
and the times that they will be needed. This is difficult and not practical in real
systems. The first of these is trivially simple but, of course, ineffective for
actually doing anything about deadlock conditions. We generally focus on the
middle two approaches. An algorithm for detecting deadlocks in a distributed
system was proposed by Chandy, Misra, and Haas. Processes request resources
from the current holder of that resource. Some processes may wait for
resources, which may be held either locally or remotely. Cross-machine arcs
make looking for cycles, and hence detecting deadlock, difficult. This algorithm
avoids the problem of constructing a Global WFG.

Q4. What do you mean by Atomic commit in Distributed Database System?

A4. In the field of computer science, an atomic commit is an operation that


applies a set of distinct changes as a single operation. The problem with atomic
commits is that they require coordination between multiple systems. In order
to ensure atomicity property of a distributed transaction, all local sites
participating in the transaction must coordinate their actions so that they
either unanimously abort or unanimously commit the transaction, and so the
transactions effects either persist at all sites involved in the transaction or are
obliterated from them as if the transaction has never existed. This is achieved
by employing an atomic commit protocol (ACP) that executes a commit or an
abort operation across multiple sites as a single logical operation. An atomic
commit protocol (ACP) is a distributed algorithm used to ensure the atomicity
property of transactions in distributed database systems. This added cost is
due to the overhead of the required coordination messages and log writes at
each involved database site to achieve atomicity.

LALIT KUMAR 1704310034


ASSIGNMENT-3

Q1. What do you mean by distributed objects?


A1. A distributed object is an object that can be accessed remotely. This means
that a distributed object can be used like a regular object, but from anywhere on
the network. An object is typically considered to encapsulate data and behavior.
In a system for distributed objects, the unit of distribution is the object. That is,
a client imports ”something” which allows the client access to the remote
object as if it were part of the original client program (as with RPC and RMI,
sort of transparently). A client actually imports a Java class and this becomes
part of the set of classes available on the client machine.

Q2. Define the term secret key cryptography with its characteristics.
A2. In secret-key cryptography, a sequence of bits, called the secret key, is used
as an input to a mathematical function to encrypt a plaintext message; the
same key is also used to decrypt the resulting ciphertext message and obtain
the original plaintext. Such cryptographic system, requiring the key to be
shared by both parties, is also known as symmetric-key cryptography.
Characteristics of secret key cryptography :

1. Privacy/confidentiality: Ensuring that no one can read the message


except the intended receiver.
2. Authentication: The process of proving one's identity.
3. Integrity: Assuring the receiver that the received message has not been
altered in any way from the original.
4. Non-repudiation: A mechanism to prove that the sender really sent this
message.
5. Key exchange: The method by which crypto keys are shared between
sender and receiver.

In cryptography, we start with the unencrypted data, referred to as plaintext.


Plaintext is encrypted into ciphertext, which will in turn (usually)
be decrypted back into usable plaintext. The encryption and decryption is
based upon the type of cryptography scheme being employed and some form
of key.

LALIT KUMAR 1704310034


Q3. What are the benefits of caching.

A3. Effective caching aids both content consumers and content providers. Some
of the benefits that caching brings to content delivery are:

Decreased network costs: Content can be cached at various points in the


network path between the content consumer and content origin. When the
content is cached closer to the consumer, requests will not cause much
additional network activity beyond the cache.

Improved responsiveness: Caching enables content to be retrieved faster


because an entire network round trip is not necessary. Caches maintained close
to the user, like the browser cache, can make this retrieval nearly
instantaneous.

Increased performance on the same hardware: For the server where the
content originated, more performance can be squeezed from the same
hardware by allowing aggressive caching.

Availability of content during network interruptions: With certain policies,


caching can be used to serve content to end users even when it may be
unavailable for short periods of time from the origin servers.

Q4. Explain the salient features of mounting and caching process.

A4. MOUNTING : Mount mechanisms allow the binding together of different


file namespaces to form a single hierarchical namespace. The Unix operating
system uses this mechanism. A special entry, known as a mount point, is
created at some position in the local file namespace that is bound to the root
of another file name space. From the users point of view a mount point is
indistinguishable from a local directory entry and may be traversed using
standard path names once mounted. The kernel maintains a structure called a

LALIT KUMAR 1704310034


mount table which maps mount points to appropriate file systems. Whenever
a file access path crosses a mount point, this is intercepted by the kernel,
which then obtains the required service from the remote server.

CACHING : Caching is an important mechanism to improve the performance of


a file system, however, guaranteeing the consistency of the cached items
requires elaborate and expensive client/server protocols. An alternative
approach to maintaining consistency is to treat cached data (mostly meta data)
as hints. With this scheme, cached data is not expected to be completely
consistent, but when it is, it can dramatically improve performance. For
maximum performance benefit, a hint should nearly always be corrrect. To
prevent the occurrence of negative consequences if a hint is erroneous, the
classes of applications that use hints must be restricted to those that can
recover after discovering that the cached data is invalid, that is, the data
should be self validating upon use. Note that file data cannot be treated as a
hint because use of the cached copy will not reveal whether it is current or
stale. For example, after the name of a file or directory is mapped to a physical
object in the server, the address of that object can be stored as a hint in the
client's cache.

LALIT KUMAR 1704310034


ASSIGNMENT-4

Q1. What are distributed database?


A1. A distributed database is basically a database that is not limited to one
system, it is spread over different sites, i.e, on multiple computers or over a
network of computers. A distributed database system is located on various
sited that don’t share physical components. It needs to be managed such that
for the users it looks like one single database.
Types of distributed database:
1. Homogeneous Database:
In a homogeneous database, all different sites store database identically. The
operating system, database management system and the data structures
used – all are same at all sites. Hence, they’re easy to manage.
2. Heterogeneous Database:
In a heterogeneous distributed database, different sites can use different
schema and software that can lead to problems in query processing and
transactions. Also, a particular site might be completely unaware of the other
sites. Different computers may use a different operating system, different
database application. They may even use different data models for the
database. Hence, translations are required for different sites to
communicate.

Q2. What is transaction?


A2. A transaction is a collection of operation that represents a unit of
consistency and recovery A transaction starts by initialising things, then reads
and/or modifies objects. At the end, either Commit Changes are saved,
resources are released; state is consistent Abort For an outsider, nothing
happened.
A distributed transaction is a set of operations on data that is performed across
two or more data repositories (especially databases). It is typically coordinated
across separate nodes connected by a network, but may also span multiple
databases on a single server. There are two possible outcomes: 1) all
operations successfully complete, or 2) none of the operations are performed
at all due to a failure somewhere in the system. In the latter case, if some work
was completed prior to the failure, that work will be reversed to ensure no net
LALIT KUMAR 1704310034
work was done. This type of operation is in compliance with the “ACID”
(atomicity-consistency-isolation-durability) principles of databases that ensure
data integrity.

Q3. What are commit protocols?


A3. Commit protocols are used to ensure atomicity across sites – a transaction
which executes at multiple sites must either be committed at all the sites, or
aborted at all the sites. It is not acceptable to have a transaction committed at
one site and aborted at another.
The different distributed commit protocols are −

 One-phase commit - Distributed one-phase commit is the simplest


commit protocol. Let us consider that there is a controlling site and a
number of slave sites where the transaction is being executed.
 Two-phase commit - The two-phase commit phase commit (2PC)
protocol is widely used. Execution of the protocol is initiated by the
coordinator after the last step of the transaction has been reached.
transaction has been reached. The protocol involves all the local sites at
which the transaction executed .
 Three-phase commit - The three-phase commit phase commit (3PC)
protocol is more complicated and more expensive, but avoids some
drawbacks of two-phase commit protocol. This protocol is not used in
practice.

Q4. What is routing?


A4. Routing is the act of moving information across an inter-network from a
source to a destination. Along the way, at least one intermediate node typically
is encountered. It’s also referred to as the process of choosing a path over
which to send the packets. Routing is often contrasted with bridging, which
might seem to accomplish precisely the same thing to the casual observer. The
primary difference between the two is that bridging occurs at Layer 2 (the data
link layer) of the OSI reference model, whereas routing occurs at Layer 3 (the
network layer). This distinction provides routing and bridging with different
information to use in the process of moving information from source to
destination, so the two functions accomplish their tasks in different ways. The
routing algorithm is the part of the network layer software responsible for

LALIT KUMAR 1704310034


deciding which output line an incoming packet should be transmitted on, i.e.
what should be the next intermediate node for the packet.

Q5. What is Deadlock free packet switching?


A5. Deadlock is one of the most serious system failures that can occur in a
computer system or a network. Deadlock states have been observed in existing
computer networks emphasizing the need for carefully designed flow control
procedures (controllers) to avoid deadlocks. Such a deadlock-free controller is
readily found if we allow it global information about the overall network state.
Generally, this assumption is not realistic, and we must resort to deadlock free
local controllers using only packet and node information. We present here
several types of such controllers, we study their relationship and give a proof
of their optimality with respect to deadlock free controllers using the same set
of local parameters.
The packet switching controller has the following requirements:
1. The consumption of a packet (at its destination) is always allowed.
2. The generation of a packet in a node where all buffers are empty is always
allowed.
3. The controller uses only local information, that is, whether a packet can be
accepted in a node- u depends only on information known node- u or
contained in the packet.

Q6. Write short notes on Fault tolerant services & CORBA remote object
references.

A6. Fault Tolerance simply means a system’s ability to continue operating


uninterrupted despite the failure of one or more of its components. This is true
whether it is a computer system, a cloud cluster, a network, or something else.
In other words, fault tolerance refers to how an operating system (OS)
responds to and allows for software or hardware malfunctions and failures.

An OS’s ability to recover and tolerate faults without failing can be handled by
hardware, software, or a combined solution leveraging load balancers. Some
computer systems use multiple duplicate fault tolerant systems to handle

LALIT KUMAR 1704310034


faults gracefully. This is called a fault tolerant network. The goal of fault
tolerant computer systems is to ensure business continuity and high
availability by preventing disruptions arising from a single point of failure.

CORBA remote object : In most situations, a CORBA client has a


reference to a remote object in the form of an object stub. The stub
encapsulates the actual object reference, providing what seems like a direct
interface to the remote object within the local environment. If the client is
implemented in C++, Java, or some other object-oriented language, the object
stub is a native object in that language.

CORBA includes its own root object class, because some object-programming
languages may have different inheritance structures. In the Java binding for
CORBA, all CORBA object references (local or remote) implement
the org.omg.CORBA.Object interface. So, when a client of a remote CORBA
object receives a stub for the object, it actually gets
an org.omg.CORBA.Object that serves as a proxy for the remote object.

LALIT KUMAR 1704310034

You might also like