RPCS Flashcards
How to carry out RPC
- The client calls c.stub, then c.stub marshalls the relevant messages in the stub
- OS is called and send message to server node. Then it is handed to the server stub
- Message is unmarshalled and then routine is called. This call is then executed and results are sent to server stub, then marshalled for transmission.
- Server calls OS and results are sent to client node.
- Client stub receives results and then unmarshalls and sends result to client.
Call by Value
The parameter value is copied on the stack; in the called
procedure, a local variable gets initialised to this value. The called procedure may modify it, but such changes do not affect the value of the original variable.
Call by reference
The reference to the variable is copied on the stack; the called procedure can therefore access the variable and changes are directly reflected in the calling program.
Call by copy-restore
The variable’s value is copied on the stack as in call by value, then copied back on the stack after the call, overwriting the original value.
Interface definition language
A specification language used to specify service routines. IDL is required for stub compilers if server and client are written in different languages.
Dynamic binding definition
The stub compiler doesn’t produce the client stubs with inbuilt server actions. Instead it has an inbuilt program that will dynamically locate the server at runtime.
Dynamic binding steps
1: The specification of service is registered with a binder,
2: The server (service provider) uses the service specification for generating the server stub and linking it to the service routine.
3: Application builder can examine the service specifications registered in the binder for the desired service, and select a service specification, pass it through stub generator for creating a client stub;.
What are the possible failures that affect RPC Semantics
- Client is unable to locate server process
- Client’s request message is lost
- Server’s reply is lost
- Server crashes during call
- Client crashes during call
At least once def
Normal termination: Call is executed one or more times
Abnormal termination: Call not executed, partially, once or more than once
At most once def
Normal termination: Call is executed once.
Abnormal termination: Call is executed once, partially or not at all
Exactly once def
Normal termination: Call is executed once
Abnormal termination: Call is not executed
At least once in presence of server crashes
Client: The client makes a call with a timer, if client times out then they retry. If no response or AU is received, then client takes abnormal termination.
Server: Stateless server so server doesn’t retain information regarding previous executions. The server executes received call request and sends reply.
Exactly once in the presence of server crashes
This is impossible to implement in presence of server crashes. Server could be in the middle of unrecoverable action when it crashes, so system is required to undo itself to a pre execution state. This means the crash recovery should undo or cancel any changes made by partial executions. It should be as if no executions happened.
At most once in the presence of server crashes
Client: Client sends call message, but this message has a sequence number. Each new request has a new sequence number larger than the previous one.
Server: Stateful server, so information is retained from previous executions. Each call is checked for freshness so if a sequence number of a call is recognised by the server, the results of that execution will be sent to the client.
Orphans
Orphans occur when the client crashes after sending a call request. This means the server executes a call and send the response, but client either times out or crashes. This can cause interference with other processes and the waste of server resources.