Presentation is loading. Please wait.

Presentation is loading. Please wait.

03 – Remote invoaction Request-reply RPC RMI Coulouris 5

Similar presentations


Presentation on theme: "03 – Remote invoaction Request-reply RPC RMI Coulouris 5"— Presentation transcript:

1 03 – Remote invoaction Request-reply RPC RMI Coulouris 5
Birrel_Nelson_84.pdf

2 Remote invocation, indirect communication
Mechanisms for process communication on a DS Built on top of interprocess communication primitives Lower level Provided by the OS Applications This chapter Remote invocation, indirect communication Middleware layers Underlying interprocess communication primitives: sockets, message passing, multicast support, overlay networks UDP and TCP

3 Request Reply Protocols
Support client-server interaction Usually synchronous Client blocks until reply is received Reliable (reply is an acknowledge) May use UDP datagram instead of TCP streams TCP knowledge is redundant Connection establishing requires extra messages Flow control is redundant for some uses Which pass only small arguments and results

4 Request Reply Protocols
Communication primitives doOperation getRequest sendReply Client Server Request doOperation getRequest message select object (wait) execute method Reply sendReply message (continuation)

5 Request Reply Protocols
doOperation Sends request to the remote server Arguments Server remote reference Operation id Returns reply send (TCP), sendto (UDP)

6 Request Reply Protocols
getRequest Blocking function / waits for request Returns request data sendReply Sends response to client Arguments Reply Client id send (TCP), sendto (UDP)

7 Request Reply Protocols
MessageType int (0=Request, 1= Reply) requestId int remoteReference RemoteRef operationID int or Operation arguments array of bytes Message identifier RequestId increasing sequence of integers (per sending process) RemoteReference Identification of the process (IP address, port, process id)

8 Request Reply Protocols
Failure model (UDP) Omission failures Delivery order not guaranteed Timeouts doOperation can Repeats transmission of message

9 Request Reply Protocols
Duplicate messages After time-outs Protocols must recognize them Reception of duplicate request Ignore second repetitions Implement idepotent operation History required

10 Request Reply Protocols
Exchange protocols R (request) Online request is sent No need for response Client may unblock imediatly RR (request-reply) Special ACK message not required Implemented by the response Subsequent Request is Acknowledgment of the reply Exchange protocols RRA (request-reply- ack) Explicit ack of the reply Server can clean history TCP simplifies protocol Larger messages Acknowledgements not necessary

11 Remote Procedure Call Request Reply protocols
Not transparent (w.r.t. distribution) Local invocation ≠ remote invocation Extends procedure call abstraction RPCs are called as if in local address space RPC system hides Distribution Encoding/decoding of parameters/reply Passing of messages Semantics of call

12 Remote Procedure Call Interfaces
RPCs should mimic programming language structures Modules/ libraries / classes Function/procedures/methods Use the concept of interface A set of well defined ointeraction points Encapsulate implementation details Service interfaces Set of procedures offered by a server Defining parameters and return values (and types)

13 Remote Procedure Call Interfaces
Provide/implement good programming practices Implementation are hidden from the programmer Server programming language /architecture is hidden SW evolution is possible Distribution imposes Impossible access to remote variables Call by reference not suitable Input parameters: client → server transfer Output parameters client ← server transfer Addresses in one process are not valid on another Addresses can not be passed

14 Remote Procedure Call Interface Definition Languages
Static languages require the a priori declaration of functions and types Publication of a service requires its description Interface Definition Languages (IDL) allow: Specification of interfaces Communication of interfaces Production of .c/.h files Examples SUN XDR, CORBA IDL Webservices WSDL Java interfaces

15 Remote Procedure Call RPC call semantics
DoOperation can be implemented differently Retry request message Are retries made until reply is received? Duplicate filtering What happens when server receives duplicate message Retransmission of results Is history kept to prevent re-execution of operations?

16 Remote Procedure Call RPC call semantics
Fault tolerance measures Retransmit request message Duplicate filtering Re-execute procedure or retransmit reply Maybe No Not Applicable No fault tolerance measures applied Omission failures (message lost), crash failures (server fails) At-least-once Yes Re-execute procedure Invoker receives a result (code was executed at least once) or an exception (result was not received) Retransmission of requests Crash failures (server fails), arbitrary failures (requests are retransmitted, procedure may be executed more than once) At-most-once Retransmit reply Invoker receives a result (code was executed once) or an exception (result was not received, but code not executed or executed once)

17 Remote Procedure Call Transparency
Minimum requirement RPC tries to hide differences from local/remote procedure call Syntax is similar Data marshaling and retransmission is hidden However RPC are more vulnerable to failure Involve network, other computer, other process Code should be able to recover RPC latency is higher Parameter passing is different

18 Remote Procedure Call Implementation
client process server process Request Reply client stub procedure server stub procedure client program service procedure Communication module Communication module dispatcher Generated automatically Stubs Marshal arguments /return values Dispatcher Redirects call General Communication module Hand coded Client program Service procedure

19 Remote Method Invocation
Extends RPC to the OO world RPC and RMI Support programming with interfaces Built on top of Request-reply protocols Offer similar semantics Offer similar level of transparency RMI Use OO mechanisms Object, classes inheritance, OO development methods/tools Provide concept of object identity All objects have references (local or remote) That can be globally accessed

20 Remote Method Invocation Implementation
Proxy Dispatcher Skeleton Static Generation IDL+compiler (Similar to SUN RPC) Dynamic invocation Language support for reflection method interception (client) Dynamic code loading

21 Remote Method Invocation Execution
Server/client programs Binder/ns Process that provides object reference from textual name Server threads In order to allow concurrent method execution Requires synchronization Activation When are objects killed?


Download ppt "03 – Remote invoaction Request-reply RPC RMI Coulouris 5"

Similar presentations


Ads by Google