You are on page 1of 51

OBJECTIVE QUESTION

1. What is meant distributed system?

1. We define a distributed system as a collection of autonomous computers linked by a network,


with software designed to produce an integrated computing facility.
2. A system in which hardware or software components located at networked computers
communicate and coordinate their actions only by message passing.
3. A collection of two or more independent computers which coordinate their processing through
the exchange of synchronous or asynchronous message passing.
4. A collection of independent computers that appear to the users of the system as single
computers.
2. What are the significance of distributed system?
a. Concurrency of computers.
b. No global clock.
c. Independent failures.
3. Why we do you need distributed system?
a. Functional distribution: Computers have different functional capabilities (i.e.,
sharing of resources with specific functionalities).
b. Load distribution/balancing: Assign tasks to processors such that the overall
system performance is optimized.
c. Replication of processing power: Independent processors working on the same
task.
d. Distributed system consisting of collections of microcomputers may have
processing powers that no supercomputer will ever achieve.
e. Physical separation: Systems that rely on the fact that computers are physically
separated (e.g., to satisfy reliability requirements).
f. Economics: Collections of microprocessors offer a better price/performance ratio
than large mainframes.mainframes:10 times faster, 1000 times as expensive.
4. What are the two type of resource sharing?

a. Hardware sharing: Printers. plotters and large disks and other peripherals are shared
to reduce costs.

b. Data sharing is important in many applications:


1. Software developers working in a team need to access each other’s code and
share the same development tools.
2. Many commercial applications enable users to access shared data objects in a single
active database.
3. The rapidly growing area of group-ware tools enables users to cooperate with
in a network.
5. List the distributed systems challenges?
a. Heterogeneity: standards and protocols; middleware; virtual machine;
b. Openness: publication of services; notification of interfaces;
c: Security: firewalls; encryption;
d. Scalability: replication; caching; multiple servers;
e. Failure Handling. failure tolerance; recover/roll-back; redundancy;
f. Concurrency. concurrency control to ensure data consistency.
g. Transparency. Middleware; location transparent naming; anonymity
6. What are the three components of security?
Security for information resources has three components:
 Confidentiality: production against disclosure to unauthorized individuals.
 Integrity: production against or corruption.
 Availability: production against interference with the means to access the
resources.
7. List the challenges to be considered for designing scalable distributed system?
 Controlling the cost of physical resources
 Controlling the performance loss
 Preventing software resources running out
 Avoiding performance bottlenecks.
8. What is meant by DSM?
Distributed shared memory (DSM): DSM provides a global shared address space
across the different machines on a cluster. The shared address space distinguishes it from
packages such as PVM that provide a message passing interface between machines. There is a
growing consensus in the parallel computing community that a shared memory interface is more
desirable from the application programmer’s viewpoint, allowing him to focus on algorithmic
development rather than on managing communication.
9. What is marshalling and unmarshalling?
 An agreed standard for the representation of data structures and primitive values
is called an external and data representation
 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. Thus marshalling consists of
the translation of structured data items and primitives values into an external data
representation. Similarly, unmarshalling consists of the generation of primitive
values from their external data representation and the rebuilding of the data
structures.
10. Draw the Middleware Architecture.
Application
RMI,RPC and events
Request reply protocol
External data representation
Operating system

11 What are the benefits of programming with interface in DS?


I. As with any form of modular programming, programmers are concerned only with
the abstraction offered by the service interface and need not be aware of
implementation details.
II. In potentially heterogeneous distributed systems , programmers also do not need to
know the programming language or underlying platform used to implementation
service.
III. This approach provides natural support for software evolution in this
implementation can change as long as the interface remains the same.
12.Define RMI
.
Each process contains a collection of objects, some of which can receive both
local and remote invocations whereas the other objects can receive only local invocations as
shown in figure.
Method invocation between objects in different processes, whether in the same computer or not,
are known as remote method invocations. Method invocation between objects in the same
process is local method invocation. We refer to objects that can receive remote invocation as
remote objects.
13. What are the main choices to be considered in design of RMI?
RMI invocation semantics
a. Retry-reply protocols, where we showed that doOperation can be implemented in different
ways to provide different guarantees.
b. The main choices are:
i. Retry request message: Controls whether to retransmit the request message until
either a reply is received or the server is assumed to have failed.
ii. Duplicate filtering: Controls when retransmissions are used and whether to filter out
duplicate requests at the server.
Iii.Retrasmission of results: Controls whether to keep a history of result message to
enable lost results to be retransmitted without re-executing the operations at the server.

14. Sketch the RMI reply-request message structure.


Message Type
Request Id
Object Reference
Method Id
arguments
15. Define RPC.
The software components required to implement RPC are
The client that accesses a service includes one stub procedure for each procedure the
service interface. The stub procedure behaves like a local procedure to the client but instead of
executing the call it marshals the procedure identifier and the arguments into a request message
which it sends via its communication module to the server. When the reply message arrives it
unmarshals the results.
The server process contains a dispatcher together with one server stub procedure and
one service procedure for each procedure in the service interface. The dispatcher selects one of
the server stub procedures according to the procedure identifier in the request message.
16. Define callbacks.
The general idea behind callbacks is that instead of clients polling the server to find out whether
some event has occurred, the server should inform its clients whenever that event occurs. The
term callback is used to refer to a server’s action of notifying clients about an event.

17. What is concurrency control?

Changes to a file by one client should not interfere with the operation of other clients
simultaneously accessing or changing the same file. This is well-known issue of concurrency
control .The need for concurrency control for accss to shared data in many applications
Is widely accepted and techniques are known for its implementation ,but they are costly .Most
current file services follow morden UNIX standards in providing advisery or mandatoryfile or
record-level locking.

18.What is file replication?

In a file service that supports replication, a file may be represented by several copies of its
contents at different locations. This has two benefits-its enables multiple servers to share the
load of providing a service to clients accessing the same set of files, enhancing the scalability
of the service, and it enhances fault tolerance by enabling clients to locate another server that
holds a
copy of the file when one has failed. Few file services support replication fully, but most
support the catching of files or portions of files locally, a limited form of replication.

19.Whatis meant by directory services?

The directory services provide a mapping between text names for files and their UFIDs. Client
may obtain the UFIDs of a file by quoting its text name to the directory services. The directory
services provides the function needed to generate directories, to add new file name to directories
and to obtain UFIDs from directories. It is client of the flat file services; its directory is stored
in files of the flat services. When a hierarchic file-naming scheme is adopted as in
UNIX, directories hold references to other directories.
20. what are the timestamps in called caching?

i. Tc is the time when the cache entry was last validated.


ii. Tm is the when the block was last modified at the server.
iii. A cache entry is valid at time T if T-Tc is less than a freshness interval
t,or if the value for Tm recorded t the client matches the value of Tm at
the server (that is,the data has not been modified at the server since the
cache entry was made).

21. What is meant by URI?

URI-Uniform Resource Identifiers came about from the need to identify resources on the
web, and other internet resources such as electronic mailboxes. An important goal was to
identify resources in a coherent way, so that they could all be processed by common software
such as browser. URIs is ‘uniform’ in that their syntax incorporates that of indefinitely many
individual types of resource identifier(i.e URI schemas),and there are procedures for managing
the global namespace of schemas. The advantage of uniformity is that eases the process of
introducing new types of identifier, as well as using existing types of identifier in new
contexts without disrupting existing usage.

22.What is global name services?

The Global name Service developed at the Digital Equipment corporation systems,
Research
Center,is a descentdant of Grapevine with ambitious goals,
including:

 com- Commercial organization.


 edu- universities and other educational institutions.
 gov- US governmental agencies
 mil- US military organization
 net- major network support centers
 org- organizations not mentioned above
 int – International oragnisations.

23. Define name space.

A namespace is the collection of all valid names recognized by a particular service. The service
will attempt to look up a valid name, even though that name may prove not to correspond to
any object. Name space requires a syntactic definition to separate.
24. What is meant by hardware and software clock?
Clock devices can be programmed to generate interrupts at regular intervals in orders
that, for example, time slicing can be implemented.The operating system reads the
node’s hardware clock value, H(t) , scales it and adds an offset so as to produce software
clock C (t)=αHi(t)+β that approximately measures real ,physical time t for process pi.

25. What is clock resolution?


