---
title: "RPC vs RMI; modern RPC transparency"
subject: "Distributed System"
chapter: 2
key: "semester_7/distributed_system:differentiate-rpc-modern-rpc"
source: https://www.bctengineer.com/q/semester_7/distributed_system/differentiate-rpc-modern-rpc
site: BCT Engineering
---

# RPC vs RMI; modern RPC transparency

Distributed System · Chapter 2: Distributed Objects and File System

- Asked in: 2070 Chaitra, 2+6 marks
- Video: [Remote Procedure Call in Distributed Computing in Hindi](https://www.youtube.com/watch?v=z0S6o7cGXuE) — Perfect Computer Engineer
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_7/distributed_system/differentiate-rpc-modern-rpc
- Whole chapter: https://www.bctengineer.com/md/semester_7/distributed_system/chapter-2

## Question

Differentiate between RPC and RMI. How does modern RPC maintain the transparency in distributed system?

## Short answer

RPC calls a remote procedure with ordinary data; RMI calls a method on a remote object with references and object state. Modern RPC maintains transparency through IDL-generated stubs, standard data representation, dynamic binding, deep-copying pointers, failure handling with at-most-once semantics, threads, and security services.

## Answer

#### RPC versus RMI
| Point | RPC | RMI |
|---|---|---|
| Paradigm | Procedure oriented | Object oriented |
| What is called | A remote procedure/function | A method of a remote object |
| Parameters | Ordinary data, passed by value (structures) | Objects too, passed by value (serialised) or by remote reference |
| Object identity | None | Remote object references identify objects |
| State | Procedures usually without object state | Methods work on the state of an object |
| Language | Usually language independent (C, XDR) | Java RMI is Java only; CORBA is language independent |
| Interface | IDL such as Sun XDR/rpcgen | Java interface or CORBA IDL |
| Garbage collection | Not applicable | Distributed garbage collection of remote objects |
| Polymorphism, inheritance | Not supported | Supported |
| Use | Procedural client-server | Complex distributed object applications |

#### How modern RPC maintains transparency
Conventional RPC gave only partial access transparency: the programmer had to call special library routines, remote calls could not use pointers or global variables, the call semantics differed from a local call, and failures were not handled. Modern RPC (DCE RPC, ONC+, Java) improves this:

1. **IDL and stub generator:** an IDL compiler makes the client and server stubs automatically, so the remote call looks like a local call (**access transparency**).
2. **Standard data representation (XDR/NDR):** marshalling hides differences in byte order and formats of heterogeneous machines.
3. **Dynamic binding and a naming/directory service:** the client finds the server by a name at run time, giving **location transparency**, with replicated servers in a group.
4. **Pointer and structure handling:** complex data is copied by value (deep copy) so pointers and linked structures can be passed.
5. **Failure handling:** call semantics (at-most-once) with timeouts, retransmission and exceptions, so failures are reported in a similar way to local errors (**failure transparency**).
6. **Threads and asynchronous RPC:** many calls are served at once; the client can continue without waiting.
7. **Security services:** authentication and encrypted calls are integrated (Kerberos).

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. Which statement correctly distinguishes RMI from RPC?
   A. RMI calls plain procedures while RPC calls object methods
   B. RMI invokes methods of remote objects that have identity and state; RPC calls remote procedures
   C. RMI has no parameter passing while RPC passes by value
   D. RMI is always language independent while RPC is Java only
   Answer: B. RPC is procedure oriented; RMI is object oriented and uses remote object references to identify objects. (Key point: Paradigm)

2. How can parameters be passed in RMI but not in ordinary RPC?
   A. Objects can be passed by value (serialised) or by remote reference
   B. Only as raw integers
   C. Only by remote reference, never by value
   D. Pointers to the client's memory are shared directly
   Answer: A. RPC passes ordinary data by value; RMI also passes objects, by serialisation or remote reference. (Key point: Parameter passing)

3. How does modern RPC give access transparency?
   A. Remote calls are forbidden from using parameters
   B. The programmer writes socket code in each stub by hand
   C. Clients must call special library routines for every remote call
   D. An IDL compiler generates stubs automatically so the remote call looks like a local call
   Answer: D. IDL-generated stubs hide marshalling and communication, so the call syntax is like a local call. (Key point: Stub generation)

4. Why does modern RPC use a standard data representation such as XDR/NDR?
   A. To locate the server by name
   B. To provide garbage collection of remote objects
   C. To hide differences in byte order and data formats between heterogeneous machines
   D. To make the call faster by skipping marshalling
   Answer: C. Marshalling into a standard format lets machines with different formats exchange data correctly. (Key point: Handling heterogeneity)

## Related in Distributed System

- [Access transparency and modern RPC](https://www.bctengineer.com/question.md?key=semester_7%2Fdistributed_system%3Amodern-rpc-access-transparency) — Distributed System, chapter 2
- [Distributed object, IDL; RPC vs RMI](https://www.bctengineer.com/question.md?key=semester_7%2Fdistributed_system%3Aobject-idl-rpc-rmi) — Distributed System, chapter 2
- [Object communication; RPC vs RMI](https://www.bctengineer.com/question.md?key=semester_7%2Fdistributed_system%3Aobjects-communicate-rpc-rmi) — Distributed System, chapter 2
- [Compare RPC and RMI](https://www.bctengineer.com/question.md?key=semester_7%2Fdistributed_system%3Arpc-vs-rmi) — Distributed System, chapter 2, asked 2×
- [Autonomous vs distributed system](https://www.bctengineer.com/question.md?key=semester_7%2Fdistributed_system%3Aautonomous-vs-distributed) — Distributed System, chapter 1
- [DS vs centralized; layers of transparency](https://www.bctengineer.com/question.md?key=semester_7%2Fdistributed_system%3Ads-over-centralized-transparency) — Distributed System, chapter 1

## Related in other subjects

- [LTI system and closed loop in modern systems](https://www.bctengineer.com/question.md?key=semester_3%2Fcontrol_systems%3Alti-define-cl-pronounced) — Control Systems, chapter 1
