ArticleDirectory
My Sina Weibo:Http://weibo.com/freshairbrucewoo.
You are welcome to exchange ideas and improve your technology together.
I. RPC overview section 1. RPC Structured Network
RPC(Remote Procedure Call Protocol) -- Remote process call protocol, which is a type of Remote ComputerProgramRequest the service, without understanding the protocol of the underlying network technology.RPCThe Protocol assumes the existence of certain transmission protocols, suchTCPOrUDPTo carry information data between communication programs. InOSIIn the network communication model,RPCIt spans the transport layer and application layer.RPCThis makes it easier to develop applications, including distributed network applications.
RPCUse Client/Server mode. A request is a client, and a service provider is a server. First, the client calls the process to send a call information with process parameters to the service process, and then waits for the response information. On the server side, the process remains asleep until the call information reaches. When a call Information arrives, the server obtains the process parameters, calculates the results, sends the reply information, and waits for the next call Information. Finally, the client calls the process to receive the reply information and obtain the process results, then, call and execute to continue.
Currently, there are multipleRPCMode and execution. Originally createdSunProposed by the company.IETF oncCharter revisedSunVersion to makeONC RPCProtocol becomesIETFStandard protocol. Nowadays, the most common mode and execution are the distributed computing environment based on open software (DCE).
Section II. Protocol Structure
Remote Procedure Call (RPCThe Information Protocol consists of two different structures: Call information and reply information. The information process is as follows:
RPC: Remote process call Process
RPCCall information: Each Remote Procedure Call information includes the following unsigned integer fields to identify the Remote Procedure independently:
Program No (Program number)
Program version number (Program version number)
Process number (Procedure Number)
RPCThe caller information is in the following format:
Struct call_body {
Unsigned int rpcvers;
Unsigned int prog;
Unsigned int vers;
Unsigned int proc;
Opaque_auth cred;
Opaque_auth Verf;
1 parameter
2 parameter ...};
RPCResponse Information:RPCThe change in Protocol reply information depends on whether the network server receives or rejects the call Information. The reply request includes information that distinguishes the following situations:
RPCCall information is successfully executed..
RPCRemote implementation is not the second version of the protocol.RPCSupported minimum and maximum versions.
In a remote system, remote programs are unavailable.
The remote program does not support the requested version number. Returns the minimum and maximum versions supported by the remote program.
The request process number does not exist. Usually the caller protocol or program error.
RPCThe reply information is as follows:
Enum reply_stat stat
{Msg_accepted = 0,
Msg_denied = 1};
Section 3. Working Principles
Runtime,One client-to-ServerRPCCall,The internal operations are roughly as follows:
1.Call the client handle and execute the transfer parameters.
2.Call the local system kernel to send network messages
3.Send messages to a remote host
4.The server handle obtains the message and obtains parameters.
5.Execute Remote Process
6.The execution process returns the result to the server handle.
7.The server handle returns the result and calls the remote system kernel.
8.Message returned to local host
9.The client handle receives messages from the kernel.
10.The customer receives the data returned by the handle.
Section 4 RPC over HTTP
Microsoft RPC-over-HTTPDeployment(RPC over HTTP)AllowRPCThe client securely and effectively passesInternetConnectRPCServer program and execute remote process call. This is inRPC-over-HTTPProxy, or for shortRPCProxy Middleware.
RPC the Agent runs on IIS Computer. It accepts Internet RPC requests, perform authentication, verification, and access check on these requests. If the request passes all tests, RPC the proxy forwards the request to the RPC Server. RPC over HTTP , RPC the client does not communicate with the server directly, they use the RPC proxy as the middleware.