Note that successive events will correspond to different timestamps only if the clock
resolution-the period between updates of the clock-value-is smaller than the time
interval betw4een successive events. The rate at which events occur depends on such
factors as the length of the processor instruction cycle.
26. What is clock drift?
Clock drift, which means that they count time at different rates and so diverge.
The underling oscillators are subject to physical variations, with the consequence that
their frequencies of oscillation differ. Moreover ,even the same clock’s frequency varies
with temperature. Designs exist that attempt to compensate for this variation, but they
cannot eliminate it. A clock’s drift rate is the change in the offset (difference in
reading) between the clock and a nominal perfect reference clock per unit of time
measured by the reference clock.
27. What is IAT?
Computer clocks can be synchronized to external sources of highly accurate time. The
most accurate physical clocks use atomic oscillators, whose drift rate is about one part in
1013.the most accurate physical clocks use atomic oscillators, whose drift rate is
about one part in
1013. The output of these atomic clocks is used as the standard for elapsed real a time,
known as International Atomic Time.
28. What is CUT?
Coordinated Universal Time-abbreviated as UTC (From the French equivalent)-is as
international standard for timekeeping. It is based on atomic time, but a so-called ‘leap
second’ is inserted-or, more rarely, deleted-occasionally to keep it in step with
astronomical time.
29. What is logical clock?
 Lamport [1978] invented a simple mechanism by which the happened
before ordering can be captured numerically, called a logical clock.
 A Lamport logical clock is a monotonically increasing software counter,
whose value need bear no particular relationship to any physical clock.
 Each process p keeps its own logical clock, L , which it uses to apply so-
called
Lamport timestamps to a events.
 We denote the timestamp of event e at pi by L (e) , and by L(e) we denote
the timestamp of event e at whatever process it occurred at.
30. Define Vector clock
Vector clocks for a system of N processes is an array of N integers
• Shortcoming of Lamport clocks:
L(e) < L(e') doesn't imply e
→ e'
• Vector clock: an array of N integers for a system of N processes
– Each process keeps its own vector clock Vi to timestamp local events
– Piggyback vector timestamps on messages
• Rules for updating vector clocks:
– Vi[i]] is the number of events that pi has timestamped
– Viji] ( j≠ i) is the number of events at pj that pi has been affected by
VC1: Initially, Vi[ j ] := 0 for pi, j=1.. N (N
processes) VC2: before pi timestamps an event, Vi[
i ] := Vi[ i ]+1
VC3: pi piggybacks t = Vi on every message it sends
VC4: when pi receives a timestamp t, it sets Vi[ j ] := max(Vi[ j ] , t[ j ]) for j=1..N
(merge operation)

30. What is meant by cut?


Consider the events occurring at processes p1 and p2 shown in
figure
31. Define Global state predicate
 A Global State Predicate is a function that maps from the set of global process states to
True or False.
 Detecting a condition like deadlock or termination requires evaluating a Global
State Predicate.
 A Global State Predicate is stable: once a system enters a state where it is true,
such as deadlock or termination, it remains true in all future states reachable from that
state.
 However, when we monitor or debug an application, we are interested in non

stable predicates .
32. List the assumption considered in snapshot algorithm
– Neither channels nor processes fail
– Reliable communications ensure every message sent is received exactly once
– Channels are unidirectional
– Messages are received in FIFO order
– There is a path between any two processes
– Any process may initiate a global snapshot at any time
– Processes may continue to function normally during a snapshot
33. Define Failure detector.
A failure detector is a service that processes queries about whether a particular process
has failed .It is often implemented by an object local to each process that runs failure
detection algorithms in conjunction with its counterparts at the other processes.
34. List the properties of failure detector
A failure detector is not necessarily accurate. Most fails into the category of
unreliable failure detectors.
 A result of unsuspected
 A result of Suspected

35. What is meant by election


Election: choosing a unique process for a particular role is called an election
– All the processes agree on the unique choice
– For example, server in dist. mutex

36. What is CUT?


Coordinated Universal Time-abbreviated as UTC (From the French equivalent)-is as
international standard for timekeeping. It is based on atomic time, but a so-called ‘leap
second’ is inserted-or, more rarely, deleted-occasionally to keep it in step with
astronomical time.

37. What is logical clock?


 Lamport [1978] invented a simple mechanism by which the happened
before ordering can be captured numerically, called a logical clock.
 A Lamport logical clock is a monotonically increasing software counter,
whose value need bear no particular relationship to any physical clock.
 Each process p keeps its own logical clock, L , which it uses to apply so-
called
Lamport timestamps to a events.
 We denote the timestamp of event e at pi by L (e) , and by L(e) we denote
the timestamp of event e at whatever process it occurred at.
38. Define Vector clock

Vector clocks for a system of N processes is an array of N integers


• Shortcoming of Lamport clocks:
L(e) < L(e') doesn't imply e
→ e'
• Vector clock: an array of N integers for a system of N processes
– Each process keeps its own vector clock Vi to timestamp local events
– Piggyback vector timestamps on messages
• Rules for updating vector clocks:
– Vi[i]] is the number of events that pi has timestamped
– Viji] ( j≠ i) is the number of events at pj that pi has been affected by
VC1: Initially, Vi[ j ] := 0 for pi, j=1.. N (N
processes) VC2: before pi timestamps an event, Vi[
i ] := Vi[ i ]+1
VC3: pi piggybacks t = Vi on every message it sends
VC4: when pi receives a timestamp t, it sets Vi[ j ] := max(Vi[ j ] , t[ j ]) for j=1..N (merge operation)

39. Explain requirements of interactive consistency?


Three requirements of a consensus algorithm
 Termination: Eventually every correct process sets its decision variable
 Agreement: The decision value of all correct processes is the same: if pi and pj
are correct and have entered the decided state, then di=dj for all (i,j=1,2, …, N)
 Integrity: If the correct processes all proposed the same value, then any correct
process in the decided state has chosen that value.

40. What is marshalling? Explain the marshalling operation in CORBA?


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. Thus marshalling consists of the translation of structured data items and
primitive values into an external data representation. Similarly, unmarshalling consists
of the generation of primitive values from their external data representation and the
rebuilding of the data structures.
Marshalling in CORBA • Marshalling operations can be generated automatically from
the specification of the types of data items to be transmitted in a message. The types
of the data structures and the types of the basic data items are described in CORBA IDL,
which provides a notation for describing the types of the arguments and results of RMI
methods. For example, we might use CORBA IDL to describe the data structure in the
message in as follows:
struct
Person{
string name;
string place;
unsigned long year;
};
The CORBA interface compiler generates appropriate marshalling and
unmarshalling operations for the arguments and results of remote methods from the
definitions of the types of their parameters and results.
SUBJECTIVE QUESTIONS

Q.1. What is Distributed system? Explain with examples.

Q.2. How will you ensure the consistency of a cut in state recording of the various process?
Explain.

Q.3. Explain the concept of concurrency of components, Lack of global clock with suitable
example.

Q.4. What is Distributed operating system? Discuss.

Q.5. What is the design issues in Distributed operating system? Explain.

Q.6. Explain the concept of Lamport Algorithm for logical clocks.

Q.7.What do you understand by language mechanism and its constructs?

Q.8.Where do you need RPC? Explain the process with an example.

Q.9. Is there any difference between RPC and RMI? If yes, Differentiate Remote procedure call
and remote method invocation.

Q.10. Write short note on Java RMI case study.

Q.11. Explain client server model in distributed system.

Q.12. What is the difference between message passing and shared variable synchronization?

Q.13. What is static process scheduling? Explain in detail.

Q.14.What is distributed file system? Explain its design and implementation.

Q.15.Explain rate monotonic for real time scheduling.

Q.16. What are the basic applications of distributed process implementation?

Q.17.What are the issues in concurrency control in a distributed file system? Explain.

Q.18.What is memory consistency model? Explain in brief.


Q.19.What are the different types of failures in distributed systems?

Q.20.What is the need of update propagation in replica data management?

Q.21. What do you mean by byzantine agreement?

Q.22. Write case study on CORMA RMI. Explain with its proper architecture.

Q.23.Differentiate network file system and Andrew file system.

Q.24. Write short note on Windows File system.

Q.25.Write short note Randomized distributed agreement.


SOLUTIONS
Q.1. What is Distributed system? Explain with examples.

