Aos Unit-1 Notes
Aos Unit-1 Notes
, DCET)
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
AOS(UNIT-1) 1
Mrs. Sameera Begum(CSE Dept., DCET)
UNIT I
Introduction:
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
AOS(UNIT-1) 2
Mrs. Sameera Begum(CSE Dept., DCET)
transferred to lightly loaded computers, thereby reducing the time tasks wait before
receiving service.
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
AOS(UNIT-1) 3
Mrs. Sameera Begum(CSE Dept., DCET)
Each computer supports multiple users and provides access to remote resources.
Workstation model
Each user has a workstation at his disposal where all the users work is performed.
With the help of distributed file system,a user can access data regardless of its
location
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.
Definition:
A DOS appears to its users as a centralized operating system for a single machine
but it runs on multiple –independent computers.
1. Global Knowledge
2. Naming
3. Scalability
4. Compatibility
5. Process Synchronization
AOS(UNIT-1) 5
Mrs. Sameera Begum(CSE Dept., DCET)
6. Resource Management
7. Security
8. Structuring
9. Client-Server Model
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 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
AOS(UNIT-1) 6
Mrs. Sameera Begum(CSE Dept., DCET)
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
For example, broadcast based protocols work well for small systems( systems
having a small number of computers) but not for large 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
AOS(UNIT-1) 7
Mrs. Sameera Begum(CSE Dept., DCET)
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
Resource Management
AOS(UNIT-1) 8
Mrs. Sameera Begum(CSE Dept., DCET)
Distributed Scheduling:
AOS(UNIT-1) 9
Mrs. Sameera Begum(CSE Dept., DCET)
Security
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) 10
Mrs. Sameera Begum(CSE Dept., DCET)
Communication in DOS
AOS(UNIT-1) 11
Mrs. Sameera Begum(CSE Dept., DCET)
AOS(UNIT-1) 12
Mrs. Sameera Begum(CSE Dept., DCET)
AOS(UNIT-1) 13
Mrs. Sameera Begum(CSE Dept., DCET)
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.
(denoted by a||b) if
AOS(UNIT-1) 14
Mrs. Sameera Begum(CSE Dept., DCET)
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 ab 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
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
AOS(UNIT-1) 15
Mrs. Sameera Begum(CSE Dept., DCET)
The numbers assigned by the system of clocks have no relation to physical time,
and hence the name logical clocks
AOS(UNIT-1) 16
Mrs. Sameera Begum(CSE Dept., DCET)
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. e16 is a message send event in P1 which increments Cp1 to 6 due to IR1
AOS(UNIT-1) 17
Mrs. Sameera Begum(CSE Dept., DCET)
due to 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
BUT
C(a) < C(b) doesn’t imply a → b !!( If a and b are events in different processes)
AOS(UNIT-1) 18
Mrs. Sameera Begum(CSE Dept., DCET)
Vector Clocks
Implementation rules:
Ci[i]:= Ci[i]+d
AOS(UNIT-1) 19
Mrs. Sameera Begum(CSE Dept., DCET)
• a → b iff ta < tb
• Events a and b are causally related iff ta < tb or tb < ta, else they are
concurrent
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) 20
Mrs. Sameera Begum(CSE Dept., DCET)
There are two protocols to make use of vector clocks for the causal ordering.
AOS(UNIT-1) 21
Mrs. Sameera Begum(CSE Dept., DCET)
Issues:
– no global clock
Some notations:
GS is consistent iff
for all i, j, 1 ≤ i, j ≤ n,
inconsistent(LSi, LSj) = Ф
GS is transitless iff
for all i, j, 1 ≤ i, j ≤ n,
transit(LSi, LSj) = Ф
AOS(UNIT-1) 23
Mrs. Sameera Begum(CSE Dept., DCET)
Chandy-Lamport’s Algorithm
• One process acts as initiator, starts the state collection by following the
marker sending rule below.
– 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:
AOS(UNIT-1) 24
Mrs. Sameera Begum(CSE Dept., DCET)
• 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.
AOS(UNIT-1) 25
Mrs. Sameera Begum(CSE Dept., DCET)
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
c2. Thai is, ee’,e’c3 and ec2
AOS(UNIT-1) 26
Mrs. Sameera Begum(CSE Dept., DCET)
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 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.
AOS(UNIT-1) 27
Mrs. Sameera Begum(CSE Dept., DCET)
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) 28
Mrs. Sameera Begum(CSE Dept., DCET)
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) 29