DS Answer PDF
DS Answer PDF
Date: 2019January10
Complete Distributed
System Notes
BCT(Fourth Year I Part)
© Authors
Chapter 1
Introduction
A Distributed System (DS) is one in which
Computer Computer
Node Node
A distributed system is a collection of independent computers at
networked locations such that they communicate and interact only
through message passing that is viewed as a single coherent system by
its users.
Generally, all the components of the distributed system interact so as to
obtain a common goal.
A computer program running in distributed system is called distributed
program.
Distributed programming is used to write distributed programs.
It differs from parallel system as each computer in a distributed
system has its own memory i.e. distributed memory; but in
parallel system, all processors have access to shared memory for
information exchange.
Motivation:
• Enhance Performance: This is due to the fact that many tasks can be
executed concurrently at different computers. Load distribution among
computers can further improve response time.
The lack of common memory and system wide common clock is an inherent
problem In distributed systems.
No Global Clock :
- In other to coordinate to the remote networks it is necessary to synchronize
clock in primitive technologies. But as there is no single correct global timing
system, it is very difficult to synchronize global clock across all the networks
of the system located at different locations.
- The main characteristics of the distributed system is that it does not need
any global clock system to coordinate with the network at different locations
because the only way of communication is message passing through the
network.
Independent Failures :
- The computer system can fail or crash at any time.
- In primitive centralized system, if the server fails then the whole
system fails to operate leaving the negative consequences to the end
users.
- With distributed system, even one network fails, it does not hamper
the overall system. The workload of the failed network can be
overcomed by the other networks within the system situated at
different locations.
- This provides reliable system to the end users.
Design Goals
Resource Sharing
- The main goal of distributed system is to allow users to access
remote resources and to share them in controlled and efficient
manner.
- The resources may be printer, database, data, files and so on.
- By sharing resources among the users, we can minimize the
implementational cost of the system.
- It is also necessary for easy collaboration and information exchange
among the users of the system.
- Making resource sharing and information exchange easier result in
increasing security related problems in the system which must be
handled properly and efficiently to protect data from being
compromised.
Openness
- A distributed system should be open. It must provides services with
the standard rule following some protocols defining syntax and
semantic of that service.
- Services are specified through an interface defined in the Interface
Definition Language (IDL).
- IDL must specify complete description of the service including
function name, parameters, return values, possible exceptions and
what the service is used for.
- The interface specification should be complete (All the necessary
things required to implement the interface should be specified) and
neutral (The structure of the implementation should not be specified).
- Open distributed system helps to achieve interoperability (Ability for
two implementations to work together relying upon each other’s
services) and portability (Ability of an application designed for a
distributed system, to execute correctly on other distributed systems
with same implementations without any modification to the
application).
- It also helps in adding of new components or replacing current
components without affecting the system.
Transparency
- Transparency is the ability to hide the fact that the processes and the
resources of the distributed system are physically distributed across
multiple computers or machines and makes users to realize that it is a
single coherent system.
- Transparency should be considered with other issues like
performance.
- For eg: Let a person wants to print a file from the mobile device.
Then it would be great if he/she could print it from a nearby printer
than from printer located far from his current position. It is against the
location transparency but provides reliable outcome to the system.
Scalability
- A distributed system should be scalable with respect to size (Able to
add any numbers of users and resources), geography (Users and
resources may be in any locations) and administration (Easy
management even if there are many independent administraions).
Client vs Server
- Client and server are the process rather than the computer.
- The process which requests an operation is called client and the
process that provides the requested service is called server.
- Client is active while server is passive.
- Server runs continuously while clients run until the applications lasts.
- An executing web browser is a client while the web server is a
server.
Web Challenges
- If the resources are deleted or moved, the links to that resource still
remains. Such links are called dangling links.
- The response of the web server to the users may be slow.
- The web page is not satisfactory user interface.
Semantic Web
- The web of linked metadata resources is called semantic web.
- Proper metadata helps the search engines to search the contents in
effective and efficient way.
Cluster System
- Cluster system is generally used for parallel programming in which a
single program is run in parallel on multiple computers within the
system.
- The feature of cluster computing is homogeneity. It means all the
computers within the cluster system must have same operating
system and must be operated within the same network.
Cloud System
- Cloud computing system is a type of Internet-based computing that
provides shared computer processing resources and data to
computers and other devices on demand.
- It enables on demand access to a shared pool of configurable
computing resources.
- The system can be accessed using a web browser regardless of the
location and the devices used.
Chapter 2
RMI Transparency
- It involves hiding of marshalling, message passing as well as the
task of locating and contacting a remote object so as to make both
local and remote invocations look similar.
Working of RPC
1. Client procedure calls client stub in normal way.
2. Client stub builds message, call local OS.
3. Client's OS sends message to remote OS.
4. Remote OS gives message to server stub.
5. Server stub unpacks parameters, call server.
6. Server does work, returns result to the stub.
7. Server stub packs it in message, call local OS.
8. Server's OS sends message to client's OS.
9. Client's OS gives message to client stub.
10. Stub unpacks result, returns to client.
Case Study : Sun RPC
- SUN RPC was designed for client-server communication in the Sun
Network File System.
- It can be used over either UDP or TCP. Over UDP, the length of
request and reply messages is restricted in length(theoretically 64
kilobytes).
- It uses at-least-once invocation semantics.
- It provides an interface language called XDR and an interface
compiler rpcgen used with C language.
Introduction to DFS
- File system is necessary for organization, storage, retrieval, naming,
sharing and protection of files.
- Files contain data and attributes.
- Distributed file system is a model of file system that is distributed
across multiple machines.
- DFS provides services to the clients of distributed system.
Requirements of DFS
1. The design of DFS must support transparency of access, location,
migration , performance, etc.
2. Concurrent file updates should be controlled.
3. It should support file replication to enhance scalability and fault
tolerance.
4. The service interfaces should be defined such that they can be
implemented in heterogeneous systems.
5. The service should continue to operate even in case of client or
server failures.
6. It should maintain consistent states for files.
7. It should provide access control mechanisms to provide security.
Importance of DFS
1. It supports sharing of information in the form of files throughout the
Intranet.
2. It enables programs to store and access remote files exactly as
they do on local ones.
File Service Architecture
- Distributed file system consists of three components:
a) Flat file service
b) Directory service
c) Client module
Directory Service
- It is a component that provides mapping between text names for files
and their UFID.
- The various directory service operations are: lookup, addName,
unName and getNames.
Client Module
- It is a component running in client computer, integrating the file
service and directory service operations under a single API.
- With the use of cache, client module helps to achieve high
performance.
Properties
1. It is both an implementation and a specification of how to access
remote files.
2. It focuses on sharing a file system in a transparent way.
3. It uses client server model. A node can act both as client and
server.
4. It uses mount to make server file system visible from a client.
5. It is stateless (all client requests must be self contained).
6. It is machine and operating system independent.
Architecture
1. Protocol:
- It uses SUN RPC mechanism and SUN external data representation
(XDR) standard.
- The protocol is stateless. It enhances crash recovery.
- Each procedure call must contain all the information necessary to
complete the call.
2. Server Side:
- It provides file handle consisting of:
a) Filesystem id (identify disk partition)
b) I-node number (identify file)
c) Generation number
- File system id is stored in super block.
- Generation number is stored in I-node.
3. Client Side:
- It provides transparent interface to NFS.
- Mapping between remote file name and remote file address is done
at server boot time through remote mount.
Operations
1. Search for file within directory
2. Read a set of directory entries
3. Manipulate links and directories
4. Read/write file attributes
5. Read/write file data
Name Services
- Names are used to refer various resources.
- Resources are accessed using identifier or references.
- A name is a value that can be resolved to an identifier or an address.
- Names are used because they are human readable.
- Name services are those services that are used to resolve resource
names.
- Name service returns the information about the resource when the
name of a resource is given.
- Name service is responsible to store a collection of one or more
naming contexts.
DNS
-DNS is the Internet naming scheme that allows resources to be
accessed by using alphanumeric names.
- A valid DNS names allows; A to Z, a to z, 0 to 9 and Hyphen (-).
- The DNS is a distributed hierarchical database as shown below :
-A ‘.’ is used as a separator.
Working Mechanism:
1. Issue a DNS query to ask for IP address of www.egnitenotes.com
2. Issue a query to root name server.
3. Returns the IP address of TLD.
4. Issue a query and sent to TLD servers.
5. Reply with ns1.egnitenotes.com and IP address.
6. Issue another query and sent to ns1.egnitenotes.com
7. Reply IP address of www.egnitenotes.com
8. Return IP address of www.egnitenotes.com to client.
9. Request for web content to IP address of www.egnitenotes.com
Terminology
- A query is a request for name resolution which is directed to a DNS
server.
- A recursive query is sent to DNS server and requires a complete
answer.
- A iterative query is directed to DNS server which may be answered
with a referral to another DNS server.
- Root hints contain IP address for DNS root servers.
Resource Records
1. A- record = Address
2. CNAME = Alias
3. NS = Authoritative name server
4. MX = Mail exchange
5. PTR = Domain Name Pointer
Chapter 3
Core OS Functinality
1. Process Manager:
- As a process manager, OS handles the creation of processes and
the operations upon them.
2. Thread Manager:
- As a thread manager, OS is responsible for thread creation,
synchronization and scheduling.
3. Communication Manager
- OS is responsible for communication between threads attached to
different processes on same computer or in remote processes.
- In some OS, additional service is necessary for communication.
4. Memory Manager:
- OS also deals with management of physical and virtual memory to
ensure efficient data sharing.
5. Supervisor:
- OS is responsible to dispatch interrupts, system call traps, memory
management control, hardware cache and so on.
Protection
- The underlying resources in a distributed system should be protected
from illegitimate access.
- To ensure protection of resources, operating system must provides a
means to provide clients to perform operations on the resources if and
only if they have rights to do so.
- For example: Consider a file with only read or write operations. The
illegitimate access would be access of file for write by the client who
have read access only.
- Resources can be protected by the use of type-safe programming
language like JAVA in which no module can access a traget module
without having a reference to it.
- Hardware support can be employed to protect modules from
illegitimate invocations, for which kernel should be implemented.
Kernel:
- A kernel is a program that is executed with complete access
privileges for the physical resources on its host computer.
- It controls memory management.
- It ensures access of physical resources by the acceptable codes
only.
- A kernel process executes in supervisor mode and restricts other
processes to execute in user mode.
- It sets up address space for the process. A process is unable to
access memory outside its address space.
- A process can switch the address space via interrupt or system call
trap.
Selection of Kernel:
- Micro kernel is suitable for distributed operating system.
- The services of distributed system are complex and segregation of
micro kernel makes it easy.
- Micro kernel provides faster communication among the processes
with low overhead.
Middleware
Role of middleware in Distributed System
- Middleware is a software that provides services which are not
provided by the OS to enable various components of distributed
system to communicate and manage data.
- The major role of middleware is to handle communication between
components of the system, without making any assumptions of the
contents if the receiver could understand the contents.
- Middleware is also responsible for load management such as
starting and stopping services and managing loads directed to them.
- It also provides other services such as authentication and
authorization, audit and logging.
- It provides interoperability between applications that run on different
operating system.
Cristian’s Method
- It makes use of a time server to get the current time and helps in
synchronization of computer externally.
- Upon request, the server process S provides the time according to
its clock to the requesting process p.
- This method achieve synchronization only if the round trip times
between client and time server are sufficiently short compared to the
required accuracy.
Algorithm:
- A process p requests time in a message mr and receives time value t
in a message mt. Process p records total round trip time T(round)
taken to send request mr and receive reply mt.
- Assuming elapsed time is splitted before and after S placed t in mt,
the time estimate to which p should set its clock is t + T(round)/2.
- Assuming min as the earliest point at which S could have placed
time mt after p dispatches mr, then:
a) Time by S’s clock when reply arrives is in range [t + min, t +
T(round) – min]
b) Width of time range is T(round) – 2 * min
c) Accuracy is +- (T(round) /2 – min)
Discussion:
- If a time server fails, the synchronization is impossible.
- To remove this drawback, time should be provided by a group of
synchronized time servers.
Berkeley’s Algorithm
- It is an algorithm for internal synchronization.
- A computer is chosen as a master.
- All other computers are slaves.
- Master periodically polls for the time of slaves and the slaves send
back their clock values to master.
- The master estimates local time of each slave by observing the
round-trip times.
- Master calculates average of obtained time including its own time.
- While calculating average, it eliminates faulty clocks by choosing a
subset of clocks that do not differ from one another by more than a
specified amount.
- The master then sends the amount by which each slave should
adjust their clock which may be positive or negative.
- If the master fails, one of the slaves can be elected to take the place
of master.
Network Time Protocol (NTP)
- It defines an architecture to enable clients, across the Internet to be
synchronized accurately to UTC.
- It synchronizes against many time servers.
Design Aims:
- Adjust system clock close to UTC over Internet.
- Handle bad connectivity
- Enable frequent resynchronization
- Security
Working of NTP
- It calculates offset oj and delay dj as:
Logical Clock
- Logical clock is a virtual clock that records the relative ordering of
events in a process.
- It is a monotonically increasing software counter.
- It is realized whenever relative ordering of events is more important
than the physical time.
- Physical clocks are not needed to be synchronized.
- The value of logical clock is used to assign time stamps to the
events.
Vector Clock
- Vector clock is a clock that gives ability to decide whether two events
are causally related or not by looking at their time stamps.
- A vector clock for a system of N processes is an array of N integers.
- Each process keeps its own vector clock Vi used to time stamp local
events.
- The disadvantage is that it takes more amount of storage and
message payload proportional to the number of processes.
Algorithm:
Marker receiving rule for process Pi :
On Pi's receipt of a marker message over channel c:
if (Pi has not yet recorded its state) it:
records its process state;
records state of c as empty set;
turns on recording of messages over in
coming channels;
else
Pi records state of c as set of messages
received over c;
end if
Ricart-Agrawala Algorithm
- It makes use of distributed agreement to implement mutual
exclusion.
- All the processes are assumed to keep Lamport's logical clock.
- The process requiring access to critical section multicast request
message to all other process competing for same resource.
- A process enters critical section when all processes reply to the
message.
- Each process keeps its state with respect to critical section as
released, requested or held.
Algorithm:
Problems
1. It is expensive to handle message traffic [2(n-1) messages]
2. Failure of one involved process blocks the progress.
Token Based Algorithm
- A logical token is passed among the processes.
- A token represents access right to the shared resources.
- The process which holds the token is granted access to critical
section.
- It includes Ricart-Agrawala second algorithm and token ring
algorithm.
Advantages:
1. It requires only n-1 requests and one reply.
2. Failure of process which is not holding token does not prevent
progress.
State Diagram:
The state diagram is shown in given figure:
Token Ring Algorithm
- The n processes are arranged in a logical ring as shown in given
figure:
Algorithm:
1. Token is initially given to one process.
2. When a process requires to enter CS, it waits until it gets token
from its left neighbor and retains it. After it left CS, it passes token to
its neighbor in clockwise direction.
3. If a process gets token but does not require to enter CS, it
immediately passes token along the ring.
Problem:
1. It adds load to the network as token should be passed even the
process do not need it.
2. If one process fails, no progress is possible until the faulty process
is extracted from the ring.
3. Election process should be done if the process holding the token
fails.
Distributed Election
- Election algorithm is an algorithm for choosing a unique process to
play a particular role.
- Any process can be elected but only one process must be elected
and all other processes must agree on it.
- Election started after a failure of current coordinator.
- Election process has two phases:
1. Selection of new leader
2. Information to all processes about the elected process
Bully Algorithm
- Any process can crash during the election.
- It assumes that the system is synchronous.
- It assumes that each process knows identifiers of other processes
and it can communicate with process with higher identifier.
- It has three types of messages : election message, answer message
and coordinator message.
- When a process Pi detects a failure and election is to be held, it
sends election message to all processes with higher identifier and
waits for the answer message.
1. If no answer arrives within a time limit, Pi becomes coordinator and
sends coordinator message to all other processes.
2. If answer message arrives, Pi knows another process has to be a
coordinator and waits for coordinator message. If coordinator
message fails to arrive within a time limit, Pi resends the election
message.
Algorithm:
1. Rule for election process initiator
statePi := ELECTION-ON
Pi sends election message to processes with high
er identifier
Pi waits for answer message
if no answer message before timeout then
Pi is coordinator and sends coordinator m
essage to all processes
else
Pi waits for coordinator message
if no coordinator message arrives before
timeout then
restart election procedure
end if
end if
Average Case:
- n/2 message need to reach maximal node.
- n message to return maximal node.
- n message to rotate elected message.
- Total message : 2n + n/2
Worst Case:
- n-1 message to reach maximal node
- Total message : 3n -1
Chapter 7
Replication
Replication and its Reasons
- Replication is the mechanism of maintenance of multiple copies of
data at multiple computers.
- It helps to make distributed system effective by enhancing
performance.
Consistency Models
- Consistency model is the contract between processes and the data
store.
- Whenever a read operation is done, it should return a value showing
the last write operation on data. But due to lack of global clock, it is
difficult to determine last write operation.
Types of Consistency
------------------------
1. Strict Consistency
- Any read to shared data returns value stored by the most recent
write.
- It makes use of absolute time ordering of all shared resources.
- It is unrealistic for distributed system as it requires absolute global
time.
2. Sequential Consistency
- The result of any execution is same as if operations of all processes
were executed in some sequential order.
3. Causal Consistency
- Writes that are causally related must be seen by all the processes in
the same order.
Object Replication
- Data in the distributed system contains collection of items. These
items are called objects.
- An object can be file or object generated by programming paradigm.
- Object replication is the mechanism to form physical replicas of such
objects, each stored at single computer and tied to some degree of
consistency.
Problem:
- If objects are shared, the concurrent accesses to the shared objects
should be managed to guarantee state consistency.
Solution:
- The process of handling concurrent invocations are shown in given
figure:
Created By: Sushant Gautam
Chapter 8
Operations:
openTransaction() --> trans;
//starts new transaction and delivers uniq
ue TID trans.
closeTransaction(trans) --> (commit, abort);
// commit return value indicates transaction
has committed.
// abort return valuue indicates transaction
has aborted.
abortTransaction(trans);
//abort the transaction
Nested Transaction
- The transaction which is composed of other transactions as per the
requirement is called nested transaction.
- The outermost transaction is called top level transaction and others
are called sub-transactions.
- The sub-transactions at same level can run concurrently but their
access to common objects is serialized.
Locks
- The use of exclusive locks helps to serialize access to the objects.
- The server attempts to lock any object that is about to be used by
any operation of a client's transaction.
- If client requests access to locked object, it must wait.
Transaction T:
Transaction U:
Operations Locks
Operations Locks
--------------------------------------------------------
-----------------------------------------
openTransaction
balance = b.getBalance(); Lock B
b.setBalance(balance*1.1);
openTransaction
a.withdraw(balance/10); Lock A
balance = b.getBalance(); Wait for T's lock on B
Lock B
b.setBalance(balance*1.1);
c.withdraw(balance/10); Lock C
Lock Compatibility
Lock Requested
ReadWrite
None Ok Ok
Lock already setRead Ok Wait
WriteWait Wait
Deadlock
- The use of locks can lead to deadlock.
- The situation in which two transactions are waiting and each is
dependent on the other to release a lock so as to resume is called
deadlock.
Deadlock Prevention:
- Lock all the objects used by a transaction when it starts.
Deadlock Detection:
- A wait for graph is analyzed to detect deadlock by finding cycles.
- If deadlock is present, a transaction is selected for abortion.
Optimistic Concurrency Control
- Transactions are allowed to proceed as though there were no
possibility of conflict with other clients until it completes its task and
issues a closeTransaction request.
- If conflict arises, some transaction will be aborted and should be
restarted by the client.
- Each transaction has three phases:
1. Working phase
2. Validation phase
3. Update phase
Working phase
-Each transaction get copy of most recently committed version of the
object.
- Read operation is performed immediately.
- Write operation record new values as tentative values.
- A same object can have several tentative values.
Validation Phase
- When closeTransaction is received, the transaction is validated to
confirm whether or not there is conflicts.
- On successful validation, transaction can commit.
Update Phase
- If transaction is validated, all the tentative values are made
permanent.
Problems
- Starvation prevails.
Validation of Transaction
- Each transaction is assigned a transaction number when it enters
validation phase.
- A transaction with number Ti precedes a transaction with number Tj if
i < j.
- For transaction Tv to be serializable with respect to Ti, their
operations must conform the rules as:
1. Tv - write and Ti - read
- Ti must not read objects written by Tv
2. Tv - read and Ti - write
- Tv must not read objects written by Ti
3. Tv - write and Ti - write
- Ti must not write objects written by Tv and vice versa.
Timestamp Ordering
- Each transactions's operation is validated when it is carried out.
- If operation can not be validated, the transaction is aborted.
- Each transaction is assigned a unique timestamp value when it
starts.
- A transaction's request to write an object is valid only if that object
was last read and written by earlier transactions.
- A transaction's request to read an object is valid only if that object
was last written by earlier transactions.
Write Rule
Read Rule
Fault Tolerance
Introduction to Fault Tolerance
- Fault means defects within hardware or software unit.
- Error means deviation from accuracy.
- Failure is the condition occured when error results system to function
incorrectly.
- Fault tolerance means ability to provide services despite of faults
occur in some node of the system.
- A system is said to be k-fault tolerant if it is able to function properly
even if k nodes of the system suffer from concurrent failures.
Types of Faults
1. Node fault
2. Program fault
3. Communication fault
4. Timing fault
Primary backup replication or Passive replication
- At any point of time, there is a single primary replica manager and
one or more secondary replica managers or backups.
- The front end of the system is able to communicate only with the
primary replica manager to obtain the service.
- The primary replica manager executes the operations and sends
updated data to the backups.
Event Sequence:
1. Request : The FE issues request to the primary RM with unique
identifier.
2. Coordination : Primary RM takes the request in the order in which it
receives it and re sends the response if already executed.
3. Execution : The primary RM executes request and stores response.
4. Agreement : If request is an update, primary RM sends updated
state, response and unique identifier to all the backups. The backups
send an acknowledgement.
5. Response : The primary RM responds to front end.
Advantages:
1. It is simple and easy to implement.
2. It can be implemented even if primary RM behaves non-
deterministically.
Disadvantages:
1. It provides high overhead.
2. If primary RM fails, more latency is incurred as new view is formed.
3. It can not tolerate byzantine failures.
Active Replication
- The replica managers are state machines that play equivalent roles.
- FE multicast requests to the group of RM and all of them process the
requests independently but identically and reply.
- If any RM crashes, others RM can responds. So, there is no
degradation on performance.
- It can tolerate byzantine failures.
Event Sequence:
1. Request : The FE attaches a unique identifier to the request and
multicast it to the group of RM. It does not issue the next request until
it has received a response.
2. Coordination : The group communication system delivers the
request to every correct RM in the same order.
3. Execution : Every replica manager executes the request.
4. Agreement : No agreement phase is needed.
5. Response : Each replica manager sends its response to the FE.
The no of replies that the FE collects depends upon failure
assumptions.
Advantages:
1. It can tolerate byzantine failure.
2. If any RM fails, it does not affect system performance.
Disadvantages:
- RM must be deterministic.
- Atomic broadcast protocol must be used.
Process Resilience
- Process resilience is a mechanism to protect against faulty
processes by replicating and distributing computations in a group.
Reliable Multicasting
Problems:
- Message lost
- Acknowledgement lost
- Receiver suppresses their feedback
Solutions:
- Atomic multicast guarantees all process received message or none
at all.
Distributed Commit
- It deals with methods to ensure that either all processes commit to
the final result or none of them do.
Two Phase Commit
Model:
- The client who initiated computation acts as coordinator.
- Processes required to commit act as participant.
Phases:
1a - Coordinator sends VOTE_REQUEST to participants
1b - When participant receives VOTE_REQUEST, it reply with YES or
NO. If it sends NO, it aborts its local computations.
2a - Coordinator collects all votes. If all are YES, it sends COMMIT to
all participants. Otherwise, it sends ABORT.
2b - Each participants waits for COMMIT or ABORT and handles
accordingly.
Participant Failure:
1. Initial state = Make transition to ABORT
2. Ready state = Contact another participants
3. Abort state = Make transition to ABORT
4. Commit state = Make transition to COMMIT
Implementation:
1. Coordinator
2. Participants:
Distributed Recovery
- It is the mechanism to handle failures.
- It helps to recover correct state of the system after failure.
Independent Checkpointing
- Each process periodically checkpoints independent of other
processes.
- Upon failure, locate a consistent cut backward.
- It needs to rollback until consistent cut is found.
Coordinated Checkpointing
- The state of each process in the system is periodically saved on
stable storage.
- If failure occurs, it rollbacks to previous error free state recorded by
the checkpoints of all the processes.
Architecture of CORBA
The general architecture is shown in given figure:
1. Interface Repository:
- It provides representation of available object interfaces of all objects.
- It is used for dynamic invocation.
2. Implementation Repository:
- It stores implementation details for each object's interfaces.
(Mapping from server object name to filename to implement service)
- The information stored may be OS specific.
- It is used by object adapter to solve incoming call and activate right
object method.
3. Object Request Broker (ORB)
- It provides mechanisms by which objects can interact with each
other transparently.
4. Static Invocation:
- It allows a client to invoke requests on an object whose compile time
knowledge of server's interface specification is known.
- For client, object invocation is similar to local method of invocation,
which automatically forwarded to object implementation through ORB,
object adapter and skeleton.
- It has low overhead, and is efficient at run time.
5. Dynamic Invocation:
- It allows a client to invoke requests on object without having compile
time knowledge of object's interface.
- The object and interface are detected at run time by inspecting the
interface repository.
- The request is then constructed and invocation is performed as it
static invocation.
- It has high overhead.
6. Object Adapter:
- It is the interface between server object implementation and ORB.
Services Provided by CORBA
1. Naming service
- It allows clients to find and locate objects based on name.
2. Trading service
- It allows clients to find and locate objects based on their properties.
3. Notification service
- It allows objects to notify other objects that some event has occured.
4. Transaction Service
- It allows atomic transactions and rollback on failures.
5. Security Service
- It protects components from unauthorized access or users.
6. Concurrency control service
- It provides a lock manager that can obtain and free locks for
transactions to manage concurrent transactions.
7. Life cycle service
- It defines conventions for creating, deleting, copying and moving
CORBA objects.
8. Time service
- It provides interfaces for synchronizing time.
Mach
- Mach is a microkernel that runs on both multiprocessor and
uniprocessor computers connected by networks.
- It incorporates sophisticated IPC and virtual memory facilities.
- Port is used to identify individual resources.
- To access a resource, a message is sent to the corresponding port.
- It provides a single system call for message passing : mach_msg
- This system call provides interactions for both asynchronous
message passing and request-reply.
- mach_ msg contains msg_header, option, snd_siz, rcv_siz,
rcv_name, timeout and notify.
JINI
- It is a coordination based system from Sun Microsystems written in
JAVA.
- It uses RMI and Java object serialization to enable Java objects to
move around the network.
- Services may be added or removed without configuration.
- It is not based on central control.
Components of JINI
1. Service:
- An entity that another program, service or user can use.
2. Client:
- A component that is capable of using JINI services.
3. Lookup Service:
- A component that keeps track of the services offered in the
federation.
TIB/Rendezvous
- Synchronization and data transmission are inseparable activities
which must be synchronized to exchange information. This process is
called rendezvous.
Implementation of TIB
- One of the two communicating tasks knows the name of the other
and names it explicitly.
- The second task knows only that it expects some external
interaction.
- It is based on subject based addressing.
- Receiving a message on subject X is possible only if receiver had
subscribed to X.
- Publishing a message on subject X means sending message to all
subscribers of X.