A distributed system is a software system in which components located on networked


computers communicate and coordinate their actions by passing messages.

A collection of a autonomous computers a) linked by a network b) using software to produce an


integrated computing facility

What size is a distributed system?


Local Area Network (10's of hosts) Metropolitan Area Networks (100's of hosts) Wide Area
Networks (internet) (1000's or 1,000,000's of hosts)

Open distributed system

Published specifications Provision for uniform interprocess communications and published


interfaces for access Conformance of all vendors to published standard must be tested and
certified if users are to be protected from responsibility for resolving system integration problems

Concurrency

Multi-programming
Multi-processing

Parallel executions in distributed systems

1. Many users using the same resources, application interactions


2. Many servers responding to client requests

Scalability

How the system handles growth Small system –two computers and a file server on a single
network Large system current Internet Scalability
- software should not change to support growth
- research area - for large, high-performance networks
Avoid centralization to support scalability
Choose your naming or numbering scheme carefully
Handle timing problems with caching and data replication

Fault Tolerance

Computers fail therefore we need: hardware redundancy software recovery


Increase in availability for services
Network is not normally redundant
Program recovery via the process group

Transparency

transparency of

 access
 location
 concurrency
 replication
 failure
 migration
 performance
 scaling

Key characteristics of distributed systems

1. Resource sharing
2. Openess
3. Concurrency
4. Scalability
5. Fault tolerance
6. Transparency

Key design goals

 High performance
 Reliability
 Scalability
 Consistency
 Security

Basic design issues

 naming
 communications
 software structure
 workload allocation
 consistency maintenance

Naming

 communication identifier
 name service
 contextual resolution of name
 name mapping
 pure names vs names with meaning

Communication

Reasons for communicating:


transfer of data
synchronization
Methods of communications
message passing - send and receive primitives
synchronous or asynchronous
blocking or non-blocking
mechanisms of message passing - channels, sockets, ports
client-server communication model
group multicast communication model
Q.2. How will you ensure the consistency of a cut in state recording of the various process?
Explain.

Recording the global state of a distributed system on-the-fly is an important paradigm.


The lack of globally shared memory, global clock and unpredictable message delays in a
distributed system make this problem non-trivial.
The global state of a distributed system is the union of the states of the individual processes.
Given that the processes of a distributed system do not share memory but instead communicate
solely through the exchange of messages, a process that wishes to construct a global state must
infer the remote components of that state through message exchanges. Thus, a fundamental
problem in distributed computing is to ensure that a global state constructed in this manner is
meaningful.

Q.3. Explain the concept of concurrency of components, Lack of global clock with suitable
example.

 A distributed system is a collection of independent computers that appears to its users as


a single coherent system. Andrew Tanenbaum

 A distributed system is one in which components located at networked computers


communicate and coordinate their actions only by passing messages.

 concurrency of components’ execution

 lack of a global clock

 independent failures of components

Examples

Examples of distributed systems and applications of distributed computing include the following :

 Telecommunication networks:
 Telephone networks and cellular networks

 Computer networks such as the Internet


 Wireless sensor networks
 Routing algorithms
 Network applications:
 World wide web and peer-to-peer networks
 Massively multiplayer online games and virtual reality communities
 Distributed databases and distributed database management systems
 Network file systems
 Distributed information processing systems such as banking systems and airline
reservation systems
 Real-time process control:
 Aircraft control systems
 Industrial control systems
 Parallel computation:
 Scientific computing, including cluster computing and grid computing and
various volunteer computing projects; see the list of distributed computing projects
 Distributed rendering in computer graphics

Q.4. What is Distributed Operating System? Discuss.

A distributed operating system is software over a collection of


independent, networked, communicating, and physically separate computational nodes. [1] Each
individual node holds a specific software subset of the global aggregate operating system. Each
subset is a composite of two distinct services provisionary.The first is a ubiquitous
minimal kernel, or microkernel, that directly controls that node’s hardware. Second is a higher-
level collection of system management components that coordinate the node's individual and
collaborative activities. These components abstract microkernel functions and support user
applications.
The microkernel and the management components collection work together. They support the
system’s goal of integrating multiple resources and processing functionality into an efficient and
stable system. This seamless integration of individual nodes into a global system is referred to
as transparency, or single system image; describing the illusion provided to users of the global
system’s appearance as a single computational entity.
Q.5. What is the design issues in Distributed Operating System? Explain.

Design Considerations

Transparency

Transparency or single-system image refers to the ability of an application to treat the system on
which it operates without regard to whether it is distributed and without regard to hardware or
other implementation details. Many areas of a system can benefit from transparency, including
access, location, performance, naming, and migration. The consideration of transparency directly
affects decision making in every aspect of design of a distributed operating system. Transparency
can impose certain requirements and/or restrictions on other design considerations.
Systems can optionally violate transparency to varying degrees to meet specific application
requirements. For example, a distributed operating system may present a hard driv e on one
computer as "C:" and a drive on another computer as "G:". The user does not require any
knowledge of device drivers or the drive's location; both devices work the same way, from the
application's perspective. A less transparent interface might require the application to know
which computer hosts the drive. Transparency domains:

 Location transparency—Location transparency comprises two distinct aspects of


transparency, naming transparency and user mobility. Naming transparency requires that
nothing in the physical or logical references to any system entity should expose any
indication of the entity's location, or its local or remote relationship to the user or application.

User mobility requires the consistent referencing of system entities, regardless of the system
location from which the reference originates. [8]:20

 Access transparency—Local and remote system entities must remain indistinguishable when
viewed through the user interface. The distributed operating system maintains this perception
through the exposure of a single access mechanism for a system entity, regardless of that
entity being local or remote to the user. Transparency dictates that any differences in
methods of accessing any particular system entity—either local or remote—must be both
invisible to, and undetectable by the user. [3]:84

 Migration transparency—Resources and activities migrate from one element to another


controlled solely by the system and without user/application knowledge or action. [9]:16

 Replication transparency—The process or fact that a resource has been duplicated on


another element occurs under system control and without user/application knowledge or
intervention.[9]:16

 Concurrency transparency—Users/applications are unaware of and unaffected by the


presence/activities of other users.[9]:16

 Failure transparency—The system is responsible for detection and remediation of system


failures. No user knowledge/action is involved other than waiting for the system to resolve
the problem. [10]:30
 Performance Transparency—The system is responsible for the detection and remediation of
local or global performance shortfalls. Note that system policies may prefer some users/user
classes/tasks over others. No user knowledge or interaction. is involved. [8]:23

 Size/Scale transparency—The system is responsible for managing its geographic reach,


number of nodes, level of node capability without any required user knowledge or
interaction. [8]:23

 Revision transparency—The system is responsible for upgrades and revisions and changes to
system infrastructure without user knowledge or action.
 Control transparency—The system is responsible for providing all system information,
constants, properties, configuration settings, etc. in a consistent appearance, connotation, and
denotation to all users and applications. [3]:84

 Data transparency—The system is responsible for providing data to applications without


user knowledge or action relating to where the system stores it. [3]:85

 Parallelism transparency—The system is responsible for exploiting any ability to parallelize


task execution without user knowledge or interaction. Arguably the most difficult aspect of
transparency, and described by Tanenbaum as the "Holy grail" for distributed system
designers.[38]:23–25

Inter-process communication

Inter-Process Communication (IPC) is the implementation of general communication, process


interaction, and dataflowbetween threads and/or processes both within a node, and between
nodes in a distributed OS. The intra-node and inter-node communication requirements drive low-
level IPC design, which is the typical approach to implementing communication functions that
support transparency. In this sense, IPC is the greatest underlying concept in the low-level design
considerations of a distributed operating system.

Process management

Process management provides policies and mechanisms for effective and efficient sharing of
resources between distributed processes. These policies and mechanisms support operations
involving the allocation and de-allocation of processes and ports to processors, as well as
mechanisms to run, suspend, migrate, halt, or resume process execution. While these resources
and operations can be either local or remote with respect to each other, the distributed OS
maintains state and synchronization over all processes in the system.

As an example, load balancing is a common process management function. Load balancing


monitors node performance and is responsible for shifting activity across nodes when the system
is out of balance. One load balancing function is picking a process to move. The kernel may
employ several selection mechanisms, including priority-based choice. This mechanism chooses
a process based on a policy such as 'newest request'. The system implements the policy.

