Distributed System 25 Questions
Distributed System 25 Questions
Q1. How the resources sharing done in distributed system? Explain with an
example. 10 Marks UPTU/MTU-2009/10/11
Ans. With distributed system, it is easier for users to access remote resources and
to share resources with other users. Example, printers, files, web pages etc.
• A distributed system should also make it easier for users to exchange
information.
• Easier resource and data exchange could cause security problems a
distributed system should deal with this problem.
• Resources in a distributed system are physically encapsulated within
computers and can only be accessed from other computers by communication
interface enabling the resources to be accessed and updated reliably and
consistently. For example, users are concerned with sharing data in the form
of a shared database or a set of web pages, not the disks and processors that
those are implemented on. Similarly user think in terms of shared resources
such as search engine or a currency converter, without regard for the server
or server that provide there.
Another example, a search engine on the web provides a facility to users
through out the world.
Distributed system is used to describe a system with the fallowing
characteristics. It consists of several computers that do not share a memory or a
clock.
For example
Q3. What do you mean by Global state of the distributed system? Also explain
the main features of consistent Global state. 10 Marks UPTU/MTU-
2009/10/11/12
Ans: . Global State: “The global state of a distributed system is the set oflocal
states of all individual processes involved in the computation plus the state of the
communication channels.” Consistent Global state: A global state of a distributed
system is consistent if no transactions are in progress.
• A global state is consistent if it could have been observed by an external
observer.
• If e -» e then it is never the care that e' is observed by the external observer
and
not .
Q5. What do you mean by Casual Ordering of messages? Discuss the salient
features of Broadcast based protocol
that make the uses of Vector clock which ensures Causual Ordering of
messages. 10 Marks UPTU/MTU-2010/9/8/11
Ans: Causal ordering of messages:
purpose of causal ordering of messages is to insure that the same causal
relationship for the "message send" events correspond with "message receive"
events, (i.e. All the messages are processed in order that they were created.) Part-ii
Schiper-Eggli-Sandoz Protocol Instead of maintaining a vector dock based on the
number of messages sent to each process, the vector dock for this protocol can
increment at any rate it would like to and has no additional meaning related to the
number of messages currently outstanding.
Sending a message:
1. All messages are timestamped and sent out with a list of all the timestamps of
messages sent to other processes.
2. Locally store the timestamp that the message was sent with.
Receiving a message:
* A message cannot be delivered if there is a message mentioned in the list of
timestamps that predates this one.
• Otherwise, a message can be delivered, performing the following steps:
1. Merge in the list of timestamps from the message:
Q9. What are the shortcomings of Ramamoorthy's two phase algorithm for
deadlock detection? Show that Byzantim agreement cannot always be
reached among four processors if two processors are faulty.
■ Ans: Each site maintains a status table of all processes initiated at that site:
includes all resources locked & all resources being waited on.
■ Controller requests (periodically) the status table from each site.
■ Controller then constructs WFG from these tables, searches for cycle(s).
■ If no cycles, no deadlocks.
■ Otherwise, (cycle exists): Request for state tables again.
■ Construct WFG based only on common transactions in the 2 tables.
■ If the same cycle is detected again, system is in deadlock.
■ Later proved: cycles in 2 consecutive reports need not result in a deadlock.
Hence, this algorithm detects false deadlocks.
(ii). A Byzantine fault is an arbitrary fault that occurs during the execution of an
algorithm by a distributed system. It encompasses those faults that are commonly
referred to as "crash failures" and "send and omission failures".’ When a Byzantine
failure has occurred, the system may respond in any unpredictable way, unless it
is designed to have Byzantine fault tolerance.
These arbitrary failures may be loosely categorized as follows:
• a failure to take another step in the algorithm, also known as a crash failure;
• a failure to correctly execute a step of the algorithm; and
• arbitrary execution of a step other than the one indicated by the algorithm.
For example, if the output of one function is the input of another, then small
round-off errors in the first function can produce much larger errors in the second.
If the second function were fed into a third, the problem could grow even larger,
until the values produced are worthless. Another example is in compiling source
code. One minor syntactical error early on in the code can produce large numbers
of perceived errors later, as the compiler gets out-of-phase with the lexical and
syntactic information in the source program.
Steps are taken by processes, the abstractions that execute the algorithms. A
faulty process is one that at some point exhibits one of the above failures. A
process that is not faulty is correct.
The Byzantine failure assumption models real-world environments in which
computers and networks may behave in unexpected ways due to hardware
failures, network congestion and disconnection, as well as malicious attacks.
Byzantine failure-tolerant algorithms must cope with such failures and still satisfy
the specifications of the problems th^y are designed to solve. Such algorithms tire
commonly characterized by their resilience t, the number of faulty processes with
which an algorithm can cope.
Many classic agreement problems, such as the Byzantine Generals' Problem,
have no solution unless t < n / 3, where n is the number of processes in the
system.
Q10. What are the communication models proposed for the distributed
objects? Explain the concept of remote method invocation with a suitable
example.
Ans: Distributed objects are implemented in Objective-C using the 'Cocoa API
with the NSCcnneclion class and supporting objects.
• Distributed objects are used .n java RMI.
• CORBA lets one'build distributed mixed object systems.
• DCOM is a framework for distributed objects on the Microsoft platform.
• DDObjects is a framework for distributed objects using Borland Delphi.
• JavaSpaces is a Sun specification for a distributed, shared memory (spaces
based)
• Pyro is a framework for distributed objects using the Python
programminglanguage.
• Distributed Ruby (DRb) is a framework for distributed objects using the Ruby
programming language.
RM1 (Remote Method Invocation) is a way that a programmer, using the Java
programming language and development environment, can write object-oriented
programming in which objects on different computers can interact in a distributed
network. RMI is the Java version of what is generally known as a remote procedure
cali (RPC), but with the ability to pass one or more objects along with the request.
The object can include information that will change the service that is performed in
the remote computer. Sun Microsystems, the inventors of Java, calls this "moving
behavior." For example, when a riser at a remote computer fills out an expense
account, the Java program interacting with the user could communicate, using
RMI, with a Java program in another computer that always had the latest policy
about expense reporting. In reply, that program would send back an object and
associated method information that would enable the remote computer program to
screen the user's expense account data in a way that was consistent with the latest
policy. The user and the company both would save time by catching mistakes
early. Whenever the company policy changed, it would require a change to a
program in only one computer.
RMI is implemented as three layers:
• A stub program in the client side of the client/ server relationship, and a
corresponding skeleton at the server end. The stub appears to the calling
program to be the program being called for a service, (Sun uses the term proxy as
a synonym for stub.)
• A Remote Reference Layer that can behave differently depending on the
parameters passed by the calling program. For example, this layer can determine
whether the request is to call a single remote service or multiple remote programs
as in a multicast.
• A Transport Connection Layer, which sets up and manages the request,
• A single request travels down through the layers on one computer and up
through the layers at the other end.
Q11. Discuss how a public key scheme can be used to solve the key
distribution problem in a private key cryptographic scheme.
Ans, Key Distribution Scheme in Private key distribution: ItusesDiffie-Hellmar
key exchange (D-H) is a cryptographic protocol that allows two parties that have
no prior knowledge of each other to jointly establish a shared secret key over an
insecure communications channel. This key can then be used to encrypt
subsequent communications using a symmetric key cipher.
Synonyms of Diffie-Heltman key exchange include:
• Diffie-Hellman key agreement
• Diffie-Hellman key establishment
• Diffie-Hellman key negotiation
• Exponential key exchange
Heilman suggested the algorithm be called Diffie-Hellman-Merkle key exchange
to the invention of public-key cryptography.
Although Diffie-Hellman key agreement itself is an anonymous (r^or\-
authentic^ted) key- agreement protocol, it provides the basis for a variety of
authenticated protocols, end is used to provide perfect forward secrecy in
Transport Layer Security's ephemeral modes. Description
Q13. Describe how a non-recoverable situation could arise if write locks are released
after the last operation of a transaction but before its commitment
Ans. Non Recoverable situation arise if write locks are released; The present
invention provides a system that supports'recovery in he event a previous process
holding a lock used to- mutual exclusion purposes loses ownership of the lock.
This loss of ownership may occur due to the previous process dying or the lock
becoming unmapped. Under the present invention a process first attempts to
acquire the lock. If the attempt to acquire the lock returns wilh an error indicating
that the previous process holding the lock lost ownership of the lock, the process
attempts to make program state protected by the lock consistent. If the attempt to
make the program state consistent is successful, the system reinitializes and
unlocks the lock. Otherwise, the system marks the lock as unrecoverable so that
subsequent processes attempting to acquire the lock are notified that the lock is
not recoverable. One aspect of the present invertion includes receiving a
notification in an operating system that a process died, and dete mining if the
process died while holding a lock. If the process died while holding the lock, the
system marks the lock to indicate to subsequent acquirers of the lock that a
previous holder of the lock died, and unlocks the lock so that other processes may
acquire the lock. According to one aspect of the present invention, if the attempt o
acquire the lock returns with an error indicating the lock is not recoverable, the
process performs operations to work around the program state that is inconsistent,
and reinitializes the lock.
Write ahead togging (WAL) is a family of techniques for providing atomicity and
durability (two of the ACID properties) in database systems. In a system using
WAL, all modifications are written to a log before they are applied. Usually both
redo and undo information is stored in the log. The purpose of this can be
illustrated by an example. Imagine a program that is in the middle of performing
some operation when the machine it is running on loses power. Upon restart, that
program might well need to know whether the operation it was performing
succeeded, half-:ucceeded, or failed. If a write-ahead log were used, the program
could check this tog and compare what it was supposed to be doing when it
unexpectedly lost power to what was actually done. Based on this comparison, the
program could decide to undo what it had started, complete what it had started, or
keep things as they are.
Q14. Discuss the web challenges for implementing distributed system.
Ans. These are following:
1. Heterogeneity 2 Openness
3. Security
4. Stability
5. Failure handling
6. Concurrency
7. Transparency
1. Heterogeneity: We set up protocols to solve these heterogeneities.
• Middle ware: A software layer that provides a programming abstraction as
well as marking the heterogeneity.
• Mobile code: Code that can be sent from one to another computer and run
at destination.
2. Openness: Open DS can be constructed from heterogenous hardware and
software.
3. Security: Security for information resources has three components:
confidentiality, integrity, availability.
4. Scalability: A system is described as scalable if it remains effective when
there is a significant increases in the number of resources and the number of
users.
Failure Handling:
Techniques for dealing with failures
• Detecting failures
• Masking failures
• Tolerating failures
• Recovering from failures
• Redundancy
6. Concurrency: “There is a possibility that several clients will attempt to
access a shared resources at the same time.”
7. Transparency: Eight forms of transparency:
• Access transparency
• Location transparency
• Concurrency transparency
• Replication transparency
• Failure transparency
• Mobility transparency
• Performance transparency
• Scaling transparency “Transparency is defined as the concealment
from the user and application progammer of the separation of components in a
distributed system, so that the system is provided as a whole rather than as a
collection of independent components”.
(B) Remote interface: Every remote object has a remote interface that specifies
which of its methods
can be involved remotely
Q19. What are the public and private keys? List the key differences and issue
in public keys cryptography and private key cartography?
Ans: Public and Private Keys: In cryptographic system, there isauseoftwo key
pairs-Public key and private key. '
• A public key is known to everyone.
• A private key or key is known only to the recipient of the message.
Public Key Cryptography
? Ppbjic key encryption uses a pair of mathematically related keys. A message
that is encrypted with the first key must be decrypted with the second key,
and a message that is encrypted with the second key must be decrypted with
the first key.
• Each participant in a public-key system has a pair of keys. The symmetric
(private) key is kept secret. The other key is distributed to anyone who wants
it, this key is public key.
To send an encrypted massage to you, the sender encrypts the message by using
your public key. When you receive the message you decrypt it by using your
symmetric key to send a message to someone, you encrypt the message by using
the recipients public key. The message can be decrypted with the recipients
symmetric key only.
Private key encryption:
• Private key encryption systems use a single key that is shared between the
sender and the receiver. Both must have the key, the sender encrypts the
message by using the key, and the receiver decrypts the message with the
same key. Both must keep the key private to keep their communication
private.
Characteristics:
• Private key encryption requires a key for every pair of individuals who need
to communicate privately. The necessary number of keys rises
dramatically as the number of participant increases.
The fact that keys must be shared between pairs of communicators means that the
keys must somehow be distributed to the participants
Ans. • Time stamp method is similar to two-phase locking in that both use
pessimistic approaches in which conflicts between transactions are detected
as each object is accessed.
• Time stamp ordering decide serialization order statically when transaction
sort on the other hand two-phase locking decide the serialization order
dynamically.
• T ime stamp ordering is better then strict two phase locking for read only
transaction.
• Two-phase locking is better when the operations in transactions are
predominantly updated.
• Timestamp ordering aborts the transaction immediately, whereas locking
makes the transaction wait.
• Time stamp ordering is deadlock free.
• When optimistic concurrency control is used all transactions when they
allowed to commit or in forward validation transaction are aborted earlier.
I his results in relatively efficient operation where there are few conflicts, but a
substantial amount of work may have to be repeated when a transaction is aborted
Methods for concurrency control is
I. lacking: In distributed transaction the locks
on an object are held locally, when locking is used for concurrency control the
objects remain lock'd and are unavailable for another transaction during the
atomic commit protocol. Consider following interleaving of transaction T and
U at servers X and Y.
T t
Strict two phase locking: is the most popular version of two phase locking
which guarantees strict schedules. In this variation, a transaction T does not
release any of its exclusive (write) lock and until after it commits or aborts.
Hence, no others transaction can read or write an item that is written by T
unless T has committed, leading to a strict schedule for recoverability.
Strict two phase locking: is not deadlock-free. A more restrictive version is rigorous
two phase locking
Q23. Explain the following:
(a) Fault tolerant services
(b) Highly available services.
(b) Highly available services. Ans. Our emphasis now is on giving clients access to
the service-with reasonable response times-for as much of the time as possible,
even if some results do not conform to sequential consistency. For example, user
on the train at the beginning may be willing to core with temporary inconsistencies
between copies of data such as diaries they can continue to work while
disconnected and fix any problem later. Example, Gassip architecture for
implementing highly available services.
Q24. Explain the term “routing”. How routing problem .can be classified? Also
discuss the criterion for good routing algorithms.