Remote Procedure Call or RPC
Remote procedure call (RPC) is an interprocess communication (IPC) mechanism that enables data exchange and invocation of functionality between different processes. These processes can be on the same computer or on local area network (LAN) or even across the internet. Microsoft has a service that runs for communicating between processes in the network which is called ms-rpc.
There basically are four components of RPC:
1. Caller: A program which calls a sub-routine
2. Callee: A sub-routine which calls is called by the caller.
3. Server: A program which accepts connections from a client and provides services to it.
4. Client: A program which requests connections and services from a server.
In order for an RPC to execute successfully, several steps must take place:
- The caller program cannot feed raw data to the remote procedure instead it must prepare input parameters to be passed to the RPC. This is because the caller and the callee can reside in two different hardware so their certain data types may be different. To solve the problem of different data types (external data exchange) XDR or ASN.1 (Abstract Syntax Notation) is adopted as standard formats.
- In RPC call the calling program will have to pass the machine address of the target procedure plus the network address if it is being called from a network, else it only needs the machine address in the local processor.
- The RPC receives and operates on any input parameters and passes the result back to the caller.
- The calling program receives the RPC result and continues execution
To get a better look at Remote Procedure Call try the following examples on RPC:
1. rpcinfo -p localhost
2. cat /etc/rpc
3. rpcclient -c dir -i xxx.xxx.xxx.xxx -p xxxx
4. net rpc SHUTDOWN -C “Comment here” -f -I xxx.xxx.xxx.xxx -U username%password
5. rpcgen [infile]
References of RPC: