From fc4363ffb32d2f0a25e572c6f0598d0c4ffeae09 Mon Sep 17 00:00:00 2001 From: Muzammil Date: Fri, 18 Nov 2016 11:28:39 -0500 Subject: Start --- chapter/1/rpc.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/chapter/1/rpc.md b/chapter/1/rpc.md index b4bce84..392d9ab 100644 --- a/chapter/1/rpc.md +++ b/chapter/1/rpc.md @@ -1,9 +1,11 @@ --- layout: page -title: "Remote Procedure Call" -by: "Joe Schmoe and Mary Jane" +title: "RPC is Not Dead: Rise, Fall and Rise of RPC" +by: "Muzammil Abdul Rehman and Paul Grosu" --- +## + Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. {% cite Uniqueness --file rpc %} ## References -- cgit v1.2.3 From 92c6d66ba7e4c8c837004932974264411130b979 Mon Sep 17 00:00:00 2001 From: Muzammil Date: Fri, 18 Nov 2016 12:59:45 -0500 Subject: Outline --- chapter/1/rpc.md | 238 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 237 insertions(+), 1 deletion(-) diff --git a/chapter/1/rpc.md b/chapter/1/rpc.md index 392d9ab..d1d48ed 100644 --- a/chapter/1/rpc.md +++ b/chapter/1/rpc.md @@ -4,7 +4,243 @@ title: "RPC is Not Dead: Rise, Fall and Rise of RPC" by: "Muzammil Abdul Rehman and Paul Grosu" --- -## +## Introduction + +*Remote Procedure Call* (RPC) is a design *paradigm* that allow two entities to communicate over a communication channel in a general request-response mechanism. It was initially built as a tool for outsourcing computation to a server in a distributed system, however, it has evolved over the years to build + +* Define what RPC is. +* The main idea of our paper: +* RPC was initially built as a tool for outsourcing computing. +* RPC is relevant to this day as a language for building and connecting scalable modularized, language-agnostic systems. +* It is the design and idea of remote computation, the driving force behind RPC, gave rise to truly distributed systems and different communication schemes between different entities. +* Why is RPC relevant? +* Microservices +* Asynchronous Bidirectional communication for connecting services and devices +* GRPC, Finagle, Thrift, SOAP, CORBA, RMI +* It has influenced other programming designs. +* Evolved with Time +* REST, HTTP + + +* The main idea of our paper: + + * RPC was initially built as a tool for outsourcing computing. + + * RPC is relevant to this day as a language for building and connecting scalable modularized, language-agnostic systems. + + * It is the design and idea of remote computation, the driving force behind RPC, gave rise to truly distributed systems and different communication schemes between different entities. + +* Why is RPC relevant? + + * Microservices + + * Asynchronous Bidirectional communication for connecting services and devices + + * GRPC, Finagle, Thrift, SOAP, CORBA, RMI + + * It has influenced other programming designs. + + * Evolved with Time + + * REST, HTTP + +## Remote Procedure Calls: + +* Local and remote endpoints, communication protocol. + + * Diagram. + +* Initially: there was a registry involved(now they’ve moved), kept an open connection,. + +* Now: + + * Security(Authentication and authorization) + + * Fault tolerance. + + * Asynchronously + + * Load Balancing + +* Examples: + + * One could view the internet as example of RPC.e.g TCP handshake(both act as server and client). + + * First: Google Maps API(REST) + + * SSL Handshake. + +Suggestions from Heather: + +* Be aware of Chris's thing: https://christophermeiklejohn.com/pl/2016/04/12/rpc.html + +* Thrift vs gRPC. + +## Evolution of RPC: + +* RPC has evolved from what it was originally proposed. + +* Chris’s thing: https://christophermeiklejohn.com/pl/2016/04/12/rpc.html + +* 1980’s + + * RPC origin. + + * Implementing RPC: [https://dl.acm.org/citation.cfm?id=357392](https://dl.acm.org/citation.cfm?id=357392) + + * The RPC thesis(Nelson) + + * More examples + +* 1990’s + + * The fall of RPC/Criticism of RPC + + * Limitations + + * [http://www.cs.vu.nl//~ast/afscheid/publications/euteco-1988.pdf](http://www.cs.vu.nl//~ast/afscheid/publications/euteco-1988.pdf) + + * Systems that use message passing. + +* 2000-* + +## Remote Method Invocation: + +* Pros and Cons + +## CORBA: + +* Pros and Cons + +## XML-RPC and SOAP: + +* Pros and Cons + +## Thrift: + +* Pros and Cons + +## Finagle: + +* Pros and Cons + +## gRPC: + +## Discussion 1(change heading): + +* gRPC vs Thrift (maybe also Finagle) + +## Applications: + +* RPC and shared state (Persistence Layer): + + * [http://ieeexplore.ieee.org/document/1302942/?arnumber=1302942&tag=1](http://ieeexplore.ieee.org/document/1302942/?arnumber=1302942&tag=1) + + * http://ieeexplore.ieee.org/document/918991/?arnumber=918991 + +* Grid computing: + + * https://link.springer.com/article/10.1023/A:1024083511032 + +* Mobile Systems(offloading and battery requirements): [https://link.springer.com/article/10.1007/s11036-012-0368-0](https://link.springer.com/article/10.1007/s11036-012-0368-0) + +* Embedded RPC: + + * https://dl.acm.org/citation.cfm?id=1127840 + +* Micro services architecture(ecosystem) + +* Streaming + +* RPC can be async + +* Shared State + +* microservices + +## RPC in Streaming Protocols: + +* Streaming requests and buffered responses + +## RPC in microservices ecosystem: + +* Creating new services. + +* Bootstrapping + +* Load balancing + + * Creating new services in Actor-Like model + + * Fault tolerance + + * Self-recovery + +* Business and Persistence Layer were combined and the Persistence layer is not shared anymore, where each endpoints has its own persistent state: + + * [https://help.sap.com/saphelp_nwmobile711/helpdata/de/7e/d1a40b5bc84868b1606ce0dc72d88b/content.htm](https://help.sap.com/saphelp_nwmobile711/helpdata/de/7e/d1a40b5bc84868b1606ce0dc72d88b/content.htm) + +## Security in RPC: + +* Initially it was separate. + + * Authentication, authorization issues have been resolved + +* Now embedded in the protocol + +* Security and Privacy in RPC + + * Bugs in the libraries. + + * Trust Issues between client and the server. + + * [http://static.usenix.org/publications/library/proceedings/sec02/full_papers/giffin/giffin_html/](http://static.usenix.org/publications/library/proceedings/sec02/full_papers/giffin/giffin_html/) + + * Brewer’s view: https://people.eecs.berkeley.edu/~brewer/cs262b-2004/PODC-keynote.pdf + + * E programming language: distributed object model/VAT + +## Discussion: + +* RPC vs REST and other services. RPC influence. + +* The future of RPC + + * Where it shines. Not in message passing. + +## Conclusions: + + Some conclusion. + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Class: Functional Programming for Distributed Computing + +Theme: The idea of communicating and invoking remote functions for distributed computation. + +Target Audience: Networks background, and wants to learn RPC. + +-> RPC is not XYZ (HTTP, REST, …) though it has influenced. The + +RPC influence in XYZ design, though + +* RPC started in 1980’s and still continues as a relevant model of performing distributed computation, which initially was developed for a LAN and now can be globally implemented. + +* RPC started as a separate implements of REST, Streaming RPC, and now made possible of integration of all these implementations as a single abstraction for a user endpoint service. + + * (subsection) How RPC influenced other models of communication. + +* RPC Models: + + * One Server Model + +* Methods of invoking remote function. + +* Discuss the evolution and pitfalls as they developed to an optimized + +* Software-As-A-Service: End-User focused. + + Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. {% cite Uniqueness --file rpc %} -- cgit v1.2.3 From 4d364efe97868d268ed190e003d764571c537252 Mon Sep 17 00:00:00 2001 From: Muzammil Date: Mon, 21 Nov 2016 11:06:27 -0500 Subject: RPC: Commit 1 --- _bibliography/rpc.bib | 122 +++++++++++++++++++++++++----- chapter/1/rpc.md | 201 ++++++++++++++++---------------------------------- 2 files changed, 169 insertions(+), 154 deletions(-) diff --git a/_bibliography/rpc.bib b/_bibliography/rpc.bib index 416b697..b0e8932 100644 --- a/_bibliography/rpc.bib +++ b/_bibliography/rpc.bib @@ -7,20 +7,108 @@ year = {2010}, } -@inproceedings{Elsman2005, - author = {Martin Elsman}, - title = {Type-specialized serialization with sharing}, - booktitle = {Trends in Functional Programming}, - year = {2005}, - pages = {47-62}, -} - -@article{Kennedy2004, - author = {Andrew Kennedy}, - title = {Pickler combinators}, - journal = {J. Funct. Program.}, - volume = {14}, - number = {6}, - year = {2004}, - pages = {727-739}, -} \ No newline at end of file +@article{implementingrpc, + title={Implementing remote procedure calls}, + author={Birrell, Andrew D and Nelson, Bruce Jay}, + journal={ACM Transactions on Computer Systems (TOCS)}, + volume={2}, + number={1}, + pages={39--59}, + year={1984}, + publisher={ACM} +} + +@article{rmipaper, + title={A Distributed Object Model for the Java\^{} T\^{} M System}, + author={Wollrath, Ann and Riggs, Roger and Waldo, Jim}, + year={1996} +} + +@book{rmibook, + title={Java. rmi: The Remote Method Invocation Guide}, + author={Pitt, Esmond and McNiff, Kathy}, + year={2001}, + publisher={Addison-Wesley Longman Publishing Co., Inc.} +} + +@book{critiqueofrpc, + title={A critique of the remote procedure call paradigm}, + author={Tanenbaum, Andrew Stuart and van Renesse, Robbert}, + year={1987} +} + +@inproceedings{rpcoverrdma, + title={FaSST: Fast, Scalable and Simple Distributed Transactions with Two-Sided (RDMA) Datagram RPCs}, + author={Kalia, Anuj and Kaminsky, Michael and Andersen, David G}, + booktitle={12th USENIX Symposium on Operating Systems Design and Implementation (OSDI 16)}, + pages={185--201}, + organization={USENIX Association} +} + +@inproceedings{sunnfs, + title={Design and implementation of the Sun network filesystem}, + author={Sandberg, Russel and Goldberg, David and Kleiman, Steve and Walsh, Dan and Lyon, Bob}, + booktitle={Proceedings of the Summer USENIX conference}, + pages={119--130}, + year={1985} +} + +@misc{thrift, + title={Apache Thrift}, + author={Prunicki, Andrew}, + year={2009} +} + +@book{corba, + title={CORBA 3 fundamentals and programming}, + author={Siegel, Jon and Ph. D.}, + volume={2}, + year={2000}, + publisher={John Wiley \& Sons New York, NY, USA:} +} + +@misc{grpc, + title = {gRPC}, + author={Google}, + url = {http://www.grpc.io/}, + note = {Accessed: 2016-11-11}, +} + +@misc{soaparticle1, + title = {Exclusive .NET Developer's Journal "Indigo" Interview with Microsoft's Don Box}, + author={Derek Ferguson}, + url = {http://dotnet.sys-con.com/node/45908}, + note = {Accessed: 2016-11-11}, +} + +@misc{corbasite, + title = {CORBA-OMG}, + author={CORBA}, + url = {http://www.corba.org/}, + note = {Accessed: 2016-11-11}, +} + + +@inproceedings{finagle, + title={Your server as a function}, + author={Eriksen, Marius}, + booktitle={Proceedings of the Seventh Workshop on Programming Languages and Operating Systems}, + pages={5}, + year={2013}, + organization={ACM} +} + +@inproceedings{anycastrpc, + title={Anycast-RPC for Wireless Sensor Networks}, + author={Bergstrom, Eric and Pandey, Raju}, + booktitle={2007 IEEE International Conference on Mobile Adhoc and Sensor Systems}, + pages={1--8}, + year={2007}, + organization={IEEE} +} + +@article{rpcrfc, + title={RFC 1831 - RPC: Remote procedure call protocol specification version 2}, + author={Srinivasan, Raj}, + year={1995} +} diff --git a/chapter/1/rpc.md b/chapter/1/rpc.md index d1d48ed..a05022f 100644 --- a/chapter/1/rpc.md +++ b/chapter/1/rpc.md @@ -1,248 +1,175 @@ --- layout: page -title: "RPC is Not Dead: Rise, Fall and Rise of RPC" +title: "RPC is Not Dead: Rise, Fall and the Rise of RPC" by: "Muzammil Abdul Rehman and Paul Grosu" --- ## Introduction -*Remote Procedure Call* (RPC) is a design *paradigm* that allow two entities to communicate over a communication channel in a general request-response mechanism. It was initially built as a tool for outsourcing computation to a server in a distributed system, however, it has evolved over the years to build +*Remote Procedure Call* (RPC) is a design *paradigm* that allow two entities to communicate over a communication channel in a general request-response mechanism. It was initially built as a tool for outsourcing computation to a server in a distributed system, however, it has evolved over the years to build modular, scalable, distributed, language-agnostic ecosystem of applications. This RPC *paradigm* has been part of the driving force in creating truly revolutionizing distributed systems and giving rise to various communication schemes and protocols between diverse systems. -* Define what RPC is. -* The main idea of our paper: -* RPC was initially built as a tool for outsourcing computing. -* RPC is relevant to this day as a language for building and connecting scalable modularized, language-agnostic systems. -* It is the design and idea of remote computation, the driving force behind RPC, gave rise to truly distributed systems and different communication schemes between different entities. -* Why is RPC relevant? -* Microservices -* Asynchronous Bidirectional communication for connecting services and devices -* GRPC, Finagle, Thrift, SOAP, CORBA, RMI -* It has influenced other programming designs. -* Evolved with Time -* REST, HTTP +RPC *paradigm* has been implemented in various forms in our every-day systems. From lower level applications like Network File Systems{% cite sunnfs --file rpc %} and Remote Direct Memory Access{% cite rpcoverrdma --file rpc %} to access protocols to developing an ecosystem of microservices, RPC has been used everywhere. Some of the major examples of RPC include SunNFS{% cite sunnfs --file rpc %}, Twitter's Finagle{% cite finalge --file rpc %}, Apache Thrift{% cite thrift --file rpc %}, Java RMI{% cite rmipaper --file rpc %}, SOAP, CORBA{% cite corba --file rpc %}, Google's gRPC{% cite grpc --file rpc %}. +* adds paragraph about rise and fall -* The main idea of our paper: +RPC has evolved over the years. Starting off as a synchronous, insecure, request-response system, RPC has evolved into a secure, asynchronous, fault-tolerant, resilient *paradigm* that has influenced protocols and programming designs, like, HTTP, REST, and just about anything with a request-response system. It has transitioned to an asynchronous bidirectional communication for connecting services and devices across the internet. RPC has influenced various design paradigms and communication protocols. - * RPC was initially built as a tool for outsourcing computing. - - * RPC is relevant to this day as a language for building and connecting scalable modularized, language-agnostic systems. - - * It is the design and idea of remote computation, the driving force behind RPC, gave rise to truly distributed systems and different communication schemes between different entities. - -* Why is RPC relevant? - - * Microservices - - * Asynchronous Bidirectional communication for connecting services and devices - - * GRPC, Finagle, Thrift, SOAP, CORBA, RMI - - * It has influenced other programming designs. +## Remote Procedure Calls: - * Evolved with Time +* Diagram of RPC: Local and remote endpoints, communication protocol. - * REST, HTTP +*Remote Procedure Call paradigm* can be defined, at a high level, as a set of two language-agnostic communication *endpoints* connected over a network with one endpoint sending a request and the other endpoint generating a response based on that request. In the simplest terms, it's a request-response paradigm where the two *endpoints*/hosts have different *address space*. The host that requests a remote procedure can be referred to as *caller* and the host that responds to this can be referred to as *callee*. -## Remote Procedure Calls: +The *endpoints* in the RPC can either be a client and a server, two nodes in a peer-to-peer network, two hosts in a grid computation system, or even two microservices. The RPC communcation is not limited to two hosts, rather could have multiple hosts or *endpoints* involved {% cite anycastrpc --file rpc %}. -* Local and remote endpoints, communication protocol. +* explain the diagram here. - * Diagram. +One important feature of RPC is different *address space* {% cite implementingrpc --file rpc %} for all the endpoints, however, passing the locations to a global storage(Amazon S3, Microsoft Azure, Google Cloud Store) is not impossible.In RPC, all the hosts have separate *address spaces*. They can't share pointers or references to a memory location in one host. This *address space* isolation means that all the information is passed in the messages between the host communicating as a value (objects or variables) but not by reference. Since RPC is a *remote* procedure call, the values sent to the *remote* host cannot be pointers or references to a *local* memory. However, passing links to a global shared memory location is not impossible but rather dependent on the type of system(see *Applications* section for detail). -* Initially: there was a registry involved(now they’ve moved), kept an open connection,. +Originally, RPC was developed as a synchronous, language-specific marshalling service with a custom network protocol to outsource computation{% cite implementingrpc --file rpc %}. It had registry-system to register all the servers. One of the earliest RPC-based system{% cite implementingrpc --file rpc %} was implemented in the Cedar programming language in early 1980's. The goal of this system was to provide similar progamming semantics as local procedure calls. Developed for a LAN network with an inefficient network protocol and a *serialization* scheme to transfer information using the said network protocol, this system aimed at executing a *procedure*(also referred as *method* or a *function*) in a remote *address space*. The single-thread synchronous client and the server were written in an old *Cedar* programming language with a registry system used by the servers to *bind*(or register) their procedures. The clients used this registry system to find a specific server to execute their *remote* procedures. -* Now: +Modern RPC-based systems are language-agnostic, fault-tolerant, asynchronous, load-balanced systems. Authenticaiton and authorization to these systems have been added as needed along with other security features. - * Security(Authentication and authorization) +RPC programs have a network, therefore, they need to handle remote errors and be able to communication information successfully. Error handling generally varies and is categorized as *remote-host* or *network* failure handling. Depending on the type of the system, and the error, the caller(or the callee) return an error and these errors can be handled accordingly. For asynchronous RPC calls, it's possible to specify events to ensure progress. - * Fault tolerance. +RPC implementations use a *serialization*(also referred to as *marshalling* or *pickling*) scheme on top of an underlying communication protocol(traditionally TCP over IP). These *serialization* schemes allow both the caller *caller* and *callee* to become language agnostic allowing both these systems to be developed in parallel without any language restrictions. Some examples of serialization schemes are JSON, XML, or Protocol Buffers{% cite grpc --file rpc %}. - * Asynchronously +RPC allows different components of a larger system to be developed independtly of one another. The language-agnostic nature combined with a decoupling of some parts of the system allows the two components(caller and callee) to scale separately and add new functionalities. - * Load Balancing +Some RPC implementations have moved from a one-server model to a dynamically-created, load-balanced microservices. * Examples: - * One could view the internet as example of RPC.e.g TCP handshake(both act as server and client). - * First: Google Maps API(REST) - * SSL Handshake. -Suggestions from Heather: - -* Be aware of Chris's thing: https://christophermeiklejohn.com/pl/2016/04/12/rpc.html - -* Thrift vs gRPC. ## Evolution of RPC: -* RPC has evolved from what it was originally proposed. +RPC started in 1980’s and still continues as a relevant model of performing distributed computation, which initially was developed for a LAN and now can be globally implemented. +* RPC has evolved from what it was originally proposed. * Chris’s thing: https://christophermeiklejohn.com/pl/2016/04/12/rpc.html +* diagram(maybe not): 4 lines, (y-axis: -1 to 1, x-axis 1980's 2016) -* 1980’s +### The Rise: All Hail RPC - * RPC origin. +* RPC origin. - * Implementing RPC: [https://dl.acm.org/citation.cfm?id=357392](https://dl.acm.org/citation.cfm?id=357392) + * Implementing RPC: [https://dl.acm.org/citation.cfm?id=357392](https://dl.acm.org/citation.cfm?id=357392) + * The RPC thesis(Nelson) + * More examples - * The RPC thesis(Nelson) +### The Fall: RPC is Dead - * More examples +* The fall of RPC/Criticism of RPC + * Limitations + * http://www.cs.vu.nl//~ast/afscheid/publications/euteco-1988.pdf + * Systems that use message passing. -* 1990’s +### The Rise, Again: Long Live RPC - * The fall of RPC/Criticism of RPC +* gRPC +* XML SOAP +* Java RMI +* Finagle +* Thrift +* Apache Etch +* Sun RPC(ONC RPC) - * Limitations - * [http://www.cs.vu.nl//~ast/afscheid/publications/euteco-1988.pdf](http://www.cs.vu.nl//~ast/afscheid/publications/euteco-1988.pdf) +#### Java Remote Method Invocation: +Java RMI (Java Remote Method Invocation){% cite rmibook --file rpc %} is a Java implementation for performing RPC (Remote Procedure Calls) between a client and a server. The client using a stub passes via a socket connection the information over the network to the server. The Remote Object Registry (ROR){% cite rmipaper --file rpc %} on the server contains the references to objects that can be accessed remotely and through which the client will connect to. The client then can request of the invocation of methods on the server for processing the requested call and then responds with the answer. RMI provides some security by being encoded but not encrypted, though that can be augmented by tunneling over a secure connection or other methods. - * Systems that use message passing. -* 2000-* -## Remote Method Invocation: +#### CORBA: +CORBA (Common Object Request Broker Architecture){% cite corba --file rpc %} was created by the Object Management Group {% cite corbasite --file rpc %} to allow for language-agnostic communication among multiple computers. It is an object-oriented model defined via an Interface Definition Language (IDL) and the communication is managed through an Object Request Broker (ORB). Each client and server have an ORB by which they communicate. The benefits of CORBA is that it allows for multi-language implementations that can communicate with each other, but much of the criticism around CORBA relates to poor consistency among implementations. -* Pros and Cons - -## CORBA: - -* Pros and Cons +#### XML-RPC and SOAP: -## XML-RPC and SOAP: +SOAP (Simple Object Access Protocol) is a successor of XML-RPC as a web-services protocol for communicating between a client and server. It was initially designed by a group at Microsoft {% cite soaparticle1 --file rpc %}. The SOAP message is a XML-formatted message composed of an envelope inside which a header and a body is provided. The body of the message contains the request and response of the message, which is transmitted over HTTP or SMTP. The benefits of such a protocol is that provides the flexibility for transmission of multiple tranport protocol, though parsing such messages could become a bottleneck. -* Pros and Cons - -## Thrift: -* Pros and Cons +#### Thrift: +Thrift is a RPC created by Facebook and now part of the Apache Foundation {% cite thrift --file rpc %}. It is a language-agnostic IDL by which one generates the code for the client and server. It provides the opportunity for compressed serialization by customizing the protocol and the transport after the description file has been processed. -## Finagle: +#### Finagle: +Finagle was generated by Twitter and is an RPC written in Scala and can run on an JVM. It is based on three object types: Service objects, Filter objects and Future objects{% cite finagle --file rpc %}. The Future objects acts by asynchronously being requested for a computation that would return a response at some time in the future. The Service objects are an endpoint that will return a Future upon processing a request. A Filter object transforms requests for further processing in case additional customization is required from a request. +#### Open Network Computing RPC: * Pros and Cons -## gRPC: +#### gRPC: -## Discussion 1(change heading): +### The Contenders for the Throne: gRPC, Thrift or RMI * gRPC vs Thrift (maybe also Finagle) ## Applications: * RPC and shared state (Persistence Layer): - - * [http://ieeexplore.ieee.org/document/1302942/?arnumber=1302942&tag=1](http://ieeexplore.ieee.org/document/1302942/?arnumber=1302942&tag=1) - + * http://ieeexplore.ieee.org/document/1302942/?arnumber=1302942&tag=1 * http://ieeexplore.ieee.org/document/918991/?arnumber=918991 * Grid computing: - * https://link.springer.com/article/10.1023/A:1024083511032 -* Mobile Systems(offloading and battery requirements): [https://link.springer.com/article/10.1007/s11036-012-0368-0](https://link.springer.com/article/10.1007/s11036-012-0368-0) +* Mobile Systems(offloading and battery requirements): + * https://link.springer.com/article/10.1007/s11036-012-0368-0 * Embedded RPC: - * https://dl.acm.org/citation.cfm?id=1127840 * Micro services architecture(ecosystem) -* Streaming - * RPC can be async * Shared State * microservices -## RPC in Streaming Protocols: +* Futures and promises: RPC? -* Streaming requests and buffered responses +### Streaming requests and buffered responses -## RPC in microservices ecosystem: +### RPC in microservices ecosystem: + +RPC started as a separate implements of REST, Streaming RPC, and now made possible of integration of all these implementations as a single abstraction for a user endpoint service. * Creating new services. * Bootstrapping * Load balancing - * Creating new services in Actor-Like model - * Fault tolerance - * Self-recovery * Business and Persistence Layer were combined and the Persistence layer is not shared anymore, where each endpoints has its own persistent state: - - * [https://help.sap.com/saphelp_nwmobile711/helpdata/de/7e/d1a40b5bc84868b1606ce0dc72d88b/content.htm](https://help.sap.com/saphelp_nwmobile711/helpdata/de/7e/d1a40b5bc84868b1606ce0dc72d88b/content.htm) + * https://help.sap.com/saphelp_nwmobile711/helpdata/de/7e/d1a40b5bc84868b1606ce0dc72d88b/content.htm ## Security in RPC: - * Initially it was separate. - * Authentication, authorization issues have been resolved - * Now embedded in the protocol - * Security and Privacy in RPC - * Bugs in the libraries. - * Trust Issues between client and the server. - - * [http://static.usenix.org/publications/library/proceedings/sec02/full_papers/giffin/giffin_html/](http://static.usenix.org/publications/library/proceedings/sec02/full_papers/giffin/giffin_html/) - + * http://static.usenix.org/publications/library/proceedings/sec02/full_papers/giffin/giffin_html/ * Brewer’s view: https://people.eecs.berkeley.edu/~brewer/cs262b-2004/PODC-keynote.pdf - * E programming language: distributed object model/VAT ## Discussion: - * RPC vs REST and other services. RPC influence. - * The future of RPC - * Where it shines. Not in message passing. + * RPC is not XYZ (HTTP, REST, …) though it has influenced. -## Conclusions: - - Some conclusion. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Class: Functional Programming for Distributed Computing - -Theme: The idea of communicating and invoking remote functions for distributed computation. - -Target Audience: Networks background, and wants to learn RPC. - --> RPC is not XYZ (HTTP, REST, …) though it has influenced. The - -RPC influence in XYZ design, though - -* RPC started in 1980’s and still continues as a relevant model of performing distributed computation, which initially was developed for a LAN and now can be globally implemented. - -* RPC started as a separate implements of REST, Streaming RPC, and now made possible of integration of all these implementations as a single abstraction for a user endpoint service. - - * (subsection) How RPC influenced other models of communication. - -* RPC Models: - - * One Server Model - -* Methods of invoking remote function. - -* Discuss the evolution and pitfalls as they developed to an optimized - -* Software-As-A-Service: End-User focused. - +## Conclusions(maybe not a heading): +RPC is not dead: long live the Remote Procedure calls. -Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. {% cite Uniqueness --file rpc %} ## References -- cgit v1.2.3 From 0d0ba3a765e2296a4313d89b368e8abf68d9f932 Mon Sep 17 00:00:00 2001 From: Paul Grosu Date: Tue, 6 Dec 2016 15:27:39 -0500 Subject: gRPC --- chapter/1/figures/grpc-cross-language.png | Bin 0 -> 27394 bytes chapter/1/figures/http2-frame.png | Bin 0 -> 12057 bytes chapter/1/figures/http2-stream-lifecycle.png | Bin 0 -> 49038 bytes chapter/1/gRPC.md | 122 +++++++++++++++++++++++++++ 4 files changed, 122 insertions(+) create mode 100644 chapter/1/figures/grpc-cross-language.png create mode 100644 chapter/1/figures/http2-frame.png create mode 100644 chapter/1/figures/http2-stream-lifecycle.png create mode 100644 chapter/1/gRPC.md diff --git a/chapter/1/figures/grpc-cross-language.png b/chapter/1/figures/grpc-cross-language.png new file mode 100644 index 0000000..c600f67 Binary files /dev/null and b/chapter/1/figures/grpc-cross-language.png differ diff --git a/chapter/1/figures/http2-frame.png b/chapter/1/figures/http2-frame.png new file mode 100644 index 0000000..59d6ed5 Binary files /dev/null and b/chapter/1/figures/http2-frame.png differ diff --git a/chapter/1/figures/http2-stream-lifecycle.png b/chapter/1/figures/http2-stream-lifecycle.png new file mode 100644 index 0000000..87333cb Binary files /dev/null and b/chapter/1/figures/http2-stream-lifecycle.png differ diff --git a/chapter/1/gRPC.md b/chapter/1/gRPC.md new file mode 100644 index 0000000..49bdee5 --- /dev/null +++ b/chapter/1/gRPC.md @@ -0,0 +1,122 @@ +--- +layout: page +title: "gRPC" +by: "Paul Grosu (Northeastern U.), Muzammil Abdul Rehman (Northeastern U.), Eric Anderson (Google, Inc.), Vijay Pai (Google, Inc.), and Heather Miller (Northeastern U.)" +--- + +

