Power RPC Quick Reference - RPC Technologies --- Netbula RPC ONC
Rpc
-
Upload
ram-prakash-reddy -
Category
Technology
-
view
468 -
download
1
Transcript of Rpc
Remote Procedure
Calls
ByP.SAHITHI CHAITANYA (1551210075)
A.RAMPRAKASH REDDY(1551210077)G.V.R.SHASHANK(1551210080)
Introduction Inter-process communication (IPC). Another virtual address space.
Another process on the same machine. Another process on different machine.
Hides remote interaction. Network programming standard 1980s Builds on named pipes or Winsock. Remote Method Invocation (RMI)
How RPC Operates
Cont…. When client code calls a remote
procedure, the client stub code Retrieves the required parameters from the
client address space. Marshals1 the parameters as needed into a
standard NDR2 format for transmission over the network.
Calls functions in the RPC client run-time library to send the request and its parameters to the server.
1 Marshalling (similar to serialization) is the process of transforming the memory representation of an object to a data format suitable for storage or transmission2 Network Data Representation (NDR) is an implementation of the presentation layer in the OSI model.
Cont… The server performs the following steps to
call the remote procedure: The server RPC run-time library functions accept
the request and call the server stub procedure. The server stub retrieves the parameters from
the network buffer and converts (i.e. unmarshals) them from the network transmission format to the format the server needs.
The server stub calls the actual procedure on the server.
Stubs Client stub
Packs parameter into message. Calls : Send & Receive.
Server Stub Calls : Receive & Send. Unpacks parameter from the message.
Details of message passing are hidden – two libraries.
Cont…
Steps1. The client procedure calls the client stub in the normal way. 2. The client stub builds a message and traps to the kernel.3. The kernel sends the message to the remote kernel.4. The remote kernel gives the message to the server stub.5. The server stub unpacks the parameters and calls the server.6. The server does the work and returns the result to the stub.7. The server stub packs it in a message and traps to the kernel.8. The remote kernel sends the message to the clients kernel.9. The client’s kernel gives the message to the client stub.10. The stub unpacks the result and returns to the client.
Parameter Passing
Parameter Marshaling. Ex: Remote procedure “sum( i, j)”.
Identical machines.
Problems - Parameter Passing Different Machine Types
Ex: IBM mainframes (EBCDIC) & IBM PCs(ASCII).
Different representation of Integers (1s compliment & 2s Compliment), Floating point numbers.
Numbering of bytes Right to Left (Ex: Intel 486) – Little Endian. Left to Right (Ex: Sun SPARC) – Big Endian.
Example - 1
Example - 2
Representation of Information Canonical Form
Convert internal representation while marshaling.
Ex: 2’s compliment for integers. 0 for ASCII. 1 for Boolean. IEEE format for floating point no.
Pointer Passing One way is to forbid the pointers & reference parameters in
general. – Highly undesirable One strategy is copying the whole array/structure (simple)
into message. Call by reference is replaced by copy/restore. Optimization – Buffer knows if stub is an input / output
parameter. (Twice as efficient). Pointer is followed (dereferenced) by putting it in the
register. – Highly Inefficient.
Dynamic Binding
Hardwiring network add. of server into client – Extremely Inflexible
To avoid problems like Replication of server Relocation Migration Interface Change
Terms Exports Interface Imports Interface Binder Registering
Unique Id – Typically 32 bit long Handle
System Dependent IP Add. , Ethernet Add. , etc.
Disadvantages
Overhead Exporting & Importing Costs Time Many short lived client process may have to start over
again. Binder may act as bottleneck in distributed system. Registering / Deregistering of interfaces creates more
overhead.
RPC semantics-presence of failures Unable to locate the server Lost request message Lost reply message Server crashes Client crashes
Unable to locate the server When server is down it intimate the value -
1 Client is unable to locate the server
Lost request message Message send from client to server is lost
Lost reply message Reply message from server to client is lost
Server crashes Server crashes after receiving a request Solutions
Atleast one semantic Atmost one semantic Exactly one semantic
Client crashes Client crashes after sending a request Solution is extermination
Protocols for RPCs1. Request protocol2. Request / Reply protocol3. Request /Reply /Acknowledge-Reply
protocol
Request (R) protocolClient Server
First RPC
NextRPC
Request message
Request message Procedureexecution
Procedureexecution
Request / Reply (RR) protocol
Client Server
First RPC
NextRPC
Request message
Request message
Procedureexecution
Procedureexecution
Reply message
Reply message
Also serves as acknowledgement for the request message
Also serves as acknowledgement for the request message
Also serves as acknowledgement for the reply of the previous RPC
Request / Reply / Ack. (RRA) protocol
Client Server
First RPC
NextRPC
Request message
Request message
Procedureexecution
Procedureexecution
Reply message
Reply message
Reply acknowledgement message
Reply acknowledgement message