RPC, Remote Procedure Call

Prabhaker Mateti

Wright State University

www.cs.wright.edu/~pmateti

Table of Contents

1 Local v Remote

  1. Slides
  2. We will use local in the sense of process address space, not as in local/global lexical scoping
  3. Remote may not always mean that a node is remote. It really means that it can be.
  4. Obviously, we have some way of naming these; usually, IP address, or FQHN fully qualified host name.
  5. We are ignoring all kinds of "firewalling" issues.

2 Operational Semantics of Local Procedure Call

  1. The code of both P and Q are in the address space of a single process.
  2. Procedure P makes a call Q(a, b, c) on procedure Q.
  3. Arguments a, b, c are from the run time context of P.
  4. These are "passed" to Q: i.e., bound to the three formal parameters of Q
  5. Control is in Q ==> P is waiting for the answers by Q
  6. P resumes at the point below the call, when Q returns

3 Parameter Passing

  1. Procedure P makes a call Q(a, b, c) on procedure Q.
  2. P gives to Q the input arguments
  3. P receives from Q the results
  4. Call by val, by ref, by name, … ?
  5. Call by values-in + values-out: expressions a, b, c are evaluated.

4 The Idea of RPC

  1. The code of P is in one process PP and that of Q in another QQ.
  2. Do the "equivalent" of local procedure call – semantically
  3. Must we make some assumptions?

5 How to Develop RPC programs

  1. Start with sequential version of the program QPRG
  2. Select the remote procedures
  3. Describe the interface
  4. Generate the stub procedures
  5. Build two programs: server SPRG, client CPRG
  6. semantics of QPRG "equals" SPRG + CPRG
  7. Example Makefile

6 Automated Build of RPC programs

  1. Lots of assumptions
    1. no globals shared between SPRG and CPRG
  2. How do we locate/ declare SPRG?
    1. Globally unique program identifier
    2. Transient versions
  3. rpcgen Generate the stub procedures

7 A Design of RPC

  1. A Typical RPC architecture ../RPC/rpc-diag-tikz.pdf
  2. ../RPC/05-rpc-case_studies.ppt from Rutgers
  3. ../RPC/7b.pptx from Portland State
  4. ../RPC/L16-17.fa14.ppt from U of Illinois, UC
  5. Required study: At least one of the above.
  6. Highly Recommended: All three.

8 Unix/Linux RPC

  1. rpcbind/portmap are started at boot
  2. check the result of rpcinfo -p
  3. NFS is based on ONC/Sun RPC

9 References

  1. 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.
  2. 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.
  3. Andrews book, Chapter 9. Highly recommended reading.

Copyright © 2016 • www.wright.edu/~pmateti • 2016-08-30