REMOTE PROCEDURE CALL (RPC)
a) Remote Procedure Call (RPC) is a powerful technique for constructing distributed, client-server based applications.
b) RPC works by allowing one program (a client) to directly call procedures (functions) on another machine (the server).
c) The client makes a procedure call that appears to be local but is run on a remote machine.
d) When an RPC is made, the calling arguments are packaged and transmitted across the network to the server.
e) The server unpacks the arguments, performs the desired procedure, and sends the results back to the client.
RPC Requirements:
2) Runtime Libraries & header files
3) Name Service Provide (locator)
4) Endpoint Mapper
1) MIDL Compiler:
a) The Microsoft Interface Definition Language (MIDL) defines interfaces between client and server programs.
b) Microsoft includes the MIDL compiler with the Platform Software Development Kit (SDK) to enable developers to create the interface definition language (IDL) files and application configuration files (ACF) required for remote procedure call (RPC) interfaces and COM/DCOM interfaces.
c) MIDL also supports the generation of type libraries for OLE Automation.
d) The MIDL compiler processes an IDL file to generate a type library and output files.
e) The type of output files generated by the MIDL compiler depends on the attributes specified in the IDL file's interface attribute list.
ACF -> Application Configuration File
IDC: Interface. Describes the data exchange and parameter passing mechanism between caller and called procedure.
Server: Implements the Interface.
Client: Uses the Interface.
b) Pass that to MIDL Compiler.
c) Generates the Stubs.
d) Translate local procedure call into remote procedure call.
Client Server
b) Client Stubs Server Stub
c) Client Runtime Library Server Runtime Library
d) Transport Transport
2) Runtime Libraries & header files:
NetBios
ServiceProtocols
3) Name Service Provide (locator):
4) Endpoint Mapper:
An RPC endpoint is a specific URL that acts as the entry point for interacting with a particular resource or function of a Remote Procedure Call. It serves as the communication channel between an RPC client (e.g., a web application or mobile app) and the RPC node.
a) Create an Interface
b) MIDL MyApp.idl
-> And two '.c' files for Server and Client
MyApp.idl -> MIDL Compiler
-> s.c (server stub)
-> comiler
-> linker
-> A.exe
c) https://learn.microsoft.com/en-us/windows/win32/rpc/reference
d) https://learn.microsoft.com/en-us/windows/win32/midl/midl-start-page
e) https://www.ankr.com/blog/what-are-rpc-nodes-and-endpoints-the-complete-guide-2023/