RPC, Remote Procedure Call
1 Overview
- Remote Procedure Call (Java Remote Method Invocation RMI) is a
fundamental idea in Distributed Computing.
- A simple architecture for Client-Server computing.
- Emulate "ordinary" (local) procedure calls in the context of
Client-Server computing.
2 Local v Remote
- Slides
- We will use local in the sense of process address space, not
as in local/global lexical scoping
- Remote may not always mean that a node is remote. It really
means that it can be.
- Obviously, we have some way of naming these; usually, IP address,
or FQHN fully qualified host name.
- We are ignoring all kinds of "firewalling" issues.
3 Operational Semantics of Local Procedure Call
- The code of both P and Q are in the address space of a single process.
- Procedure P makes a call Q(a, b, c) on procedure Q.
- Arguments a, b, c are from the run time context of P.
- These are "passed" to Q: i.e., bound to the three formal parameters of Q
- Control is in Q ==> P is waiting for the answers by Q
- P resumes at the point below the call, when Q returns
4 Parameter Passing
- Procedure P makes a call Q(a, b, c) on procedure Q.
- P gives to Q the input arguments
- P receives from Q the results
- Call by val, by ref, by name, … ?
- Call by values-in + values-out: expressions a, b, c are evaluated.
5 The Idea of RPC
- The code of P is in one process PP and that of Q in another QQ.
- Do the "equivalent" of local procedure call – semantically
- Must we make some assumptions?
6 How to Develop RPC programs
- Start with sequential version of the program QPRG
- Select the remote procedures
- Describe the interface
- Generate the stub procedures
- Build two programs: server SPRG, client CPRG
- semantics of QPRG "equals" SPRG + CPRG
- Example
Makefile
7 Automated Build of RPC programs
- Lots of assumptions
- no globals shared between SPRG and CPRG
- …
- How do we locate/ declare SPRG?
- Globally unique program identifier
- Transient versions
rpcgen
Generate the stub procedures
9 Practical Linux RPC
- Make sure that
rpcbind/portmap
is started at boot. Option -i
- Check the result of
rpcinfo -p
10 References
- Andrew D. Birrell and Bruce Jay Nelson, Implementing Remote
Procedure Calls, ACM Transactions on Computer Systems (TOCS), 2,
1, pp. 39–59, 1984. A classic paper. Highly recommended reading.
- Oracle.com, ONC+ Developer's Guide;
http://docs.sun.com/app/docs/doc/816-1435; Reference. This is a
highly recommended complete book on RPC.
- Andrews book, Chapter 9. Highly recommended reading.
- http://twitter.github.io/finagle Finagle is an extensible RPC
system for the JVM. Finagle is written in Scala, but provides both
Scala and Java APIs. Reference
Copyright © 2016 •
www.wright.edu/~pmateti • 2016-08-30