#cs454

Reading: 4.2, 4.3, 8.3

Remote Procedure Calls (RPCs)

Call remote procedures as if they are local ones.

One challenge is passing pointers as arguments to procedures. A pointer is only meaningful only within the address space of the process in which it is used.

A solution would be to copy the entire data structure (copy-by-value).

Steps

  1. Client procedure calls the client stub.
  2. Client stub builds the message and calls the local OS.
  3. Client’s OS sends the message to the remote OS
  4. Remote OS gives the message to server stub.
  5. Server stub unpacks the parameters and calls the server
  6. Server does the work and return the results to the stub.
  7. Server stub packs the results in a message and calls its local OS
  8. Server OS sends the message to the client OS
  9. Client OS gives the message to client stub
  10. Stub unpacks the result and return it to the client.

Binding

Server loads functions in memory, populate its export table and exports its interface to the registry.

Clients query the registry for the server_ip and then asks the server for the binding info for each fname.

Preventing duplicate calls

In Xerox RPC, clients call the server with client_ip, proc_id, seq_num, fid, args.

The server first checks its export table, then its prev_calls table which stores client_ip, proc_id, seq_num to check if the call is a duplicate, if it is, return the old result.

RPC in presence of failures

  • client cannot locate the server
    • use special code as the return value to indicate failure
  • lost request message
    • use a timer and retransmit if timeout
    • if many requests are lost cannot locate server
  • lost reply message
    • same as above, use a timer
  • server crashes
    • client cannot distinguish if its a crash or the msg is lost
    • 3 solutions
      • wait until server reboots
      • give up and report failure
      • client gets no help

Distributed Object Management

The remote interface specifies which methods can be invoked remotely.

Message-Based Communication

Built directly on top of the message-oriented model offered by the transport layer.

Synchronous: Sender is blocked until the message is stored in the local buffer at the receiving host or delivered to the receiver. Asynchronous: Sender continues immediately after sending.

Transient: message can be lost Persistent: message stored in the communication system as long as it takes to deliver the message.