Resource management

Systems resources such as memory, files, devices, etc. are distributed throughout a system, and
at any given moment, any of these nodes may have light to idle workloads. Load sharing and
load balancing require many policy-oriented decisions, ranging from finding idle CPUs, when to
move, and which to move. Many algorithms exist to aid in these decisions; however, this calls
for a second level of decision making policy in choosing the algorithm best suited for the
scenario, and the conditions surrounding the scenario.

Reliability

Distributed OS can provide the necessary resources and services to achieve high levels
of reliability, or the ability to prevent and/or recover from errors. Faults are physical or logical
defects that can cause errors in the system. For a system to be reliable, it must somehow
overcome the adverse effects of faults.

The primary methods for dealing with faults include fault avoidance, fault tolerance, and fault
detection and recovery. Fault avoidance covers proactive measures taken to minimize the
occurrence of faults. These proactive measures can be in the form
of transactions, replication and backups. Fault tolerance is the ability of a system to continue
operation in the presence of a fault. In the event, the system should detect and recover full
functionality. In any event, any actions taken should make every effort to preserve the single
system image.

Availability

Availability is the fraction of time during which the system can respond to requests.

Performance

Many benchmark metrics quantify performance; throughput, response time, job completions per
unit time, system utilization, etc. With respect to a distributed OS, performance most often
distills to a balance between process parallelismand IPC. Managing the task granularity
of parallelism in a sensible relation to the messages required for support is extremely
effective.[citation needed] Also, identifying when it is more beneficial to migrate a process to its data,
rather than copy the data, is effective as well
Synchronization

Cooperating concurrent processes have an inherent need for synchronization, which ensures that
changes happen in a correct and predictable fashion. Three basic situations that define the scope
of this need:

 one or more processes must synchronize at a given point for one or more other
processes to continue,
 one or more processes must wait for an asynchronous condition in order to continue,
 or a process must establish exclusive access to a shared resource.

Improper synchronization can lead to multiple failure modes including loss of atomicity,
consistency, isolation and durability,deadlock, livelock and loss of serializability.[citation needed]

Flexibility

Flexibility in a distributed operating system is enhanced through the modular and


characteristics of the distributed OS, and by providing a richer set of higher-level services.
The completeness and quality of the kernel/microkernel simplifies implementation of such
services, and potentially enables service providers greater choice of providers for such
services.

Q.6. Explain the concept of Lamport Algorithm for logical clocks.

A logical clock is a mechanism for capturing chronological and causal relationships in


a distributed system. Distributed system may have no physically synchronous global clock, and
logical clock allow to get global ordering on events from different processes in such systems.
First implementation, the Lamport timestamps, was proposed by Leslie Lamport in 1978 (Turing
Award in 2013).
In logical clock systems each process have two data structures with logical local time and logical
global time. Logical local time is used by the process to mark its own events, and logical global

time is the local information about global time. A special protocol is used to update logical local
time after each local event, and logical global time when processes exchange data. [1]

Logical clocks are useful in computation analysis, distributed algorithm design, individual event
tracking, exploring computational progress.

Logical clock algorithms of note are:

 Lamport timestamps, which are monotonically increasing software counters.


 Vector clocks, that allow for partial ordering of events in a distributed system.
 Version vectors, order replicas, according to updates, in an optimistic replicated system.
 Matrix clocks, an extension of vector clocks that also contains information about other
processes' views of the system.

Lamport's logical clock in distributed systems

 In a distributed system, it is not possible in practice to synchronize time across entities


(typically thought of as processes) within the system; hence, the entities c an use the concept
of a logical clock based on the events through which they communicate.
 If two entities do not exchange any messages, then they probably do not need to share a
common clock; events occurring on those entities are termed as concurrent even ts.
 Among the processes on the same local machine we can order the events based on the local
clock of the system.
 When two entities communicate by message passing, then the send event is said to 'happen
before' the receive event, and the logical order can be established among the events.
 A distributed system is said to have partial order if we can have a partial order relationship
among the events in the system. If 'totality', i.e., causal relationship among all events in the
system, can be established, then the system is said to have total order.
 A single entity cannot have two events occur simultaneously. If the system has total order we
can determine the order among all events in the system. If the system has partial order
between processes, which is the type of order Lamport's logical clock provides, then we can
only tell the ordering between entities that interact. Lamport addressed ordering two events
with the same timestamp (or counter): "To break ties, we use any arbitrary total ordering < of

the processes." Thus two timestamps or counters may be the same within a distributed
system, but in applying the logical clocks algorithm events that occur will always maintain at
least a strict partial ordering.

Q.7.What do you understand by language mechanism and its constructs?

Language Constructs for Distributed Real-Time Programming Abstract For many distributed
applications, it is not sufficient for programs to be logically correct. In addition, they must satisfy
various timing constraints. This paper discusses primitives that support the construction of
distributed real-time programs. O ur discussion is focused in two areas: timing specification and
communication. To allow the specifications of timing constraints, we introduce the language
constructs for defining temporal scope and specifying message deadline. We also identify
communication primitives needed for real-time programming. The issues underlying the
selection of the primitives are explained, including handling of timing exceptions. The primitives
will eventually be provided as part of a distributed programming system that will be used to
construct distributed multi-sensory systems.

For many computer applications, such as robot arm control, missile control, on -line process
control, etc., it is not sufficient for programs to be logically correct. In addition to being logically
correct, the programs must satisfy certain timing constraints determined by the underlying
physical process being controlled to avoid possible catastrophic results. Programs whos e
correctness depends on the adherence of timiig . constraints are called real -time programs.
Furthermore, it has been recognized that for certain real-time. applications, such as multi-sensory
robot systems [12], it is natural to diitribute control among several connected processors. This
distributed view of the underlying system allows real-time programs to be implemented as
relatively independent processse which run mynchronously except for occasional
synchronization and communication. We call such concurrent programs which are required to
respond to external and internal stimuli within a specified deadline distributed real -time
programs.
Q.8.Where do you need RPC? Explain the process with an example.

Remote Procedure Call (RPC) is a protocol that one program can use to request a service from a
program located in another computer in a network without having to understand network details.
(A procedure call is also sometimes known as a function call or a subroutine call.) RPC uses the
client/server model.

RPC is a powerful technique for constructing distributed, client-server based applications. It is


based on extending the notion of conventional, or local procedure calling, so that the called
procedure need not exist in the same address space as the calling procedure. The two processes
may be on the same system, or they may be on different systems with a network connecting
them. By using RPC, programmers of distributed applications avoid the details of the interface
with the network. The transport independence of RPC isolates the application from the physical
and logical elements of the data communications mechanism and allows the application to use a
variety of transports.

RPC makes the client/server model of computing more powerful and easier to program. When
combined with the ONC RPCGEN protocol compiler (Chapter 33) clients transparently make
remote calls through a local procedure interface.

An RPC is analogous to a function call. Like a function call, when an RPC is made, the calling
arguments are passed to the remote procedure and the caller waits for a response to be returned
from the remote procedure. Figure 32.1 shows the flow of activity that takes place during an
RPC call between two networked systems. The client makes a procedure call that sends a request
to the server and waits. The thread is blocked from processing until either a reply is received, or
it times out. When the request arrives, the server calls a dispatch routine that performs the
requested service, and sends the reply to the client. After the RPC call is completed, the client
program continues. RPC specifically supports network applications.

RPC Application Development

Consider an example:
A client/server lookup in a personal database on a remote machine. Assuming that we cannot
access the database from the local machine (via NFS).

We use UNIX to run a remote shell and execute the command this way. There are some
problems with this method:

 the command may be slow to execute.


 You require an login account on the remote machine.

The RPC alternative is to

 establish an server on the remote machine that can repond to queries.


 Retrieve information by calling a query which will be quicker than previous approach.

To develop an RPC application the following steps are needed:

 Specify the protocol for client server communication


 Develop the client program
 Develop the server program

The programs will be compiled seperately. The communication protocol is achieved by


generated stubs and these stubs and rpc (and other libraries) will need to be linked in.

Q.9. Is there any difference between RPC and RMI? If yes, Differentiate Remote
procedure call and remote method invocation.

