Message Types

There are two types of messages used in the RPC implementation:

  1. Call Messages
  2. Reply Messages

1. Call Messages:

The client sends the call message to the server so that the remote procedure can be executed.

Format:

  1. Remote Procedure Identifier: This field has the information regarding the remote procedure which is to be executed.
  2. Arguments: The arguments that are required for the execution of the procedure.
  3. Message Identification: This field is used to identify the messages that are lost and duplicated through the sequence number.
  4. Message Type: This field is used to identify the message type i.e. whether a message belongs to call message type or reply message type.
  5. Client Identification: This field allows the server to identify the client and to authenticate the client process as well.

RPC Call Message Format:

  Remote Procedure Identifier  
Message Identifier Message Type Client Identifier Program Number Version Number Procedure Number Arguments

2. Reply Messages:

The server returns the result of the remote procedure execution to the client using a reply message.  There are two forms of reply messages- successful messages and unsuccessful messages. 

A. Successful Reply Message: If the particular remote procedure is executed successfully.

Format:

Message Identifier     Message Type     Reply Status (0) - Successful     Result

B. An Unsuccessful Message: If any of the following conditions arise then the message is of unsuccessful type:

  1. The server identifies by scanning the client’s identifier field that the client is not authorized to utilize the service.
  2. The Identifier is missing.
  3. If the server does not find any detail in program number, version number, or procedure number fields.
  4. During the execution of the remote procedure, an exception condition occurs.
  5. If the server is unable to decode the given arguments.
  6. The server finds that the call message is not coherent to it.

Format:

Message Identifier     Message Type     Reply Status (1) - Unsuccessful     Reason for failure

What is Message Buffering?

Remote Procedure Call (RPC) is a communication technology that is used by one program to make a request to another program for utilizing its service on a network without even knowing the network’s details. 

The inter-process communication in distributed systems is performed using Message Passing. It permits the exchange of messages between the processes using primitives for sending and receiving messages. The programmer must understand the message as well as the names of the source and destination processes. The send() primitive is used by the process for sending messages and receive() primitive is used by the process for receiving messages.

RPC Messages:

In distributed systems, communication is carried out between processes by passing messages from one process to another. Message passing is at the lowest level of abstraction whereas RPC represents higher abstraction. Because of the lowest level of abstraction, it requires that the application programmer be able to identify the message, source process, destination process, and data types likely from the involved processes. 

Syntax: The syntax used in message passing for the send() and receive() primitives are as follows:

send (receiver, message) // requires the name of the destination process 
                            and the message data as arguments
receive(sender, message) // requires the name of the sender process 
                            and the message data as arguments

Semantics:

  1. Blocking/non-blocking: A blocking send() stops the process and waits until the message has been sent and the message buffer has been cleared before continuing. A blocking receive, on the other hand, blocks at receive() until the message arrives. A non-blocking send quickly returns control to the caller. The message transmission process is then run in parallel with the sending phase.
  2. Buffered/Unbuffered messages: Unbuffered receive() means that instead of using a message buffer, the transmitting process sends the message immediately to the receiving process. The address, receiver, in send() is the process’s address; however, in buffered send(), the address is the buffer’s address.
  3. Reliable/Unreliable send: Unreliable send() transmits a message to the recipient without expecting it to be acknowledged, and it does not automatically retransmit the message to ensure receipt. A reliable send() ensures that the message has been received by the time the send() is finished.
  4. Direct/Indirect Communication: The use of ports allows for indirect communication. The transmitter sends messages to the port, and the receiver receives them from the port. Instead of sending the message to an intermediate port, the message is sent directly to the process, which is identified specifically in the send, receive in case of direct communication.
  5. Fixed/Variable size messages: The size of fixed-size messages is limited by the system. Variable size messages are more complex to construct, but they make programming easier; the opposite is true for fixed-size messages.

Similar Reads

Message Types:

There are two types of messages used in the RPC implementation:...

Message Buffering

Buffering implies queuing of sending or receiving messages during transmission to and from one process to another. The buffer is the temporary storage area used to hold the message until receiving process is not ready to receive the message so that it can be retrieved later on. Following are the buffering mechanisms depending on synchronous and asynchronous systems:...