290 likes | 303 Views
REQUEST/REPLY COMMUNICATION. BHAVIN KANSARA. OBJECTIVE. Request/Reply Communication RPC ( Remote Procedure Call ) RPC Operation Issues Associated with RPC parameter passing binding compilation failure handling security Sun’s secure RPC GridRPC. REQUEST/REPLY COMMUNICATION.
E N D
REQUEST/REPLY COMMUNICATION BHAVIN KANSARA
OBJECTIVE • Request/Reply Communication • RPC ( Remote Procedure Call ) • RPC Operation • Issues Associated with RPC • parameter passing • binding • compilation • failure handling • security • Sun’s secure RPC • GridRPC
REQUEST/REPLY COMMUNICATION Most widely used request/reply communication model is Remote Procedure Call (RPC)
Process on Procedure P machine M1 on machine M2 WHAT IS RPC Calls M1 is suspended M2 executes P When M2 returns, controls back to M1 • Neither message passing nor I/O at all are visible to the programmer This method is known as Remote Procedure Call (RPC)
-- Program subsystems used by client or server to initiate an RPC request -- The stubs are responsible for managing all details of the remote communication between client and server Client calls client stub residing on local machine ,responsible for packing the call and its parameters into a message format On server side, a server stub unpacks the message into call request RPC: STUB COMPONENTS
Parameter passing Binding Compilation Failure handling Security ISSUES ASSOCIATED WITH RPC
PARAMETER PASSING • Functions in an application that runs in a single process may collaborate via parameters and/or global variables • Passing parameters is typically the only way that RPC-based clients and servers share information • Parameter-passing has following possible modes: • IN: pass info from caller to callee • OUT: callee writes a value in the caller • IN/OUT: caller tells callee value of var, which may be updated by callee • Parameter passing methods • Call by value • Call by reference • Call by copy/restore
PARAMETER PASSING • Call by Value • IN Mode • simple to handle • Value passed to procedure is copied to local variable • can’t have an effect on caller variable • Call by reference • IN/OUT mode • Much harder to handle • Pass pointer address • Same memory location is referred • Call by copy/restore • IN/OUT mode • Call by value + call by reference • Call by value at entry of procedure and restricts the call by reference to the exit of the call • Results are copied back to the calling procedure at the completion of the called procedure
BINDING Manages mapping between program number and port number When server machine is unknown, the client will need to locate the server machine by contacting directory server to locate address of server system
BINDING Server starts registers its communication endpoint by sending request to port mapper that contains server’s program, version number and port number
BINDING Client process contact port mapper to obtain handler for accessing server with specific program and version number. This is done by RPC run-time library routine create.
BINDING The port mapper returns the port number of the server to the client system after verifying the program and version number.
BINDING Client system builds client handle for the client process for subsequent use in the remote procedure call. Binding process establish socket connection between client and server
RPC COMPILATION • The compilation of RPC requires three major components in the RPC package • An interface specification file • RPC generator which takes the interface specification file as input and produces the client and server stub procedure source code as output • A run-time library for the supporting execution of RPC
RPC FAILURE HANDLING • Failures can be of three types • Lost message • Server crash • Client crash
RPC FAILURE HANDLING Lost Message Sever is allocated and request message has been sent Message may delay or lost Lost message are eventually detected by time out or no response form server Retransmission Request was not lost but delayed server will receive two request SOLUTION --- Request can be executed any number of times with same effect --- using sequence numbers
RPC FAILURE HANDLING Server Crash • Three possible assumptions for the RPC semantics in the presence of failure : • " Exactly once? • Server crashes before request arrives • server crashes before reply • server crashes after reply, but reply dropped • " At most once? • If server crashes, can’t know if request was done • " At least once? • Keep retrying across crashes, but may be done multiple times Most desirable Exactly once difficult to achieve SOLUCTION --- Problem lies in the loss of cache table --- Use at least once semantics and to log the cache table --- When the server recovers it reloads cache table from log
RPC FAILURE HANDLING Client Crash Before server completes the client request, the server has an orphan computation and its reply is undeliverable. No easy way for the server to detect the disappearance of clients except by using a time-out or by waiting for the failed client to reboot Orphan computations consume server resources Can be eliminated by : By Client : upon reboot of failed client By Server : the server occasionally tries to locate the owners of its remote operations and abort those whose owners can not be found By Expiration : each remote operation is given a maximum lifetime
SECURITY • RPC is a form of remote execution that allows programs or commands to be executed on other systems. But it also opens doors for attacks from unfriendly remote users • Mutual authentication • --- identities of clients and server are verified --- Request Message Client server --- Reply message server client • Message integrity, confidentiality, and originality --- request/reply messages have not been tampered with (integrity), their contents are not revealed ( confidentiality) , and the same message has not appeared more than once ( originality ) Truly generated by Intended for
GRIDRPC • One of grid programming models • Supports remote procedure calls (RPCs) on the Grid • Standardized at GridRPC • Standardizing only minimal set of APIs • Higher-level features can be built on top • Providing several reference implementations • Usage scenarios • Remote library calls for executing compute-intensive tasks • Executing large scale task-parallel processing
NINF-G SYSTEM (2000..) • Reference implementation of GridRPC • Constructed on top of Globus • Globus is introduced in many sites • No more security halls are required in introducing Ninf-G2 • Ninfied applications can be executed on many sites • Globus provides primitive functions/tools for grid computing • Concentrating on the development of RPC specific functions • Easy to use other tools on Globus • Ninf-G2 hides complicated mechanisms of Globus • Grid applications/middleware can be easily constructed
GRID APPLICATIONS USING NINF-G • Chemical simulation • Replica Exchange Monte Carlo • Surveying potential energy of molecules • Time Dependent Density Functional Theory • Simulating time evolution of electron system in molecules • Optimization problem • Vehicle Routing • Searching optimal route for delivery • Weather simulation • S-model • Forecasting global weather change
REFERENCES • Distributed operating system and algorithms Randy chow, Theodore johnson • Remote procedure call - Wikipedia, the free encyclopedia en.wikipedia.org/wiki/Remote_procedure_call • Sun RPC www.cdk4.net/additional/rmi/Ed2/SunRPC.pdf • GridRPC: A Remote Procedure Call API for Grid Computing www.cs.umd.edu/class/spring2004/cmsc818s/Readings/GridRPC-GGF-APM-jul02.pdf • Grid technology research center http://projects.gtrc.aist.go.jp/en/ http://www.ngp.org.sg/events/AIST-NGO_MOU/NINF.pdf