67

Or are they synonyms?

Dimitri C.
  • 21,861
  • 21
  • 85
  • 101

7 Answers7

88

Wikipedia is usually great for these purposes.

RPC:

Remote procedure call (RPC) is an Inter-process communication technology that allows a computer program to cause a subroutine or procedure to execute in another address space (commonly on another computer on a shared network) without the programmer explicitly coding the details for this remote interaction.

IPC:

Inter-process communication (IPC) is a set of techniques for the exchange of data among multiple threads in one or more processes. Processes may be running on one or more computers connected by a network.

So, RPC is just one kind of IPC.

Eli Bendersky
  • 263,248
  • 89
  • 350
  • 412
15

RPC - Remote Procedure Call - is a particular type of communication, but can be on a single machine, or across a network between machines. http://en.wikipedia.org/wiki/Remote_procedure_call

IPC - Inter-Process Communication - is a general term for communication between different processes (which are usually on a single machine). http://en.wikipedia.org/wiki/Inter-process_communication

Douglas Leeder
  • 52,368
  • 9
  • 94
  • 137
14

An RPC (remote procedure call) is a form of IPC (interprocess communication) - the latter is a more general term, covering lots of mechanisms besides RPCs.

9

IPC is a set of method to communicate with two process which may be in same computer or different computer.it includes direct & indirect communication,synchronous & asynchronous communication and explicit buffering. But RPC is a method to call a procedure from sever to client and get back its result as message..

vrnithinkumar
  • 1,273
  • 1
  • 11
  • 29
5
  • Remote Procedure Call (calling methods remotely at a system)
  • Interprocess Communication (method enabling processes in the same system to interact).
Aggelos Biboudis
  • 1,175
  • 8
  • 27
2

RPC = IPC + server location, marshalling, network failure, delays - special copy tricks, speed

For further detail:- https://www.cs.cmu.edu/~410-f03/lectures/L31_IPCRPC.pdf

Vishal Gupta
  • 768
  • 1
  • 5
  • 7
2

To answer your question, it's better to get a good grasp on what IPC and RPC(s) exactly are, how they work, and what properties they have, so we could better spot their differences if there are any.
I'm going to refer to a book throughout my answer by the title of: "Operating System Concepts, 10th edition", written by Avi Silberschatz, Peter Baer Galvin, and Greg Gagne and published by John Wiley & Sons Inc., more information about the book here.

IPC

Why and when should we use IPC?

There are two types of processes: independent processes and cooperating processes. independent processes don't have any interactions with other processes as their name suggests. But on the other hand, a cooperating process needs to have communication and interaction with other processes, that's when IPC comes in, as we read in section 3.4, page 123 of the book:

Cooperating processes require an interprocess communication (IPC) mechanism that will allow them to exchange data— that is, send data to and receive data from each other. There are two fundamental models of interprocess communication: shared memory and message passing.

There are two types of communication as the book mentioned. shared memory and message-passing. The model used for an RPC is often based on the latter, so to be able to better compare the two (IPC and RPC), I'd assume that both are using a message-passing scheme.
So what is message-passing and how does it work in IPC?
section 3.6, page 128 of the book states:

Message passing provides a mechanism to allow processes to communicate and to synchronize their actions without sharing the same address space. It is particularly useful in a distributed environment, where the communicating processes may reside on different computers connected by a network.

and also:

There are several methods to logically implement a link:

  • Direct or indirect communication
  • Synchronous or asynchronous communication
  • Automatic or explicit buffering

Therefore, we should consider that processes that are trying to communicate with each other via message-passing can either be in the same or a separate machine (and on the same network).
There are also, many ways in which a link (logically) could be established between processes that are communicating using message-passing as @vrnithinkumar mentioned in the answers and the book also suggests. but one point to consider either way, is that the processes themselves are the ones that are mainly involved in sending and receiving messages, or here it may seem as such. Sure, OS (or any other medium) could provide the means for such communication and be able to control it, still, not much of an interface was introduced for the purpose on this side.

RPC

What exactly is an RPC and when is it used and how does it operate?
The book defines RPC(s) as:

Procedure calls sent across a network to execute on another computer; commonly used in client-server computing.

furthermore in section 3.8.2:

One of the most common forms of remote service is the RPC paradigm, which was designed as a way to abstract the procedure-call mechanism for use between systems with network connections. It is similar in many respects to the IPC mechanism and it is usually built on top of such a system.

here then the book mentions a particular difference between IPC and RPC(s):

In contrast to IPC messages, the messages exchanged in RPC communication are well structured and are thus no longer just packets of data. Each message is addressed to an RPC daemon listening to a port on the remote system, and each contains an identifier specifying the function to execute and the parameters to pass to that function. The function is then executed as requested, and any output is sent back to the requester in a separate message.

In RPCs something called a stub is used which does some of the heavy lifting for sending/receiving messages in the system. the book explains stubs on page 150:

The RPC system hides the details that allow communication to take place by providing a stub on the client side. Typically, a separate stub exists for each separate remote procedure. When the client invokes a remote procedure, the RPC system calls the appropriate stub, passing it the parameters provided to the remote procedure. This stub locates the port on the server and marshals the parameters. The stub then transmits a message to the server using message passing. A similar stub on the server side receives this message and invokes the procedure on the server. If necessary, return values are passed back to the client using the same technique.

Another thing to consider here is the way that a stub operates, which provides the system with some degree of encapsulation.

Conclusion

So now that we have a better understanding of RPC and IPC, let's answer these questions:
Is there a difference between RPC and IPC? Yes, there is.
What are the differences between RPC and IPC? Generally, the purpose of RPC is simply to call a function (procedure) for the caller and to return a message containing the result of calling that function. However, the purpose of IPC is solely to exchange data between the processes associated with communication. Even in cases where RPC is used as a form of IPC, like the Android binder framework, we could say that the model suggests an emphasize towards encapsulation and the interface (by utilizing the word RPC here), used for the process communication. Or to simply put it, it does IPC in the RPC way (or arguably vice-versa).
Are RPC and IPC synonyms? Although they have many similarities and properties, a technical answer would be, no.