The only real difference between RPC and RMI is that there is objects involved in RMI:
instead of invoking functions through a proxy function, we invoke methods through a proxy. The
difference between RMI and RPC is that: RMI as the name indicates Remote Method
Invoking: it invokes a method or an object.
RPC is C based, and as such it has structured programming semantics, on the other side, RMI is
a Java based technology and it's object oriented.

With RPC you can just call remote functions exported into a server, in RMI you can have
references to remote objects and invoke their methods, and also pass and return more remote
object references that can be distributed among many JVM instances, so it's much more
powerful.

RMI stands out when the need to develop something more complex than a pure client -server
architecture arises. It's very easy to spread out objects over a network enabling all the clients to
communicate without having to stablish individual connections explicitly

The main difference between RPC and RMI is that RMI involves objects. Instead of calling
procedures remotely by use of a proxy function, we instead use a proxy object.

There is greater transparency with RMI, namely due the exploitation of objects, references,
inheritance, polymorphism, and exceptions as the technology is integrated into the language.

RMI is also more advanced than RPC, allowing for dynamic invocation, where interfaces can to
change at runtime, and object adaption, providing an additional layer of abstraction.

Q.10. Write short note on Java RMI case study.

INTRODUCTION

Remote method invocation allows applications to call object methods located remotely, sharing
resources and processing load across systems. Unlike other systems for remote execution which
require that only simple data types or defined structures be passed to and from methods, RMI
allows any Java object type to be used - even if the client or server has never encountered it
before. RMI allows both client and server to dynamically load new object types as required.

THREE STEPS
If we want to build a distributed system based on Java RMI we have to follow three steps:

1.Defining the remote interfaces: A remote interface specifies the methods that can be invoked
remotely by a client. Clients program to remote interfaces, not to the implementation classes of
those interfaces. The design of such interfaces includes the determination of the types of object s
that will be used as the parameters and return values for these methods. If any of these interfaces
or classes do not yet exist, you need to define them as well.

2.Implementing the remote objects: Remote objects must implement one or more remote
interfaces. The remote object class may include implementations of other interfaces and methods
that are available only locally. If any local classes are to be used for parameters or return values
of any of these methods, they must be implemented as well.

3.Implementing the clients: Clients that use remote objects can be implemented at any time
after the remote interfaces are defined, including after the remote objects have been deployed.

1 - REMOTE INTERFACE

An object becomes remote by implementing a remote interface so, before anything else, we have
to implement a remote interface like this: RemoteReservation.java

This Java interface is a remote interface because:

 it extends the interface java.rmi.Remote;


 each method of the interface declares RemoteException in its throws clause.

2 - REMOTE OBJECTS

Server implementation: RemoteReservationImpl.java

This object is the server implementation and it contains remote methods implementations and a
"particulary" main. In the main server take locale RMI registry reference, that offers "yellow
pages service", and bind on it our new service ("ReservationService").

3 - IMPLEMENTING THE CLIENT


Client implementation: ReservationClient.java

Client have to set the Java SecurityManager and connect to the server using Naming.lookup( ...)
method. N.B. Client MUST know: address server, server RMI registry port and service name (in
our case it is "ReservationService")

Now we have ALMOST all the components required to offer our new service. Finally we need
stub! It acts as a gateway for client side objects and all outgoing requests to server side objects
that are routed through it. The stub wraps client object functionality and by adding the network
logic ensures the reliable communication channel between client and server.

Open a shell in the server package root folder and type " rmic -d
unibo/sisdist1011/rmi/reservation/ unibo.sisdist1011.rmi.reservation.RemoteReservationImpl ".
This command create stub starting from server class. Obviously it considers the remote interface.

N.B. Create a security file in server and client folder in which we describe Java security policy
for this program. Because this is a simple case study we allow anything and set "AllPermission"
variable.

Q.11. Explain client server model in distributed system.

The client–server model of computing is a distributed application structure that partitions tasks
or workloads between the providers of a resource or service, called servers, and service
requesters, called clients.[1] Often clients and servers communicate over a computer network on
separate hardware, but both client and server may reside in the same system. A server host runs
one or more server programs which share their resources with clients. A client does not share any
of its resources, but requests a server's content or service function. Clients therefore initiate
communication sessions with servers which await incoming requests.

Examples of computer applications that use the client–server model are Email, network printing,
and the World Wide Web.
Client and server communication

In general, a service is an abstraction of computer resources and a client does not have to be
concerned with how the server performs while fulfilling the request and delivering the response.
The client only has to understand the response based on the well-known application protocol, i.e.
the content and the formatting of the data for the requested service.

Clients and servers exchange messages in a request-response messaging pattern: The client sends
a request, and the server returns a response. This exchange of messages is an example of inter-
process communication. To communicate, the computers must have a common language, and
they must follow rules so that both the client and the server know what to expect. The language
and rules of communication are defined in a communications protocol. All client-server
protocols operate in the application layer. The application-layer protocol defines the basic
patterns of the dialogue. To formalize the data exchange even further, the server may implement
an API (such as a web service).[3] The API is an abstraction layer for such resources as databases
and custom software. By restricting communication to a specific content format, it facilitates
parsing. By abstracting access, it facilitates cross-platform data exchange. [4]

A server may receive requests from many different clients in a very short period of time.
Because the computer can perform a limited number of tasks at any moment, it relies on a
scheduling system to prioritize incoming requests from clients in order to accommodate them all
in turn. To prevent abuse and maximize uptime, the server's software limits how a client can use
the server's resources. Even so, a server is not immune from abuse. A denial of service attack
exploits a server's obligation to process requests by bombarding it with requests incessantly. This
inhibits the server's ability to respond to legitimate requests.

Example

When a bank customer accesses online banking services with a web browser (the client), the
client initiates a request to the bank's web server. The customer's login credentials may be stored
in a database, and the web server accesses the database server as a client. An application server
interprets the returned data by applying the bank's business logic, and provides the output to the
web server. Finally, the web server returns the result to the client web browser for display.
In each step of this sequence of client–server message exchanges, a computer processes a request
and returns data. This is the request-response messaging pattern. When all the requests are met,
the sequence is complete and the web browser presents the data to the customer.

This example illustrates a design pattern applicable to the client–server model: separation of
concerns.

Q.12. What is the difference between message passing and shared variable
synchronization?

In computer science, message passing sends a message to a process (which may be an actor or
object) and relies on the process and the supporting infrastructure to select and invoke the actual
code to run. Message passing differs from conventional programming where a process,
subroutine, or function is directly invoked by name. Message passing is key to some models of
concurrency and object-oriented programming.

Message passing is used ubiquitously in modern computer software. It is used as a way for the
objects that make up a program to work with each other and as a way for objects and systems
running on different computers (e.g., the Internet) to interact. Message passing may be
implemented by various mechanisms, including channels.

The correct behaviour of a concurrent program depends on synchronisation and


communication between its processes.

Synchronisation: the satisfaction of constraints on the interleaving of the actions of


processes (e.g. an action by one process only occurring after an action by another).

Communication: the passing of information from one process to another

– Concepts are linked since communication requires synchronisation, and


synchronisation can be considered as contentless communication.
passing.

Q.13. What is static process scheduling? Explain in detail.

Interactive processes spend more time waiting for I/O and generally experience short CPU
bursts. A text editor is an example of an interactive process with short CPU bursts.

Interactive bursts
Compute-intensive processes, conversely, spend more time running instructions and less time on
I/O. They exhibit long CPU bursts. A video transcoder is an example of a process with long CPU
bursts. Even though it reads and writes data, it spends most of its time processing that data.

Compute bursts
Most interactive processes, in fact, spend the vast bulk of their existence doing nothing but
waiting on data. As I write this on my Mac, I have 44 processes running just under my user
account. This includes a few browser windows, a word processor, spreadsheet, several shell
windows, Photoshop, iTunes, and various monitors and utilities. Most of the time, all these
processes collectively are using less than 3% of the CPU. This is not surprising since most of
these programs are waiting for user input, a network message, or sleeping and waking up
periodically to check some state.

Consider a 2.4 GHz processor. It executes approximately 2,400 million instructions per second
(and this does not even count multi-core or hyper threaded processors). It can run 24 billion
instructions in the ten seconds it might take you to skim a web page before you click on a link —
or 1.2 billion instructions in the half second it might take you to hit the next key as you’re typing.
The big idea in increasing overall system throughput was the realization that we could keep
several programs in memory and switch the processor to run another process when a process has
to wait on an I/O operation. This is multiprogramming. The next big idea was realizing that you
could preempt a process and let another process run and do this quickly enough to give the
illusion that many processes are running at the same time. This is multitasking.

