ArtsAutosBooksBusinessEducationEntertainmentFamilyFashionFoodGamesGenderHealthHolidaysHomeHubPagesPersonal FinancePetsPoliticsReligionSportsTechnologyTravel

Remote Procedure Calls (RPC)

Updated on December 21, 2010

Distributed Operating System:: RPC (REMOTE PROCDURE CALL)

No message passing at all is visible to the programmer. This method is known as Remote Procedure Call, or often just RPC

The RPC mechanism is an extension of a normal procedure call mechanism.

The RPC model is used for transfer of control and data within a program

The caller (also known as the client process) sends a call (request) message to the callee (also known as the server process) and waits (blocks) for a reply message.

A major issue in the design of an RPC facility is its transparency property

Syntactic Transparency: A remote procedure call should have the same syntax as a local procedure call, which is not very difficult to achieve.

Semantic Transparency: Semantics of remote procedure calls are identical to those of local procedure calls.

Unlike local procedure calls, the called procedure is executed in an address space that is disjoint from the calling program’s address space.

– called procedure has no access to the local environment.

– Passing addresses (pointers) as arguments is meaningless.

– So, passing pointers as parameters is not attractive. An alternative may be to send a copy of the value pointed.

– Call by reference can be replaced by copy in/copy out but at the cost of slightly different semantics.

Remote procedure calls are more vulnerable to failure than local procedure calls

– Programs that make use of RPC must have the capability to handle this type of error.

– This makes it more difficult to make RPCs transparent.

RPCs consume much more time (100 to 1000 times) than local procedure calls due to the involvement of communication network.

So, achieving semantic transparency is not easy.

To achieve the goal of semantic transparency, the implementation of RPC is based on the concept of stubs

Stubs provide a perfectly normal local procedure call abstraction.

To hide the existence of functional details of the underlying network, an RPC communication package (called RPC runtime) is used in both the client and server sides.

implementation of an RPC mechanism involves the following five elements:

1. The Client

2. The Client stub

3. The RPC Runtime

4. The server stub, and

5. The server

Client: To invoke a remote procedure, a client makes a perfectly local call that invokes the corresponding procedure in the stub

Client Stub: The client stub is responsible for performing the following tasks:

· On receipt of a call request from the client, it packs the specification of the target procedure and the arguments into a message and asks the local runtime system to send it to the server stub.

· On receipt of the result of procedure execution, it unpacks the result and passes it to the client.

RPCRuntime: The RPC runtime handles the transmission of the messages across the network between client and server machines. It is responsible for retransmissions, acknowledgements, and encryption.

· On the client side, it receives the call request from the client stub and sends it to the server machine. It also receives reply message (result of procedure execution) from the server machine and passes it to the client stub.

· On the server side, it receives the results of the procedure execution from the server stub and sends it to the client machine. It also receives the request message from the client machine and passes it to the server stub.

Server Stub: The functions of server stub are similar to that of the client stub. It performs the following two tasks:

  • The server stub unpacks the call receipt messages from local RPCRuntime and makes a perfect local call to invoke the appropriate procedure in the server.
  • The server stub packs the results of the procedure execution received from server, and asks the local RPCRuntime to send it to the client stub.

Server: On receiving the call request from the server stub, the server executes the appropriate procedure and returns the result to the server stub.

Manual Stub Generation: RPC implementer provides a set of translation functions from which user can construct his own stubs. It is simple to implement and can handle complex parameters.

Automatic Stub Generation: This is the most commonly used technique for stub generation. It uses an Interface Definition Language (IDL), for defining the interface between the client and server.

An interface definition also contains information to indicate whether each argument is an input, output or both.

A server program that implements procedures in an interface is said to export the interface. A client program that calls the procedures is said to import the interface.

The interface definition is processed using an IDL compiler (the IDL compiler in Sun RPC is called rpcgen) to generate components that can be combined with both client and server programs, without making changes to the existing compilers.

The client stubs are compiled and linked with the client program and the server stubs are compiled and linked with server program.

Any remote procedure call involves a client process and a server process that are possibly located on different computers.

Call messages sent by the client to server for requesting execution of particular remote procedure.

Reply messages sent by the server to the client for returning the result.

The transfer of message data between two computers requires encoding and decoding of message data. In case of RPCs this operation is known as Marshalling

The marshalling process must reflect the structure of all types of program objects used in the concerned language.

Server Implementation: Based on the style of implementation used servers may be of two types: Stateful and Stateless.

A stateful server maintains client’s state information from one remote procedure call to the next.

Open (filename, mode): used to open filename in specified mode. When the server executes this operation, it creates an entry for this file in a file-table that is used for maintaining state information.

Read (fid, n, buffer): This operation returns n bytes of file data starting from the byte currently addressed by the read-write pointer and then increments the pointer by n.

Write (fid, n, buffer): The server takes n bytes of data from the buffer and writes to the file identified by the read-write pointer.

Seek (fid, position): causes to change the value of the read pointer.

Close (fid): causes the server to delete the file state information from the file-table.

Stateless Server: A stateless server does not maintain any client state information. So every request must accompany with all the necessary parameters.

Read (filename, position, n, buffer): Read n bytes from the file from position.

Write (filename, position, n, buffer): Write n bytes from buffer to file starting at position.

Merits of a stateful server: A stateful server provides an easier programming paradigm. It is typically more efficient than stateless servers.

Demerits of stateful server: If the server crashes and restarts, the state information it was holding may be lost and the client may produce inconsistent results. If the client process crashes and restarts, the server will have inconsistent information about the client.

Instance-per-call-servers: They exist only for the duration of a single call

Call-by-Value: All parameters are copied into a message that is transmitted.

