Distributed Operating Systems
Distributed Operating Systems
Architecture of
Traditional/Centralized Systems
• Server provides service
• Client requests service
• In centralized systems, all clients in the
network interact with only 1 server
• In distributed systems, any computer
can act as server or as client
3
Communication Primitives
1. Message Passing(MP) Model:
SEND(destination, message)
RECEIVE(source, buffer for storing message)
E.g. SEND(192.16.2.1, "Hello")
E.g. RECEIVE(192.16.2.2,&buff)
Receiver will either periodically check for messages or be signaled by sender.
Communication Primitives(contd.)
Buffered Option Unbuffered Option
Messages are copied 3 times: sender user Message is copied directly from sender
buffer->sender kernel buffer-> receiver kernel user buffer to receiver user buffer directly.
buffer->receiver user buffer.
Sender can reuse user buffer as soon as Sender should avoid reusing user buffer
message is copied to the kernel buffer. until the message is sent.
Communication Primitives(contd.)
2. Remote Procedure Call(RPC) Model:
Message Passing model is highly flexible but has some issues to be
addressed by programmers:
Pairing of responses with request messages
Data representation (when computers of different architectures or
programs written in different programming languages are communicating)
Knowing address of the remote machine(server)
Taking care of communication and system failures
It is difficult to debug errors as programs can be time-dependent
RPC addresses these issues by hiding all the above details from
programmers.
Stub Procedures and Binding Server take care of all the above
details instead of the client and server procedures.
Thus hiding the details from programmers and thereby reducing
the burden on the client and server programs.
10
Communication Primitives(contd.)
Basic RPC Operation:
11
Communication Primitives(contd.)
Design issues in RPC:
1. Structure:
Stub procedures
Procedure E.g. P(x,y) where x,y are parameters
2. Binding:
Binding server
service->server address : Location Transparent
service, server address-> server port number : Location Not Transparent
3. Parameter and result passing:
parameters + code conversion format : machine has to recognize all formats + software
updation needed for new format => poor portability
Solution: standard format
passing parameters by value(simple) vs by reference(complex)
different semantics for handling local and remote procedures
4. Incremental results
5. Protocol flexibility
12
Communication Primitives(contd.)
Design issues in RPC(contd.):
6. Error Handling, semantics and correctness:
Computer Failures
Communication Failures
At least once semantics: >=1 execution of RPC valid else failure
Exactly once semantics: 1 execution of RPC valid else failure
At most once semantics or Zero-or-One semantics: <=1 i.e. 0/1 execution of RPC valid
else failure
Correctness condition: C1 -> C2 implies W1 -> W2 ; W1 and W2 modify the same
shared data ; Ci is call made by client and Wi is corresponding computation done at
server
7. Reliable, High Throughput, Connection-oriented packets e.g. TCP vs
Unreliable, Low Latency, Connectionless datagrams e.g.
UDP
8. MultiRPC, Parallel procedure call (PARPC)
9. Synchronous vs Asynchronous RPC
13
Subjects
John {own} {read} {own} {recvmail}
Smith {read,write} {own} {sendmail} {own}
Implementations of Access
Matrix(contd.)
Capability-based addressing:
17
Implementations of Access
Matrix(contd.)
Capabilities can also be used as an addressing mechanism
Features:
Relocatability: an object can be relocated anywhere in main memory without
making any changes to the capabilities that refer it(since only base field of object
has to be changed in the object table)
Sharing: several programs can share the same object(program or data) using
different names(object descriptor)=> 2 pointers can be made to point to the
same object table entry
Implementation Considerations:
Tagged approach: Tag(1 or more bits attached to each memory location and to
every processor register) indicate whether the memory word or a register
contains a capability(Tag is ON) or ordinary data(Tag is OFF)
Partitioned approach: Capabilities and ordinary data are stored
separately=>separate segments e.g. separate i.e. 2 sets of registers
18
Implementations of Access
Matrix(contd.)
Advantages:
Efficiency: validity of an access can be easily tested
Simplicity: natural correspondence between the structural properties of
capabilities and semantic properties of addressing variables
Flexibility: users can define certain addressing parameters
Drawbacks:
Control of propagation of capabilities: s1 passes copy of capabilities of o1
to s2; s2 can propagate this by passing the copy to other subjects without
knowledge of s1. To control this propagation use copy bit(boolean) or a
depth counter(integer)
Review: determining all subjects which have access to an object difficult
Revocation of access rights: owner of capability must review all copies
Garbage collection or lost object problem: when all the capabilities of an
object get deleted, object is inaccessible to users=> becomes garbage. Soln:
keep track of when the count of number of copies = 0
19
Implementations of Access
Matrix(contd.)
Advantages:
Easy Review of an Access: determining all subjects which have access
to an object easy
Easy Revocation of Access: achieved by simply removing the subject’s
entry from the object’s ACL
Implementation Considerations:
Efficiency of Execution: ACL has to be searched for every access to a
protected object, it can be very slow. Soln: store first access in shadow
registers and use it for lookup. But here when revoking access both ACL
and shadow registers has to be updated or all the shadow registers have
to be cleared and rebuild them.
Efficiency of Storage: large storage requirements for storing ACL of
each subject=> use protection groups( subjects are grouped) and ACL
entries have group id instead of individual subject.
▪ Granularity: should not be coarse(many subjects in 1 group) since they will all have
identical access.
▪ Authority to change ACL: self control(centralized, only owner has rights) and
hierarchical control(group of processes in the hierarchy have access).
21