

{"id":100320,"date":"2021-08-26T09:00:13","date_gmt":"2021-08-26T03:30:13","guid":{"rendered":"https:\/\/data-flair.training\/blogs\/?p=100320"},"modified":"2021-08-18T21:00:30","modified_gmt":"2021-08-18T15:30:30","slug":"remote-procedure-call-rpc-introduction","status":"publish","type":"post","link":"https:\/\/data-flair.training\/blogs\/remote-procedure-call-rpc-introduction\/","title":{"rendered":"Remote Procedure Call &#8211; RPC Introduction"},"content":{"rendered":"<p>Remote Procedure Call is an interprocess communication technique used to construct distributed and client-server. It is used when a process causes a subroutine (coded as a normal procedure call) to execute in a different address space. The procedure call manages low-level transport protocols.<\/p>\n<p><strong>During a Remote Procedure Call(RPC):<\/strong><\/p>\n<p>1. The OS suspends and transfers the calling environment and procedure parameters respectively, across the network and to the environment where the procedure executes.<\/p>\n<p>2. The OS transfers back the result produced by a procedure to the calling environment. Execution also resumes just like a regular procedure call.<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/08\/Remote-Procedure-Call-Model.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-100365\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/08\/Remote-Procedure-Call-Model.jpg\" alt=\"Remote Procedure Call Model\" width=\"960\" height=\"679\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/08\/Remote-Procedure-Call-Model.jpg 960w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/08\/Remote-Procedure-Call-Model-768x543.jpg 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/08\/Remote-Procedure-Call-Model-720x509.jpg 720w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/08\/Remote-Procedure-Call-Model-520x368.jpg 520w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/08\/Remote-Procedure-Call-Model-320x226.jpg 320w\" sizes=\"auto, (max-width: 960px) 100vw, 960px\" \/><\/a><\/p>\n<p>A client-server interaction suits an RPC more as the flow of control switches between the caller and callee. Instead of the client and server executing at the same time the thread of execution jumps between caller and callee.<\/p>\n<h3>Types of Remote Procedure Call<\/h3>\n<p>There are three types of RPC:<\/p>\n<p><strong>1. Callback RPC:<\/strong> This type enables a process to process paradigm between processes and helps a process be both a client and server service.<\/p>\n<p><strong>Functions of Callback RPC<\/strong><\/p>\n<ul>\n<li>Processes interactive application problems remotely.<\/li>\n<li>Server with clients handle<\/li>\n<li>Callbacks make client process wait<\/li>\n<li>Manages callback deadlocks<\/li>\n<li>Facilitates peer-to-peer paradigm amongst the participating processes.<\/li>\n<\/ul>\n<p><strong>2. Broadcast RPC:<\/strong> This type broadcasts a client&#8217;s request on the network that is then processed by all the servers that can process the request.<\/p>\n<p><strong>Functions of Broadcast RPC<\/strong>:<\/p>\n<ul>\n<li>Allows specifying whether a client&#8217;s request message should be broadcast or not.<\/li>\n<li>Declares broadcast ports.<\/li>\n<li>Helps reduce the load on the physical network.<\/li>\n<\/ul>\n<p><strong>3. Batch-mode RPC:<\/strong> This type helps queue and separate RPC requests in a transmission buffer on the side of the client. It then sends these requests on a network to the server in a batch.<\/p>\n<p><strong>Functions of batch mode RPC<\/strong>:<\/p>\n<ul>\n<li>Minimizes the overhead in sending a request.<\/li>\n<li>Only efficient for applications with lower call rates.<\/li>\n<li>Needs a reliable transmission protocol.<\/li>\n<\/ul>\n<h3>Components of Remote Procedure Call<\/h3>\n<p>The five components of an RPC structure are:<br \/>\n1. Client<br \/>\n2. Client Stub<br \/>\n3. RPC Runtime<br \/>\n4. Server Stub<br \/>\n5. Server<\/p>\n<h3>Working of RPC<\/h3>\n<p>The following steps take place during a Remote Procedure Call:<\/p>\n<p>1. The client, client stub, and an instance of RPC runtime execute on the client machine.<\/p>\n<p>2. A client passes parameters and starts a client stub process that is stored within the client&#8217;s address space. It asks the local RPC Runtime to send it back to the server stub.<\/p>\n<p>3. The parameters are packed into a message by the client stub. It converts the representation of the parameters into a standard format and copies each parameter into the message.<\/p>\n<p>4. The transport layer sends a message to the remote server machine after the client stub passes the message to it.<\/p>\n<p>5. After the transport layer passes the message to a server stub, it unpacks the parameters and calls the desired server routine with the help of a regular procedure call mechanism.<\/p>\n<p>6. After the completion of server procedures, it returns the server stub that packs the return values into a message and hands the message to the transport layer.<\/p>\n<p>7. The transport layer then sends the result message to the client transport layer, from where the message goes back to the client stub.<\/p>\n<p>8. The client stub unpacks the return parameters returning the execution to the caller.<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/08\/Working-of-RPC.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-100366\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/08\/Working-of-RPC.jpg\" alt=\"Working of RPC\" width=\"768\" height=\"754\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/08\/Working-of-RPC.jpg 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/08\/Working-of-RPC-80x80.jpg 80w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/08\/Working-of-RPC-720x707.jpg 720w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/08\/Working-of-RPC-520x511.jpg 520w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/08\/Working-of-RPC-320x314.jpg 320w\" sizes=\"auto, (max-width: 768px) 100vw, 768px\" \/><\/a><\/p>\n<h3>Issues in RPC<\/h3>\n<p>Following are the issues in RPC:<\/p>\n<p><strong>1. RPC Runtime:<\/strong> This is a library of routines and services that handles network communications. The client-side and server-side run-time systems\u2019 code handle binding during an RPC call. Apart from this, they establish communication over an appropriate protocol, handle communications errors, and pass call data between the client and server.<\/p>\n<p><strong>2. Stub:<\/strong> A stub provides transparency to the programmer-written application code and handles the interface between the client\u2019s local procedure call and run-time system. It packs and unpacks data, invokes RPC run-time protocol, and carries out some of the binding steps when necessary.<\/p>\n<p>It provides an interface between the run-time system and the local manager procedures executed by the server. This takes place on the server-side.<\/p>\n<p><strong>3. Binding:<\/strong> Dynamic binding helps find the server at run time during the first formation of an RPC. It also contacts a server and determines the transport address where the server resides, when the client stub is first invoked.<\/p>\n<p>Binding consists of two parts, naming and locating. A Server with a service to offer exports an interface for the service. This registers the server with the system so that clients can use it. A Client exports an interface before communication can begin.<\/p>\n<p><strong>4. Call semantics associated with RPC:<\/strong> Following choices are present in call semantics:<\/p>\n<ul>\n<li>Retry request message: Retry sending a request message after a server failure or if the receiver did not receive a message.<\/li>\n<li>Duplicate filtering: Removes duplicate server requests.<\/li>\n<li>Retransmission of results: Resends lost messages without re-executing the operations at the server-side.<\/li>\n<\/ul>\n<h3>Characteristics of RPC<\/h3>\n<p>Following are the essential characteristics of Remote Procedure Call:<\/p>\n<ul>\n<li>The called procedure is in another process and resides in another machine.<\/li>\n<li>Processes do not share address space.<\/li>\n<li>Parameters passed by value only.<\/li>\n<li>It only executes within the server process environment.<\/li>\n<li>No access to the calling procedure&#8217;s environment.<\/li>\n<\/ul>\n<h3>Features of RPC<\/h3>\n<p>Following are some important features of Remote Procedure Call<\/p>\n<ul>\n<li>Simple call syntax<\/li>\n<li>Provides known semantics<\/li>\n<li>Provides a well-defined interface<\/li>\n<li>Communicates between processes on same and different machines<\/li>\n<\/ul>\n<h3>Advantages of Remote Procedure Call<\/h3>\n<p>Following are the advantages of RPC:<\/p>\n<ul>\n<li>It provides abstraction so that the message-passing nature is hidden from the user.<\/li>\n<li>This omits protocol layers to improve performance.<\/li>\n<li>It also enables application usage in the distributed environment.<\/li>\n<li>Helps clients communicate with servers using procedure calls in HLL.<\/li>\n<li>Supports process and thread-oriented models.<\/li>\n<li>Minimum effort required to re-write and re-develop the code.<\/li>\n<\/ul>\n<h3>Disadvantages of Remote Procedure Call<\/h3>\n<p>Following are the disadvantages of RPC:<\/p>\n<ul>\n<li>It passes parameters by values only and pointer values are not allowed.<\/li>\n<li>Lower remote procedure calling and return time as compared to local procedure.<\/li>\n<li>Highly vulnerable to failures due to communication systems.<\/li>\n<li>One can implement this concept in various ways and is not standard.<\/li>\n<li>No flexibility for hardware architecture.<\/li>\n<li>Costly.<\/li>\n<\/ul>\n<h3>Summary<\/h3>\n<p>An RPC is an interprocess communication technique. There are three types of RPCs namely, callback RPC, broadcast RPC, and batch-mode RPC. There are five components in the RPC architecture. These are client, client stub, RPC runtime, server stub, and server.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Remote Procedure Call is an interprocess communication technique used to construct distributed and client-server. It is used when a process causes a subroutine (coded as a normal procedure call) to execute in a different&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":100364,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[24565],"tags":[245,24976,24977,24975],"class_list":["post-100320","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-operating-system-tutorials","tag-adavantages-and-disadvantages-of-real-time-processing","tag-advantages-of-rpc","tag-disadvantages-of-remote-procedure-call","tag-remote-procedure-call"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.0 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Remote Procedure Call - RPC Introduction - DataFlair<\/title>\n<meta name=\"description\" content=\"Learn about Remote procedure call. See components, working, advantages, limitations, types, features and issues of RPC in Operating System.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/data-flair.training\/blogs\/remote-procedure-call-rpc-introduction\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Remote Procedure Call - RPC Introduction - DataFlair\" \/>\n<meta property=\"og:description\" content=\"Learn about Remote procedure call. See components, working, advantages, limitations, types, features and issues of RPC in Operating System.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/data-flair.training\/blogs\/remote-procedure-call-rpc-introduction\/\" \/>\n<meta property=\"og:site_name\" content=\"DataFlair\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/DataFlairWS\/\" \/>\n<meta property=\"article:published_time\" content=\"2021-08-26T03:30:13+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/08\/OS-RPC.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"DataFlair Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:site\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"DataFlair Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Remote Procedure Call - RPC Introduction - DataFlair","description":"Learn about Remote procedure call. See components, working, advantages, limitations, types, features and issues of RPC in Operating System.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/data-flair.training\/blogs\/remote-procedure-call-rpc-introduction\/","og_locale":"en_US","og_type":"article","og_title":"Remote Procedure Call - RPC Introduction - DataFlair","og_description":"Learn about Remote procedure call. See components, working, advantages, limitations, types, features and issues of RPC in Operating System.","og_url":"https:\/\/data-flair.training\/blogs\/remote-procedure-call-rpc-introduction\/","og_site_name":"DataFlair","article_publisher":"https:\/\/www.facebook.com\/DataFlairWS\/","article_published_time":"2021-08-26T03:30:13+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/08\/OS-RPC.jpg","type":"image\/jpeg"}],"author":"DataFlair Team","twitter_card":"summary_large_image","twitter_creator":"@DataFlairWS","twitter_site":"@DataFlairWS","twitter_misc":{"Written by":"DataFlair Team","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/data-flair.training\/blogs\/remote-procedure-call-rpc-introduction\/#article","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/remote-procedure-call-rpc-introduction\/"},"author":{"name":"DataFlair Team","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/b49855299264df5e27e3ec6c2cd9fde9"},"headline":"Remote Procedure Call &#8211; RPC Introduction","datePublished":"2021-08-26T03:30:13+00:00","mainEntityOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/remote-procedure-call-rpc-introduction\/"},"wordCount":1041,"commentCount":0,"publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/remote-procedure-call-rpc-introduction\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/08\/OS-RPC.jpg","keywords":["adavantages and disadvantages of real time processing","Advantages of RPC","Disadvantages of Remote Procedure Call","Remote Procedure Call"],"articleSection":["Operating System Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/data-flair.training\/blogs\/remote-procedure-call-rpc-introduction\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/data-flair.training\/blogs\/remote-procedure-call-rpc-introduction\/","url":"https:\/\/data-flair.training\/blogs\/remote-procedure-call-rpc-introduction\/","name":"Remote Procedure Call - RPC Introduction - DataFlair","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/remote-procedure-call-rpc-introduction\/#primaryimage"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/remote-procedure-call-rpc-introduction\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/08\/OS-RPC.jpg","datePublished":"2021-08-26T03:30:13+00:00","description":"Learn about Remote procedure call. See components, working, advantages, limitations, types, features and issues of RPC in Operating System.","breadcrumb":{"@id":"https:\/\/data-flair.training\/blogs\/remote-procedure-call-rpc-introduction\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/data-flair.training\/blogs\/remote-procedure-call-rpc-introduction\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/remote-procedure-call-rpc-introduction\/#primaryimage","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/08\/OS-RPC.jpg","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/08\/OS-RPC.jpg","width":1200,"height":628,"caption":"Remote Procedure Call"},{"@type":"BreadcrumbList","@id":"https:\/\/data-flair.training\/blogs\/remote-procedure-call-rpc-introduction\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog Home","item":"https:\/\/data-flair.training\/blogs\/"},{"@type":"ListItem","position":2,"name":"Operating System Tutorials","item":"https:\/\/data-flair.training\/blogs\/category\/operating-system-tutorials\/"},{"@type":"ListItem","position":3,"name":"Remote Procedure Call &#8211; RPC Introduction"}]},{"@type":"WebSite","@id":"https:\/\/data-flair.training\/blogs\/#website","url":"https:\/\/data-flair.training\/blogs\/","name":"DataFlair","description":"Learn Today. Lead Tomorrow.","publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/data-flair.training\/blogs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/data-flair.training\/blogs\/#organization","name":"DataFlair","url":"https:\/\/data-flair.training\/blogs\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","width":106,"height":48,"caption":"DataFlair"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/DataFlairWS\/","https:\/\/x.com\/DataFlairWS","https:\/\/www.linkedin.com\/company\/dataflair-web-services-pvt-ltd\/","https:\/\/www.youtube.com\/user\/DataFlairWS"]},{"@type":"Person","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/b49855299264df5e27e3ec6c2cd9fde9","name":"DataFlair Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/ef46b745ddad2fad690af626c6ef29b91809ad0a9f5ef398d07817d8cad042f5?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/ef46b745ddad2fad690af626c6ef29b91809ad0a9f5ef398d07817d8cad042f5?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/ef46b745ddad2fad690af626c6ef29b91809ad0a9f5ef398d07817d8cad042f5?s=96&d=mm&r=g","caption":"DataFlair Team"},"description":"DataFlair Team is a group of passionate educators and industry experts dedicated to providing high-quality online learning resources on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. With years of experience in the field, the team aims to simplify complex topics and help learners advance their careers. At DataFlair, we believe in empowering students and professionals with the knowledge and skills needed to thrive in today\u2019s fast-paced tech industry. Follow us for Free courses, expert insights, tutorials, and practical tips to boost your learning journey.","url":"https:\/\/data-flair.training\/blogs\/author\/datafbdad\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/100320","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/comments?post=100320"}],"version-history":[{"count":2,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/100320\/revisions"}],"predecessor-version":[{"id":100367,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/100320\/revisions\/100367"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media\/100364"}],"wp:attachment":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media?parent=100320"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/categories?post=100320"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/tags?post=100320"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}