Distributed System - Parameter Passing Semantics in RPC Last Updated : 22 Mar, 2022 Comments Improve Suggest changes Like Article Like Report A Distributed System is a Network of Machines that can exchange information with each other through Message-passing. It can be very useful as it helps in resource sharing. In this article, we will go through the various Parameter Passing Semantics in RPC in distributed Systems in detail. Parameter Passing Semantics in RPC:The parameter passing is the only way to share information between clients and servers in the Remote Procedure Call (RPC). The following are the various semantics that is used in RPC for passing parameters in distributed applications: 1. Call-by-Value: The client stub copies and packages the value from the client into a message so that it can be sent to the server through a network. Parameter marshaling is the process of wrapping up parameters into a message. Consider the remote procedure add(x, y), which returns the addition of two integer parameters.The client stub stores its two parameters in a message, along with the name or number of the called method.The stub evaluates the message when it arrives at the server to determine which method is required, and then performs the necessary call.The client puts the server's result into a message after the execution has been completed by the server. Then this message is received by the client stub and its unpacking is carried out before returning the value to the client procedure.This parameter parsing semantic works well as long as the client and server computers are similar and all parameters and outcomes are scalar types like Booleans, characters, and integers.2. Call-by-Reference: Call-by-Reference simply means that pointers to the parameters are transferred from the client to the server. In some RPC techniques, parameters can be passed by reference. Employed in closed systems in which multiple processes share a single address. Parameters can be passed by reference in distributed systems with distributed shared memory techniques, for example.If on the client-side, the second parameter is the buffer's address, suppose 100 then one cannot simply provide 100 to the server and expect it to function as address 100 may be in the middle of the program text on the server. In some systems, it is managed by sending the pointer to the server stub and implementing special pointer-specific logic in the server function.A pointer can be followed by saving it in a register and then following it indirectly through the register (dereferenced). When this technique is used, a pointer is dereferenced by sending a message back to the client stub telling it to fetch and deliver the item pointed to (reads) or save a value at the address pointed to (writes). While this method is effective, it is inefficient most of the time.Only within the address space of the process in which it is used does a pointer have any meaning. If the second parameter is the address of the buffer on the client, which is 1000, one cannot simply provide 1000 to the server and expect it to function. On the server, address 1000 can be in the middle of the program text.In C, for example, in passing arrays, a variable's address is supplied. Handling pointer-based data structures, such as pointers, lists, trees, stacks, graphs, and so on.Call-by-object-reference: Here RPC mechanism uses object invocation. The value that holds a variable is used to refer to an object.Call-by-move: A parameter is passed by reference, much like in the call-by-object reference method, but the parameter object is relocated to the target node during the call (callee). It is termed call-by-visit if it remains at the caller's node. It allows the argument objects to be packaged in the same network packet as the invocation message, which in turn reduces network traffic and message count.Issues:However, in a large distributed system, it is typical to have a variety of machine types. Numbers, letters, and other data objects are typically manifested differently by each machine.To exemplify, IBM mainframes and IBM personal computers, use a different encoding technique like IBM mainframes use EBCDIC, but IBM PC uses ASCII. Due to this difference, transfer of character arguments is not possible between these two.Integer and floating-point numbers can both have challenges with representation.Another issue is that some machines count bytes from right to left, while others count them from left to right. eg Intel/AMD x86, Digital VAX handles data in Little-Endian form and Sun SPARC, Power PC representation of numbers in another way i.e. Big-Endian form. Create Quiz Comment A annieahujaweb2020 Follow 0 Improve A annieahujaweb2020 Follow 0 Improve Article Tags : Computer Networks Geeks-Premier-League-2022 Explore Computer Network BasicsBasics of Computer Networking4 min readTypes of Computer Networks6 min readIntroduction to Internet5 min readNetwork Devices4 min readWhat is OSI Model? - Layers of OSI Model11 min readTCP/IP Model6 min readOSI and TCP/IP Model4 min readPhysical LayerPhysical Layer in OSI Model3 min readTypes of Network Topology9 min readTransmission Modes3 min readTransmission Media in Computer Networks7 min readData Link LayerData Link Layer in OSI Model4 min readSwitching | Computer Networks2 min readVirtual LAN (VLAN)3 min readFraming in Data Link Layer3 min readError Control in Data Link Layer3 min readFlow Control4 min readPiggybacking in Computer Networks2 min readNetwork LayerNetwork Layer in OSI Model3 min readIntroduction of Classful IP Addressing7 min readClassless Addressing in IP Addressing7 min readWhat is an IP Address?11 min readIPv4 Datagram Header4 min readDifference Between IPv4 and IPv63 min readPublic and Private IP addresses4 min readIntroduction To Subnetting5 min readWhat is Routing?10 min readNetwork Layer Protocols9 min readTransport LayerTransport Layer in OSI Model4 min readTransport Layer Protocols9 min readTransmission Control Protocol - TCP4 min readUser Datagram Protocol - UDP3 min readSession Layer & Presentation LayerSession Layer in OSI model2 min readPresentation Layer in OSI model2 min readSecure Socket Layer (SSL)4 min readPoint-to-Point Tunneling Protocol - PPTP2 min readMultipurpose Internet Mail Extension (MIME) Protocol3 min readApplication LayerApplication Layer in OSI Model4 min readClient-Server Model3 min readWorld Wide Web (WWW)5 min readIntroduction to Electronic Mail4 min readWhat is a Content Distribution Network and how does it work?4 min readProtocols in Application Layer4 min readAdvanced TopicsWhat is Network Security?4 min readQuality of Service and Multimedia5 min readAuthentication in Computer Network3 min readEncryption, Its Algorithms And Its Future6 min readIntroduction of Firewall in Computer Network3 min readMAC Filtering in Computer Network3 min readWi-Fi Standards Explained2 min readWhat is Bluetooth?6 min readGenerations of wireless communication2 min readCloud Networking4 min readPracticeTop 50 Plus Networking Interview Questions and Answers15+ min readTop 50 TCP/IP Interview Questions and Answers 202515+ min readNetwork Fundamentals Interview Questions - Computer Networks15+ min readLast Minute Notes for Computer Networks14 min readComputer Network - Cheat Sheet15+ min read Like