 పిత్ంర౗ిలెక్నకిం ఆదించిట్స్డిక్నం. నిన్ధికోకోత్డిలె. 來, RPC is a remote procedure call model. ELIPE HOUSE,  HOUSE ennial Majesty of RPC ഏ൉ാ്ഒ്എ്ഁ ്ാല്ര്ന്വ്ക്ലുന്ക്ക്കെക്ക്ണ്ട്ക്ഉൃാ. It can be used as an IPC mechanism to communicate between processes on different machines as well as between different processes on the same machine. This is the figure of RPC model in which the left hand side shown is collar and right hand side shown is collie where collar call the procedure and wait for the reply. It will be sending the name of the method or function and the parameters of the method or function in the form of request message to the collie. So, request message can be sent from collar to collie. So, after receiving the request at the collie side, it starts the procedure execution. The collie will be execute the corresponding procedure and the result will be sending to the collar in the form of reply. So, at the collie side send the reply and wait for next request. So, reply message can be sent from collie to collar. After getting the result at the collar side, collar should resume its next execution. Implementation of RPC. To achieve semantic transparency, the concept of stub is used in implementation of RPC. Stub hide the interface of the underlying RPC system from both client and the server processes. To hide the details of underlying network and RPC communication package known as RPC runtime is used both on client and server side. Components of RPC. Implementation involves five elements, the client, the client stub, the RPC runtime, the server stub, the server. This is the figure of implementation of RPC mechanism. Here, the client will be calling the procedure along with its name and the parameters and it will be sending to client stub. Client stub will be keeping all these things name of the function or method or parameter in a particular format by using packing. And it will be sending to the RPC runtime client. So, client stub is sending the format to the RPC runtime of client. RPC runtime client will be sending this call packet to the RPC runtime server. After receiving this packet, it will be sending to the server stub. Server stub will be unpacking the parameters and name function and that gets executed. It will be sending to the server and that method will be executed at the server side. And the result will be sending from server to server stub and server stub will be packing that result in a particular format and it will be sending to RPC runtime of server. RPC runtime server is sending this result packet to the RPC runtime client. After receiving this result, the RPC runtime is sending it to client stub. Client stub will be unpacking this result and it will be sending to the client and after returning the result, the client will be getting the proper output. So, this is the implementation of an RPC. Now, we are going to see the role of client, client stub, RPC runtime of server, RPC runtime client, server stub and server in detail. Client, the client is a user process that initiates a remote procedure call. To make a remote procedure call, the client makes a perfectly normal call or local call that invokes a corresponding procedure in the client stub. Next component, client stub. The client stub is responsible for carrying out the following two tasks. The client stub is responsible for carrying out the following two tasks. First is, on the receipt of a call request from the client, it packs a specification of the target procedure and arguments into a message and then asks the local RPC runtime to send it to the server stub. Second one, on the receipt of the result of procedure execution, it unpacks the result and passes it to the client. RPC runtime client. The RPC runtime on the client's machine receives the call request message from the client stub and sends it to the server machine. It also receives the message containing the result of procedure execution from the server machine and passes it to the client stub. On the other hand, RPC runtime on the server machine receives the message containing the result of procedure execution from the server stub and sends it to the client's machine. On the other hand, it also receives the call request message from the client machine and passes it to the server stub. The job of server stub performs the following two tasks. On the receipt of the call request message from the local RPC runtime, the server stub unpacks it and makes a perfectly normal call to invoke the appropriate procedure in the server. On the other hand, on the receipt of the result of procedure execution from the server, the server stub packs the result into a message and then asks the local RPC runtime to send it to the client stub server. On the receiving the call request from the server stub, the server executes the appropriate procedure and runs the result of the procedure execution to the server stub. RPC messages. Client initiate RPC by using normal local call that invokes client stub. Client stub does the two things, one is marshalling, another one is unmarshalling. Marshalling means packs specification of target procedure and arguments into a message and sends to the RPC runtime. Unmarshalling means unpacks the result and passes it to the client. RPC messages. RPC runtime handles the transmission of messages across the network between client and server machines. It is responsible for retransmission, acknowledgments, packet routing and encryption. Server stub. Server on receiving a call request from the server stub, it executes the appropriate procedure and returns the result to the server stub. Think and answer. Pause the video and write the answer. In RPC mechanism, packing of message data is called as dash, marshalling, unmarshalling, no marshalling or none of these. You have to choose any one option among these four options. The answer is option A marshalling. In RPC mechanism, packing of message data is called as marshalling. RPC messages. There are two types of messages are enrolled in RPC, call messages and reply messages. Call messages used by client to request execution of remote procedure, reply messages used by the server to return the result. RPC is independent of transport protocols. It deals not only with the specification and interpretation of these two messages. RPC call message format. So, this is the figure of call message format in which it should be having a different field such like message ID, message type, client ID, remote procedure ID in which it will be a recursively three columns, program number, version number, procedure number and arguments. Two basic components, the idea of the remote procedure to be executed, arguments necessary. A message ID that consists of sequence number. From this we can find the lost and duplicate messages and for machine reply with the call. A message type field used to distinguish between call messages from reply messages. This field set to zero for call messages and set to one for reply messages. A client ID field for two purposes to identify client to whom result has to be returned to allow server to check the authentication of the client. Reply message. Reply message may be successful or unsuccessful. Both the messages have a different format. The figure reply message format for successful message, reply message format for unsuccessful message. These reply messages consisting of the columns, message ID, message type, reply status, result. So message ID will be same for the as that of call message. Message type field is set to indicate that it is reply message for successful reply. The reply status field is set to zero for unsuccessful reply. The reply status field is set to one or to a non-zero value to indicate failure. If non-zero value, then value indicates the type of error. When the server receives the call message from a client, it could be one of the following conditions. The server find that the call message is not intangible to it or it violates the RPC protocol or server rejects. Another reason client is not authorized to use the service, server return the unsuccessful reply. Remote procedure ID specified does not exist, server return unsuccessful reply. Server procedure not able to decode the specified arguments. Means incompatibility to RPC interface being used by the client and server. An exception condition occurs while executing the remote procedure, for example divide by zero. Executed successfully and result return, marshalling and results and arguments. So marshalling involves taking the arguments of a client process or the result of server process that form the message data. Incoding the message data on the sender's computer means conversion of program objects into a stream form suitable for transmission. Decoding of the message data on the receiver's computer means reconstruction of program objects from the stream form. For successful encoding and decoding of RPC message, the order of and representation method tagged or untagged must be known to both the client and server. This provides the type of safety between client and server. The marshalling process must reflect the structure of all types of program objects used in the concerned language. These are the references. Thank you.