This is possible only in a distributed shared memory system. it is also possible in object-based systems, because in this case client needs to pass the names of objects, which are like reference. In object-based systems it is called call-by-object-reference.

To avoid many remote references, another parameter-passing mode, called call-by-move was proposed

The Request Protocol: Also known as the R protocol. It is useful for RPCs in which the called procedure has nothing to return and the client does not require confirmation for the procedure having been executed. An RPC protocol that uses R protocol is also called asynchronous RPC.

Request/Reply Protocol (RR protocol): It is a basic idea to eliminate acknowledgements.

The Request/Reply/Acknowledge-Reply Protocol (RRA): It is useful for the design of systems involving simple RPCs. The server needs to keep a copy of the reply only until it receives the acknowledgement for reply from client

Broadcasting: A broadcast message is sent to locate the server. The first server responding to this message is used by the client. OK for small networks.

Binding Agent: A binding agent is basically a name server used to bind a client to a server by providing information about the desired server.

Binding at Link Time: A server exports its service by registering with the binding agent as part of the initialization process

Binding at Call Time: A client is bound to a server at the time when it calls the server for the first time during execution.

Indirect Call Method: When a client calls the server for the first time, it passes the server’s interface name and the arguments of the RPC call to the binding agent

The encryption techniques provide protection from eavesdropping and detect attempts at modifications, replay, or creation of calls.


    0 of 8192 characters used
    Post Comment

    • profile image


      3 years ago

      Because here is a list of multiplayer games is that the leave was asked ddcgakbegdga


    This website uses cookies

    As a user in the EEA, your approval is needed on a few things. To provide a better website experience, uses cookies (and other similar technologies) and may collect, process, and share personal data. Please choose which areas of our service you consent to our doing so.

    For more information on managing or withdrawing consents and how we handle data, visit our Privacy Policy at:

    Show Details
    HubPages Device IDThis is used to identify particular browsers or devices when the access the service, and is used for security reasons.
    LoginThis is necessary to sign in to the HubPages Service.
    Google RecaptchaThis is used to prevent bots and spam. (Privacy Policy)
    AkismetThis is used to detect comment spam. (Privacy Policy)
    HubPages Google AnalyticsThis is used to provide data on traffic to our website, all personally identifyable data is anonymized. (Privacy Policy)
    HubPages Traffic PixelThis is used to collect data on traffic to articles and other pages on our site. Unless you are signed in to a HubPages account, all personally identifiable information is anonymized.
    Amazon Web ServicesThis is a cloud services platform that we used to host our service. (Privacy Policy)
    CloudflareThis is a cloud CDN service that we use to efficiently deliver files required for our service to operate such as javascript, cascading style sheets, images, and videos. (Privacy Policy)
    Google Hosted LibrariesJavascript software libraries such as jQuery are loaded at endpoints on the or domains, for performance and efficiency reasons. (Privacy Policy)
    Google Custom SearchThis is feature allows you to search the site. (Privacy Policy)
    Google MapsSome articles have Google Maps embedded in them. (Privacy Policy)
    Google ChartsThis is used to display charts and graphs on articles and the author center. (Privacy Policy)
    Google AdSense Host APIThis service allows you to sign up for or associate a Google AdSense account with HubPages, so that you can earn money from ads on your articles. No data is shared unless you engage with this feature. (Privacy Policy)
    Google YouTubeSome articles have YouTube videos embedded in them. (Privacy Policy)
    VimeoSome articles have Vimeo videos embedded in them. (Privacy Policy)
    PaypalThis is used for a registered author who enrolls in the HubPages Earnings program and requests to be paid via PayPal. No data is shared with Paypal unless you engage with this feature. (Privacy Policy)
    Facebook LoginYou can use this to streamline signing up for, or signing in to your Hubpages account. No data is shared with Facebook unless you engage with this feature. (Privacy Policy)
    MavenThis supports the Maven widget and search functionality. (Privacy Policy)
    Google AdSenseThis is an ad network. (Privacy Policy)
    Google DoubleClickGoogle provides ad serving technology and runs an ad network. (Privacy Policy)
    Index ExchangeThis is an ad network. (Privacy Policy)
    SovrnThis is an ad network. (Privacy Policy)
    Facebook AdsThis is an ad network. (Privacy Policy)
    Amazon Unified Ad MarketplaceThis is an ad network. (Privacy Policy)
    AppNexusThis is an ad network. (Privacy Policy)
    OpenxThis is an ad network. (Privacy Policy)
    Rubicon ProjectThis is an ad network. (Privacy Policy)
    TripleLiftThis is an ad network. (Privacy Policy)
    Say MediaWe partner with Say Media to deliver ad campaigns on our sites. (Privacy Policy)
    Remarketing PixelsWe may use remarketing pixels from advertising networks such as Google AdWords, Bing Ads, and Facebook in order to advertise the HubPages Service to people that have visited our sites.
    Conversion Tracking PixelsWe may use conversion tracking pixels from advertising networks such as Google AdWords, Bing Ads, and Facebook in order to identify when an advertisement has successfully resulted in the desired action, such as signing up for the HubPages Service or publishing an article on the HubPages Service.
    Author Google AnalyticsThis is used to provide traffic data and reports to the authors of articles on the HubPages Service. (Privacy Policy)
    ComscoreComScore is a media measurement and analytics company providing marketing data and analytics to enterprises, media and advertising agencies, and publishers. Non-consent will result in ComScore only processing obfuscated personal data. (Privacy Policy)
    Amazon Tracking PixelSome articles display amazon products as part of the Amazon Affiliate program, this pixel provides traffic statistics for those products (Privacy Policy)