0
11kviews
Short note on Light Weight RPC

Similar questions

How does light weight RPC work in cross domain architecture?

Marks: 10 M

Year: May 13, May 14, Dec 14

1 Answer
1
221views
  • Lightweight RPC is a communication facility that is designed and optimized for communication between protected domains in the same machine.
  • LRPC Simplify aspects of RPC such as control transfer, data transfer, linkage, and stubs.
  • The communication traffic in operating systems are of two type i.e. Cross-domain that involves communication between domains on the same machine and Cross-machine that involves communication between domains located on separate machines.
  • The LRPC is a facility designed and optimized for cross-domain communications where user level server processes have its own address space.
  • Execution model of LRPC is borrowed from “protected procedure call” of capability systems.
  • LRPC is safe and transparent which represents a viable communication alternative for microkernel operating systems.
  • It is used in small-kernel operating systems to avoid cost incurred by using RPC.

To enhance the performance of conventional RPC systems, the following techniques are user by LRPC:

1. Simple Control Transfer

  • LPRC uses a control transfer mechanism where a client’s thread executes the requested procedure in the server’s domain.
  • It uses a special threads scheduling mechanism, called handoff scheduling for direct context switch from the client thread to the server thread of an LRPC.
  • In this mechanism the client binds to a server interface before making its first call.
  • When the call to the server is made, client provides the server with an argument stack as well as its own thread of execution causing a trap to the kernel.
  • Kernel validates caller, creates a call linkage and dispatches client’s thread directly to server domain which triggers server execution.
  • On called procedure completion, control and results return through kernel back to the point of client’s call.

2.Simple Data Transfer

It is a parameter-passing mechanism that is similar to procedure call which has shared argument stack to eliminate redundant data copies. - RPC pass argument and results in the form of messages between client and server domains.

In a cross-domain RPC Argument copying requires data to be copied four times:

i. Stub to RPC message,

ii. Client message to kernel,

iii. Kernel to server,

iv. Server to stack

  • To reduce this operation, LRPC uses a shared-argument stack that is accessible to both the client and the server due to which same arguments in an LRPC can be copied only once i.e. from the client’s stack to the shared argument stack.
  • LRPC reduces the cost of data transfer by performing fewer copies of the data during its transfer from one domain to another.
  • Pair wise allocation of argument stacks enables LRPC to provide a private channel between the client and server to ensure safe operation.

3.Simple stub:

  • LRPC facilitates the generation of highly optimized stubs due to the use of control and data transfer model.
  • Every procedure has a call stub in the client’s domain and an entry stub in the server’s domain.
  • Three Layered communication protocol is defined for every procedure in an LRPC interface.They are:

i. End to end, described by calling conventions

ii. Stub to stub, implemented by stubs

iii. Domain to domain, implemented by kernel

  • LRPC stubs blur the boundaries between the protocol layers to reduce the cost of interlayer crossings.
  • A simple LRPC needs only one formal procedure call to client stub and one return from server procedure and client stub each.
  • Example: During control transfer, the kernel associates execution stack with the initial call frame directly invokes the corresponding procedure’s entry in the server’s domain. No message examination or dispatching is done and the server stub starts executing the procedure by directly branching to the procedure’s first instruction.

4.Design for concurrency:

  • To achieve high call throughput and low call latency in LRPC having multiple processors with shared memory, special mechanisms are used.
  • Throughput is increased by avoiding needless lock contention by minimal use of shared-data structures while latency is reduced by reduction of context switching overhead.
  • LRPC achieves a factor-of-three performance and reduces cost of cross domain communication.
Please log in to add an answer.