Operating-Systems-Notes

Remote Procedure Calls

Example : GetFile App

Remote Procedure Calls (RPC)

+ Higher-level interface for data movement and communication
+ Error handling
+ Hiding complexities of cross machine interactions

RPC requirements

rpcrequirements

  1. Client/Server interactions
  2. Procedure Call Interface => RPC
    • sync call semantics
  3. Type checking
    • error handling
    • packet bytes interpretation
  4. Cross machine conversion
    • e.g. big/little endian
  5. Higher level protocol
    • access control, fault tolerance, different transport protocols

Structure of RPC

rpcstructure

RPC Steps:

(-1.) register : server registers procedure, arg types, location
(0.) bind : client finds and binds to desired server

  1. call : client make RPC call; control passed to stub, client code blocks
  2. marshal : client stub “marshals” args (serialize args into buffer)
  3. send : client sends message to server
  4. receive : server receives message; passes message to server stub; access control
  5. unmarshal : server stub “unmarshals” args (extract args from buffer)
  6. actual call : server stub calls local procedure implementation
  7. result : server performs operation and computes result of RPC operation

(same on return <=)

Interface definition Language (IDL)

RPC can use IDL that is

  1. Language agnostic
    • XDR in SunRPC
  2. Language specific
    • Java in JavaRMI

Marshalling

Marshalling

Unmarshalling

Unmarshalling

Marshalling/Unmarshalling routines are provided by RPC system compiler.

Binding and Registry

Pointers

here, y points to location in caller address space

Handling Partial Failures

RPC Design choice