+

gRPC

+

+ +

+

Paul Grosu (Northeastern U.), Muzammil Abdul Rehman (Northeastern U.), Eric Anderson (Google, Inc.), Vijay Pai (Google, Inc.), and Heather Miller (Northeastern U.)

+

+ +
+ +

Abstract

+ +gRPC has been built from a collaboration between Google and Square as a public replacement of Stubby, ARCWire and Sake {% cite Apigee %}. The gRPC framework is a form of an Actor Model based on an IDL (Interface Description Language), which is defined via the Protocol Buffer message format. With the introduction of HTTP/2 the internal Google Stubby and Square Sake frameworks are now been made available to the public. By working on top of the HTTP/2 protocol, gRPC enables messages to be multiplexed and compressed bi-directionally as premptive streams for maximizing capacity of any microservices ecosystem. Google has also a new approach to public projects, where instead of just releasing a paper describing the concepts will now also provide the implementation of how to properly interpret the standard. + + +

Introduction

+ +In order to understand gRPC and the flexibity of enabling a microservices ecosystem to become into a Reactive Actor Model, it is important to appreciate the nuances of the HTTP/2 Protocol upon which it is based. Afterward we will describe the gRPC Framework - focusing specifically on the gRPC-Java implementation - with the scope to expand this chapter over time to all implementations of gRPC. At the end we will cover examples demonstrating these ideas, by taking a user from the initial steps of how to work with the gRPC-Java framework. + +

1 HTTP/2

+ +The HTTP 1.1 protocol has been a success for some time, though there were some key features which began to be requested by the community with the increase of distributed computing, especially in the area of microservices. The phenomenon of creating more modularized functional units that are organically constructed based on a share-nothing model with a bidirectional, high-throughput request and response methodology demands a new protocol for communication and integration. Thus the HTTP/2 was born as a new standard, which is a binary wire protocol providing compressed streams that can be multiplexed for concurrency. As many microservices implementations currently scan header messages before actually processing any payload in order to scale up the processing and routing of messages, HTTP/2 now provides header compression for this purpose. One last important benefit is that the server endpoint can actually push cached resources to the client based on anticipated future communication, dramatically saving client communication time and processing. + +

1.1 HTTP/2 Frames

+ +The HTTP/2 protocol is now a framed protocol, which expands the capability for bidirectional, asynchronous communication. Every message is thus part of a frame that will have a header, frame type and stream identifier aside from the standard frame length for processing. Each stream can have a priority, which allows for dependency between streams to be achieved forming a priority tree. The data can be either a request or response which allows for the bidirectional communication, with the capability of flagging the communication for stream termination, flow control with priority settings, continuation and push responses from the server for client confirmation. Below is the format of the HTTP/2 frame {% cite RFC7540 %}: + +

+
+ Figure 1: The encoding a HTTP/2 frame. +

+ +

1.2 Header Compression

+ +The HTTP header is one of the primary methods of passing information about the state of other endpoints, the request or response and the payload. This enables endpoints to save time when processing a large quantity to streams, with the ability to forward information along without wasting time to inspect the payload. Since the header information can be quite large, it is possible to now compress the them to allow for better throughput and capacity of stored stateful information. + + +

1.3 Multiplexed Streams

+ +As streams are core to the implementation of HTTP/2, it is important to discuss the details of their implemenation in the protocol. As many streams can be open simultanously from many endpoints, each stream will be in one of the following states. Each stream is multiplexed together forming a chain of streams that are transmitted over the wire, allowing for asynchronous bi-directional concurrency to be performed by the receiving endpoint. Below is the lifecycle of a stream {% cite RFC7540 %}: + +

+
+ Figure 2: The lifecycle of a HTTP/2 stream. +

+ +

1.4 Flow Control of Streams

+ +Since many streams will compete for the bandwidth of a connection, in order to prevent bottlenecks and collisions in the transmission. This is done via the WINDOW_UPDATE payload for every stream - and the overall connection as well - to let the sender know how much room the receiving endpoint has for processing new data. + +

2 Protocol Buffers with RPC

+ +Though gRPC was built on top of HTTP/2, an IDL had to be used to perform the communication between endpoints. The natural direction was to use Protocol Buffers is the method of stucturing data for serialization between a server and client. At the time of the start of gRPC development only version 2.0 (proto2) was available, which only implemented data structures without any request/response mechanism. An example of a Protocol Buffer data structure would look something like this: + +``` +// A message containing the user's name. +message Hello { + string name = 1; +} +``` +

+ Figure 3: Protocol Buffer version 2.0 representing a message data-structure. +

+ +Thus the language had to be updated to support gRPC and the development of a service message with a request and a response definition was added for version version 3.0 of Protocol Buffers. The updated implementation would look as follows {% cite HelloWorldProto %}: + +``` +// The request message containing the user's name. +message HelloRequest { + string name = 1; +} + +// The response message containing the greetings +message HelloReply { + string message = 1; +} + +// The greeting service definition. +service Greeter { + // Sends a greeting + rpc SayHello (HelloRequest) returns (HelloReply) {} +} +``` +

+ Figure 4: Protocol Buffer version 3.0 representing a message data-structure with the accompanied RPC definition. +

+ +Notice the addition of a service, where the RPC call would use one of the messages as the structure of a Request with the other being the Response message format. + +Once of these Proto file get generated, one would then use them to compile with gRPC to for generating the Client and Server files representing the classical two endpoints of a RPC implementation. + +

3 gRPC

+ +gRPC was built on top of HTTP/2, and we will cover the specifics of gRPC-Java, but expand it to all the implementations with time. gRPC is a framework for + +

+
+ Figure 5: gRPC allows for asynchronous language-agnostic message passing via Protocol Buffers. +

+ + +## References + +[Apigee]: https://www.youtube.com/watch?v=-2sWDr3Z0Wo +[Authentication]: http://www.grpc.io/docs/guides/auth.html +[Benchmarks]: http://www.grpc.io/docs/guides/benchmarking.html +[CoreSurfaceAPIs]: https://github.com/grpc/grpc/tree/master/src/core +[ErrorModel]: http://www.grpc.io/docs/guides/error.html +[gRPC]: https://github.com/grpc/grpc/blob/master/doc/g_stands_for.md +[gRPC-Companies]: http://www.grpc.io/about/ +[gRPC-Languages]: http://www.grpc.io/docs/ +[gRPC-Protos]: https://github.com/googleapis/googleapis/ +[Netty]: http://netty.io/ +[RFC7540]: http://httpwg.org/specs/rfc7540.html +[HelloWorldProto]: https://github.com/grpc/grpc/blob/master/examples/protos/helloworld.proto + -- cgit v1.2.3 From 5594d046d3fdf98fc96adf629f0dfc1529b56d68 Mon Sep 17 00:00:00 2001 From: Paul Grosu Date: Tue, 6 Dec 2016 15:30:03 -0500 Subject: gRPC --- chapter/1/gRPC.md | 1 + 1 file changed, 1 insertion(+) diff --git a/chapter/1/gRPC.md b/chapter/1/gRPC.md index 49bdee5..ae8d2c1 100644 --- a/chapter/1/gRPC.md +++ b/chapter/1/gRPC.md @@ -12,6 +12,7 @@ by: "Paul Grosu (Northeastern U.), Muzammil Abdul Rehman (Northeastern U.), Eri

Paul Grosu (Northeastern U.), Muzammil Abdul Rehman (Northeastern U.), Eric Anderson (Google, Inc.), Vijay Pai (Google, Inc.), and Heather Miller (Northeastern U.)

+

Abstract

-- cgit v1.2.3 From 7a4919f1267279165276e13e24fb95b8698ac457 Mon Sep 17 00:00:00 2001 From: Paul Grosu Date: Tue, 6 Dec 2016 15:35:54 -0500 Subject: submit --- chapter/1/gRPC.md | 1 - 1 file changed, 1 deletion(-) diff --git a/chapter/1/gRPC.md b/chapter/1/gRPC.md index ae8d2c1..49bdee5 100644 --- a/chapter/1/gRPC.md +++ b/chapter/1/gRPC.md @@ -12,7 +12,6 @@ by: "Paul Grosu (Northeastern U.), Muzammil Abdul Rehman (Northeastern U.), Eri

Paul Grosu (Northeastern U.), Muzammil Abdul Rehman (Northeastern U.), Eric Anderson (Google, Inc.), Vijay Pai (Google, Inc.), and Heather Miller (Northeastern U.)

-

Abstract

-- cgit v1.2.3 From db03fdb08aedc5125580c7ec8baa7215f08fea92 Mon Sep 17 00:00:00 2001 From: Paul Grosu Date: Tue, 6 Dec 2016 18:24:23 -0500 Subject: submit --- chapter/1/gRPC.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/chapter/1/gRPC.md b/chapter/1/gRPC.md index 49bdee5..741f265 100644 --- a/chapter/1/gRPC.md +++ b/chapter/1/gRPC.md @@ -40,7 +40,6 @@ The HTTP/2 protocol is now a framed protocol, which expands the capability for b The HTTP header is one of the primary methods of passing information about the state of other endpoints, the request or response and the payload. This enables endpoints to save time when processing a large quantity to streams, with the ability to forward information along without wasting time to inspect the payload. Since the header information can be quite large, it is possible to now compress the them to allow for better throughput and capacity of stored stateful information. -

