Upload
others
View
7
Download
0
Embed Size (px)
Citation preview
Imed Bouchrika. Distributed Objects , Uni of Souk-Ahras 2014-2015 http://www.imed.ws
2. Communication Paradigms
Master II – Software Engineering
Imed BouchrikaDept of Mathematics & Computer Science
University of Souk-Ahras
Imed Bouchrika. Distributed Objects, Uni of Souk-Ahras 2014-2015 http://www.imed.ws
Distributed System DefinitionTanenbaum defines a distributed system as:
“a collection of independent computers that
appear to the users of the system as a single
computer”
independent : This means that, architecturally, the
machines are capable of operating independently.
single computer : The second point is that the software
enables this set of connected machines to appear as a
single computer to the users of the system.
2
Imed Bouchrika. Distributed Objects, Uni of Souk-Ahras 2014-2015 http://www.imed.ws
Distributed System :The figure below shows a simple distributed systems for a number of
applications running through different operating system
The middleware takes responsibility for the heterogeneity of the
communications.
3
Imed Bouchrika. Distributed Objects, Uni of Souk-Ahras 2014-2015 http://www.imed.ws
Communication
Communication :
is the activity of conveying or sending information through
the exchange of ideas, commands or ... as by speech, non-
verbal gestures, writings ,,, between two or more
participants
4
Imed Bouchrika. Distributed Objects, Uni of Souk-Ahras 2014-2015 http://www.imed.ws
Few Questions
What are the entities ( Participants ) that are communicating ?
How do these entities communicate, or what Communication
Paradigm is used?
What Roles and responsibilities do these entities have in the overall
architecture?
How are these entities mapped on to the physical distributed
infrastructure (what is their placement)?
5
Imed Bouchrika. Distributed Objects, Uni of Souk-Ahras 2014-2015 http://www.imed.ws
Who : Communication Entities
Processes
an executing instance of a computer program
Threads
“Lightweight Process” running within a process
Distributed Objects
An instance of a class that can be invoked at a distance
Components
A unit of functionality providing a service published through
an interface. Components are housed into a container.
Web Services.
6
Imed Bouchrika. Distributed Objects, Uni of Souk-Ahras 2014-2015 http://www.imed.ws
Communication Entities
Distributed Objects :
Introduced to enable and encourage the use of object-
oriented approaches (OOP) in distributed systems
Decomposition for the given problem domain so that
Computation can be made through a number of interacting
objects.
Objects are accessed via interfaces, with an associated
interface definition language providing a specification of the
methods defined on an object
7
Imed Bouchrika. Distributed Objects, Uni of Souk-Ahras 2014-2015 http://www.imed.ws
Communication Entities
Software Components:
Introduced to enable and encourage the use of object-
oriented approaches in distributed systems
Computation consists of a number of interacting objects
representing natural units of decomposition for the given
problem domain
objects are accessed via interfaces, with an associated
interface definition language providing a specification of the
methods defined on an object
8
Imed Bouchrika. Distributed Objects, Uni of Souk-Ahras 2014-2015 http://www.imed.ws
Communication Entities
Web Services:
Introduced to enable and encourage the use of object-
oriented approaches in distributed systems
Computation consists of a number of interacting objects
representing natural units of decomposition for the given
problem domain
objects are accessed via interfaces, with an associated
interface definition language providing a specification of the
methods defined on an object
9
Imed Bouchrika. Distributed Objects, Uni of Souk-Ahras 2014-2015 http://www.imed.ws
How : Communication Paradigms
Inter-Process communication
Remote Invocation
Indirect Communication
10
Imed Bouchrika. Distributed Objects, Uni of Souk-Ahras 2014-2015 http://www.imed.ws
How : Communication Paradigms
Other Classifications of Paradigms :
Remote procedure call
Message-oriented communication
Stream-oriented communication
Software-based distributed shared memory
11
Imed Bouchrika. Distributed Objects, Uni of Souk-Ahras 2014-2015 http://www.imed.ws
Communication Paradigms
Inter-Process communication
Communication between processes is based on low-level
support provided by the OS in the distributed system
including:File
Sockets
Piping
Signals
Shared Memory
....12
Imed Bouchrika. Distributed Objects, Uni of Souk-Ahras 2014-2015 http://www.imed.ws
Communication Paradigms
Remote Invocation
Remote Procedure Call ( RPC )
Is a way of communication in which a computer program
can invoke a subroutine or function
To execute on a remote machine and returns the results
to the invoker if any.
The programmer usually write the same code as for the
local case
whilst all the complexity is hidden and managed by the
middleware
13
Imed Bouchrika. Distributed Objects, Uni of Souk-Ahras 2014-2015 http://www.imed.ws
Communication Paradigms
indirect communication
This is through a third entity, allowing a strong degree of
decoupling between senders and receivers, in particular:
Space decoupling : senders do not need to know who they are
sending to
Time Decoupling : senders and receivers do not need to exist
at the same time
14
Imed Bouchrika. Distributed Objects, Uni of Souk-Ahras 2014-2015 http://www.imed.ws
Communication Paradigms
indirect communication
Message-Based PassingMessage-Queues
Synchronous vs Asynchronous
Transient vs PersistentExample : JMS
Distributed Shared Memory
A form of memory architecture where physically separate
memories can be addressed as virtually one memory.Example: OpenSSI: Allows a collection of computers to be treated
as one large system.
Publish-Subscribe Systems
15
Imed Bouchrika. Distributed Objects, Uni of Souk-Ahras 2014-2015 http://www.imed.ws
Roles : Client-Server
2 architectural styles stemming from the role of
individual processes
Client-server
Peer-to-Peer
16
Imed Bouchrika. Distributed Objects, Uni of Souk-Ahras 2014-2015 http://www.imed.ws
Client-Server
Processes divided into two groups:
Server: process implementing a specific service
(file system service, database service, ...)
Client: process that requests a service from a
server by sending it a request and subsequently
waiting for the server’s reply
17
Imed Bouchrika. Distributed Objects, Uni of Souk-Ahras 2014-2015 http://www.imed.ws
Client-Server
Request-reply protocol
18
Imed Bouchrika. Distributed Objects, Uni of Souk-Ahras 2014-2015 http://www.imed.ws
Client-Server
The client can be either Thin or Thick client.
Thin client is designed so that
The amount of client software should be small
The bulk of processing takes place on the servers.
Because the software requirements are minimal, less
hardware is needed to run the software.
There is no need for much administration, expansion
slots and maintenance.
Examples : X terminal or Web Browser-based websites.
19
Imed Bouchrika. Distributed Objects, Uni of Souk-Ahras 2014-2015 http://www.imed.ws
Client-Server
The client can be either Thin or Thick client.
Thick client (or fat client )
performs the bulk of data processing operations.
A server may perform rather rudimentary (primitive) or
simple tasks such as storing and retrieving data.
20
Imed Bouchrika. Distributed Objects, Uni of Souk-Ahras 2014-2015 http://www.imed.ws
Client-Server
Request-reply protocol
Requests are sent in messages from clients to a server
When a client sends a request for an operation to be
carried out
Replies are sent in messages from the server to the clients
21
Imed Bouchrika. Distributed Objects, Uni of Souk-Ahras 2014-2015 http://www.imed.ws
Client-Server
A process can be both a client and a server, since
servers sometimes invoke operations on other servers
The terms “client” and “server” apply only to the roles
played in a single Request
But in general they are distinct concepts:
Clients are active and server are passive
Server run continuously, whereas clients last only as
long as the applications of which they form a part
22
Imed Bouchrika. Distributed Objects, Uni of Souk-Ahras 2014-2015 http://www.imed.ws
Client-Server
Multi-tier architecture (n-tier architecture)
Client–server architecture in which
Presentation,
Application processing
( Business Logic )
Data management functions
are logically separated.
23
Imed Bouchrika. Distributed Objects, Uni of Souk-Ahras 2014-2015 http://www.imed.ws
Peer 2 Peer
24
Imed Bouchrika. Distributed Objects, Uni of Souk-Ahras 2014-2015 http://www.imed.ws
Peer 2 Peer
All the processes involved in a task or activity play similar
roles,
Peers do interact cooperatively without any distinction between
client and server processes or the computers that they run on
All peers run the same program and offer the same set of
interfaces to each other.
The aim of the P2P architecture is to exploit the resources
(both data and hardware) in a large number of participating
computers for the fulfilment of a given task or activity
25
Imed Bouchrika. Distributed Objects, Uni of Souk-Ahras 2014-2015 http://www.imed.ws
Peer 2 Peer
Examples for Peer 2 Peer Applications.
Napster ?
Torrents
Mule ...
26
Imed Bouchrika. Distributed Objects , Uni of Souk-Ahras 2014-2015 http://www.imed.ws
Group Chat using Sockets
Master II – Software Engineering
Imed BouchrikaDept of Mathematics & Computer Science
University of Souk-Ahras
Imed Bouchrika. Distributed Objects, Uni of Souk-Ahras 2014-2015 http://www.imed.ws
Chat Server
28