Presentation is loading. Please wait.

Presentation is loading. Please wait.

Outcomes What is RPC? The difference between conventional procedure call and RPC? Understand the function of client and server stubs How many steps could.

Similar presentations


Presentation on theme: "Outcomes What is RPC? The difference between conventional procedure call and RPC? Understand the function of client and server stubs How many steps could."— Presentation transcript:

1 Outcomes What is RPC? The difference between conventional procedure call and RPC? Understand the function of client and server stubs How many steps could happen for a RPC? How RPC deals with the parameter passing? How to write a client and server using DCE RPC?

2 RPC - Conventional Procedure Call
Parameter passing in a local procedure call: the stack before the call to read (fd, buf, nbytes) The stack while the called procedure is active

3 Definition of Remote Procedure Call
Principle of RPC between a client and server program. When a process on machine A calls a procedure on machine B, the calling process on A is suspended, and execution of the called procedure takes place on B. Information can be transported from the caller to the callee in the parameters and can come back in the procedure result. No message passing at all is visible to the programmer. This method is known as Remote Procedure Call.

4 Client and Server Stubs
2-8 Steps involved in doing remote computation through RPC The function of stub is that, instead of asking operating to give it data, it packs the parameters into message and requests the message to be sent to the server. After client stub calls send, it calls receive, block itself until the reply comes back.

5 Steps of a Remote Procedure Call
Client procedure calls client stub in normal way Client stub builds message, calls local OS Client's OS sends message to remote OS Remote OS gives message to server stub Server stub unpacks parameters, calls server Server does work, returns result to the stub Server stub packs it in message, calls local OS Server's OS sends message to client's OS Client's OS gives message to client stub Stub unpacks result, returns to client

6 Passing Reference Parameters
Passing the reference parameter is very difficult: read(fd, buf, nbytes) example One solution is to forbid pointers and reference parameters in general. Strategy : In read example, the client stub knows the buf points to an array and the array length. Client stub copies the array into message and send it to the server Server stub call the server with a pointer to this array When server (procedure) finishes, the original message can be sent back to the client stub Client stub copies buf back to the client (procedure).

7 Parameter Specification and Stub Generation
Hiding a RPC requires C-S agree on the format of the messages they exchange In this example, both S stub and C stub should knows the format of foobar RPC protocols should contains all agreements such as transfer protocols and message format, etc. Different procedure has different interface to the applications. It should be defined by IDL (interface define Language. A procedure The corresponding message.

8 Writing a Client and a Server
2-14 The steps in writing a client and a server in DCE RPC.

9 Binding a Client to a Server
2-15 Client-to-server binding in DCE. To allow a client to call a server, the server must be registered first The steps to locate the server and bind to it: Locate the server’s machine Locate the server (i.e. the correct process) on that machine


Download ppt "Outcomes What is RPC? The difference between conventional procedure call and RPC? Understand the function of client and server stubs How many steps could."

Similar presentations


Ads by Google