Invocación remota

Anuncio
FUNDAMENTOS DE SISTEMAS DISTRIBUIDOS
Departament d’Arquitectura de Computadors
Invocación remota
(based on M. L. Liu Distributed Computing -- Concepts and Application
http://www.csc.calpoly.edu/~mliu/book/index.html)
Local Objects vs. Distributed Objects
Local objects are those whose methods can only be invoked by a
local process, a process that runs on the same computer on
which the object exists.
o A distributed object is one whose methods can be invoked by a
remote process, a process running on a computer connected via
a network to the computer on which the object exists.
o
v.2004.09
FUNDAMENTOS DE SISTEMAS DISTRIBUIDOS
Departament d’Arquitectura de Computadors - UPC
2
2.1
The Distributed Object Paradigm
In a distributed object paradigm, network resources are represented by distributed objects.
To request service from a network resource, a process invokes one of its operations or
methods, passing data as parameters to the method. The method is executed on the
remote host, and the response is sent back to the requesting process as a return value.
Host A
Host B
client process
method call
object state data item
object operation
a distributed object
FUNDAMENTOS DE SISTEMAS DISTRIBUIDOS
Departament d’Arquitectura de Computadors - UPC
v.2004.09
3
An Archetypal Distributed Objects System
object
registry
object client
object server
client
proxy
server
proxy
runtime
support
runtime
support
network
support
network
support
physical data path
logical data path
v.2004.09
FUNDAMENTOS DE SISTEMAS DISTRIBUIDOS
Departament d’Arquitectura de Computadors - UPC
4
2.2
Local Procedure Call and Remote Procedure Call
host A
proc1
execution flow
proc2
A local procedure call
host B
host A
1. proc1 on host A makes a call
to proc 2 on host B.
2. The runtime support maps
the call to a call to the proxy
on host A.
3. The proxy marshalls the data
and makes an IPC call to a
proxy on host B.
7. The proxy received the return
value, unmarshalls the data,
and forwards the return value
to proc1, which resumes its
execution flow.
proc1
proc2
proxy
proxy
4. The proxy on host B
unmarshalls the data
received and issues a
call to proc2.
5. The code in proc2 i s
executed and returns
to the proxy on host B.
6. The proxy marshalls
the return value and
makes an IPC call to
the proxy on host A.
A remote procedure call
(the return execution path is not shown)
FUNDAMENTOS DE SISTEMAS DISTRIBUIDOS
Departament d’Arquitectura de Computadors - UPC
v.2004.09
5
Remote Procedure Calls (RPC) - 2
o
o
Since its introduction in the early 1980s, the Remote
Procedure Call model has been widely in use in network
applications.
There are two prevalent APIs for this paradigm.
– the Open Network Computing Remote Procedure Call, evolved from
the RPC API originated from Sun Microsystems in the early 1980s.
– The other well-known API is the Open Group Distributed Computing
Environment (DCE) RPC.
o
Both APIs provide a tool, rpcgen, for transforming remote
procedure calls to local procedure calls to the stub.
v.2004.09
FUNDAMENTOS DE SISTEMAS DISTRIBUIDOS
Departament d’Arquitectura de Computadors - UPC
6
2.3
The Java RMI Architecture
Directory service
object
client
object
server
supports the interface with
the application program
maps the platform-independent stub/skeleton
layer to the platform-dependent transport
layer; carries out remote reference protocols
stub
skeleton
remote reference layer
remote reference layer
transport layer
transport layer
sets up, maintains, and shuts down
connections; and carries out the
transport protocol
logical data path
physical data path
FUNDAMENTOS DE SISTEMAS DISTRIBUIDOS
Departament d’Arquitectura de Computadors - UPC
v.2004.09
7
CORBA: The Basic Architecture
naming
lookup
naming service
object client
object
implementation
stub
skeleton
ORB
ORB
network
network
operating
system
operating
system
logical data flow
physical data flow
v.2004.09
FUNDAMENTOS DE SISTEMAS DISTRIBUIDOS
Departament d’Arquitectura de Computadors - UPC
8
2.4
SOAP: Remote Procedure Call using HTTP
service
object
web
server
method name,
parameter list
return value
web
client
HTTP request
HTTP response
FUNDAMENTOS DE SISTEMAS DISTRIBUIDOS
Departament d’Arquitectura de Computadors - UPC
v.2004.09
9
SOAP Messages
SOAP envelope
header block
optional
SOAP header
header block
message body
v.2004.09
required
SOAP body
FUNDAMENTOS DE SISTEMAS DISTRIBUIDOS
Departament d’Arquitectura de Computadors - UPC
10
2.5
Descargar