Aos Unit-1
Aos Unit-1
Dar-Us-Salam, Hyderabad
UNIT-I
Architectures of Distributed Systems:
• System Architecture Types
• Issues in distributed Systems
Theoretical Foundations:
• Introduction
• Limitations of Distributed Systems
• Lamport’s Logical Clocks
• Vector Clock’s
• Casual Ordering of messages
• Global State Reordering Algorithm
• Cuts of a distributed Computation
• Termination Detection
UNIT I
AOS(UNIT-1) 1
Introduction:
(The resources owned and controlled by a computer are said to be local, while
the resources owned and controlled by other computers and those that can
only be accessed through the network are said to be remote.
Resource sharing. Since a computer can request a service from another computer
by sending an appropriate request to it over the communication network, hardware
and software resources can be shared among computers. For example, a printer, a
compiler, a text processor, or a database at a computer can be shared with remote
computers.
Enhanced performance. A distributed computing system is capable of providing
rapid response time and higher system throughput. This ability is mainly due to the
fact that many tasks can be concurrently executed at different computers. Moreover,
distributed systems can employ a load distributing technique to improve response
time. In load distributing, tasks at heavily loaded computers are transferred to lightly
loaded computers, thereby reducing the time tasks wait before receiving service.
AOS(UNIT-1) 2
Improved reliability and availability. A distributed computing system provides
improved reliability and availability because a few components of the system can
fail without affecting the availability of the rest of the system. Also, through the
replication of data (e.g., files and directories) and services, distributed systems can
be made fault tolerant. Services are processes that provide functionality (e.g., a file
service provides file system management; a mail service provides an electronic mail
facility).
Modular expandability. Distributed computing systems are inherently amenable to
modular expansion because new hardware and software resources can be easily
added without replacing the existing resources.
• Minicomputer model
In this model, distributed system consists of several minicomputers(Eg VAXs).
Each computer supports multiple users and provides access to remote resources.
• Workstation model
AOS(UNIT-1) 3
• Processor pool model
This model attempts to allocates one or more processors according to users need
Once the task is completed, the processors are returned to the pool.
1. Global Knowledge
2. Naming
3. Scalability
4. Compatibility
5. Process Synchronization
6. Resource Management
7. Security
8. Structuring
➢ Global Knowledge
In the case of shared memory computer systems, the up-to-date state of all the
processes and resources, in other words, the global (entire) state of the system, is
completely and accurately known. Hence, the potentially problematic issues that
arise in the design of these systems are well understood and efficient solutions to
them exist.
In distributed computing systems, these same issues take on new dimensions and
their solutions become much more complex for the following reasons. Due to the
unavailability of a global memory and a global clock, and due to unpredictable
AOS(UNIT-1) 4
message delays, it is practically impossible for a computer to collect up-to-date
information about the global state of the distributed computing system
Therefore, a fundamental problem in the design of a distributed operating system
is to determine efficient techniques to implement decentralized system wide
control, where a computer does not know the current and complete status of the
global state
➢ Naming
Names are used to refer objects. Objects are computers, printers, services, files and
users. An example of a service is an name service
Make use of: Table look-up or algorithm.(In the implementation of Table lookup,
tables(also known as directories) that store names and their physical addresses are
used for mapping names to their addresses.
➢ Scalability
The techniques used in designing a system should not result in system unavailability
or Performance should not be degraded when the system grows.
AOS(UNIT-1) 5
For example, broadcast based protocols work well for small systems( systems having
a small number of computers) but not for large systems.
System requirements should (ideally) increase linearly with the number of computer
systems
Includes: overheads for message exchange in algorithms used for file system
updates, directory management...
➢ Compatibility
The three different levels of compatibility that exits in distributed systems are
Binary level: All Processors execute the same binary instruction, even though the
processors may differ in performance and in input-output. It exhibits binary level
compatibility
➢ Process Synchronization
AOS(UNIT-1) 6
problem.Concurrent access to a single resource by several un coordinated processes
must be serialized to avoid dead locks.
➢ Resource Management
RPC is mainly used in migrating the computation and for providing communication
between computers..
AOS(UNIT-1) 7
➢ Distributed Scheduling:
Authorization :It is the process of deciding what privileges an entity has and making
only these privileges available.
➢ Structuring
The nucleus of the operating system also referred as Micro kernel supports the
interaction(through messages) between the processes providing the system services.
AOS(UNIT-1) 8
Object-oriented operating system: It Implements services as objects. The
operating system that is structured using objects is known as Object-oriented
operating system.
AOS(UNIT-1) 9
➢ A Distributed System with two sites:
AOS(UNIT-1) 10
AOS(UNIT-1) 11
LAMPORT’S LOGICAL CLOCKS
Lamport’s proposed the scheme to order events in a distributed system using logical
clocks. The execution of processes is characterized by a sequence of events.
Depending on the application, the execution of the procedure could be one event or
the execution of an instruction could be one event. When processes exchange
messages, sending a message constitutes one event and receiving a message
constitutes one event.
A relation that orders events based on the behavior of the underlying computation is
as follows
Ordering of Events
Happened Before relationship: The Happened Before relation captures the casual
dependencies between events. i.e whether two events are casually related or not.
The relation → is defined as follows.
AOS(UNIT-1) 12
Example: In the space time diagram of below, e11, e12, e13, and e14 are in process
P; events and e21,e22, e23, and e24 are events in message transfers process P. The
arrows represent between the processes. For example, arrow e12¬23 message
corresponds to a sent from process P1 to process P2, e12 is the event of sending the
message at P1, and e23 is the event of receiving the same message at P2. In Fig. 5.2,
we se that e22 →e13, e13 ’->e14, and therefore e22 → e14. In other words, event 22
causally affects event e14. Note that whenever a→b holds for two events a and b,
there exists a path from a to b which moves only forward along the time axis in the
space-time diagram. Events e21 and e11 are concurrent even though e11 appears to
have occurred before e21 in real (global) time for a global observer.
Logical clocks
In order to realize the relation →, Lamport introduced the following system of logical
clocks. There is a clock Ci at each process Pi in the system.
AOS(UNIT-1) 13
The clock Ci can be thought of as a function that assigns a number Ci(a) to any event
a, called the timestamp of event a, at Pi
The numbers assigned by the system of clocks have no relation to physical time, and
hence the name logical clocks
AOS(UNIT-1) 14
Example
Both the clock values Cp1, and Cp2, are assumed to be zero initially and d is assumed
to be 1. e11 is an internal event in process P1 which causes CP1, to be incremented
to 1 due to IR1. Similarly, e21 and e22 are two events in P2 resulting CP2= 2 due to
IR1. e16 is a message send event in P1 which increments Cp1, to 6 due to IRI. e 16 is
a message send event in P1 which increments Cp1 to 6 due to IR1
The message is assigned a timestamp = 6. The event e25, corresponding to the receive
event of the above message, increments the clock Cp2, to 7 (max(4+1,6+1) due to
AOS(UNIT-1) 15
rules IR1 and IR2. Similarly, e24 is a send event in P2. The message is assigned a
timestamp = 4. The event e17 Corresponding to the receive event of the above
message increments the clock Cp1, to 7 (max(6+1, 4+1)) due to rules IR1 and and
IR2
C(a) < C(b) doesn’t imply a → b !!( If a and b are events in different processes)
So not a true clock
AOS(UNIT-1) 16
Vector Clocks
Implementation rules:
Ci[i]:= Ci[i]+d
AOS(UNIT-1) 17
[IR2] If event a is sending message m by process Pi, then message m is assigned a
timestamp tm=Ci(a), On receiving the same message m by process Pj, Cj is updated
as follows:
• a → b iff ta < tb
• Events a and b are causally related iff ta < tb or tb < ta, else they are
concurrent
AOS(UNIT-1) 18
CAUSAL ORDERING OF MESSAGES
The Causal ordering of messages deals with the notion of maintaining the same
casual relationship that holds among “message send” events with the corresponding
“message receive” events.
AOS(UNIT-1) 19
M)
Causal Ordering of Messages
AOS(UNIT-1) 20
CAPTURING GLOBAL STATE
Issues:
– no global clock
Some notations:
AOS(UNIT-1) 21
– time (send(m)) : time at which send(m) occured
For a message mij sent by Si to Sj, we say that
Global state:
In a consisten global state, for every received message a corresponding send event is
recorded in the global state.In fig 5.8 ,the global state { LS12, LS23 ,LS33} are
AOS(UNIT-1) 22
Transitless Global State:
Thus all the communication channel are empty in a transitless global state
The state of the channel all the state of channels are empty; that means,
no message is in transit.
Chandy-Lamport’s Algorithm
• One process acts as initiator, starts the state collection by following the marker
sending rule below.
AOS(UNIT-1) 23
• Marker sending rule for process P:
– P records its state; then for each outgoing channel C from P on which a
marker has not been sent already, P sends a marker along C before any
further message is sent on C
– If Q has not recorded its state then Q records the state of C as empty; Q
then follows the marker sending rule
Points to Note:
• Markers sent on a channel distinguish messages sent on the channel before the
sender recorded its states and the messages sent after the sender recorded its
state
• The state collected may not be any state that actually happened in reality,
rather a state that “could have” happened
If a cut event ci at site Si is Si’s local state at that instant, then clearly cut denotes a
global state of the system.
Where ci є C and cj є C
That is a cut is consistent cut if every message that was received before a cut event
was sent before the cut event at the sender site in the cut.
For example in the below figure the cut is not consistent because the message sent
by S2 is received before c3 but the corresponding send did not occur before event
AOS(UNIT-1) 25
c2.
Thai is, e→e’,e’→c3 and e→c2
Termination Detection
A process may either be in an active state or idle state. Only active processes
can send messages. An active process may become idle at any time. An idle process
can become active on receiving a computation message. Computation messages are
those that are related to the underlying computation being performed by the
cooperating processes. A computation is said to have terminated if and only if all the
AOS(UNIT-1) 26
processes are idle and there are no messages in transit. The messages sent by the
termination detection algorithm are referred to as control messages.
Basic Idea
One of the cooperating processes monitors the computation and is called the
controlling agent. Initially all processes are idle, the controlling agent’s weight
equals 1, and the weight of the rest of the processes is zero. The computation starts
when the controlling agent sends a computation message to one of the processes.
Any time a process sends a message, the process’s weight is split between itself and
the process receiving the message
The weight received along with a message is added to the weight of the process.
Thus, the algorithm assigns a weight W (0 < W < 1) to each active process (including
the controlling agent) and to each message in transit.
On finishing the computation, a process sends its weight to the controlling agent,
which adds the received weight to its own weight. When the weight of the controlling
agent is once again equal to 1, it concludes that the computation has terminated.
AOS(UNIT-1) 27
Rule 1. The controlling agent or an active process having weight W may send a
computation message to a process P by doing:
Derive W1and W2 such that
W1 + W2 = W, W1 >0, W2 > 0;
W := Wi;
Send B(W2) to P;
Rule 2. On receipt of B(DW), a process P having weight W does:
W= W + DW;
If P is idle, P becomes active;
Rule 3. An active process having weight W may become idle at any time by doing:
Send C(W) to the controlling agent;
W := 0;
(The process becomes idle);
Rule 4. On receiving C(DW), the controlling agent having weight W takes the
following actions:
W := W + DW\
If W = 1, conclude that the computation has terminated
AOS(UNIT-1) 28