DISTRIBUTED SYSTEMS
Lecture four
middle ware
Middle ware
• Refers to a layer of services or softwares added
between those of a network OS and the actual
applications.
• Also known as software in the middle.
• It is a Set of tools that provide a uniform means
and style of access to system resources across
all platforms
Middleware
Middleware runs between client /server processes.
• Enable programmers to build applications that look and feel
the same
• Enable programmers to use the same method to access data
It Shields the client and application programmers
from the complexity of the communication protocol,
NOS functions and hardware configurations.
Software and software Layers in Distributed
Systems
Applications, services
Middleware
Operating system
Platform
Computer and network hardware
4
Middle ware functions
1.Facilitate the implementation of distributed
applications
2. Attempt to hide the heterogeneity of the
underlying system architectures (both hardware
and software).
Middle ware services
There are a number of services common to
many middle ware systems. These include:
• communication services
• Naming services
• Distributed transaction services
• Security services
communication services
• All middle ware attempts to implement access
transparency by offering high level
communication facilities that hide the low- level
message passing through computer networks.
• E.g http protocol allow transparent fetching of
documents in the web
Naming services
• Naming services allow entities to be shared and
looked up.
• This implemented by providing directory services
which are comparable to telephone books and
yellow pages
• The location of the entity is assumed to be fixed.
Naming services
• E.g a url contains the name of the server where the
document to which the url refers is stored.
• if the document is moved to another server, its url
ceases to work
Distributed transaction services
• An important property of a transaction is that it allows
multiple read and write operations to occur atomically.
• Atomically means that the transaction either
succeeds so that all its write operations are actually
performed or it fails leaving all referenced data
unaffected
Distributed transaction services
• Distributed transaction services operate on data that
are spread across multiple machines.
• These services are offered in order to hide failures in
the system
Security services
• Virtually all middleware systems provide Facilities
for security.
• For example facilities to provide identification and
authentication before a shared resource is
accessed
Middle ware models
• most middleware is based on some model, or
paradigm,.
• This Models are used for two main reasons:
• 1.To describe distribution and communication.
• 2. To make development and integration of
distributed applications as simple as possible,
13
Middle ware models
Middle ware Models include the following:
1.Remote Procedure Calls (RPCs)
2.Distributed objects.
3.Distributed documents
4.Distributed file systems
14
1.Remote Procedure Calls (RPCs
• The idea behind RPC is to call code remotely as if
we were just calling a procedure
• involves hiding network work communication by
allowing a process to call a procedure whose
implementation is on a remote machine.
15
1.Remote Procedure Calls (RPCs
• From the client's point of view, calling a service on
the server should look just like calling a local
function, and the RPC framework is the responsible
for serializing parameters to the service, making sure
the correct service is run, and fetching the result
back to the client.
16
1.Remote Procedure Calls (RPCs)
• Parameters are transparently shipped to the remote
host where the procedure is subsequently executed,
after which the results are sent back to the caller.
• It appears as if the procedure call was executed
locally:
• The calling process remains unaware of the fact that
n/w communication took place, except perhaps for
some loss of performance.
17
1.Steps of a Remote Procedure Call (RPCs)
18
1.Steps of a Remote Procedure Call (RPCs)
1. Client procedure calls client stub in normal way
2. Client stub builds message, calls local OS
3. Client's OS sends message to remote OS
4. Remote OS gives message to server stub
5. Server stub unpacks parameters, calls server
19
1.Steps of a Remote Procedure Call (RPCs)
6. Server does work, returns result to the stub
7. Server stub packs it in message, calls 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
20
Remote procedure calls(RPC)
• Parameters are transparently shipped to the remote
host where the procedure is subsequently executed,
after which the results are sent back to the caller.
21
Remote procedure calls(RPC)
Rpc provides the following services
1. access transparency-a call to remote procedure may
be similar to a local procedure
2.location transparency – The developer can refer to
the procedure by name, unaware of
Where exactly the remote procedure is located.
3. synchronization – since the process invoking the
RPC remains suspended (blocked) until the
Remote procedure is completed,just as a call to
Local procedure.
22
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 and
we invoke methods through a proxy .
23
Remote method invocation
– In this approach, local object
invokes(calls) methods of an object
residing on a remote computer
- invocation appears as if it was a local
method call
24
Remote method invocation
25
Remote method invocation
• The objective of RMI is that each object implements
an interface that hides all the internal details of the
object from its users.
• An interface consists methods that the objects
Implements.
• The only thing that a process sees of an object
is its interface.
26
Remote method invocation
• Each object is located on a single machine and it’s
interface available on other machines.
• A method invocation is simply transformed into a
message that is sent to the object.
• The object executes the requested method and
sends back the result (reply message) to the
invoking process.
27
A Remote Object
• A remote object will advertise and implement a remote interface
• Remote invocation can only invoke methods in the remote interface
Example of an interface
A Java Server example
RMI System
RMI System
Stub and Skeleton Layer: intercepts calls
from client and redirects to Remote
Reference Layer
They unmarshals the request and invokes the
corresponding method in the remote object.
these RMI components are generated automatically by an
interface compiler.
Remote Reference Layer interprets
references to remote objects, knows what to
do with them. Passes messages to the
Transport Layer: sends messages using
request-reply protocol
RMI System
• Proxy: the local representative of the
remote object.
• Dispatcher: relays a request to the
appropriate skeleton method.
Remote method invocation
• The client hold references to remote objects that
it can invoke methods on.
• These references behave just like local objects,
but when invoked dispatch the method
invocation to the remote object.
34
3. Distributed documents
• information is organized into documents, with
each document residing at a machine
transparently located somewhere in the world.
• Documents contain links that refer to other
documents.
• By following a link, the document to which that
link refers is fetched from its location and
displayed on the user’s screen.
• e.g world wide web
35
4. distributed file systems
• A distributed file system is a subsystem of
distributed system that performs file management
activities where multiple users share files and
storage resources that physically dispersed.
• It is designed to provide abstraction of a storage
device.i.e convenient mechanism for storing and
retrieving information.
36
DFS components
• Service – software entity running on one or more
machines and providing a particular type of
function to a priori unknown clients
• Server – service software running on a single
machine
• Client – process that can invoke a service using a
set of operations that forms its client interface
DFS structure
DFS structure : There are two models
4. Distributed file systems
• In the DFS model communication between
processes is done using shared files.
• Major difference other paradigms and the DFS
paradigm is that the resources (files) in DFS are
much longer lived.
• Clients access files and directories that are provided
by one or more file servers
39
Distributed file systems
• A file server provides a client with a file service
interface and a view of the file system.
• Note that the view provided to different clients by the
same server may be different, for example, if clients
only see files that they are authorized to access.
40
Distributed file systems
• Access to files is achieved by clients
performing operations (such as create,
delete, read, write, etc.) from the file service
interface on a file server.
• Depending on the implementation the
operations may be executed by the servers
on the actual files, or by the client on local
copies Of the file.
41
Features of a good DFS
1.Flexible:
• It must be possible to add or replace file servers.
• A DFS should also support multiple underlying file
system types (e.g., various Unix file systems, various
Windows file systems, etc.)
42
Features of a good DFS
1.provides transparency – e.g structure transparency,
access, naming, replication transparency
2. user mobility – user should have the flexibility to work
on different times
3. Scalability -a dfs should be designed to easily cope
with growth of nodes and users in the system
Features of a good DFS
4. Simplicity and ease of use
The semantics of a distributed file System
should be easy to understand and the user interface
to the file system should be simple.
5. High performance:
Time of accessing secondary devices and cpu
processing time should be minimal.
Time needed to satisfy clients requests in dfs should
be comparable to that of a centralized file system.
DFS services
Distributed file system typically provides
three types of services.
1.Storage service- allocating and managing
of space on a secondary storage device
that is used for storage of file system
2. True file service- concerned with the
operations on individual files such as
operations for accessing and modifying
data in files and creating and deleting files
Distributed file systems services
Name service
- provides a mapping between text names for file
and references to files that is file Ids
- Most file systems use directories to perform
this mapping.
File models
Different file systems use different conceptual
Models of a file.
There are two types of file models.
1. Unstructured files
2. structured files.
3. mutable files
4. immutable files
1. Unstructured files
• In this model, the content of each file of the file
System appears to the file server as a uninterrupted
sequence of bytes
• The operating system is not interested in the
information stored in the files.
• It is only the application programs that interrupt
• The data stored in the files.
structured files
• In this model, a file appears to the file server as an
ordered sequence of records.
• records of different files of the same file system can
be of different size.
• In this model, a record is the smallest unit of file data
can be accessed.
Immutable files
• A file cannot be modified once it has been created exce
to be deleted.
• They are easy to support consistent sharing.
Mutable files
• an update performed on a file overwrites its old contents
to produce the new contents
Take away
• Discuss the following topics max (7pgs):
• Distributed Computing Environment (DCE)
• Distributed objects
• CORBA
• Process Migration
• Kerberos