Q.14.What is distributed file system? Explain its design and implementation.

Distributed File System (DFS) is a set of client and server services that allow an organization
using Microsoft Windows servers to organize many distributed SMB file shares into a
distributed file system.

Distributed File System (DFS) is a set of client and server services that allow an organization
using Microsoft Windows servers to organize many distributed SMB file shares into a distributed
file system. DFS provides location transparency and redundancy to improve data availability in
the face of failure or heavy load by allowing shares in multiple different locations to be logically
grouped under one folder, or DFS root.

Microsoft's DFS is referred to interchangeably as 'DFS' and 'Dfs' by Microsoft and is unrelated to
the DCE Distributed File System, which held the 'DFS' trademark [1] but was discontinued in
2005.

It is also called "MS-DFS" or "MSDFS" in some contexts, e.g. in the Samba user space project.

There is no requirement to use the two components of DFS together; it is perfectly possible to
use the logical namespace component without using DFS file replication, and it is perfectly
possible to use file replication between servers without combining them into one namespace.

A DFS root can only exist on a server version of Windows (from Windows NT 4.0 and up) and
OpenSolaris[2] (in kernel space) or a computer running Samba (in user space.) The Enterprise and
Datacenter Editions of Windows Server can host multiple DFS roots on the same server.
OpenSolaris intends on supporting multiple DFS roots in "a future project based on Active
Directory (AD) domain-based DFS namespaces". [3]

There are two ways of implementing DFS on a server:


 Standalone DFS namespace allow for a DFS root that exists only on the local computer,

and thus does not use Active Directory. A Standalone DFS can only be accessed on the
computer on which it is created. It does not offer any fault tolerance and cannot be linked
to any other DFS. This is the only option available on Windows NT 4.0 Server systems.
Standalone DFS roots are rarely encountered because of their limited utility.
 Domain-based DFS namespace stores the DFS configuration within Active Directory.

Q.15. Explain rate monotonic for Real Time scheduling.

In computer science, rate-monotonic scheduling (RMS)[1] is a scheduling algorithm used in


real-time operating systems (RTOS) with a static-priority scheduling class. [2] The static priorities
are assigned on the basis of the cycle duration of the job: the shorter the cycle duration is, the
higher is the job's priority.

These operating systems are generally preemptive and have deterministic guarantees with regard
to response times. Rate monotonic analysis is used in conjunction with those systems to provide
scheduling guarantees for a particular application.
A simple version of rate-monotonic analysis assumes that threads have the following properties:

 No resource sharing (processes do not share resources, e.g. a hardware resource, a queue,
or any kind of semaphore blocking or non-blocking (busy-waits))
 Deterministic deadlines are exactly equal to periods
 Static priorities (the task with the highest static priority that is runnable immediately
preempts all other tasks)
 Static priorities assigned according to the rate monotonic conventions (tasks with shorter
periods/deadlines are given higher priorities)
 Context switch times and other thread operations are free and have no impact on the
model
Q.16. What are the basic applications of distributed process implementation?
A distributed operating system is a software over a collection of
independent, networked, communicating, and physically separate computational nodes. [1] Each
individual node holds a specific software subset of the global aggregate operating system. Each
subset is a composite of two distinct service provisioners. [2] The first is a ubiquitous
minimal kernel, ormicrokernel, that directly controls that node’s hardware. Second is a higher-
level collection of system management components that coordinate the node's individual and
collaborative activities. These components abstract microkernel functions and support user
applications.[3]

The microkernel and the mana gement components collection work together. They support the
system’s goal of integrating multiple resources and processing functionality int o an efficient and
stable system. [4] This seamless integration of individual nodes into a global system is referred to
as transparency, or single system
m image; describing the illusion provided to users of the global
system’s appearance as a single computational entity.

Q.17.What are the issues in concurrency control in a distributed file system? Explain.

Concurrency

Concurrency control becomes an issue when more than one person or client is accessing the
same file or block and want to update it. Hence updates to the file from one client should not
interfere with access and updates from other clients. This problem is more complex with file
systems due to concurrent overlapping writes, where different writers write to overlapping
regions of the file concurrently. [4] This problem is usually handled by concurrency control or
locking which may either be built into the file system or provided by an add-on protocol.

Q.18.What is memory consistency model? Explain in brief.

Types of Consistency

There are many different models of consistency,


some of which are included in the list below:

 Strict Consistency Model: "The strict consistency model is the strongest form of
memory coherence, having the most stringent consistency requirements. A
shared-memory system is said to support the strict consistency model if the value
returned by a read operation on a memory address is always the same as the value
written by the most recent write operation to that address, irrespective of the
locations of the processes performing the read and write operations. That is, all
writes instantaneously become visible to all processes."

 Sequential Consistency Model: "The sequential consistency model was proposed


by Lamport ... . A shared-memory system is said to support the sequential
consistency model if all processes see the same order of all memory access
operations on the shared memory. The exact order in which the memory access
operations are interleaved does not matter. ... If one process sees one of the
orderings of ... three operations and another process sees a different one, the
memory is not a sequentially consistent memory."

 Casual Consistency Model: "The causal consistency model ... relaxes the
requirement of the sequential model for better concurrency. Unlike the sequential
consistency model, in the causal consistency model, all processes see only those
memory reference operations in the same (correct) order that are potentially
causally related. Memory reference operations that are not potentially causally
related may be seen by different processes in different orders."
 FIFO Consistency Model: For FIFO consistency, "Writes done by a single
process are seen by all other processes in the order in which they were issued, but
writes from different processes may be seen in a different order by different
processes.
"FIFO consistency is called PRAM consistency in the case of distributed shared
memory systems."

 Pipelined Random-Access Memory (PRAM) Consistency Model: "The pipelined


random-access memory (PRAM) consistency model ... provides weaker
consistency semantics than the (first three) consistency models described so far. It
only ensures that all write operations performed by a single process are seen by all
other processes in the order in which they were performed as if all the write
operations performed by a single process are in a pipeline. Write operations
performed by different processes may be seen by different processes in different
orders."

 Weak Consistency Model: "Synchronization accesses (accesses required to


perform synchronization operations) are sequentially consistent. Before a
synchronization access can be performed, all previous regular data accesses must
be completed. Before a regular data access can be performed, all previous
synchronization accesses must be completed. This essentially leaves the problem
of consistency up to the programmer. The memory will only be consistent
immediately after a synchronization operation."

 Release Consistency Model: "Release consistency is essentially the same as weak


consistency, but synchronization accesses must only be processor consistent with
respect to each other. Synchronization operations are broken down
into acquire and release operations. All pending acquires (e.g., a lock operation)
must be done before a release (e.g., an unlock operation) is done. Local
dependencies within the same processor must still be respected.
"Release consistency is a further relaxation of weak consistency without a
significant loss of coherence."

 Entry Consistency Model: "Like ... variants of release consistency, it requires the
programmer (or compiler) to use acquire and release at the start and end of each
critical section, respectively. However, unlike release consistency, entry
consistency requires each ordinary shared data item to be associated with some
synchronization variable, such as a lock or barrier. If it is desired that elements of
an array be accessed independently in parallel, then different array elements must
be associated with different locks. When an acquire is done on a synchronization
variable, only those data guarded by that synchronization variable are made
consistent."

 Processor Consistency Model: "Writes issued by a processor are observed in the


same order in which they were issued. However, the order in which writes from
two processors occur, as observed by themselves or a third processor, need not be
identical. That is, two simultaneous reads of the same location from different
processors may yield different results."

 General Consistency Model: "A system supports general consistency if all the
copies of a memory location eventually contain the same data when all the writes
issued by every processor have completed."

Q.19.What are the different types of failures in distributed systems?

Crash failures: Crash failures are caused across the server of a typical distributed system and if
these failures are occurred operations of the server are halt for some time. Operating system
failures are the best examples for this case and the corresponding fault tolerant systems are
developed with respect to these affects.