1.3 Multiplexed Streams

As streams are core to the implementation of HTTP/2, it is important to discuss the details of their implemenation in the protocol. As many streams can be open simultanously from many endpoints, each stream will be in one of the following states. Each stream is multiplexed together forming a chain of streams that are transmitted over the wire, allowing for asynchronous bi-directional concurrency to be performed by the receiving endpoint. Below is the lifecycle of a stream {% cite RFC7540 %}: @@ -68,6 +67,18 @@ message Hello { Figure 3: Protocol Buffer version 2.0 representing a message data-structure.

+This message will also be encoded for highest compression when sent over the wire. For example, let us say that the message is the string "Hi". + + + + + + + + + +
TypeMeaningUsed For
0Varintint32, int64, uint32, uint64, sint32, sint64, bool, enum
164-bitfixed64, sfixed64, double
2Length-delimitedstring, bytes, embedded messages, packed repeated fields
3Start groupgroups (deprecated)
4End groupgroups (deprecated)
532-bitfixed32, sfixed32, float
+ Thus the language had to be updated to support gRPC and the development of a service message with a request and a response definition was added for version version 3.0 of Protocol Buffers. The updated implementation would look as follows {% cite HelloWorldProto %}: ``` -- cgit v1.2.3 From 48ff73298ef9c06266fd031e5eceeb8128df0206 Mon Sep 17 00:00:00 2001 From: Paul Grosu Date: Tue, 6 Dec 2016 18:26:40 -0500 Subject: submit --- chapter/1/gRPC.md | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/chapter/1/gRPC.md b/chapter/1/gRPC.md index 741f265..62a3795 100644 --- a/chapter/1/gRPC.md +++ b/chapter/1/gRPC.md @@ -69,15 +69,10 @@ message Hello { This message will also be encoded for highest compression when sent over the wire. For example, let us say that the message is the string "Hi". - - - - - - - - -
TypeMeaningUsed For
0Varintint32, int64, uint32, uint64, sint32, sint64, bool, enum
164-bitfixed64, sfixed64, double
2Length-delimitedstring, bytes, embedded messages, packed repeated fields
3Start groupgroups (deprecated)
4End groupgroups (deprecated)
532-bitfixed32, sfixed32, float
+

+
+ Table 1: Tag values for Protocol Buffer types. +

Thus the language had to be updated to support gRPC and the development of a service message with a request and a response definition was added for version version 3.0 of Protocol Buffers. The updated implementation would look as follows {% cite HelloWorldProto %}: -- cgit v1.2.3 From e9d10f981f3e2d81f913bd59c4d797373c980f6d Mon Sep 17 00:00:00 2001 From: Paul Grosu Date: Tue, 6 Dec 2016 18:27:35 -0500 Subject: submit --- chapter/1/figures/protobuf-types.png | Bin 0 -> 19941 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 chapter/1/figures/protobuf-types.png diff --git a/chapter/1/figures/protobuf-types.png b/chapter/1/figures/protobuf-types.png new file mode 100644 index 0000000..aaf3a1e Binary files /dev/null and b/chapter/1/figures/protobuf-types.png differ -- cgit v1.2.3 From 2b0e3e9ff9f08b00aed2268853208a6b9926695b Mon Sep 17 00:00:00 2001 From: Paul Grosu Date: Tue, 6 Dec 2016 18:47:16 -0500 Subject: submit --- chapter/1/gRPC.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/chapter/1/gRPC.md b/chapter/1/gRPC.md index 62a3795..fb3c2a0 100644 --- a/chapter/1/gRPC.md +++ b/chapter/1/gRPC.md @@ -67,13 +67,19 @@ message Hello { Figure 3: Protocol Buffer version 2.0 representing a message data-structure.

-This message will also be encoded for highest compression when sent over the wire. For example, let us say that the message is the string "Hi". +This message will also be encoded for highest compression when sent over the wire. For example, let us say that the message is the string "Hi". Every Protocol Buffer type has a value, and in this case a string has a value of `2`, as noted in the Table 1 {% cite Protobuf-Types %}.


Table 1: Tag values for Protocol Buffer types.

+One will notice that there is a number associated with each field element in the Protocol Buffer definition, which represents its tag. In Figure 3, the field `name` has a tag of `1`. When a message gets encoded each field will start with a one byte value (8 bits), where the least-significant 3-bit value encode the type and the rest the tag. In this case tag which is `1`, with a type of 2. Thus the encoding will be `00001 010`, which has a hexdecimal value of `A`. The following byte is the length of the string which is `2`, followed by the string as `48` and `69` representing `H` and `i`. Thus the whole tranmission will look as follows: + +``` +A 2 48 69 +``` + Thus the language had to be updated to support gRPC and the development of a service message with a request and a response definition was added for version version 3.0 of Protocol Buffers. The updated implementation would look as follows {% cite HelloWorldProto %}: ``` @@ -125,4 +131,4 @@ gRPC was built on top of HTTP/2, and we will cover the specifics of gRPC-Java, b [Netty]: http://netty.io/ [RFC7540]: http://httpwg.org/specs/rfc7540.html [HelloWorldProto]: https://github.com/grpc/grpc/blob/master/examples/protos/helloworld.proto - +[Protobuf-Types]: https://developers.google.com/protocol-buffers/docs/encoding -- cgit v1.2.3 From 47c8ad4b134cfd11b8cf1b7003d7314fed42b71d Mon Sep 17 00:00:00 2001 From: Paul Grosu Date: Tue, 6 Dec 2016 19:01:59 -0500 Subject: submit --- chapter/1/gRPC.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/chapter/1/gRPC.md b/chapter/1/gRPC.md index fb3c2a0..622498d 100644 --- a/chapter/1/gRPC.md +++ b/chapter/1/gRPC.md @@ -105,17 +105,23 @@ service Greeter { Notice the addition of a service, where the RPC call would use one of the messages as the structure of a Request with the other being the Response message format. -Once of these Proto file get generated, one would then use them to compile with gRPC to for generating the Client and Server files representing the classical two endpoints of a RPC implementation. +Once of these Proto file gets generated, one would then use them to compile with gRPC to for generating the Client and Server files representing the classical two endpoints of a RPC implementation.

3 gRPC

-gRPC was built on top of HTTP/2, and we will cover the specifics of gRPC-Java, but expand it to all the implementations with time. gRPC is a framework for +gRPC was built on top of HTTP/2, and we will cover the specifics of gRPC-Java, but expand it to all the implementations with time. gRPC is a cross-platform framework that allows integration across many languages as denoted in Figure 5 {% cite gRPC-Overview %}.


Figure 5: gRPC allows for asynchronous language-agnostic message passing via Protocol Buffers.

+The officially supported languages are listed in Table 2 {% cite gRPC-Languages %}. + +

+
+ Table 2: Officially supported languages by gRPC. +

## References @@ -132,3 +138,5 @@ gRPC was built on top of HTTP/2, and we will cover the specifics of gRPC-Java, b [RFC7540]: http://httpwg.org/specs/rfc7540.html [HelloWorldProto]: https://github.com/grpc/grpc/blob/master/examples/protos/helloworld.proto [Protobuf-Types]: https://developers.google.com/protocol-buffers/docs/encoding +[gRPC-Overview]: http://www.grpc.io/docs/guides/ +[gRPC-Languages]: http://www.grpc.io/about/#osp -- cgit v1.2.3 From 2c7ba877fbfe365fe8ce74a9c34823ebe84a8eb8 Mon Sep 17 00:00:00 2001 From: Paul Grosu Date: Tue, 6 Dec 2016 19:03:55 -0500 Subject: submit --- chapter/1/figures/grpc-languages.png | Bin 0 -> 47003 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 chapter/1/figures/grpc-languages.png diff --git a/chapter/1/figures/grpc-languages.png b/chapter/1/figures/grpc-languages.png new file mode 100644 index 0000000..1f1c50d Binary files /dev/null and b/chapter/1/figures/grpc-languages.png differ -- cgit v1.2.3 From 66187e549607d715b684b0a4df7e589d057287a0 Mon Sep 17 00:00:00 2001 From: Paul Grosu Date: Tue, 6 Dec 2016 19:31:57 -0500 Subject: submit --- chapter/1/figures/grpc-benchmark.png | Bin 0 -> 17014 bytes chapter/1/gRPC.md | 12 ++++++++++++ 2 files changed, 12 insertions(+) create mode 100644 chapter/1/figures/grpc-benchmark.png diff --git a/chapter/1/figures/grpc-benchmark.png b/chapter/1/figures/grpc-benchmark.png new file mode 100644 index 0000000..9f39c71 Binary files /dev/null and b/chapter/1/figures/grpc-benchmark.png differ diff --git a/chapter/1/gRPC.md b/chapter/1/gRPC.md index 622498d..99a81e0 100644 --- a/chapter/1/gRPC.md +++ b/chapter/1/gRPC.md @@ -123,6 +123,18 @@ The officially supported languages are listed in Table 2 {% cite gRPC-Languages Table 2: Officially supported languages by gRPC.

+There are benchmarks being performed on a daily basis to ensure that gRPC performs optimally under high-throughput conditions as illustrated in Figure 6. + +

+
+ Figure 6: Benchmark showing the queries-per-second on two virtual machines with 32 cores each. +

+ + +

3.1 gRPC Java

+ +The Java implementation of gRPC has been built with Mobile platform in mind and requires support of JDK 6.0 and higher. There are + ## References [Apigee]: https://www.youtube.com/watch?v=-2sWDr3Z0Wo -- cgit v1.2.3 From 93948d701c8e531c42caeb538b7fcb352e8d19ab Mon Sep 17 00:00:00 2001 From: Paul Grosu Date: Tue, 6 Dec 2016 19:32:39 -0500 Subject: submit --- chapter/1/gRPC.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/chapter/1/gRPC.md b/chapter/1/gRPC.md index 99a81e0..96d4609 100644 --- a/chapter/1/gRPC.md +++ b/chapter/1/gRPC.md @@ -123,7 +123,7 @@ The officially supported languages are listed in Table 2 {% cite gRPC-Languages Table 2: Officially supported languages by gRPC.

-There are benchmarks being performed on a daily basis to ensure that gRPC performs optimally under high-throughput conditions as illustrated in Figure 6. +There are benchmarks being performed on a daily basis to ensure that gRPC performs optimally under high-throughput conditions as illustrated in Figure 6 {% cite gRPC-Benchmark %}.


@@ -152,3 +152,4 @@ The Java implementation of gRPC has been built with Mobile platform in mind and [Protobuf-Types]: https://developers.google.com/protocol-buffers/docs/encoding [gRPC-Overview]: http://www.grpc.io/docs/guides/ [gRPC-Languages]: http://www.grpc.io/about/#osp +[gRPC-Benchmark]: http://www.grpc.io/docs/guides/benchmarking.html \ No newline at end of file -- cgit v1.2.3 From 0598f53e1a16ab7731f081a77f15542192c28b07 Mon Sep 17 00:00:00 2001 From: Paul Grosu Date: Tue, 6 Dec 2016 21:25:40 -0500 Subject: submit --- chapter/1/gRPC.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/chapter/1/gRPC.md b/chapter/1/gRPC.md index 96d4609..0dc78c3 100644 --- a/chapter/1/gRPC.md +++ b/chapter/1/gRPC.md @@ -130,10 +130,17 @@ There are benchmarks being performed on a daily basis to ensure that gRPC perfor Figure 6: Benchmark showing the queries-per-second on two virtual machines with 32 cores each.

+Most of the public Google APIs have been ported to support gRPC and their definitions can be analyzed at the following location: + +

+ https://github.com/googleapis/googleapis/tree/master/google
+

+ +

3.1 gRPC Java

-The Java implementation of gRPC has been built with Mobile platform in mind and requires support of JDK 6.0 and higher. There are +The Java implementation of gRPC been built with Mobile platform in mind and to provide that capability it requires JDK 6.0 to be supported. Though the core of gRPC is built for data centers specifically to support C/C++ for the Linux platform, the Java and Go implementations are two very reliable platform to experiment the microservice ecosystem implementations. ## References -- cgit v1.2.3 From c4a9f8305ae1a99721030b9d3009a64453e17121 Mon Sep 17 00:00:00 2001 From: Paul Grosu Date: Tue, 6 Dec 2016 21:32:44 -0500 Subject: submit --- chapter/1/figures/grpc-googleapis.png | Bin 0 -> 33354 bytes chapter/1/gRPC.md | 8 ++++---- 2 files changed, 4 insertions(+), 4 deletions(-) create mode 100644 chapter/1/figures/grpc-googleapis.png diff --git a/chapter/1/figures/grpc-googleapis.png b/chapter/1/figures/grpc-googleapis.png new file mode 100644 index 0000000..62718e5 Binary files /dev/null and b/chapter/1/figures/grpc-googleapis.png differ diff --git a/chapter/1/gRPC.md b/chapter/1/gRPC.md index 0dc78c3..c3333c2 100644 --- a/chapter/1/gRPC.md +++ b/chapter/1/gRPC.md @@ -130,12 +130,12 @@ There are benchmarks being performed on a daily basis to ensure that gRPC perfor Figure 6: Benchmark showing the queries-per-second on two virtual machines with 32 cores each.

-Most of the public Google APIs have been ported to support gRPC and their definitions can be analyzed at the following location: +Most of the public Google APIs - including the Speech API, Vision API, BigTable, Pub/Sub, etc. - have been ported to support gRPC, and their definitions can be found at the following location:

- https://github.com/googleapis/googleapis/tree/master/google
-

- +
+ Figure 7: The public Google APIs have been updated for gRPC, and be found at https://github.com/googleapis/googleapis/tree/master/google +

3.1 gRPC Java

-- cgit v1.2.3 From 2d03731c4d9a4d2a0342e613cb8d7ad7e5fc3f7a Mon Sep 17 00:00:00 2001 From: Paul Grosu Date: Tue, 6 Dec 2016 21:35:14 -0500 Subject: submit --- chapter/1/gRPC.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/chapter/1/gRPC.md b/chapter/1/gRPC.md index c3333c2..59090d0 100644 --- a/chapter/1/gRPC.md +++ b/chapter/1/gRPC.md @@ -130,7 +130,7 @@ There are benchmarks being performed on a daily basis to ensure that gRPC perfor Figure 6: Benchmark showing the queries-per-second on two virtual machines with 32 cores each.

-Most of the public Google APIs - including the Speech API, Vision API, BigTable, Pub/Sub, etc. - have been ported to support gRPC, and their definitions can be found at the following location: +Most of the public Google APIs - including the Speech API, Vision API, Bigtable, Pub/Sub, etc. - have been ported to support gRPC, and their definitions can be found at the following location:


@@ -140,13 +140,13 @@ Most of the public Google APIs - including the Speech API, Vision API, BigTable,

3.1 gRPC Java

-The Java implementation of gRPC been built with Mobile platform in mind and to provide that capability it requires JDK 6.0 to be supported. Though the core of gRPC is built for data centers specifically to support C/C++ for the Linux platform, the Java and Go implementations are two very reliable platform to experiment the microservice ecosystem implementations. +The Java implementation of gRPC been built with Mobile platform in mind and to provide that capability it requires JDK 6.0 to be supported. Though the core of gRPC is built with data centers in mind - specifically to support C/C++ for the Linux platform - the Java and Go implementations are two very reliable platform to experiment the microservice ecosystem implementations. ## References -[Apigee]: https://www.youtube.com/watch?v=-2sWDr3Z0Wo -[Authentication]: http://www.grpc.io/docs/guides/auth.html -[Benchmarks]: http://www.grpc.io/docs/guides/benchmarking.html +`[Apigee]: https://www.youtube.com/watch?v=-2sWDr3Z0Wo` [Apigee]: https://www.youtube.com/watch?v=-2sWDr3Z0Wo +`[Authentication]: http://www.grpc.io/docs/guides/auth.html` [Authentication]: http://www.grpc.io/docs/guides/auth.html +`[Benchmarks]: http://www.grpc.io/docs/guides/benchmarking.html` [Benchmarks]: http://www.grpc.io/docs/guides/benchmarking.html [CoreSurfaceAPIs]: https://github.com/grpc/grpc/tree/master/src/core [ErrorModel]: http://www.grpc.io/docs/guides/error.html [gRPC]: https://github.com/grpc/grpc/blob/master/doc/g_stands_for.md -- cgit v1.2.3 From fc4ac30854c08373e0608260b48265627fc382fe Mon Sep 17 00:00:00 2001 From: Paul Grosu Date: Tue, 6 Dec 2016 21:36:00 -0500 Subject: submit --- chapter/1/gRPC.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/chapter/1/gRPC.md b/chapter/1/gRPC.md index 59090d0..0bb7ede 100644 --- a/chapter/1/gRPC.md +++ b/chapter/1/gRPC.md @@ -144,9 +144,9 @@ The Java implementation of gRPC been built with Mobile platform in mind and to p ## References -`[Apigee]: https://www.youtube.com/watch?v=-2sWDr3Z0Wo` [Apigee]: https://www.youtube.com/watch?v=-2sWDr3Z0Wo -`[Authentication]: http://www.grpc.io/docs/guides/auth.html` [Authentication]: http://www.grpc.io/docs/guides/auth.html -`[Benchmarks]: http://www.grpc.io/docs/guides/benchmarking.html` [Benchmarks]: http://www.grpc.io/docs/guides/benchmarking.html +`` [Apigee]: https://www.youtube.com/watch?v=-2sWDr3Z0Wo +`` [Authentication]: http://www.grpc.io/docs/guides/auth.html +`` [Benchmarks]: http://www.grpc.io/docs/guides/benchmarking.html [CoreSurfaceAPIs]: https://github.com/grpc/grpc/tree/master/src/core [ErrorModel]: http://www.grpc.io/docs/guides/error.html [gRPC]: https://github.com/grpc/grpc/blob/master/doc/g_stands_for.md -- cgit v1.2.3 From 7d22d28bce2beb45907663b8aff9e04aeae2cbbd Mon Sep 17 00:00:00 2001 From: Paul Grosu Date: Tue, 6 Dec 2016 21:36:34 -0500 Subject: submit --- chapter/1/gRPC.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/chapter/1/gRPC.md b/chapter/1/gRPC.md index 0bb7ede..2afd338 100644 --- a/chapter/1/gRPC.md +++ b/chapter/1/gRPC.md @@ -144,9 +144,12 @@ The Java implementation of gRPC been built with Mobile platform in mind and to p ## References -`` [Apigee]: https://www.youtube.com/watch?v=-2sWDr3Z0Wo -`` [Authentication]: http://www.grpc.io/docs/guides/auth.html -`` [Benchmarks]: http://www.grpc.io/docs/guides/benchmarking.html +``[Apigee]: https://www.youtube.com/watch?v=-2sWDr3Z0Wo + +``[Authentication]: http://www.grpc.io/docs/guides/auth.html + +``[Benchmarks]: http://www.grpc.io/docs/guides/benchmarking.html + [CoreSurfaceAPIs]: https://github.com/grpc/grpc/tree/master/src/core [ErrorModel]: http://www.grpc.io/docs/guides/error.html [gRPC]: https://github.com/grpc/grpc/blob/master/doc/g_stands_for.md -- cgit v1.2.3 From 7694f5c94f38a35e457649f11d571818d6eec6df Mon Sep 17 00:00:00 2001 From: Paul Grosu Date: Tue, 6 Dec 2016 21:36:51 -0500 Subject: submit --- chapter/1/gRPC.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/chapter/1/gRPC.md b/chapter/1/gRPC.md index 2afd338..ddac5d7 100644 --- a/chapter/1/gRPC.md +++ b/chapter/1/gRPC.md @@ -144,11 +144,11 @@ The Java implementation of gRPC been built with Mobile platform in mind and to p ## References -``[Apigee]: https://www.youtube.com/watch?v=-2sWDr3Z0Wo +`[Apigee]: https://www.youtube.com/watch?v=-2sWDr3Z0Wo -``[Authentication]: http://www.grpc.io/docs/guides/auth.html +`[Authentication]: http://www.grpc.io/docs/guides/auth.html -``[Benchmarks]: http://www.grpc.io/docs/guides/benchmarking.html +`[Benchmarks]: http://www.grpc.io/docs/guides/benchmarking.html [CoreSurfaceAPIs]: https://github.com/grpc/grpc/tree/master/src/core [ErrorModel]: http://www.grpc.io/docs/guides/error.html -- cgit v1.2.3 From 3027b93e08cf101f078b5a1604b302fa6d1ccee5 Mon Sep 17 00:00:00 2001 From: Paul Grosu Date: Tue, 6 Dec 2016 21:37:17 -0500 Subject: submit --- chapter/1/gRPC.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/chapter/1/gRPC.md b/chapter/1/gRPC.md index ddac5d7..20a0ce0 100644 --- a/chapter/1/gRPC.md +++ b/chapter/1/gRPC.md @@ -144,11 +144,11 @@ The Java implementation of gRPC been built with Mobile platform in mind and to p ## References -`[Apigee]: https://www.youtube.com/watch?v=-2sWDr3Z0Wo +` `[Apigee]: https://www.youtube.com/watch?v=-2sWDr3Z0Wo -`[Authentication]: http://www.grpc.io/docs/guides/auth.html +` `[Authentication]: http://www.grpc.io/docs/guides/auth.html -`[Benchmarks]: http://www.grpc.io/docs/guides/benchmarking.html +` `[Benchmarks]: http://www.grpc.io/docs/guides/benchmarking.html [CoreSurfaceAPIs]: https://github.com/grpc/grpc/tree/master/src/core [ErrorModel]: http://www.grpc.io/docs/guides/error.html -- cgit v1.2.3 From e0f2b97b972a58fff80bf0989729f1aa97bc7fba Mon Sep 17 00:00:00 2001 From: Paul Grosu Date: Tue, 6 Dec 2016 21:38:29 -0500 Subject: submit --- chapter/1/gRPC.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chapter/1/gRPC.md b/chapter/1/gRPC.md index 20a0ce0..e4eed89 100644 --- a/chapter/1/gRPC.md +++ b/chapter/1/gRPC.md @@ -134,7 +134,7 @@ Most of the public Google APIs - including the Speech API, Vision API, Bigtable,


- Figure 7: The public Google APIs have been updated for gRPC, and be found at https://github.com/googleapis/googleapis/tree/master/google + Figure 7: The public Google APIs have been updated for gRPC, and be found at https://github.com/googleapis/googleapis/tree/master/google

@@ -150,7 +150,7 @@ The Java implementation of gRPC been built with Mobile platform in mind and to p ` `[Benchmarks]: http://www.grpc.io/docs/guides/benchmarking.html -[CoreSurfaceAPIs]: https://github.com/grpc/grpc/tree/master/src/core +` `[CoreSurfaceAPIs]: https://github.com/grpc/grpc/tree/master/src/core [ErrorModel]: http://www.grpc.io/docs/guides/error.html [gRPC]: https://github.com/grpc/grpc/blob/master/doc/g_stands_for.md [gRPC-Companies]: http://www.grpc.io/about/ -- cgit v1.2.3 From bf05b2a7a974fc7af352f7a2e68f08cc610353ac Mon Sep 17 00:00:00 2001 From: Paul Grosu Date: Tue, 6 Dec 2016 21:38:48 -0500 Subject: submit --- chapter/1/gRPC.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/chapter/1/gRPC.md b/chapter/1/gRPC.md index e4eed89..af26980 100644 --- a/chapter/1/gRPC.md +++ b/chapter/1/gRPC.md @@ -145,11 +145,8 @@ The Java implementation of gRPC been built with Mobile platform in mind and to p ## References ` `[Apigee]: https://www.youtube.com/watch?v=-2sWDr3Z0Wo - ` `[Authentication]: http://www.grpc.io/docs/guides/auth.html - ` `[Benchmarks]: http://www.grpc.io/docs/guides/benchmarking.html - ` `[CoreSurfaceAPIs]: https://github.com/grpc/grpc/tree/master/src/core [ErrorModel]: http://www.grpc.io/docs/guides/error.html [gRPC]: https://github.com/grpc/grpc/blob/master/doc/g_stands_for.md -- cgit v1.2.3 From 6bf06870225d78ea9457ae87840bae822b50d893 Mon Sep 17 00:00:00 2001 From: Paul Grosu Date: Tue, 6 Dec 2016 21:39:43 -0500 Subject: submit --- chapter/1/gRPC.md | 40 ++++++++++++++++++++++++++++------------ 1 file changed, 28 insertions(+), 12 deletions(-) diff --git a/chapter/1/gRPC.md b/chapter/1/gRPC.md index af26980..20028ea 100644 --- a/chapter/1/gRPC.md +++ b/chapter/1/gRPC.md @@ -145,18 +145,34 @@ The Java implementation of gRPC been built with Mobile platform in mind and to p ## References ` `[Apigee]: https://www.youtube.com/watch?v=-2sWDr3Z0Wo + ` `[Authentication]: http://www.grpc.io/docs/guides/auth.html + ` `[Benchmarks]: http://www.grpc.io/docs/guides/benchmarking.html + ` `[CoreSurfaceAPIs]: https://github.com/grpc/grpc/tree/master/src/core -[ErrorModel]: http://www.grpc.io/docs/guides/error.html -[gRPC]: https://github.com/grpc/grpc/blob/master/doc/g_stands_for.md -[gRPC-Companies]: http://www.grpc.io/about/ -[gRPC-Languages]: http://www.grpc.io/docs/ -[gRPC-Protos]: https://github.com/googleapis/googleapis/ -[Netty]: http://netty.io/ -[RFC7540]: http://httpwg.org/specs/rfc7540.html -[HelloWorldProto]: https://github.com/grpc/grpc/blob/master/examples/protos/helloworld.proto -[Protobuf-Types]: https://developers.google.com/protocol-buffers/docs/encoding -[gRPC-Overview]: http://www.grpc.io/docs/guides/ -[gRPC-Languages]: http://www.grpc.io/about/#osp -[gRPC-Benchmark]: http://www.grpc.io/docs/guides/benchmarking.html \ No newline at end of file + +` `[ErrorModel]: http://www.grpc.io/docs/guides/error.html + +` `[gRPC]: https://github.com/grpc/grpc/blob/master/doc/g_stands_for.md + +` `[gRPC-Companies]: http://www.grpc.io/about/ + +` `[gRPC-Languages]: http://www.grpc.io/docs/ + +` `[gRPC-Protos]: https://github.com/googleapis/googleapis/ + +` `[Netty]: http://netty.io/ + +` `[RFC7540]: http://httpwg.org/specs/rfc7540.html + +` `[HelloWorldProto]: https://github.com/grpc/grpc/blob/master/examples/protos/ +helloworld.proto + +` `[Protobuf-Types]: https://developers.google.com/protocol-buffers/docs/encoding + +` `[gRPC-Overview]: http://www.grpc.io/docs/guides/ + +` `[gRPC-Languages]: http://www.grpc.io/about/#osp + +` `[gRPC-Benchmark]: http://www.grpc.io/docs/guides/benchmarking.html -- cgit v1.2.3 From 880349fca82d4504dde53d0dd706238b803046d9 Mon Sep 17 00:00:00 2001 From: Paul Grosu Date: Tue, 6 Dec 2016 21:46:21 -0500 Subject: submit --- chapter/1/gRPC.md | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/chapter/1/gRPC.md b/chapter/1/gRPC.md index 20028ea..0063958 100644 --- a/chapter/1/gRPC.md +++ b/chapter/1/gRPC.md @@ -137,11 +137,28 @@ Most of the public Google APIs - including the Speech API, Vision API, Bigtable, Figure 7: The public Google APIs have been updated for gRPC, and be found at https://github.com/googleapis/googleapis/tree/master/google

+

3.2 Authentication

-

3.1 gRPC Java

+There are two methods of authentication that are available in gRPC: + +* SSL/TLS +* Google Token (via OAuth2) + +gRPC is flexible in that once can implement their custom authentication if that is preferred. + +

3.3 gRPC Java

The Java implementation of gRPC been built with Mobile platform in mind and to provide that capability it requires JDK 6.0 to be supported. Though the core of gRPC is built with data centers in mind - specifically to support C/C++ for the Linux platform - the Java and Go implementations are two very reliable platform to experiment the microservice ecosystem implementations. +

3... Downloading gRPC Java

+ +The easiest way to download the gRPC-Java implemenation is by performing the following command: + + +

3... Hello World Demonstration

+ + + ## References ` `[Apigee]: https://www.youtube.com/watch?v=-2sWDr3Z0Wo -- cgit v1.2.3 From 0125b8bba4eea09ec018db6dfcb529ac71e1f6e2 Mon Sep 17 00:00:00 2001 From: Paul Grosu Date: Tue, 6 Dec 2016 21:47:59 -0500 Subject: submit --- chapter/1/gRPC.md | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/chapter/1/gRPC.md b/chapter/1/gRPC.md index 0063958..5c13c98 100644 --- a/chapter/1/gRPC.md +++ b/chapter/1/gRPC.md @@ -116,13 +116,6 @@ gRPC was built on top of HTTP/2, and we will cover the specifics of gRPC-Java, b Figure 5: gRPC allows for asynchronous language-agnostic message passing via Protocol Buffers.

-The officially supported languages are listed in Table 2 {% cite gRPC-Languages %}. - -

-
- Table 2: Officially supported languages by gRPC. -

- There are benchmarks being performed on a daily basis to ensure that gRPC performs optimally under high-throughput conditions as illustrated in Figure 6 {% cite gRPC-Benchmark %}.

@@ -137,6 +130,16 @@ Most of the public Google APIs - including the Speech API, Vision API, Bigtable, Figure 7: The public Google APIs have been updated for gRPC, and be found at https://github.com/googleapis/googleapis/tree/master/google

+ +

3.1 Supported Languages

+ +The officially supported languages are listed in Table 2 {% cite gRPC-Languages %}. + +

+
+ Table 2: Officially supported languages by gRPC. +

+

3.2 Authentication

There are two methods of authentication that are available in gRPC: @@ -146,6 +149,8 @@ There are two methods of authentication that are available in gRPC: gRPC is flexible in that once can implement their custom authentication if that is preferred. + +

3.3 gRPC Java

The Java implementation of gRPC been built with Mobile platform in mind and to provide that capability it requires JDK 6.0 to be supported. Though the core of gRPC is built with data centers in mind - specifically to support C/C++ for the Linux platform - the Java and Go implementations are two very reliable platform to experiment the microservice ecosystem implementations. -- cgit v1.2.3 From 507b194bd0e1222787127bc902ac022f435784f3 Mon Sep 17 00:00:00 2001 From: Paul Grosu Date: Tue, 6 Dec 2016 21:49:20 -0500 Subject: submit --- chapter/1/gRPC.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chapter/1/gRPC.md b/chapter/1/gRPC.md index 5c13c98..4b0c04b 100644 --- a/chapter/1/gRPC.md +++ b/chapter/1/gRPC.md @@ -116,14 +116,14 @@ gRPC was built on top of HTTP/2, and we will cover the specifics of gRPC-Java, b Figure 5: gRPC allows for asynchronous language-agnostic message passing via Protocol Buffers.

-There are benchmarks being performed on a daily basis to ensure that gRPC performs optimally under high-throughput conditions as illustrated in Figure 6 {% cite gRPC-Benchmark %}. +To ensure scalability, benchmarks are run on a daily basis to ensure that gRPC performs optimally under high-throughput conditions as illustrated in Figure 6 {% cite gRPC-Benchmark %}.


Figure 6: Benchmark showing the queries-per-second on two virtual machines with 32 cores each.

-Most of the public Google APIs - including the Speech API, Vision API, Bigtable, Pub/Sub, etc. - have been ported to support gRPC, and their definitions can be found at the following location: +To standardize, most of the public Google APIs - including the Speech API, Vision API, Bigtable, Pub/Sub, etc. - have been ported to support gRPC, and their definitions can be found at the following location:


-- cgit v1.2.3 From b42f4f4f4108ded7f89d80bed9a0c72fdc4ac013 Mon Sep 17 00:00:00 2001 From: Paul Grosu Date: Tue, 6 Dec 2016 22:04:40 -0500 Subject: submit --- chapter/1/gRPC.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/chapter/1/gRPC.md b/chapter/1/gRPC.md index 4b0c04b..d4f1601 100644 --- a/chapter/1/gRPC.md +++ b/chapter/1/gRPC.md @@ -147,9 +147,21 @@ There are two methods of authentication that are available in gRPC: * SSL/TLS * Google Token (via OAuth2) -gRPC is flexible in that once can implement their custom authentication if that is preferred. +gRPC is flexible in that once can plug in their custom authentication system if that is preferred. +

3.3 gRPC Mechanism

+In its simplest form gRPC has a structured set of steps one goes about using it, which has this general flow: + +1. Download gRPC for the language of interest. + +2. Implement the Request and Response definition in a ProtoBuf file. + +3. Compile the ProtoBuf file and run the code-generators for the the specific language. This will generate the Client and Server endpoints. + +4. Customize the Client and Server code for the desired implementation. + +Most of these will require tweaking the Protobuf file and testing the throughput to ensure that the network and CPU capacities are optimally maximized.

3.3 gRPC Java

-- cgit v1.2.3 From f1689419b0626987a53ca9c3e178d47b0067abf3 Mon Sep 17 00:00:00 2001 From: Paul Grosu Date: Tue, 6 Dec 2016 22:07:24 -0500 Subject: submit --- chapter/1/gRPC.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chapter/1/gRPC.md b/chapter/1/gRPC.md index d4f1601..4d06e75 100644 --- a/chapter/1/gRPC.md +++ b/chapter/1/gRPC.md @@ -149,7 +149,7 @@ There are two methods of authentication that are available in gRPC: gRPC is flexible in that once can plug in their custom authentication system if that is preferred. -

3.3 gRPC Mechanism

+

3.3 Development Cycle

In its simplest form gRPC has a structured set of steps one goes about using it, which has this general flow: -- cgit v1.2.3 From 46d75a8eb88b7edbb30a14ba8834f6b4bc2ed68a Mon Sep 17 00:00:00 2001 From: Paul Grosu Date: Tue, 6 Dec 2016 22:23:26 -0500 Subject: submit --- chapter/1/gRPC.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/chapter/1/gRPC.md b/chapter/1/gRPC.md index 4d06e75..08962b1 100644 --- a/chapter/1/gRPC.md +++ b/chapter/1/gRPC.md @@ -163,7 +163,18 @@ In its simplest form gRPC has a structured set of steps one goes about using it, Most of these will require tweaking the Protobuf file and testing the throughput to ensure that the network and CPU capacities are optimally maximized. -

3.3 gRPC Java

+

3.4 The gRPC Framework (Stub, Channel and Transport Layer)

+ +One starts by initializing a communication Channel between Client to a Server and storing that as a Stub. The Credentials are provided to the Channel when being initialized. These form a Context for the Client's connection to the Server. Then a Request can be built based on the definition in the Protobuf file. The Request and associated expectedResponse is executed by the service constructed in the Protobuf file. The Response is them parsed for any data coming from the Channel. + +The connection can be asynchronous and bi-directionally streaming so that data is constantly flowing back and available to be read when ready. This allows one to treat the Client and Server as endpoints where one can even adjust not just the flow but also intercept to filter and thus request the data of interest. + +That stub can be referenced later in order + + +The Java implementation of gRPC been built with Mobile platform in mind and to + +

3... gRPC Java

The Java implementation of gRPC been built with Mobile platform in mind and to provide that capability it requires JDK 6.0 to be supported. Though the core of gRPC is built with data centers in mind - specifically to support C/C++ for the Linux platform - the Java and Go implementations are two very reliable platform to experiment the microservice ecosystem implementations. -- cgit v1.2.3 From 3e366732f47c850dd9734dfabfada204e9bef7be Mon Sep 17 00:00:00 2001 From: Paul Grosu Date: Tue, 6 Dec 2016 22:28:38 -0500 Subject: submit --- chapter/1/gRPC.md | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/chapter/1/gRPC.md b/chapter/1/gRPC.md index 08962b1..7d9cd34 100644 --- a/chapter/1/gRPC.md +++ b/chapter/1/gRPC.md @@ -167,12 +167,9 @@ Most of these will require tweaking the Protobuf file and testing the throughput One starts by initializing a communication Channel between Client to a Server and storing that as a Stub. The Credentials are provided to the Channel when being initialized. These form a Context for the Client's connection to the Server. Then a Request can be built based on the definition in the Protobuf file. The Request and associated expectedResponse is executed by the service constructed in the Protobuf file. The Response is them parsed for any data coming from the Channel. -The connection can be asynchronous and bi-directionally streaming so that data is constantly flowing back and available to be read when ready. This allows one to treat the Client and Server as endpoints where one can even adjust not just the flow but also intercept to filter and thus request the data of interest. +The connection can be asynchronous and bi-directionally streaming so that data is constantly flowing back and available to be read when ready. This allows one to treat the Client and Server as endpoints where one can even adjust not just the flow but also intercept and decoration to filter and thus request and retrieve the data of interest. -That stub can be referenced later in order - - -The Java implementation of gRPC been built with Mobile platform in mind and to +The Transport Layer performs the retrieval and placing of binary protocol on the wire. For gRPC-Java has three implementations, though a user can implement their own: Netty, OkHttp, and inProcess.

3... gRPC Java

-- cgit v1.2.3 From c776ce785f3a35059b6da451cec4d6aac943f185 Mon Sep 17 00:00:00 2001 From: Paul Grosu Date: Wed, 7 Dec 2016 01:08:55 -0500 Subject: submit --- chapter/1/gRPC.md | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/chapter/1/gRPC.md b/chapter/1/gRPC.md index 7d9cd34..76a285b 100644 --- a/chapter/1/gRPC.md +++ b/chapter/1/gRPC.md @@ -80,7 +80,7 @@ One will notice that there is a number associated with each field element in the A 2 48 69 ``` -Thus the language had to be updated to support gRPC and the development of a service message with a request and a response definition was added for version version 3.0 of Protocol Buffers. The updated implementation would look as follows {% cite HelloWorldProto %}: +Thus the language had to be updated to support gRPC and the development of a service message with a request and a response definition was added for version version 3.0.0 of Protocol Buffers. The updated implementation would look as follows {% cite HelloWorldProto %}: ``` // The request message containing the user's name. @@ -100,7 +100,7 @@ service Greeter { } ```

- Figure 4: Protocol Buffer version 3.0 representing a message data-structure with the accompanied RPC definition. + Figure 4: Protocol Buffer version 3.0.0 representing a message data-structure with the accompanied RPC definition.

Notice the addition of a service, where the RPC call would use one of the messages as the structure of a Request with the other being the Response message format. @@ -171,13 +171,30 @@ The connection can be asynchronous and bi-directionally streaming so that data i The Transport Layer performs the retrieval and placing of binary protocol on the wire. For gRPC-Java has three implementations, though a user can implement their own: Netty, OkHttp, and inProcess. -

3... gRPC Java

+

3.5 gRPC Java

The Java implementation of gRPC been built with Mobile platform in mind and to provide that capability it requires JDK 6.0 to be supported. Though the core of gRPC is built with data centers in mind - specifically to support C/C++ for the Linux platform - the Java and Go implementations are two very reliable platform to experiment the microservice ecosystem implementations. -

3... Downloading gRPC Java

+

3.5.1 Downloading gRPC Java

-The easiest way to download the gRPC-Java implemenation is by performing the following command: +The easiest way to download the gRPC-Java implementation is by performing the following command: + +``` +git clone -b v1.0.0 https://github.com/grpc/grpc-java.git +``` + +Next compile on a Windows machine using Gradle using the following steps - and if you are using any Firewall software it might be necessary to temporarily disable it while compiling gRPC-Java as sockets are used for the tests: + +``` +cd grpc-java +set GRADLE_OPTS=-Xmx2048m +set JAVA_OPTS=-Xmx2048m +set DEFAULT_JVM_OPTS="-Dfile.encoding=utf-8" +echo skipCodegen=true > gradle.properties +gradlew.bat build -x test +cd examples +gradlew.bat installDist +```

3... Hello World Demonstration

-- cgit v1.2.3 From b8eb0b556606b2ef1ad98771382f99e7df6c20b4 Mon Sep 17 00:00:00 2001 From: Paul Grosu Date: Wed, 7 Dec 2016 01:10:03 -0500 Subject: submit --- chapter/1/gRPC.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/chapter/1/gRPC.md b/chapter/1/gRPC.md index 76a285b..ecdaa73 100644 --- a/chapter/1/gRPC.md +++ b/chapter/1/gRPC.md @@ -196,8 +196,15 @@ cd examples gradlew.bat installDist ``` +If you are having issues with Unicode translation of Git on Windows you can try the following commands after entering the `examples` folder: -

3... Hello World Demonstration

+``` +https://raw.githubusercontent.com/benelot/grpc-java/feb88a96a4bc689631baec11abe989a776230b74/examples/src/main/java/io/grpc/examples/routeguide/RouteGuideServer.java + +copy RouteGuideServer.java src\main\java\io\grpc\examples\routeguide\RouteGuideServer.java +``` + +

3 Hello World Demonstration

-- cgit v1.2.3 From 255d5413ffdb8aea348b3d143377a51755f6b701 Mon Sep 17 00:00:00 2001 From: Paul Grosu Date: Wed, 7 Dec 2016 01:21:07 -0500 Subject: submit --- chapter/1/figures/hello-world-client.png | Bin 0 -> 30161 bytes chapter/1/figures/hello-world-server.png | Bin 0 -> 13005 bytes chapter/1/gRPC.md | 28 ++++++++++++++++++++++++++-- 3 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 chapter/1/figures/hello-world-client.png create mode 100644 chapter/1/figures/hello-world-server.png diff --git a/chapter/1/figures/hello-world-client.png b/chapter/1/figures/hello-world-client.png new file mode 100644 index 0000000..c4cf7d4 Binary files /dev/null and b/chapter/1/figures/hello-world-client.png differ diff --git a/chapter/1/figures/hello-world-server.png b/chapter/1/figures/hello-world-server.png new file mode 100644 index 0000000..a51554b Binary files /dev/null and b/chapter/1/figures/hello-world-server.png differ diff --git a/chapter/1/gRPC.md b/chapter/1/gRPC.md index ecdaa73..d39a4f6 100644 --- a/chapter/1/gRPC.md +++ b/chapter/1/gRPC.md @@ -199,14 +199,38 @@ gradlew.bat installDist If you are having issues with Unicode translation of Git on Windows you can try the following commands after entering the `examples` folder: ``` -https://raw.githubusercontent.com/benelot/grpc-java/feb88a96a4bc689631baec11abe989a776230b74/examples/src/main/java/io/grpc/examples/routeguide/RouteGuideServer.java +wget https://raw.githubusercontent.com/benelot/grpc-java/feb88a96a4bc689631baec11abe989a776230b74/examples/src/main/java/io/grpc/examples/routeguide/RouteGuideServer.java copy RouteGuideServer.java src\main\java\io\grpc\examples\routeguide\RouteGuideServer.java ``` -

3 Hello World Demonstration

+

3.5.2 Running the Hello World Demonstration

+Make sure you open two Command (Terminal) windows, each within the `grpc-java\examples\build\install\examples\bin` folder. In the first of the two windows type the following command: +``` +hello-world-server.bat +``` + +You should see the following: + +

+
+ Figure 8: The Hello World gRPC Server. +

+ +In the second of the two windows type the following command: + +``` +hello-world-client.bat +``` + +You should see the following response: + +

+
+ Figure 9: The Hello World gRPC Client and the response from the Server. +

## References -- cgit v1.2.3 From 7669eaecd48e61685361666d97edc7fbbdf56970 Mon Sep 17 00:00:00 2001 From: Paul Grosu Date: Wed, 7 Dec 2016 01:22:18 -0500 Subject: submit --- chapter/1/gRPC.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chapter/1/gRPC.md b/chapter/1/gRPC.md index d39a4f6..3bea7e1 100644 --- a/chapter/1/gRPC.md +++ b/chapter/1/gRPC.md @@ -196,7 +196,7 @@ cd examples gradlew.bat installDist ``` -If you are having issues with Unicode translation of Git on Windows you can try the following commands after entering the `examples` folder: +If you are having issues with Unicode (UTF-8) translation when using Git on Windows, you can try the following commands after entering the `examples` folder: ``` wget https://raw.githubusercontent.com/benelot/grpc-java/feb88a96a4bc689631baec11abe989a776230b74/examples/src/main/java/io/grpc/examples/routeguide/RouteGuideServer.java -- cgit v1.2.3 From 5cbc7c29567b3c893e4069f2a6bc0d5ad27b7489 Mon Sep 17 00:00:00 2001 From: Paul Grosu Date: Wed, 7 Dec 2016 01:22:51 -0500 Subject: submit --- chapter/1/gRPC.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chapter/1/gRPC.md b/chapter/1/gRPC.md index 3bea7e1..643edaa 100644 --- a/chapter/1/gRPC.md +++ b/chapter/1/gRPC.md @@ -216,7 +216,7 @@ You should see the following:


- Figure 8: The Hello World gRPC Server. + Figure 8: The Hello World gRPC Server.

In the second of the two windows type the following command: @@ -229,7 +229,7 @@ You should see the following response:


- Figure 9: The Hello World gRPC Client and the response from the Server. + Figure 9: The Hello World gRPC Client and the response from the Server.

## References -- cgit v1.2.3 From 63e77966fd35ce0cbc88a70615069122ba33a1d9 Mon Sep 17 00:00:00 2001 From: Paul Grosu Date: Wed, 7 Dec 2016 16:06:48 -0500 Subject: submit --- .../1/figures/grpc-client-transport-handler.png | Bin 0 -> 67834 bytes .../1/figures/grpc-server-transport-handler.png | Bin 0 -> 60913 bytes chapter/1/gRPC.md | 31 +++++++++++++++++++-- 3 files changed, 28 insertions(+), 3 deletions(-) create mode 100644 chapter/1/figures/grpc-client-transport-handler.png create mode 100644 chapter/1/figures/grpc-server-transport-handler.png diff --git a/chapter/1/figures/grpc-client-transport-handler.png b/chapter/1/figures/grpc-client-transport-handler.png new file mode 100644 index 0000000..edd5236 Binary files /dev/null and b/chapter/1/figures/grpc-client-transport-handler.png differ diff --git a/chapter/1/figures/grpc-server-transport-handler.png b/chapter/1/figures/grpc-server-transport-handler.png new file mode 100644 index 0000000..fe895c0 Binary files /dev/null and b/chapter/1/figures/grpc-server-transport-handler.png differ diff --git a/chapter/1/gRPC.md b/chapter/1/gRPC.md index 643edaa..953cfdd 100644 --- a/chapter/1/gRPC.md +++ b/chapter/1/gRPC.md @@ -175,6 +175,31 @@ The Transport Layer performs the retrieval and placing of binary protoc The Java implementation of gRPC been built with Mobile platform in mind and to provide that capability it requires JDK 6.0 to be supported. Though the core of gRPC is built with data centers in mind - specifically to support C/C++ for the Linux platform - the Java and Go implementations are two very reliable platform to experiment the microservice ecosystem implementations. +There are several moving parts to understanding how gRPC-Java works. The first important step is to ensure that the Client and Server stub inferface code get generated by the Protobuf plugin compiler. This is usually placed in your Gradle build file called `build.gradle` as follows: + +``` + compile 'io.grpc:grpc-netty:1.0.1' + compile 'io.grpc:grpc-protobuf:1.0.1' + compile 'io.grpc:grpc-stub:1.0.1' +``` + +When you build using Gradle, then the appropriate base code gets generated for you, which you can override to build your preferred implementation of the Client and Server. + +Since one has to implement the HTTP/2 protocol, the chosen method was to have a Metadata class that will convert the key-value pairs into HTTP/2 Headers and vice-versa for the Netty implementation via GrpcHttp2HeadersDecoder and GrpcHttp2OutboundHeaders. + +Another key insight is to understand that the code that handles the HTTP/2 conversion for the Client and the Server are being done via the NettyClientHandler.java and NettyServerHandler.java classes shown in Figures 8 and 9. + +

+
+ Figure 8: The Client Tranport Handler for gRPC-Java. +

+ +

+
+ Figure 9: The Server Tranport Handler for gRPC-Java. +

+ +

3.5.1 Downloading gRPC Java

The easiest way to download the gRPC-Java implementation is by performing the following command: @@ -183,7 +208,7 @@ The easiest way to download the gRPC-Java implementation is by performing the fo git clone -b v1.0.0 https://github.com/grpc/grpc-java.git ``` -Next compile on a Windows machine using Gradle using the following steps - and if you are using any Firewall software it might be necessary to temporarily disable it while compiling gRPC-Java as sockets are used for the tests: +Next compile on a Windows machine using Gradle (or Maven) using the following steps - and if you are using any Firewall software it might be necessary to temporarily disable it while compiling gRPC-Java as sockets are used for the tests: ``` cd grpc-java @@ -216,7 +241,7 @@ You should see the following:


- Figure 8: The Hello World gRPC Server. + Figure 10: The Hello World gRPC Server.

In the second of the two windows type the following command: @@ -229,7 +254,7 @@ You should see the following response:


- Figure 9: The Hello World gRPC Client and the response from the Server. + Figure 10: The Hello World gRPC Client and the response from the Server.

## References -- cgit v1.2.3 From e25b8418bcd2297d0ecc6a350e9d4c11219c6c5c Mon Sep 17 00:00:00 2001 From: Paul Grosu Date: Wed, 7 Dec 2016 16:28:15 -0500 Subject: submit --- chapter/1/gRPC.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/chapter/1/gRPC.md b/chapter/1/gRPC.md index 953cfdd..e61e432 100644 --- a/chapter/1/gRPC.md +++ b/chapter/1/gRPC.md @@ -49,6 +49,30 @@ As streams are core to the implementation of HTTP/2, it is important to discuss Figure 2: The lifecycle of a HTTP/2 stream.

+To better understand this diagram, it is important to define some of the terms in it: + +PUSH_PROMISE - This is being performed by one endpoint to alert another that it will be sending some data over the wire. + +RST_STREAM - This makes termination of a stream possible. + +PRIORITY - This is sent by an endpoint on the priority of a stream. + +END_STREAM - This flag denotes the end of a DATA frame. + +HEADERS - This frame will open a stream. + +Idle - This is a state that a stream can be in when it is opened by receiving a HEADERS frame. + +Reserved (Local) - To be in this state is means that one has sent a PUSH_PROMISE frame. + +Reserved (Remote) - To be in this state is means that it has been reserved by a remote endpoint. + +Open - To be in this state means that both endpoints can send frames. + +Closed - This is a terminal state. + +Half-Closed (Local) - This means that no frames can be sent except for WINDOW_UPDATE, PRIORITY, and RST_STREAM. +

1.4 Flow Control of Streams

Since many streams will compete for the bandwidth of a connection, in order to prevent bottlenecks and collisions in the transmission. This is done via the WINDOW_UPDATE payload for every stream - and the overall connection as well - to let the sender know how much room the receiving endpoint has for processing new data. -- cgit v1.2.3 From e8b2aa3c2fd421f407aa4ad5979cc33ce18e0b77 Mon Sep 17 00:00:00 2001 From: Paul Grosu Date: Wed, 7 Dec 2016 16:31:11 -0500 Subject: submit --- chapter/1/gRPC.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/chapter/1/gRPC.md b/chapter/1/gRPC.md index e61e432..d645046 100644 --- a/chapter/1/gRPC.md +++ b/chapter/1/gRPC.md @@ -73,6 +73,8 @@ To better understand this diagram, it is important to define some of the terms i Half-Closed (Local) - This means that no frames can be sent except for WINDOW_UPDATE, PRIORITY, and RST_STREAM. +Half-Closed (Remote) - This means that a frame is not used by the remote endpoint to send frames of data. +

1.4 Flow Control of Streams

Since many streams will compete for the bandwidth of a connection, in order to prevent bottlenecks and collisions in the transmission. This is done via the WINDOW_UPDATE payload for every stream - and the overall connection as well - to let the sender know how much room the receiving endpoint has for processing new data. -- cgit v1.2.3 From aedd469d5ec714759ab0a7cf91c426631288be03 Mon Sep 17 00:00:00 2001 From: Paul Grosu Date: Wed, 7 Dec 2016 16:35:14 -0500 Subject: submit --- chapter/1/gRPC.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/chapter/1/gRPC.md b/chapter/1/gRPC.md index d645046..fceeaa6 100644 --- a/chapter/1/gRPC.md +++ b/chapter/1/gRPC.md @@ -283,6 +283,10 @@ You should see the following response: Figure 10: The Hello World gRPC Client and the response from the Server.

+

4 Conclusion

+ +This chapter presented an overview of the concepts behing gRPC, HTTP/2 and will be expanded in both breadth and language implementations. The area of microservices one can see how a server endpoint can actually spawn more endpoints where the message content is the protobuf definition for new endpoints to be generated for load-balancing like for the classical Actor Model. + ## References ` `[Apigee]: https://www.youtube.com/watch?v=-2sWDr3Z0Wo -- cgit v1.2.3 From 0e9470119ea56635ea096777f4656f75138b5ed1 Mon Sep 17 00:00:00 2001 From: Paul Grosu Date: Wed, 7 Dec 2016 16:36:41 -0500 Subject: submit --- chapter/1/gRPC.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chapter/1/gRPC.md b/chapter/1/gRPC.md index fceeaa6..f6c47b7 100644 --- a/chapter/1/gRPC.md +++ b/chapter/1/gRPC.md @@ -81,7 +81,7 @@ Since many streams will compete for the bandwidth of a connection, in order to p

2 Protocol Buffers with RPC

-Though gRPC was built on top of HTTP/2, an IDL had to be used to perform the communication between endpoints. The natural direction was to use Protocol Buffers is the method of stucturing data for serialization between a server and client. At the time of the start of gRPC development only version 2.0 (proto2) was available, which only implemented data structures without any request/response mechanism. An example of a Protocol Buffer data structure would look something like this: +Though gRPC was built on top of HTTP/2, an IDL had to be used to perform the communication between endpoints. The natural direction was to use Protocol Buffers is the method of stucturing key-value-based data for serialization between a server and client. At the time of the start of gRPC development only version 2.0 (proto2) was available, which only implemented data structures without any request/response mechanism. An example of a Protocol Buffer data structure would look something like this: ``` // A message containing the user's name. @@ -100,7 +100,7 @@ This message will also be encoded for highest compression when sent over the wir Table 1: Tag values for Protocol Buffer types.

-One will notice that there is a number associated with each field element in the Protocol Buffer definition, which represents its tag. In Figure 3, the field `name` has a tag of `1`. When a message gets encoded each field will start with a one byte value (8 bits), where the least-significant 3-bit value encode the type and the rest the tag. In this case tag which is `1`, with a type of 2. Thus the encoding will be `00001 010`, which has a hexdecimal value of `A`. The following byte is the length of the string which is `2`, followed by the string as `48` and `69` representing `H` and `i`. Thus the whole tranmission will look as follows: +One will notice that there is a number associated with each field element in the Protocol Buffer definition, which represents its tag. In Figure 3, the field `name` has a tag of `1`. When a message gets encoded each field (key) will start with a one byte value (8 bits), where the least-significant 3-bit value encode the type and the rest the tag. In this case tag which is `1`, with a type of 2. Thus the encoding will be `00001 010`, which has a hexdecimal value of `A`. The following byte is the length of the string which is `2`, followed by the string as `48` and `69` representing `H` and `i`. Thus the whole tranmission will look as follows: ``` A 2 48 69 -- cgit v1.2.3 From 7b757cb2d86cfa2827f2efadbc0e674ca0cbc6cf Mon Sep 17 00:00:00 2001 From: Muzammil Date: Fri, 9 Dec 2016 02:41:38 -0500 Subject: Muzammil-RPC Chapter Complete(except SunRPC) --- _bibliography/rpc.bib | 221 +++++++++++++++++++++++ chapter/1/rpc.md | 249 ++++++++++++++++---------- resources/img/rpc_chapter_1_ycog_10_steps.png | Bin 0 -> 24905 bytes 3 files changed, 372 insertions(+), 98 deletions(-) create mode 100644 resources/img/rpc_chapter_1_ycog_10_steps.png diff --git a/_bibliography/rpc.bib b/_bibliography/rpc.bib index b0e8932..db77c12 100644 --- a/_bibliography/rpc.bib +++ b/_bibliography/rpc.bib @@ -112,3 +112,224 @@ author={Srinivasan, Raj}, year={1995} } + +@misc{microservices1rpc, + title={Delving Into the Microservices Architecture}, + author={Mueller, John}, + year={2015}, + url = {http://blog.smartbear.com/microservices/delving-into-the-microservices-architecture/}, +} + +@article{rpcorigin, + title={High-level framework for network-based resource sharing}, + author={White, James E}, + year={1975} +} + +@inproceedings{interweave1, + title={Integrating remote invocation and distributed shared state}, + author={Tang, Chunqiang and Chen, DeQing and Dwarkadas, Sandhya and Scott, Michael L}, + booktitle={Parallel and Distributed Processing Symposium, 2004. Proceedings. 18th International}, + pages={30}, + year={2004}, + organization={IEEE} +} + + +@inproceedings{interweave2, + title={Interweave: A middleware system for distributed shared state}, + author={Chen, DeQing and Dwarkadas, Sandhya and Parthasarathy, Srinivasan and Pinheiro, Eduardo and Scott, Michael L}, + booktitle={International Workshop on Languages, Compilers, and Run-Time Systems for Scalable Computers}, + pages={207--220}, + year={2000}, + organization={Springer} +} + +@inproceedings{interweave3, + title={Multi-level shared state for distributed systems}, + author={Chen, DeQing and Tang, Chunqiang and Chen, Xiangchuan and Dwarkadas, Sandhya and Scott, Michael L}, + booktitle={Parallel Processing, 2002. Proceedings. International Conference on}, + pages={131--140}, + year={2002}, + organization={IEEE} +} + +@article{offloading1, + title={A survey of computation offloading for mobile systems}, + author={Kumar, Karthik and Liu, Jibang and Lu, Yung-Hsiang and Bhargava, Bharat}, + journal={Mobile Networks and Applications}, + volume={18}, + number={1}, + pages={129--140}, + year={2013}, + publisher={Springer} +} + +@misc{ibis, + title={Ibis Communication middleware}, + author={Ibis}, + url = {https://www.cs.vu.nl/ibis/rmi.html}, +} + +@article{cuckoo, + title={Cuckoo: flexible compute-intensive task offloading in mobile cloud computing}, + author={Zhou, Zhigang and Zhang, Hongli and Ye, Lin and Du, Xiaojiang}, + journal={Wireless Communications and Mobile Computing}, + year={2016}, + publisher={Wiley Online Library} +} + +@inproceedings{maui, + title={MAUI: making smartphones last longer with code offload}, + author={Cuervo, Eduardo and Balasubramanian, Aruna and Cho, Dae-ki and Wolman, Alec and Saroiu, Stefan and Chandra, Ranveer and Bahl, Paramvir}, + booktitle={Proceedings of the 8th international conference on Mobile systems, applications, and services}, + pages={49--62}, + year={2010}, + organization={ACM} +} + +@article{docker, + title={Docker: lightweight linux containers for consistent development and deployment}, + author={Merkel, Dirk}, + journal={Linux Journal}, + volume={2014}, + number={239}, + pages={2}, + year={2014}, + publisher={Belltown Media} +} + +@inproceedings{selfdest, + title={RFID systems and security and privacy implications}, + author={Sarma, Sanjay E and Weis, Stephen A and Engels, Daniel W}, + booktitle={International Workshop on Cryptographic Hardware and Embedded Systems}, + pages={454--469}, + year={2002}, + organization={Springer} +} + +@misc{orcalenfs, + title={Overview of Secure RPC}, + author={Oracle}, + url = {https://docs.oracle.com/cd/E23823_01/html/816-4557/auth-2.html}, +} + +@misc{capnprotosecure, + title={Is Cap'n Proto Secure?}, + author={Kenton}, + url = {https://capnproto.org/faq.html#is-capn-proto-secure}, +} + + +@article{grid1, + title={High performance GridRPC middleware}, + author={Caniou, Yves and Caron, Eddy and Desprez, Fr{\'e}d{\'e}ric and Nakada, Hidemoto and Tanaka, Yoshio and Seymour, Keith}, + journal={Recent Developments in Grid Technology and Applications, Nova Science Publishers}, + pages={141--181}, + year={2008} +} + +@incollection{gridsolve1, + title={Gridsolve: The evolution of a network enabled solver}, + author={YarKhan, Asim and Dongarra, Jack and Seymour, Keith}, + booktitle={Grid-Based Problem Solving Environments}, + pages={215--224}, + year={2007}, + publisher={Springer} +} + +@article{gridsolve2, + title={Interactive Grid-access using Gridsolve and giggle}, + author={Hardt, M and Seymour, Keith and Dongarra, Jack and Zapf, M and Ruitter, NV}, + journal={Computing and Informatics}, + volume={27}, + number={2}, + pages={233--248}, + year={2012} +} + +@article{ninf, + title={Ninf-G: A reference implementation of RPC-based programming middleware for Grid computing}, + author={Tanaka, Yoshio and Nakada, Hidemoto and Sekiguchi, Satoshi and Suzumura, Toyotaro and Matsuoka, Satoshi}, + journal={Journal of Grid computing}, + volume={1}, + number={1}, + pages={41--51}, + year={2003}, + publisher={Springer} +} + +@article{erlang, + title={Concurrent programming in ERLANG}, + author={Armstrong, Joe and Virding, Robert and Wikstr{\"o}m, Claes and Williams, Mike}, + year={1993}, + publisher={Citeseer} +} + +@misc{Apigee, + title={Is Cap'n Proto Secure?}, + author={Surtani, Manick and Ho, Alan}, + url = {https://www.youtube.com/watch?v=-2sWDr3Z0Wo}, +} + +@misc{CoreSurfaceAPIs, + title={gRPC core APIs}, + author={Google}, + url = {https://github.com/grpc/grpc/tree/master/src/core}, +} + +@misc{gRPCCompanies, + title={About gRPC}, + author={Google}, + url = {http://www.grpc.io/about/}, +} + +@misc{gRPCLanguages, + title={gRPC Documentation}, + author={Google}, + url = {http://www.grpc.io/docs/}, +} + +@misc{gRPCProtos, + title={Google APIs}, + author={Google}, + url = {https://github.com/googleapis/googleapis/}, +} + +@misc{rpcimage, + title={Remote Procedure Call (RPC)}, + author={Taing, Nguonly}, + url = {http://lycog.com/distributed-systems/remote-procedure-call/}, + note = {Image URL: http://lycog.com/wp-content/uploads/2011/03/rpc-10-steps.png} +} + +@misc{trendrpcthrift, + title={Remote Procedure Call (RPC)}, + author={Google Trends}, + url = {https://www.google.com/trends/explore?cat=31&date=today%2012-m&q=apache%20thrift,grpc&hl=en-US} +} + +@misc{grpcauth, + title={GRPC Authentication}, + author={Google}, + url = {http://www.grpc.io/docs/guides/auth.html}, +} + +@misc{rfc707, + title={RFC 707: A high-level framework for network-based resource sharing}, + author={White, James E}, + year={1975}, + publisher={December} +} + +@techreport{rfc674, + title={RFC 674: Procedure call documents: Version 2}, + author={Postel, J and White, JE}, + year={1974} +} + +@article{rfc684, + title={RFC 684: Commentary on procedure calling as a network protocol}, + author={Schantz, Richard}, + year={1975} +} diff --git a/chapter/1/rpc.md b/chapter/1/rpc.md index a05022f..05a6452 100644 --- a/chapter/1/rpc.md +++ b/chapter/1/rpc.md @@ -1,6 +1,6 @@ --- layout: page -title: "RPC is Not Dead: Rise, Fall and the Rise of RPC" +title: "RPC is Not Dead: Rise, Fall and the Rise of Remote Procedure Calls" by: "Muzammil Abdul Rehman and Paul Grosu" --- @@ -8,169 +8,222 @@ by: "Muzammil Abdul Rehman and Paul Grosu" *Remote Procedure Call* (RPC) is a design *paradigm* that allow two entities to communicate over a communication channel in a general request-response mechanism. It was initially built as a tool for outsourcing computation to a server in a distributed system, however, it has evolved over the years to build modular, scalable, distributed, language-agnostic ecosystem of applications. This RPC *paradigm* has been part of the driving force in creating truly revolutionizing distributed systems and giving rise to various communication schemes and protocols between diverse systems. -RPC *paradigm* has been implemented in various forms in our every-day systems. From lower level applications like Network File Systems{% cite sunnfs --file rpc %} and Remote Direct Memory Access{% cite rpcoverrdma --file rpc %} to access protocols to developing an ecosystem of microservices, RPC has been used everywhere. Some of the major examples of RPC include SunNFS{% cite sunnfs --file rpc %}, Twitter's Finagle{% cite finalge --file rpc %}, Apache Thrift{% cite thrift --file rpc %}, Java RMI{% cite rmipaper --file rpc %}, SOAP, CORBA{% cite corba --file rpc %}, Google's gRPC{% cite grpc --file rpc %}. +RPC *paradigm* has been implemented in various forms in our every-day systems. From lower level applications like Network File Systems{% cite sunnfs --file rpc %} and Remote Direct Memory Access{% cite rpcoverrdma --file rpc %} to access protocols to developing an ecosystem of microservices, RPC has been used everywhere. Some of the major examples of RPC include SunNFS{% cite sunnfs --file rpc %}, Twitter's Finagle{% cite finagle --file rpc %}, Apache Thrift{% cite thrift --file rpc %}, Java RMI{% cite rmipaper --file rpc %}, SOAP, CORBA{% cite corba --file rpc %}, Google's gRPC{% cite grpc --file rpc %}. -* adds paragraph about rise and fall - -RPC has evolved over the years. Starting off as a synchronous, insecure, request-response system, RPC has evolved into a secure, asynchronous, fault-tolerant, resilient *paradigm* that has influenced protocols and programming designs, like, HTTP, REST, and just about anything with a request-response system. It has transitioned to an asynchronous bidirectional communication for connecting services and devices across the internet. RPC has influenced various design paradigms and communication protocols. +RPC has evolved over the years. Starting off as a synchronous, insecure, request-response system, RPC has evolved into a secure, asynchronous, resilient *paradigm* that has influenced protocols and programming designs, like, HTTP, REST, and just about anything with a request-response system. It has transitioned to an asynchronous bidirectional communication for connecting services and devices across the internet. RPC has influenced various design paradigms and communication protocols. ## Remote Procedure Calls: -* Diagram of RPC: Local and remote endpoints, communication protocol. - *Remote Procedure Call paradigm* can be defined, at a high level, as a set of two language-agnostic communication *endpoints* connected over a network with one endpoint sending a request and the other endpoint generating a response based on that request. In the simplest terms, it's a request-response paradigm where the two *endpoints*/hosts have different *address space*. The host that requests a remote procedure can be referred to as *caller* and the host that responds to this can be referred to as *callee*. -The *endpoints* in the RPC can either be a client and a server, two nodes in a peer-to-peer network, two hosts in a grid computation system, or even two microservices. The RPC communcation is not limited to two hosts, rather could have multiple hosts or *endpoints* involved {% cite anycastrpc --file rpc %}. +The *endpoints* in the RPC can either be a client and a server, two nodes in a peer-to-peer network, two hosts in a grid computation system, or even two microservices. The RPC communication is not limited to two hosts, rather could have multiple hosts or *endpoints* involved {% cite anycastrpc --file rpc %}. + +
+ RPC in 10 Steps. +

Fig1. - Remote Procedure Call{% cite rpcimage --file rpc %}.

+
+ +The simplest RPC implementation looks like Fig1. In this case, the *client*(or *caller*) and the *server*(or *callee*) are separated by a physical network. The main components of the system are the client routine/program, the client stub, the server routine/program, the server stub, and the network routines. The client program can only interact with the client stub that provides the interface of the remote server to the client. This stub also provides marshalling/pickling/serialization of the input arguments sent to the stub by the client routine. Similarly, the server stub provides a client interface to the server routines. Whenever a client routine has to perform a *remote procedure*, it calls the client stub, which serializes the input argument. This serialized data is sent to the server using OS network routines (TCP/IP). The data is serialized by the server stub, present to the server routines for the given arguments. The return value from the server routines is serialized again and sent over the network back to the client where it's deserialized by the client stub and presented to the client routine. This *remote procedure* is generally hidden from the client routine and it appears as a *local procedure* to the client. RPC services also require a discovery service/host-resolution mechanism to bootstrap the communication between the client and the server. + +One important feature of RPC is different *address space* {% cite implementingrpc --file rpc %} for all the endpoints, however, passing the locations to a global storage(Amazon S3, Microsoft Azure, Google Cloud Store) is not impossible. In RPC, all the hosts have separate *address spaces*. They can't share pointers or references to a memory location in one host. This *address space* isolation means that all the information is passed in the messages between the host communicating as a value (objects or variables) but not by reference. Since RPC is a *remote* procedure call, the values sent to the *remote* host cannot be pointers or references to a *local* memory. However, passing links to a global shared memory location is not impossible but rather dependent on the type of system (see *Applications* section for detail). + +Originally, RPC was developed as a synchronous, language-specific marshalling service with a custom network protocol to outsource computation {% cite implementingrpc --file rpc %}. It had registry-system to register all the servers. One of the earliest RPC-based system {% cite implementingrpc --file rpc %} was implemented in the Cedar programming language in early 1980's. The goal of this system was to provide similar programming semantics as local procedure calls. Developed for a LAN network with an inefficient network protocol and a *serialization* scheme to transfer information using the said network protocol, this system aimed at executing a *procedure*(also referred as *method* or a *function*) in a remote *address space*. The single-thread synchronous client and the server were written in an old *Cedar* programming language with a registry system used by the servers to *bind*(or register) their procedures. The clients used this registry system to find a specific server to execute their *remote* procedures. + +Modern RPC-based systems are language-agnostic, asynchronous, load-balanced systems. Authentication and authorization to these systems have been added as needed along with other security features. Most of these systems have fault-handling built into them as modules. + +RPC programs have a network (or a communication channel), therefore, they need to handle remote errors and be able to communication information successfully. Error handling generally varies and is categorized as *remote-host* or *network* failure handling. Depending on the type of the system, and the error, the caller (or the callee) return an error and these errors can be handled accordingly. For asynchronous RPC calls, it's possible to specify events to ensure progress. + +RPC implementations use a *serialization*(also referred to as *marshalling* or *pickling*) scheme on top of an underlying communication protocol (traditionally TCP over IP). These *serialization* schemes allow both the caller *caller* and *callee* to become language agnostic allowing both these systems to be developed in parallel without any language restrictions. Some examples of serialization schemes are JSON, XML, or Protocol Buffers {% cite grpc --file rpc %}. -* explain the diagram here. +RPC allows different components of a larger system to be developed independently of one another. The language-agnostic nature combined with a decoupling of some parts of the system allows the two components (caller and callee) to scale separately and add new functionalities. This independent scaling of the system might lead to a mesh of interconnected RPC *services* facilitating one another. -One important feature of RPC is different *address space* {% cite implementingrpc --file rpc %} for all the endpoints, however, passing the locations to a global storage(Amazon S3, Microsoft Azure, Google Cloud Store) is not impossible.In RPC, all the hosts have separate *address spaces*. They can't share pointers or references to a memory location in one host. This *address space* isolation means that all the information is passed in the messages between the host communicating as a value (objects or variables) but not by reference. Since RPC is a *remote* procedure call, the values sent to the *remote* host cannot be pointers or references to a *local* memory. However, passing links to a global shared memory location is not impossible but rather dependent on the type of system(see *Applications* section for detail). +### Examples of RPC -Originally, RPC was developed as a synchronous, language-specific marshalling service with a custom network protocol to outsource computation{% cite implementingrpc --file rpc %}. It had registry-system to register all the servers. One of the earliest RPC-based system{% cite implementingrpc --file rpc %} was implemented in the Cedar programming language in early 1980's. The goal of this system was to provide similar progamming semantics as local procedure calls. Developed for a LAN network with an inefficient network protocol and a *serialization* scheme to transfer information using the said network protocol, this system aimed at executing a *procedure*(also referred as *method* or a *function*) in a remote *address space*. The single-thread synchronous client and the server were written in an old *Cedar* programming language with a registry system used by the servers to *bind*(or register) their procedures. The clients used this registry system to find a specific server to execute their *remote* procedures. +RPC has become very predominant in modern systems. In the simplest RPC systems, a client connects to a server over a network connection and performs a *procedure*. This procedure could be as simple as `return "Hello World"` in your favorite programming language. However, the complexity of the of this remote procedure has no upper bound. -Modern RPC-based systems are language-agnostic, fault-tolerant, asynchronous, load-balanced systems. Authenticaiton and authorization to these systems have been added as needed along with other security features. +Here's the code of this simple RPC server, written in Python3. +```python +from xmlrpc.server import SimpleXMLRPCServer -RPC programs have a network, therefore, they need to handle remote errors and be able to communication information successfully. Error handling generally varies and is categorized as *remote-host* or *network* failure handling. Depending on the type of the system, and the error, the caller(or the callee) return an error and these errors can be handled accordingly. For asynchronous RPC calls, it's possible to specify events to ensure progress. +# a simple RPC function that returns "Hello World!" +def remote_procedure(n): + return "Hello World!" -RPC implementations use a *serialization*(also referred to as *marshalling* or *pickling*) scheme on top of an underlying communication protocol(traditionally TCP over IP). These *serialization* schemes allow both the caller *caller* and *callee* to become language agnostic allowing both these systems to be developed in parallel without any language restrictions. Some examples of serialization schemes are JSON, XML, or Protocol Buffers{% cite grpc --file rpc %}. +server = SimpleXMLRPCServer(("localhost", 8080)) +print("RPC Server listening on port 8080...") +server.register_function(remote_procedure, "remote_procedure") +server.serve_forever() +``` -RPC allows different components of a larger system to be developed independtly of one another. The language-agnostic nature combined with a decoupling of some parts of the system allows the two components(caller and callee) to scale separately and add new functionalities. +This code for a simple RPC client for the above server, written in Python3, is as follows. -Some RPC implementations have moved from a one-server model to a dynamically-created, load-balanced microservices. +```python +import xmlrpc.client -* Examples: - * One could view the internet as example of RPC.e.g TCP handshake(both act as server and client). - * First: Google Maps API(REST) - * SSL Handshake. +with xmlrpc.client.ServerProxy("http://localhost:8080/") as proxy: + print(proxy.remote_procedure()) +``` +In the above example, we create a simple function called `remote_procedure` and *bind* it to port *8080* on *localhost*. The RPC client then connects to the server and *request* the `remote_procedure` with no input arguments. The server then *responds* with a return value of the `remote_procedure`. + +One can even view the *three-way handshake* as an example of RPC paradigm. The *three-way handshake* is most commonly used in establishing a TCP connection. Here, a server-side application *binds* to a port on the server, and adds a hostname resolution entry is added to a DNS server(can be seen as a *registry* in RPC). Now, when the client has to connect to the server, it requests a DNS server to resolve the hostname to an IP address and the client sends a SYN packet. This SYN packet can be seen as a *request* to another *address space*. The server, upon receiving this, returns a SYN-ACK packet. This SYN-ACK packet from the server can be seen as *response* from the server, as well as a *request* to establish the connection. The client then *responds* with an ACK packet. ## Evolution of RPC: -RPC started in 1980’s and still continues as a relevant model of performing distributed computation, which initially was developed for a LAN and now can be globally implemented. +RPC paradigm was first proposed in 1980’s and still continues as a relevant model of performing distributed computation, which initially was developed for a LAN and now can be globally implemented. It has had a long and arduous journey to its current state. Here are the three main(overlapping) stages that RPC went through. -* RPC has evolved from what it was originally proposed. -* Chris’s thing: https://christophermeiklejohn.com/pl/2016/04/12/rpc.html -* diagram(maybe not): 4 lines, (y-axis: -1 to 1, x-axis 1980's 2016) +### The Rise: All Hail RPC(Early 1970's - Mid 1980's) -### The Rise: All Hail RPC +RPC started off strong. With RFCs{% cite rfc674 rfc707 --file rpc %} coming out and specifying the design of Remote Procedure Calls, followed by Nelson et. al{% cite implementingrpc --file rpc %} coming up with a first implementation for the Cedar programming language, RPC revolutionized systems in general and gave rise to one of the earliest distributed systems(apart from the internet, of course). -* RPC origin. +With these early achievements, people started using RPC as the defacto design choice. It became a Holy Grail in the systems community for a few years after the first implementation. - * Implementing RPC: [https://dl.acm.org/citation.cfm?id=357392](https://dl.acm.org/citation.cfm?id=357392) - * The RPC thesis(Nelson) - * More examples +### The Fall: RPC is Dead(Late 1970's - Late 1980's) -### The Fall: RPC is Dead +RPC, despite being an initial success, wasn't without flaws. Within a year of its inception, the limitation of the RPC started to catch up with it. RFC 684 criticized RPC for latency, failures, and the cost. It also focussed on message-passing systems as an alternative to RPC design. Similarly, a few years down the road, in 1988, Tenenbaum et. al presented similar concerns against RPC {%cite critiqueofrpc --file rpc %}. It talked about problems heterogeneous devices, message passing as an alternative, packet loss, network failure, RPC's synchronous nature, and highlighted that RPC is not a one-size-fits-all model. -* The fall of RPC/Criticism of RPC - * Limitations - * http://www.cs.vu.nl//~ast/afscheid/publications/euteco-1988.pdf - * Systems that use message passing. +### The Rise, Again: Long Live RPC(Early 1990's - Today) -### The Rise, Again: Long Live RPC +Despite facing problems in its early days, RPC withstood the test of time. Researchers realized the limitations of RPC and focussed on rectifying and instead of enforcing RPC, they started to use RPC in applications where it was needed. The designer started adding exception-handling, async, network failure handling and heterogenity between different languages/devices to RPC. -* gRPC -* XML SOAP -* Java RMI -* Finagle -* Thrift -* Apache Etch -* Sun RPC(ONC RPC) +Perhaps, the earliest system in this era was SunRPC {% cite sunnfs --file rpc %} used for the Sun Network File System(NFS). This SunRPC has gone under various additions and is now referred to as Open Network Computing RPC(ONC RPC). +Soon to follow SunRPC was the language-agnostic CORBA{% cite corba --file rpc %} which was followed by Java RMI{% cite rmipaper --file rpc %}. CORBA and RMI have also undergone various modifications as internet standards were set and TCP/IP became the norm. -#### Java Remote Method Invocation: -Java RMI (Java Remote Method Invocation){% cite rmibook --file rpc %} is a Java implementation for performing RPC (Remote Procedure Calls) between a client and a server. The client using a stub passes via a socket connection the information over the network to the server. The Remote Object Registry (ROR){% cite rmipaper --file rpc %} on the server contains the references to objects that can be accessed remotely and through which the client will connect to. The client then can request of the invocation of methods on the server for processing the requested call and then responds with the answer. RMI provides some security by being encoded but not encrypted, though that can be augmented by tunneling over a secure connection or other methods. +A new breed of RPC also started in this era(early 2000's), Async RPC, giving rise to systems that use *futures* and *promises*, like Finagle{% cite finagle --file rpc %} and Cap'n Proto(post-2010). +In the post-2000 era, MAUI{% cite maui --file rpc %}, Cap'n Proto{% cite capnproto --file rpc %}, gRPC{% cite grpc --file rpc %}, Thrift{% cite thrift --file rpc %} and Finagle{% cite finagle --file rpc %} have been released, which have significantly boosted the widespread use of RPC. A level overview of some of the most important RPC implementation is as follows. +#### Java Remote Method Invocation +Java RMI (Java Remote Method Invocation){% cite rmibook --file rpc %} is a Java implementation for performing RPC (Remote Procedure Calls) between a client and a server. The client using a stub passes via a socket connection the information over the network to the server. The Remote Object Registry (ROR){% cite rmipaper --file rpc %} on the server contains the references to objects that can be accessed remotely and through which the client will connect to. The client then can request of the invocation of methods on the server for processing the requested call and then responds with the answer. RMI provides some security by being encoded but not encrypted, though that can be augmented by tunneling over a secure connection or other methods. -#### CORBA: +#### CORBA CORBA (Common Object Request Broker Architecture){% cite corba --file rpc %} was created by the Object Management Group {% cite corbasite --file rpc %} to allow for language-agnostic communication among multiple computers. It is an object-oriented model defined via an Interface Definition Language (IDL) and the communication is managed through an Object Request Broker (ORB). Each client and server have an ORB by which they communicate. The benefits of CORBA is that it allows for multi-language implementations that can communicate with each other, but much of the criticism around CORBA relates to poor consistency among implementations. -#### XML-RPC and SOAP: +#### XML-RPC and SOAP +SOAP (Simple Object Access Protocol) is a successor of XML-RPC as a web-services protocol for communicating between a client and server. It was initially designed by a group at Microsoft {% cite soaparticle1 --file rpc %}. The SOAP message is an XML-formatted message composed of an envelope inside which a header and a body are provided. The body of the message contains the request and response of the message, which is transmitted over HTTP or SMTP. The benefit of such a protocol is that it provides the flexibility for transmission over multiple transport protocol, though parsing such messages could become a bottleneck. -SOAP (Simple Object Access Protocol) is a successor of XML-RPC as a web-services protocol for communicating between a client and server. It was initially designed by a group at Microsoft {% cite soaparticle1 --file rpc %}. The SOAP message is a XML-formatted message composed of an envelope inside which a header and a body is provided. The body of the message contains the request and response of the message, which is transmitted over HTTP or SMTP. The benefits of such a protocol is that provides the flexibility for transmission of multiple tranport protocol, though parsing such messages could become a bottleneck. +#### Thrift +Thrift is an RPC system created by Facebook and now part of the Apache Foundation {% cite thrift --file rpc %}. It is a language-agnostic IDL by which one generates the code for the client and server. It provides the opportunity for compressed serialization by customizing the protocol and the transport after the description file has been processed. +#### Finagle +Finagle was generated by Twitter and is an RPC system written in Scala and can run on a JVM. It is based on three object types: Service objects, Filter objects and Future objects {% cite finagle --file rpc %}. The Future objects act by asynchronously being requested for a computation that would return a response at some time in the future. The Service objects are an endpoint that will return a Future upon processing a request. A Filter object transforms requests for further processing in case additional customization is required from a request. -#### Thrift: -Thrift is a RPC created by Facebook and now part of the Apache Foundation {% cite thrift --file rpc %}. It is a language-agnostic IDL by which one generates the code for the client and server. It provides the opportunity for compressed serialization by customizing the protocol and the transport after the description file has been processed. +#### Open Network Computing RPC +* Pros and Cons -#### Finagle: -Finagle was generated by Twitter and is an RPC written in Scala and can run on an JVM. It is based on three object types: Service objects, Filter objects and Future objects{% cite finagle --file rpc %}. The Future objects acts by asynchronously being requested for a computation that would return a response at some time in the future. The Service objects are an endpoint that will return a Future upon processing a request. A Filter object transforms requests for further processing in case additional customization is required from a request. +#### Mobile Assistance Using Infrastructure(MAUI) -#### Open Network Computing RPC: -* Pros and Cons +The MAUI project {% cite maui --file rpc %}, developed by Microsoft is a computation offloading system for mobile systems. It's an automated system that offloads a mobile code to a dedicated infrastructure in order to increase the battery life of the mobile, minimize the load on the programmer and perform complex computations offsite. MAUI uses RPC as the communication protocol between the mobile and the infrastructure. + +#### gRPC + +gRPC has been built as a collaboration between Google and Square as a public replacement of Stubby, ARCWire, and Sake {% cite Apigee --file rpc %}. The IDL for gRPC is Protocol Buffers(also referred as ProtoBuf). + +gRPC provides a platform for scalable, bi-directional streaming using both synchronized and asynchronous communication. It multiplexes the requests over a single connection using header compression. This makes it possible for gRPC to be used for mobile clients where battery life and data usage are important. +The core library is in C -- except for Java and GO -- and surface APIs are implemented for all the other languages connecting through it{% cite CoreSurfaceAPIs --file rpc %}. + +Since Protocol Buffers has been utilized by many individuals and companies, gRPC makes it natural to extend their RPC ecosystems via gRPC. Companies like Cisco, Juniper and Netflix {% cite gRPCCompanies --file rpc %} have found it practical to adopt it. +A majority of the Google Public APIs, like their places and maps APIs, have been ported to gRPC ProtoBuf {% cite gRPCProtos --file rpc %} as well. -#### gRPC: +#### Cap'n Proto +CapnProto{% cite capnproto --file rpc %} is a data interchange RPC system between that bypasses data-encoding step(like JSON or ProtoBuf) to significantly improve the performance. It's developed by the original author of gRPC's ProtoBuf, but since it uses bytes(binary data) for encoding/decoding, it outperforms gRPC's ProtoBuf. It uses futures and promises to combine various remote operations into a single to save the transportation round-trips. -### The Contenders for the Throne: gRPC, Thrift or RMI +### The Heir to the Throne: gRPC or Thrift -* gRPC vs Thrift (maybe also Finagle) +Although there are many candidates to be considered as top contenders for RPC throne, most of these are targeted for a specific type of application. ONC is generally specific to the Network File System(though it's being pushed as a standard), Cap'n Proto is relatively new and untested, MAUI is specific to mobile systems, the open-source Finagle is primarily being used at Twitter(not widespread), and the Java RMI simply doesn't even close anyways(sorry to burst your bubble Java fans). -## Applications: +Probably, the most powerful, and practical systems out there are Apache Thrift and Google's gRPC, primarily because *variants* of these two systems have been developed and used by Facebook and Google, respectively. This might be considered as biased view against other RPC implementations, however, when one considers Big Data and Internet-scale, only these two companies (and these two systems) come close. -* RPC and shared state (Persistence Layer): - * http://ieeexplore.ieee.org/document/1302942/?arnumber=1302942&tag=1 - * http://ieeexplore.ieee.org/document/918991/?arnumber=918991 +Thrift was actually released a few years ago, while the first stable release for gRPC came out in August 2016. However, despite being 'out there', Thrift is currently less popular than gRPC {%cite trendrpcthrift --file rpc %}. -* Grid computing: - * https://link.springer.com/article/10.1023/A:1024083511032 +gRPC {% cite gRPCLanguages --file rpc %} and Thrift, both, support most of the popular languages, including Java, C/C++, and Python. Thrift supports other languages, like Ruby, Erlang, Perl, Javascript, Node.js and OCaml while gRPC currently supports Node.js and Go. -* Mobile Systems(offloading and battery requirements): - * https://link.springer.com/article/10.1007/s11036-012-0368-0 +Thrift provides exception-handling as a message while the programmer has to handle exceptions in gRPC. -* Embedded RPC: - * https://dl.acm.org/citation.cfm?id=1127840 +Although custom authentication mechanisms can be implemented in both these system, gRPC come with a Google-backed authentication using SSL/TLS and Google Tokens {% cite grpcauth --file rpc %}. -* Micro services architecture(ecosystem) +The major differences between gRPC and Thrift can be summed in this table. -* RPC can be async +| Comparison | Thrift | gRPC | +| ----- | ----- | ----- | +| License | Apache2 | BSD | +| Supported Languages | C++, Java, Python, PHP, Ruby, Erlang, Perl, Haskell, C#, Cocoa, JavaScript, Node.js, Smalltalk, and OCaml | C/C++, Python, Go, Java, Ruby, PHP, C#, Node.js, Objective-C | +| Exceptions | Allows being built in the message | Implemented by the programmer | +| Authentication | Custom | Custom + Google Tokens | +| Bi-Directionality | Not straightforward | Core Implementation via HTTP/2 | +| Multiplexing | Some functionality via multiplexed server | Core Implementation via HTTP/2 | -* Shared State +Although, it's difficult to specifically choose one over the other, however, with increasing popularity of gRPC, and the fact that it's still in early stages of development, the general trend{%cite trendrpcthrift --file rpc %} over the past year has started to shift in favor of gRPC and it's giving Thrift a run for its money. -* microservices +**Note:** This study is performed in December 2016 so the results are expected to change with time. -* Futures and promises: RPC? +## Applications -### Streaming requests and buffered responses +Since its inception, various papers have been published in applying RPC paradigm to different domains, as well as using RPC implementations to create new systems. Here are some of applications and systems that incorporated RPC. -### RPC in microservices ecosystem: +#### Shared State and Persistence Layer -RPC started as a separate implements of REST, Streaming RPC, and now made possible of integration of all these implementations as a single abstraction for a user endpoint service. +One major limitation (and the advantage) of RPC is considered the separate *address space* of all the machines in the network. This means that *pointers* or *references* to a data object cannot be passed between the caller and the callee. Therefore, Interweave {% cite interweave2 interweave1 interweave3 --file rpc %} is a middleware system that allows scalable sharing of arbitrary data-types and language-independent processes running heterogeneous hardware. Interweave is specifically designed and is compatible with RPC-based systems and allows easier access to the shared resources between different applications. It even allows passing C *pointers* between the caller and the callee. -* Creating new services. +#### GridRPC -* Bootstrapping +Grid computing is one of the most widely used applications of RPC paradigm. At a high level, it can be seen as a mesh (or a network) of computers connected with each other to for *grid* such each system can leverage resources from any other system in the network. -* Load balancing - * Creating new services in Actor-Like model - * Fault tolerance - * Self-recovery +In the GridRPC paradigm, each computer in the network can act as the *caller* or the *callee* depending on the amount of resources required {% cite grid1 --file rpc %}. It's also possible for the same computer to act as the *caller* as well as the *callee* for *different* computations. -* Business and Persistence Layer were combined and the Persistence layer is not shared anymore, where each endpoints has its own persistent state: - * https://help.sap.com/saphelp_nwmobile711/helpdata/de/7e/d1a40b5bc84868b1606ce0dc72d88b/content.htm +Some of the most popular implementations that allow one to have GridRPC-compliant middleware are GridSolve{% cite gridsolve1 gridsolve2 --file rpc %} and Ninf-G{% cite ninf --file rpc %}. Ninf is relatively older than GridSolve and was first published in the late 1990's. It's a simple RPC layer that also provides authentication and secure communication between the two parties. GridSolve, on the other hand, is relatively complex and provides a middleware for the communications using a client-agent-server model. + +#### Mobile Systems and Computation Offloading + +Mobile systems have become very powerful these days. With multi-core processors and gigabytes of RAM, they can undertake relatively complex computations without a hassle. Due to this advancement, they consume a larger amount of energy and hence, their batteries, despite becoming larger, drain quickly with usage. Moreover, mobile data (network bandwidth) is still limited and expensive. Due to these requirements, it's better to offload mobile computations from mobile systems when possible. RPC plays an important role in the communication for this *computation offloading*. Some of these services use Grid RPC technologies to offload this computation. Whereas, other technologies use an RMI(Remote Method Invocation) system for this. + +The Ibis Project {% cite ibis --file rpc %} builds an RMI and GMI (Group Method Invocation) model to facilitate outsourcing computation. Cuckoo {% cite cuckoo --file rpc %} uses this Ibis communication middleware to offload computation. + +The Microsoft's MAUI Project {% cite maui --file rpc %} uses RPC communication and allows partitioning of .NET applications and "fine-grained code offload to maximize energy savings with minimal burden on the programmer". MAUI decides the methods to offload to the external MAUI server at runtime. + +#### Async RPC, Futures and Promises + +Remote Procedure Calls can be asynchronous. Not only that but these async RPCs play in integral role in the *futures* and *promises*. *Future* and *promises* are programming constructs that where a *future* is seen as variable/data/return type/error while a *promise* is seen as a *future* that doesn't have a value, yet. We follow Finagle's {% cite finagle --file rpc %} definition of *futures* and *promises*, where the *promise* of a *future*(an empty *future*) is considered as a *request* while the async fulfillment of this *promise* by a *future* is seen as the *response*. This construct is primarily used for concurrent programming. + +Perhaps the most renowned systems using this type of RPC model are Twitter's Finagle{% cite finagle --file rpc %} and Cap'n Proto{% cite capnproto --file rpc %}. + +#### RPC in Microservices Ecosystem: + +RPC implementations have moved from a one-server model to multiple servers and on to dynamically-created, load-balanced microservices. RPC started as a separate implementations of REST, Streaming RPC, MAUI, gRPC, Cap'n Proto, and has now made it possible for integration of all these implementations as a single abstraction as a user *endpoint* service. The endpoints are the building blocks of *microservices*. These *microservices* interact with each other and applications and combine to give the feel of one large monolithic service. + +The use of RPC has allowed us to create new microservices on-the-fly. The microservices can not only created and bootstrapped at runtime but also have inherent features like load-balancing and failure-recovery. This bootstrapping might occur on the same machine, adding to a Docker container {% cite docker --file rpc %}, or across a network (using any combination of DNS, NATs or other mechanisms). + +RPC can be defined as the "glue" that holds all the microservices together{% cite microservices1rpc --file rpc %}. This means that RPC is one of the primary communication mechanism between different microservices running on different systems. A microservice requests another microservice to perform an operation/query. The other microservice, upon receiving such request, performs an operation and returns a response. This operation could vary from a simple computation to invoking another microservice creating a series of RPC events to creating new microservices on the fly to dynamically load balance the microservices system. + +An example of a microservices ecosystem that uses futures/promises is Finagle at Twitter. ## Security in RPC: -* Initially it was separate. - * Authentication, authorization issues have been resolved -* Now embedded in the protocol -* Security and Privacy in RPC - * Bugs in the libraries. - * Trust Issues between client and the server. - * http://static.usenix.org/publications/library/proceedings/sec02/full_papers/giffin/giffin_html/ - * Brewer’s view: https://people.eecs.berkeley.edu/~brewer/cs262b-2004/PODC-keynote.pdf - * E programming language: distributed object model/VAT + +The initial RPC implementation {% cite implementingrpc --file rpc %} was developed for an isolated LAN network and didn't focus much on security. There're various attack surfaces in that model, from the malicious registry, to a malicious server, to a client targeting for Denial-of-Service to Man-in-the-Middle attack between client and server. + +As time progressed and internet evolved, new standards came along, and RPC implementations became much more secure. Security, in RPC, is generally added as a *module* or a *package*. These modules have libraries for authentication and authorization of the communication services (caller and callee). These modules are not always bug-free and it's possible to gain unauthorized access to the system. Efforts are being made to rectify these situations by the security in general, using code inspection and bug bounty programs to catch these bugs before-hand. However, with time new bugs arise and this cycle continues. It's a vicious cycle between attackers and security experts, both of whom tries to outdo their opponent. + +For example, the Oracle Network File System uses a *Secure RPC*{% cite oraclenfs --file rpc %} to perform authentication in the NFS. This *Secure RPC* uses Diffie-Hellman authentication mechanism with DES encryption to allow only authorized users to access the NFS. Similarly, Cap'n Proto {% cite capnprotosecure --file rpc %} claims that it is resilient to memory leaks, segfaults, and malicious inputs and can be used between mutually untrusting parties. However, in Cap'n Proto "the RPC layer is not robust against resource exhaustion attacks, possibly allowing denials of service", nor has it undergone any formal verification {% cite capnprotosecure --file rpc %}. + +Although, it's possible to come up with a *Threat Model* that would make an RPC implementation insecure to use, however, one has to understand that using any distributed system increases the attack surface anyways and claiming one *paradigm* to be more secure than another would be a biased statement, since *paradigms* are generally an idea and it depends on different system designers to use these *paradigms* to build their systems and take care of features specific to real systems, like security and load-balancing. There's always a possibility of rerouting a request to a malicious server(if the registry gets hacked), or there's no trust between the *caller* and *callee*. However, we maintain that RPC *paradigm* is not secure or insecure(for that matter), and that the most secure systems are the ones that are in an isolated environment, disconnected from the public internet with a self-destruct mechanism{% cite self --file rpc %} in place, in an impenetrable bunker, and guarded by the Knights Templar(*they don't exist! Well, maybe Fort Meade comes close*). ## Discussion: -* RPC vs REST and other services. RPC influence. -* The future of RPC - * Where it shines. Not in message passing. - * RPC is not XYZ (HTTP, REST, …) though it has influenced. -## Conclusions(maybe not a heading): +RPC *paradigm* shines the most in *request-response* mechanisms. Futures and Promises also appear to a new breed of RPC. This leads one to question, as to whether every *request-response* system is a modified implementation to of the RPC *paradigm*, or does it actually bring anything new to the table? These modern communication protocols, like HTTP and REST, might just be a different flavor of RPC. In HTTP, a client *requests* a web page(or some other content), the server then *responds* with the required content. The dynamics of this communication might be slightly different from your traditional RPC, however, an HTTP Stateless server adheres to most of the concepts behind RPC *paradigm*. Similarly, consider sending a request to your favorite Google API. Say, you want to translate your latitude/longitude to an address using their Reverse Geocoding API, or maybe want to find out a good restaurant in your vicinity using their Places API, you'll send a *request* to their server to perform a *procedure* that would take a few input arguments, like the coordinates, and return the result. Even though these APIs follow a RESTful design, it appears to be an extension to the RPC *paradigm*. + +RPC paradigm has evolved over time. It has evolved to the extent that, currently, it's become very difficult differentiate RPC from non-RPC. For the past decades, researchers and industry leaders have tried to come up with *their* definition of RPC. The proponents of RPC paradigm view every *request-response* communication as an implementation the RPC paradigm while those against RPC try to explicitly come up with the bounds of RPC. RPC supporters consider it as the Holy Grail of distributed systems. They view it as the foundation of modern distributed communication. From Apache Thrift and ONC to HTTP and REST, they advocate it all as RPC while REST developers have strong opinions against RPC. + +Moreover, with modern global storage mechanisms, the need for RPC systems to have a separate *address space* seems to be slowly dissolving and disappearing into thin air. So, the question remains what *is* RPC and what * is not* RPC? This is an open-ended question. There is no unanimous agreement about what RPC should look like, except that it has communication between two *endpoints*. What we think of RPC is: -RPC is not dead: long live the Remote Procedure calls. +*"In the world of distributed systems, where every individual component of a system, be it a hard disk, a multi-core processor, or a microservice, is an extension of the RPC, it's difficult to come with a concrete definition of the RPC paradigm. Therefore, anything loosely associated with a request-response mechanism can be considered as RPC".* +
+

+**RPC is not dead, long live RPC!** +

+
## References -{% bibliography --file rpc %} \ No newline at end of file +{% bibliography --file rpc --cited %} diff --git a/resources/img/rpc_chapter_1_ycog_10_steps.png b/resources/img/rpc_chapter_1_ycog_10_steps.png new file mode 100644 index 0000000..86c7432 Binary files /dev/null and b/resources/img/rpc_chapter_1_ycog_10_steps.png differ -- cgit v1.2.3 From 4016d5b399e39ae77afa36e1a25c4980fa1e4c9a Mon Sep 17 00:00:00 2001 From: Muzammil Date: Fri, 9 Dec 2016 11:59:39 -0500 Subject: First Draft-Muzammil --- _bibliography/rpc.bib | 26 ++++++++++++++++++++++++++ chapter/1/rpc.md | 30 ++++++++++++++++++++---------- 2 files changed, 46 insertions(+), 10 deletions(-) diff --git a/_bibliography/rpc.bib b/_bibliography/rpc.bib index db77c12..266c603 100644 --- a/_bibliography/rpc.bib +++ b/_bibliography/rpc.bib @@ -333,3 +333,29 @@ author={Schantz, Richard}, year={1975} } + +@misc{grpcbetter, + title={GRPC Authentication}, + author={Google}, + url = {https://www.quora.com/Is-GRPC-better-than-Thrift}, + publisher = {Quora} +} + +@misc{multiplexingthrift, + title={Added service multiplexing support}, + author={Yu, Lixin}, + url = {https://github.com/eleme/thriftpy/pull/88/commits/0877531f9246ca993c1d9af5d29cd009ee6ec7d4}, + publisher = {Github} +} + +@techreport{rfc5531, + title={RFC 5531: RPC: Remote Procedure Call Protocol Specification Version 2}, + author={Thurlow, R}, + year={2009} +} + +@techreport{rfc1831, + title={RFC 1831: RPC: Remote Procedure Call Protocol Specification Version 2}, + author={Srinivasan, R}, + year={1995} +} diff --git a/chapter/1/rpc.md b/chapter/1/rpc.md index 05a6452..6806580 100644 --- a/chapter/1/rpc.md +++ b/chapter/1/rpc.md @@ -109,11 +109,10 @@ Thrift is an RPC system created by Facebook and now part of the Apache Foundatio #### Finagle Finagle was generated by Twitter and is an RPC system written in Scala and can run on a JVM. It is based on three object types: Service objects, Filter objects and Future objects {% cite finagle --file rpc %}. The Future objects act by asynchronously being requested for a computation that would return a response at some time in the future. The Service objects are an endpoint that will return a Future upon processing a request. A Filter object transforms requests for further processing in case additional customization is required from a request. -#### Open Network Computing RPC -* Pros and Cons +#### Open Network Computing RPC(ONC RPC) +ONC was originally introduced as SunRPC {%cite sunrpc --file rpc %} for the Sun NFS. It supported NFS read, write, truncate, unlink, etc operations. However, it was later revised as ONC in 1995 {%cite rfc1831 --file rpc %} and then in 2009 {%cite rfc5531 --file rpc %}. The IDL used in ONC is External Data Representation (XDR), a serialization mechanism specific to networks communication and therefore, ONC is limited to applications like Network File Systems. #### Mobile Assistance Using Infrastructure(MAUI) - The MAUI project {% cite maui --file rpc %}, developed by Microsoft is a computation offloading system for mobile systems. It's an automated system that offloads a mobile code to a dedicated infrastructure in order to increase the battery life of the mobile, minimize the load on the programmer and perform complex computations offsite. MAUI uses RPC as the communication protocol between the mobile and the infrastructure. #### gRPC @@ -139,24 +138,35 @@ Thrift was actually released a few years ago, while the first stable release for gRPC {% cite gRPCLanguages --file rpc %} and Thrift, both, support most of the popular languages, including Java, C/C++, and Python. Thrift supports other languages, like Ruby, Erlang, Perl, Javascript, Node.js and OCaml while gRPC currently supports Node.js and Go. -Thrift provides exception-handling as a message while the programmer has to handle exceptions in gRPC. +The gRPC core is written in C(with the exception of Java and Go) and wrappers are written in other languages to communicate with the core, while the Thrift core is written in C++. + +gRPC also provides easier bi-drectional streaming communicaiton between the caller and callee. The client generally initiates the communication {% cite gRPCLanguages --file rpc %} and once the connection is established the client and the server can perform reads and writes independently of each other. However, bi-directional streaming in Thrift might be a little difficult to handle, since it focuses explicitly on a client-server model. To enable bi-directionaly, async streaming, one may have to run two seperate systems {%cite grpcbetter --file rpc%}. + +Thrift provides exception-handling as a message while the programmer has to handle exceptions in gRPC. In Thrift, exceptions can be returned built into the message, while in gRPC, the programmer explicitly defines this behaviour. This Thrift exception-handling makes it easier to write client-side applications. Although custom authentication mechanisms can be implemented in both these system, gRPC come with a Google-backed authentication using SSL/TLS and Google Tokens {% cite grpcauth --file rpc %}. -The major differences between gRPC and Thrift can be summed in this table. +Moreover, gRPC-based network communication is done using HTTP/2. HTTP/2 makes it feasible for communicating parties to multiplex network connections using the same port. This is more efficient(in terms of memory usage) as compared to HTTP/1.1. Since, gRPC communication is done HTTP/2, it means that gRPC can easily multiplex different services. As for Thrift, multiplexing services is possible, however, due to lack of support from underlying transport protocol, it is performed using a `TMulitplexingProcessor` class {% cite multiplexingthrift --file rpc %}. + +However, both gRPC and Thrift allow async RPC calls. This means that a client can send a request to the server and continue with its execution and the response from the server is processed it arrives. + + +The major comparison between gRPC and Thrift can be summed in this table. | Comparison | Thrift | gRPC | | ----- | ----- | ----- | | License | Apache2 | BSD | +| Sync/Async RPC | Both | Both | | Supported Languages | C++, Java, Python, PHP, Ruby, Erlang, Perl, Haskell, C#, Cocoa, JavaScript, Node.js, Smalltalk, and OCaml | C/C++, Python, Go, Java, Ruby, PHP, C#, Node.js, Objective-C | +| Core Language | C++| C | | Exceptions | Allows being built in the message | Implemented by the programmer | | Authentication | Custom | Custom + Google Tokens | -| Bi-Directionality | Not straightforward | Core Implementation via HTTP/2 | -| Multiplexing | Some functionality via multiplexed server | Core Implementation via HTTP/2 | +| Bi-Directionality | Not straightforward | Straightforward | +| Multiplexing | Possible via | Possible via HTTP/2 | Although, it's difficult to specifically choose one over the other, however, with increasing popularity of gRPC, and the fact that it's still in early stages of development, the general trend{%cite trendrpcthrift --file rpc %} over the past year has started to shift in favor of gRPC and it's giving Thrift a run for its money. -**Note:** This study is performed in December 2016 so the results are expected to change with time. +**Note:** This study is performed in December 2016 so the results are expected to change with time. ## Applications @@ -198,7 +208,7 @@ RPC can be defined as the "glue" that holds all the microservices together{% cit An example of a microservices ecosystem that uses futures/promises is Finagle at Twitter. -## Security in RPC: +## Security in RPC The initial RPC implementation {% cite implementingrpc --file rpc %} was developed for an isolated LAN network and didn't focus much on security. There're various attack surfaces in that model, from the malicious registry, to a malicious server, to a client targeting for Denial-of-Service to Man-in-the-Middle attack between client and server. @@ -208,7 +218,7 @@ For example, the Oracle Network File System uses a *Secure RPC*{% cite oraclenfs Although, it's possible to come up with a *Threat Model* that would make an RPC implementation insecure to use, however, one has to understand that using any distributed system increases the attack surface anyways and claiming one *paradigm* to be more secure than another would be a biased statement, since *paradigms* are generally an idea and it depends on different system designers to use these *paradigms* to build their systems and take care of features specific to real systems, like security and load-balancing. There's always a possibility of rerouting a request to a malicious server(if the registry gets hacked), or there's no trust between the *caller* and *callee*. However, we maintain that RPC *paradigm* is not secure or insecure(for that matter), and that the most secure systems are the ones that are in an isolated environment, disconnected from the public internet with a self-destruct mechanism{% cite self --file rpc %} in place, in an impenetrable bunker, and guarded by the Knights Templar(*they don't exist! Well, maybe Fort Meade comes close*). -## Discussion: +## Discussion RPC *paradigm* shines the most in *request-response* mechanisms. Futures and Promises also appear to a new breed of RPC. This leads one to question, as to whether every *request-response* system is a modified implementation to of the RPC *paradigm*, or does it actually bring anything new to the table? These modern communication protocols, like HTTP and REST, might just be a different flavor of RPC. In HTTP, a client *requests* a web page(or some other content), the server then *responds* with the required content. The dynamics of this communication might be slightly different from your traditional RPC, however, an HTTP Stateless server adheres to most of the concepts behind RPC *paradigm*. Similarly, consider sending a request to your favorite Google API. Say, you want to translate your latitude/longitude to an address using their Reverse Geocoding API, or maybe want to find out a good restaurant in your vicinity using their Places API, you'll send a *request* to their server to perform a *procedure* that would take a few input arguments, like the coordinates, and return the result. Even though these APIs follow a RESTful design, it appears to be an extension to the RPC *paradigm*. -- cgit v1.2.3 From e040c6af0f6e58a11fc638ff66c2dc93b960a361 Mon Sep 17 00:00:00 2001 From: Muzammil Date: Fri, 9 Dec 2016 12:14:59 -0500 Subject: Muzammil-minor --- chapter/1/rpc.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/chapter/1/rpc.md b/chapter/1/rpc.md index 6806580..99f6d4e 100644 --- a/chapter/1/rpc.md +++ b/chapter/1/rpc.md @@ -4,7 +4,7 @@ title: "RPC is Not Dead: Rise, Fall and the Rise of Remote Procedure Calls" by: "Muzammil Abdul Rehman and Paul Grosu" --- -## Introduction +## Introduction: *Remote Procedure Call* (RPC) is a design *paradigm* that allow two entities to communicate over a communication channel in a general request-response mechanism. It was initially built as a tool for outsourcing computation to a server in a distributed system, however, it has evolved over the years to build modular, scalable, distributed, language-agnostic ecosystem of applications. This RPC *paradigm* has been part of the driving force in creating truly revolutionizing distributed systems and giving rise to various communication schemes and protocols between diverse systems. @@ -168,7 +168,7 @@ Although, it's difficult to specifically choose one over the other, however, wit **Note:** This study is performed in December 2016 so the results are expected to change with time. -## Applications +## Applications: Since its inception, various papers have been published in applying RPC paradigm to different domains, as well as using RPC implementations to create new systems. Here are some of applications and systems that incorporated RPC. @@ -208,7 +208,7 @@ RPC can be defined as the "glue" that holds all the microservices together{% cit An example of a microservices ecosystem that uses futures/promises is Finagle at Twitter. -## Security in RPC +## Security in RPC: The initial RPC implementation {% cite implementingrpc --file rpc %} was developed for an isolated LAN network and didn't focus much on security. There're various attack surfaces in that model, from the malicious registry, to a malicious server, to a client targeting for Denial-of-Service to Man-in-the-Middle attack between client and server. @@ -218,7 +218,7 @@ For example, the Oracle Network File System uses a *Secure RPC*{% cite oraclenfs Although, it's possible to come up with a *Threat Model* that would make an RPC implementation insecure to use, however, one has to understand that using any distributed system increases the attack surface anyways and claiming one *paradigm* to be more secure than another would be a biased statement, since *paradigms* are generally an idea and it depends on different system designers to use these *paradigms* to build their systems and take care of features specific to real systems, like security and load-balancing. There's always a possibility of rerouting a request to a malicious server(if the registry gets hacked), or there's no trust between the *caller* and *callee*. However, we maintain that RPC *paradigm* is not secure or insecure(for that matter), and that the most secure systems are the ones that are in an isolated environment, disconnected from the public internet with a self-destruct mechanism{% cite self --file rpc %} in place, in an impenetrable bunker, and guarded by the Knights Templar(*they don't exist! Well, maybe Fort Meade comes close*). -## Discussion +## Discussion: RPC *paradigm* shines the most in *request-response* mechanisms. Futures and Promises also appear to a new breed of RPC. This leads one to question, as to whether every *request-response* system is a modified implementation to of the RPC *paradigm*, or does it actually bring anything new to the table? These modern communication protocols, like HTTP and REST, might just be a different flavor of RPC. In HTTP, a client *requests* a web page(or some other content), the server then *responds* with the required content. The dynamics of this communication might be slightly different from your traditional RPC, however, an HTTP Stateless server adheres to most of the concepts behind RPC *paradigm*. Similarly, consider sending a request to your favorite Google API. Say, you want to translate your latitude/longitude to an address using their Reverse Geocoding API, or maybe want to find out a good restaurant in your vicinity using their Places API, you'll send a *request* to their server to perform a *procedure* that would take a few input arguments, like the coordinates, and return the result. Even though these APIs follow a RESTful design, it appears to be an extension to the RPC *paradigm*. -- cgit v1.2.3 From 232cb8c6e6c0dc94190bdd88f8733621fc606ff6 Mon Sep 17 00:00:00 2001 From: Muzammil Date: Fri, 9 Dec 2016 12:33:32 -0500 Subject: Muzammil-minor again --- chapter/1/rpc.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chapter/1/rpc.md b/chapter/1/rpc.md index 99f6d4e..7688455 100644 --- a/chapter/1/rpc.md +++ b/chapter/1/rpc.md @@ -110,7 +110,7 @@ Thrift is an RPC system created by Facebook and now part of the Apache Foundatio Finagle was generated by Twitter and is an RPC system written in Scala and can run on a JVM. It is based on three object types: Service objects, Filter objects and Future objects {% cite finagle --file rpc %}. The Future objects act by asynchronously being requested for a computation that would return a response at some time in the future. The Service objects are an endpoint that will return a Future upon processing a request. A Filter object transforms requests for further processing in case additional customization is required from a request. #### Open Network Computing RPC(ONC RPC) -ONC was originally introduced as SunRPC {%cite sunrpc --file rpc %} for the Sun NFS. It supported NFS read, write, truncate, unlink, etc operations. However, it was later revised as ONC in 1995 {%cite rfc1831 --file rpc %} and then in 2009 {%cite rfc5531 --file rpc %}. The IDL used in ONC is External Data Representation (XDR), a serialization mechanism specific to networks communication and therefore, ONC is limited to applications like Network File Systems. +ONC was originally introduced as SunRPC {%cite sunrpc --file rpc %} for the Sun NFS. The Sun NFS system had a stateless server, with client-side caching, unique file-handlers, and supported NFS read, write, truncate, unlink, etc operations. However, SunRPC was later revised as ONC in 1995 {%cite rfc1831 --file rpc %} and then in 2009 {%cite rfc5531 --file rpc %}. The IDL used in ONC(and SunRPC) is External Data Representation (XDR), a serialization mechanism specific to networks communication and therefore, ONC is limited to applications like Network File Systems. #### Mobile Assistance Using Infrastructure(MAUI) The MAUI project {% cite maui --file rpc %}, developed by Microsoft is a computation offloading system for mobile systems. It's an automated system that offloads a mobile code to a dedicated infrastructure in order to increase the battery life of the mobile, minimize the load on the programmer and perform complex computations offsite. MAUI uses RPC as the communication protocol between the mobile and the infrastructure. -- cgit v1.2.3