The distributed information system is defined as “a number of interdependent computers linked by a network for sharing information among them”. A distributed information system consists of multiple autonomous computers that communicate or exchange information through a computer network. There are three ways by which entities in the distributed systems communicate:
- Interprocess Communication: It is a low-level communication paradigm. Examples are: Distributed shared memory like a mailbox
- Remote Invocation: It is a high-level and direct communication paradigm. Examples are: RPC, RMI, etc
- Indirect Communication: It is a high-level indirect communication paradigm. Examples are: Group communication, Publish/Subscribe model, etc
RPC stands for Remote Procedure Call. In RPC, a computer program causes a procedure to operate in a different address space, and it is programmed as if it were a normal procedure call. Whether the subroutine is local to the current program or remote, the programmer writes essentially the same code. A request-response message-passing mechanism is generally used to accomplish this type of client-server interaction. It's preferable to think of it as a generic structure for distributed systems. RPC is popular because it is built on the semantics of a local procedure call: the application software makes a call to a procedure, regardless of whether it is local or remote, and waits for it to return. RPCs are represented via remote method invocation in the object-oriented programming paradigm.
Theoretical suggestions of remote procedure calls as the paradigm of network operations come from the 1970s, while actual implementations emerge from the early 1980s. In 1981, Bruce Jay Nelson is credited with coining the term 'Remote procedure call'. It is widely used in:
- Protobufs (Google)
- Thrift on Facebook
- Finagle on Twitter
RPC aims to make network communication appear as if it were a function call. An application developer's job can be considerably simplified if he is entirely unaware of whether an operation is local or remote. When the procedures being called are methods of objects in an object-oriented language, RPC is known as a remote method invocation. While the RPC concept is simple, it has some flaws listed below:
- The network between the calling and called processes is prone to limit message sizes and has a proclivity for losing and reordering messages.
- The calling and called processes may operate on machines with vastly different architectures and data representation types.
RPC mechanism consists of two key components:
- A protocol that controls the messages delivered between the client and server processes and deals with the underlying network's possibly unfavorable characteristics.
- The arguments are packaged into a request message on the client computer, which is then translated back into the arguments on the server machine, and the return value is translated back into the parameters. A stub compiler is a name given to this part of the RPC system.
- Client-server request lost
- Server-client reply lost
- Server crashes after receiving a request
- Client crashes after delivering the request
The fundamental algorithm is easy to understand. The client sends a request message, which is acknowledged by the server. The server then sends a reply message after completing the operation, which the client acknowledges.
RPC timelineFollowing steps are followed in the RPC mechanism:
- Each RPC takes place within a thread. A thread is a single control flow that has just one point of execution at any one time. An application thread is a thread that is generated and maintained by application code.
- Both RPCs and RPC run-time calls are issued by RPC apps using application threads. One or more client application threads, each of which can conduct one or more RPCs, make up an RPC client.
- In addition, an RPC server employs one or more call threads provided by the RPC run-time framework to execute called remote operations. The server application thread sets the maximum number of concurrent calls it will execute when it starts listening.
- There is only one call thread in single-threaded programs. In multi-threaded applications, the maximum number of call threads is determined by the application's architecture and RPC implementation policies. The call threads are created in the server execution context by the RPC run-time mechanism.
- An RPC can be used in both client and server environments. As a result, when a client application thread contacts a remote procedure, it becomes part of an RPC thread, which is a logical thread of execution.
- An RPC thread is a conceptual construct that extends over real execution threads and the network to include the different phases of an RPC.
- The calling client application thread joins the RPC thread after making an RPC. Until the call returns, the RPC thread usually retains execution control.
- The RPC thread of a successful RPC passes through the execution stages depicted in RPC Thread Execution Phases.
- The following items are included in the execution phase:
- The RPC thread starts in the client process when a client application thread makes an RPC to its stub; the client thread then joins the RPC thread.
- The RPC thread connects to the server across the network.
- The RPC thread becomes a calling thread, which runs the remote procedure.
- The calling thread becomes part of the RPC thread when a called remote operation is running.
- When the call completes, the calling thread is no longer part of the RPC thread.
- The RPC thread then returns to the client via the network.
- When the RPC thread reaches the calling client application thread, it delivers any call results, and the client application +thread exits the RPC thread.
Getting Around Network Limitations:
To deal with the reality that networks aren't ideal conduits, RPC protocols frequently perform extra duties. There are two such functions:
- Deliver messages in a timely manner.
- Fragmentation and reassembly are used to support huge message sizes.
In most situations, the RCP protocol builds its own reliable message delivery layer on top of an unreliable substrate (e.g., UDP/IP). Similar to TCP, such an RPC protocol would most likely implement dependability using acknowledgements and timeouts.
Benefits of RPC:
- Process-oriented and thread-oriented architectures are both supported by remote procedure calls.
- Remote procedure calls can be utilized in both a distributed and a local context.
- The user is not aware of RPC's underlying message transmission method.
- To enhance performance, RPC skips several of the protocol layers.
- In remote procedure calls, the work required to rewrite and develop the code is minimal.
Drawbacks of RPC:
- The notion of a remote procedure call can be implemented in a variety of ways. It isn't a set of rules.
- RPC does not allow for hardware architectural flexibility. It is solely dependent on interaction.
- Costs have increased as a result of the remote procedure call.
Similar Reads
Syslog Message Logging Protocol
Syslog is a standard for message logging. Syslog protocol is used for system management, system auditing, general information analysis, and debugging. Syslog protocol basically uses three layers : Syslog Content - Syslog content is the information of the payload in the system packet. Syslog Applicat
3 min read
Email Protocols
Email protocols are a collection of protocols that are used to send and receive emails properly. The email protocols provide the ability for the client to transmit the mail to or from the intended mail server. Email protocols are a set of commands for sharing mails between two computers. Email proto
3 min read
Transport Layer Protocols
The transport layer is the fourth layer in the OSI model and the second layer in the TCP/IP model. The transport layer provides with end to end connection between the source and the destination and reliable delivery of the services. Therefore transport layer is known as the end-to-end layer. The tra
9 min read
ARP Protocol
ARP (Address Resolution Protocol) is an important protocol that plays an important role in the networking world. When working with your network systems, this protocol helps to identify specified network devices and find their addresses. Its main purpose is to duly transport data packets over the net
8 min read
STOMP Protocol
STOMP is the Simple (or Streaming) Text Orientated Messaging Protocol, formerly known as TTMP. It provides an interoperable wire format that allows STOMP clients to talk with any message broker asynchronously supporting the protocol. It is similar to HTTP, and works over TCP using the commands - CON
3 min read
Communication Protocols For RPCs
This article will go through the concept of Communication protocols for Remote Procedure Calls (RPCs) in Distributed Systems in detail. Communication Protocols for Remote Procedure Calls:The following are the communication protocols that are used: Request ProtocolRequest/Reply ProtocolThe Request/Re
5 min read
Classes of Routing Protocols
Routing protocols are essential for determining how data packets are transferred across networks. They help routers communicate with each other to find the most efficient paths for data to travel. Routing protocols are typically divided into categories like distance vector, link-state, and hybrid pr
5 min read
Internet Message Access Protocol (IMAP)
The Internet Message Access Protocol (IMAP) is an important part of how email works today. It lets people check and manage their emails from different devices, like phones, tablets, and computers, without losing any updates.Unlike the older Post Office Protocol (POP), which only downloads messages t
6 min read
Noisy Channels Protocols
Noisy channel protocols are commonly known as communication protocols. These protocols are designed to ensure a reliable data transmission over a channel in which there is a high probability of errors or data loss. In computer networks, these protocols are typically used to overcome the effects of c
5 min read
Internet Control Message Protocol (ICMP)
Internet Control Message Protocol is known as ICMP. The protocol is at the network layer. It is mostly utilized on network equipment like routers and is utilized for error handling at the network layer. Since there are various kinds of network layer faults, ICMP can be utilized to report and trouble
11 min read