Timing failures: Timing failures are caused across the server of a distributed system. The usual
behavior of these timing failures would be like that the server response time towards the client
requests would be more than the expected range. Control flow out of the responses may be
caused due to these timing failures and the corresponding clients may give up as they can’t wait
for the required response from the server and thus the server operations are failed due to this.

Omission failures: Omission failures are caused across the server due to lack or reply or
response from the server across the distributed systems. There are different issues raised due to
these omission failures and the key among them are server not listening or a typical buffer
overflow errors across the servers of the distributed systems.

Byzantine failures: Byzantine failures are also know as arbitrary failures and these failures are
caused across the server of the distributed systems. These failures cause the server to behave
arbitrary in nature and the server responds in an arbitrary passion at arbitrary times across the
distributed systems. Output from the server would be inappropriate and there could be chances of
the malicious events and duplicate messages from the server side and the clients get arbitrary and
unwanted duplicate updates from the server due to these failures.

Q.20.What is the need of update propagation in replica data management?

 Replication is having multiple copies of data and services in a distributed system

 Reasons:

 Reliability of the system

 Better protection against corrupted data

 Improved Performance and faster response time

 Facilitates scaling in numbers and geographical area.

 Based on Distance between clients and locations as starting point. (latency , bandwidth)

 Best K out of N locations (K<N) are selected

 By applying Clustering
 Group nodes accessing the same content and with low inter-nodal latencies into
groups or clusters and place a replica on the k largest clusters.

 Permanent Replicas

 Geographically distributed - Mirroring

 Same location – Round Robin

 Server Initiated Replicas

 Client Initiated Replicas

Q.21. What do you mean by byzantine agreement?

Byzantine fault tolerant protocols are algorithms that are robust to arbitrary types of failures in
distributed algorithms. With the advent and popularity of the Internet, there is a need to develop
algorithms that do not require any centralized control that have some guarantee of always
working correctly. The Byzantine agreement protocol is an essential part of this task. In this
article the quantum version of the Byzantine protocol, [1] which works in constant time is
described.

The Byzantine Agreement protocol is a protocol in distributed computing. It takes its name from
a problem formulated by Lamport, Shostak and Pease in 1982, [2] which itself is a reference to a
historical problem. The Byzantine army was divided into divisions with each division being led
by a General with the following properties:

 Each General is either loyal or a traitor to the Byzantine state.


 All Generals communicate by sending and receiving messages.
 There are only two commands: attack and retreat.
 All loyal Generals should agree on the same plan of action: attack or retreat.
 A small linear fraction of bad Generals should not cause the protocol to fail (less than a
fraction).

(See [3] for the proof of the impossibility result). The problem usually is equivalently restated in
the form of a commanding General and loyal Lieutenants with the General being either loyal or a
traitor and the same for the Lieutenants with the following properties.

 All loyal Lieutenants carry out the same order.


 If the commanding General is loyal, all loyal Lieutenants obey the order that he sends.

 A strictly less than fraction including the commanding General are traitors.

Q.22. Write case study on CORMA RMI. Explain with its proper architecture.

The Java Remote Method Invocation (RMI) mechanism and the Common Object Request Broker
Architecture (CORBA) are the two most important and widely used distributed object systems.
Each system has its own features and shortcomings. Both are being used in th e industry for
various applications ranging from e-commerce to health care. Selecting which of these two
distribution mechanisms to use for a project is a tough task. This article presents an overview of
RMI and CORBA, and more importantly it shows how to develop a useful application for
downloading files from remote hosts. It then:

 Presents a brief overview of distributed object systems


 Provides a brief overview of RMI and CORBA
 Gives you a flavor of the effort involved in developing applications in RMI and CORBA
 Shows how to transfer files from remote machines using RMI and CORBA
 Provides a brief comparison of RMI and CORBA

The Client/Server Model

The client/server model is a form of distributed computing in which one program (the client)
communicates with another program (the server) for the purpose of exchanging information. In
this model, both the client and server usually speak the same language -- a protocol that both the
client and server understand -- so they are able to communicate.

While the client/server model can be implemented in various ways, it is typically done using
low-level sockets. Using sockets to develop client/server systems means that we must design a
protocol, which is a set of commands agreed upon by the client and server through w hich they
will be able to communicate. As an example, consider the HTTP protocol that provides a method
called GET, which must be implemented by all web servers and used by web clients (browsers)
in order to retrieve documents.

The Distributed Objects Model

A distributed object-based system is a collection of objects that isolates the requesters of services
(clients) from the providers of services (servers) by a well-defined encapsulating interface. In
other words, clients are isolated from the implementation of services as data representations and
executable code. This is one of the main differences that distinguishes the distributed object -
based model from the pure client/server model.

In the distributed object-based model, a client sends a message to an object, which in turns
interprets the message to decide what service to perform. This service, or method, selection
could be performed by either the object or a broker. The Java Remote Method Invocation (RMI)
and the Common Object Request Broker Architecture (CORBA) are examples of this model.

RMI

RMI is a distributed object system that enables you to easily develop distributed Java
applications. Developing distributed applications in RMI is simpler than developing with sockets
since there is no need to design a protocol, which is an error-prone task. In RMI, the developer

has the illusion of calling a local method from a local class file, when in fact the arguments are
shipped to the remote target and interpreted, and the results are sent back to the callers .

The Genesis of an RMI Application

Developing a distributed application using RMI involves the following steps:

1. Define a remote interface


2. Implement the remote interface
3. Develop the server
4. Develop a client
5. Generate Stubs and Skeletons, start the RMI registry, server, and client
We will now examine these steps through the development of a file transfer application.

Example: File Transfer Application

This application allows a client to transfer (or download) any type of file (plain text or binary)
from a remote machine. The first step is to define a remote interface that specifies the signatures
of the methods to be provided by the server and invoked by clients.

Define a remote interface

The remote interface for the file download application is shown in Code Sample 1. The interface
FileInterface provides one method downloadFile that takes a String argument (the name of the
file) and returns the data of the file as an array of bytes.

CORBA

The Common Object Request Broker Architecture (or CORBA) is an industry standard
developed by the Object Management Group (OMG) to aid in distributed objects programming.
It is important to note that CORBA is simply a specification. A CORBA implementation is
known as an ORB (or Object Request Broker). There are several CORBA implementations

available on the market such as VisiBroker, ORBIX, and others. JavaIDL is another
implementation that comes as a core package with the JDK1.3 or above.

CORBA was designed to be platform and language independent. Therefore, CORBA objects can
run on any platform, located anywhere on the network, and can be written in any language that
has Interface Definition Language (IDL) mappings.

Similar to RMI, CORBA objects are specified with interfaces. Interfaces in CORBA, however,
are specified in IDL. While IDL is similar to C++, it is important to note that IDL is not a
programming language. For a detailed introduction to CORBA, please see Distributed
Programming with Java: Chapter 11 (Overview of CORBA).

The Genesis of a CORBA Application

There are a number of steps involved in developing CORBA applications. These are:

1. Define an interface in IDL


2. Map the IDL interface to Java (done automatically)
3. Implement the interface
4. Develop the server
5. Develop a client
6. Run the naming service, the server, and the client.

We now explain each step by walking you through the development of a CORBA -based file
transfer application, which is similar to the RMI application we developed earlier in this article.
Here we will be using the JavaIDL, which is a core package of JDK1.3+.

Define the Interface

When defining a CORBA interface, think about the type of operations that the server will
support. In the file transfer application, the client will invoke a method to download a file. Code
Sample 5 shows the interface for FileInterface. Data is a new type introduced using the typedef
keyword. A sequence in IDL is similar to an array except that a sequence does not have a fixed
size. An octet is an 8-bit quantity that is equivalent to the Java type byte.

Note that the download File method takes one parameter of type string that is declared in. IDL
defines three parameter-passing modes: in (for input from client to server), out (for output from
server to client), and in out (used for both input and output).

Q.23.Differentiate network file system and Andrew file system.


The Network File System (NFS) is a client/server application that lets a computer user view and
optionally store and update file on a remote computer as though they were on the user's own
computer. The user's system needs to have an NFS client and the other computer needs the NFS
server.

The Network File System (NFS) is a client/server application that lets a computer user view and
optionally store and update file on a remote computer as though they were on the user's own
computer. The user's system needs to have an NFS client and the other computer needs the NFS
server. Both of them require that you also have TCP/IP installed since the NFS server and client
use TCP/IP as the program that sends the files and updates back and forth. (However, the User
Datagram Protocol, UDP, which comes with TCP/IP, is used instead of TCP with earlier
versions of NFS.)

