Comparison of RPC and HTTP communication protocols

Source: Internet
Author: User
Tags versions xml rpc server
comparison of RPC and HTTP communication protocols


Before we start discussing this topic, let's get to know the traditional development model.

Seven-layer model of OSI network structure

The specific descriptions of the layers are as follows:

Layer Seventh: The application layer defines the interface-user program for communication and data transmission in the network, and provides standard services such as virtual terminals, files, and the transfer and processing of tasks;
Layer Sixth: The presentation layer masks the differences in data formats between different systems; Specifies data transmission format of independent structure; encoding and decoding of information; encryption and decryption; compression and decompression
Layer Fifth: The session layer manages user sessions and dialogs, controls the creation and disconnection of logical connections between users, and reports the errors that occurred on the previous layer
Layer Fourth: Transport Layer Management Network end-to-end information transmission, through error correction and flow control mechanism to provide reliable and orderly packet transmission, provide for the transmission of non-connected packets;
Layer Three: The network layer defines how data is transferred between network devices, routes packets based on unique network device addresses, and provides flow and congestion control to prevent loss of network resources
The second layer: The Data Link layer defines the program that operates the communication connection; encapsulates the packet as a data frame; monitors and corrects packet transmission errors
First layer: The physical layer defines the physical way to send data over a network device, as an interface between the network medium and the device, and defines the optical, electrical, and mechanical properties.

In the above 7 layers, the HTTP protocol is the application layer protocol. The HTTP protocol is the abbreviation for the Hypertext Transfer Protocol (hypertext Transfer Protocol), which is the basis for the World Wide Web ("A worldwide Wide web,www, or a Web"). The HTTP protocol was designed to implement the idea of the Web. The HTTP protocol is located in the application layer of the TCP/IP protocol stack. The information exchange process of the client/server model based on the HTTP protocol is divided into four processes: establishing a connection, sending a request message, sending a response message, and closing a connection.

The basic concepts of RPC are described below:

Original meaning: Remote Procedure call Protocol
Chinese explanation: (RFC-1831) FAR process call protocol
Note: A protocol that requests services from a remote computer program over a network without needing to know the underlying network technology. The RPC protocol assumes that some transport protocols exist, such as TCP or UDP, to carry information data between communication programs. In the OSI network communication model, RPC spans the transport and application tiers. RPC makes it easier to develop applications that include distributed, multi-program networks.
RPC takes client/server mode. The requestor is a client, and the service provider is a server. First, the calling process sends a call message with a process parameter to the service process, and then waits for the reply message. On the server side, the process stays asleep until the call information arrives. When a call arrives, the server obtains the process parameters, evaluates the result, sends a reply message, and then waits for the next invocation information, and finally, the client calls the procedure to receive the reply information, obtains the process result, and then invokes execution to proceed.
The RPC information protocol consists of two different structures: invocation information and reply information.

The links between the two are:

RPC over HTTP

Microsoft rpc-over-http Deployment (RPC over HTTP) allows RPC clients to securely and efficiently connect to the RPC server program over the Internet and perform remote procedure calls. This is done with the help of a middleware called the rpc-over-http agent, or simply RPC Proxy.

The RPC agent runs on the IIS computer. It accepts RPC requests from the Internet, performs authentication, validation, and access checks on these requests, and if the request passes all tests, the RPC proxy forwards the request to the RPC server that performs the actual processing. The RPC over HTTP,RPC client does not communicate directly with the server, and they use the RPC proxy as the middleware.

About XML-RPC

1.1. Introduction to XML RPC
XML RPC is an RPC mechanism that uses the HTTP protocol as a transport protocol to transfer commands and data in the form of XML literals.
An RPC system, which must consist of 2 parts: 1.rpc client, used to call the method to the RPC server and receive the return data of the method, 2.rpc server, which responds to the RPC client request, executes the method, and echoes the method execution result.

1.2. Available versions of XML RPC
Both the XML RPC client and the XML RPC server have many versions of the implementation. In general, an implementation version will implement client/server at the same time. However, because both satisfy the XML RPC specification, in theory, any version of the RPC client implementation and any one version of RPC server can be used as a companion.
Further, because XML RPC is transmitted as XML text using the HTTP protocol, it is not related to programming languages. For example, an implemented version of the RPC client includes: Perl,php,python,c/c++,java, and so on; the implementation language for RPC server includes Perl,java, and so on.
There are also more than one version implemented in the same programming language. For example, the Java version of the implementation is: Marque XMLRPC implementation (http://xmlrpc.sourceforge.net/), Apache XMLRPC Implementation (http://ws.apache.org/xmlrpc/)

The

1.3.xmlrpc works  
Complete needs to refer to XMLRPC specification (HTTP://WWW.XMLRPC.COM/SPEC)  
Simple description:  
Rpcclient how it works : Rpcclient the Rpcserver-build command package based on the URL, calls a method of a service on the Rpcserver, receives the return of the Rpcserver, parses the response packet, and takes out the returned result of the call.  
Rpcserver works by starting a webserver (in the case of a built-in webserver), registering each service that you can provide, and entering the service listening state for one handler class, per service.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.