The Andrew File System (AFS)[1] is a distributed file system which uses a set of trusted servers
to present a homogeneous, location-transparent file name space to all the client workstations. It
was developed by Carnegie Mellon University as part of the Andrew Project.[2] It is named after
Andrew Carnegie and Andrew Mellon. Its primary use is in distributed computing.

Features

AFS[3] has several benefits over traditional networked file systems, particularly in the areas of
security and scalability. It is not uncommon for enterprise AFS deployments to exceed 25,000

clients.[4] AFS uses Kerberos for authentication, and implements access control lists on
directories for users and groups. Each client caches files on the local filesystem for increased
speed on subsequent requests for the same file. This also allows limited filesystem access in the
event of a server crash or a network outage.

AFS uses the Weak Consistency model. [5] Read and write operations on an open file are directed
only to the locally cached copy. When a modified file is closed, the changed portions are copied
back to the file server. Cache consistency is maintained by callback mechanism. When a file is
cached, the server makes a note of this and promises to inform the client if the file is updated by
someone else. Callbacks are discarded and must be re-established after any client, server, or
network failure, including a time-out. Re-establishing a callback involves a status check and does
not require re-reading the file itself.

A consequence of the file locking strategy is that AFS does not support large shared databases or
record updating within files shared between client systems. This was a deliberate design decision
based on the perceived needs of the university computing environment. It leads, for example, to
the use of a single file per message in the original email system for the Andrew Project, the
Andrew Message System, rather than a single file per mailbox (i.e. maildir instead of mbox). See
AFS and buffered I/O Problems for handling shared databases

A significant feature of AFS is the volume, a tree of files, sub-directories and AFS mountpoints
(links to other AFS volumes). Volumes are created by administrators and linked at a specific
named path in an AFS cell. Once created, users of the filesystem may create directories and files
as usual without concern for the physical location of the volume. A volume may have a quota
assigned to it in order to limit the amount of space consumed. As needed, AFS administrators
can move that volume to another server and disk location without the need to notify users; indeed
the operation can occur while files in that volume are being used.
AFS volumes can be replicated to read-only cloned copies. When accessing files in a read-only
volume, a client system will retrieve data from a particular read-only copy. If at some point that
copy becomes unavailable, clients will look for any of the remaining copies. Again, users of that
data are unaware of the location of the read-only copy; administrators can create and relocate

such copies as needed. The AFS command suite guarantees that all read-only volumes contain
exact copies of the original read-write volume at the time the read-only copy was created.

The file name space on an Andrew workstation is partitioned into a shared and local name space.
The shared name space (usually mounted as /afs on the Unix filesystem) is identical on all
workstations. The local name space is unique to each workstation. It only contains temporary
files needed for workstation initialization and symbolic links to files in the shared name space.

The Andrew File System heavily influenced Version 4 of Sun Microsystems' popular Network
File System (NFS). Additionally, a variant of AFS, the Distributed File System (DFS) was
adopted by the Open Software Foundation in 1989 as part of their Distributed Computing
Environment.

Implementations

There are three major implementations, Transarc (IBM), OpenAFS and Arla, although the
Transarc software is losing support and is deprecated. AFS (version two) is also the predecessor
of the Coda file system.

A fourth implementation exists in the Linux kernel source code since at least version 2.6.10. [6]
Committed by Red Hat, this is a fairly simple implementation still in its early stages of
development and therefore incomplete as of January 2013. [7]

Available permissions

The following Access Control List permissions can be granted:

Lookup (l)
allows a user to list the contents of the AFS directory, examine the ACL associated with
the directory and access subdirectories.
Insert (i)
allows a user to add new files or subdirectories to the directory.
Delete (d)
allows a user to remove files and subdirectories from the directory.
Administer (a)
allows a user to change the ACL for the directory. Users always have this right on their
home directory, even if they accidentally remove themselves from the ACL.

Permissions that affect files and subdirectories include:

Read (r)
allows a user to look at the contents of files in a directory and list files in subdirectories.
Files that are to be granted read access to any user, including the owner, need to have the
standard UNIX "owner read" permission set.
Write (w)
allows a user to modify files in a directory. Files that are to be granted write access to any
user, including the owner, need to have the standard UNIX "owner write" permission set.
Lock (k)
allows the processor to run programs that need to "flock" files in the directory.

Additionally, AFS includes Application ACLs (A)-(H) which have no effect on access to files

Q.24. Write short note on Windows File system.


Windows file systems

Microsoft Windows OS use two major file systems: FAT, inherited from old DOS with its later
extension FAT32, and widely-used NTFS file systems. Recently released ReFS file system was
developed by Microsoft as a new generation file system for Windows 8 Servers.

FAT (File Allocation Table):


FAT file system is one of the most simple types of file systems. It consists of file system
descriptor sector (boot sector or superblock), file system block allocation table (referenced as
File Allocation Table) and plain storage space to store files and folders. Files on FAT are stored
in directories. Each directory is an array of 32-byte records, each defines file or file extended
attributes (e.g. long file name). File record references the first block of file. Any next block can
be found through block allocation table by using it as linked-list.

Block allocation table contains an array of block descriptors. Zero value indicates that the block
is not used and non-zero – reference to the next block of the file or special value for file end.

The number in FAT12, FAT16, FAT32 stands for the number if bits used to enumerate file
system block. This means that FAT12 may use up to 4096 different block references, FAT16 -
65536 and FAT32 - 4294967296. Actual maximum count of blocks is even less and depends on
implementation of file system driver.

FAT12 was used for old floppy disks. FAT16 (or simply FAT) and FAT32 are widely used for
flash memory cards and USB flash sticks. It is supported by mobile phones, digital cameras
and other portable devices.

FAT or FAT32 is a file system, used on Windows-compatible external storages or disk partitions
with size below 2GB (for FAT) or 32GB (for FAT32). Windows can not create FAT32 file
system over 32GB (however Linux supports FAT32 up to 2TB).

Q.25.Write short note Randomized distributed agreement.

A fundamental problem in distributed computing is to achieve overall system reliability in the


presence of a number of faulty processes. This often requires processes to agree on some data
value that is needed during computation. Examples of applications of consensus include whether
to commit a transaction to a database, agreeing on the identity of a leader,state machine
replication, and atomic broadcasts.

We consider the randomized consensus protocol of Aspnes and Herlihy for achieving agreement
among N asynchronous processes that communicate via read/write shared registers. The
algorithm guarantees termination in the presence of stopping failures within polynomial expected
time. Processes proceed through possibly unboundedly many rounds; at each round, they read the
status of all other processes and attempt to agree. Each attempt involves a distributed random
walk: when processes disagree, a shared coin-flipping protocol is used to decide their next
preferred value. Achieving polynomial expected time depends on the probability that all
processes draw the same value being above an appropriate bound. For the non-probabilistic part
of the algorithm, we use the proof assistant Cadence SMV to prove validity and agreement for
all N and for all rounds. The coin-flipping protocol is verified using the probabilistic model
checker PRISM. For a finite number of processes (up to 10) we automatically calculate the
minimum probability of the processes drawing the same value. The correctness of the full
protocol follows from the separately proved properties. This is the first time a complex
randomized distributed algorithm has been mechanically verified.
1. Explain in detail about the architectural model of distributed system.
 The architecture of a system is its structure in terms of separately specified
components and their interrelationships. The overall goal is to ensure that the
structure will meet present and likely future demands on it.
 Examples of architecture models are:
 Client – server model
 Peer to peer model
 Proxy server model
 Architectural elements:
 Communicating entities: The first two questions above are absolutely
central to an understanding of distributed systems; what is communicating
and how those entities communicate together define a rich design space for
the distributed systems developer to consider. It is helpful to address the
first question from a system-oriented and a problem-oriented perspective.
 Communication paradigms: We now turn our attention to how entities
communicate in a distributed system, and consider three types of
communication paradigm:
 interprocess communication;
 remote invocation;
 indirect communication.
 Architectural patterns
 Layering • The concept of layering is a familiar one and is closely related
to abstraction. In a layered approach, a complex system is partitioned into
a number of layers, with a given layer making use of the services offered
by the layer below.

You might also like