1 / 15

A Brief Intro to the RPC Project Framework

COMP 150-IDS: Internet Scale Distributed Systems (Fall 2012). A Brief Intro to the RPC Project Framework. Noah Mendelsohn Tufts University Email: noah@cs.tufts.edu Web: http://www.cs.tufts.edu/~noah. Review From the Earlier Lecture On Remote Procedure Call. float sqrt(float n) { send n;

altessa
Download Presentation

A Brief Intro to the RPC Project Framework

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. COMP 150-IDS: Internet Scale Distributed Systems (Fall 2012) A Brief Intro to theRPC Project Framework Noah Mendelsohn Tufts UniversityEmail: noah@cs.tufts.edu Web: http://www.cs.tufts.edu/~noah

  2. Review From the Earlier Lecture On Remote Procedure Call

  3. floatsqrt(float n) { send n; read s; return s;} invoke sqrt(4) voiddoMsg(Msg m) { s = sqrt(m.s); send s; } Request result=2 (no exception thrown) Response proxy stub RPC: Call remote functions automatically • Interface definition: float sqrt(float n); • Proxies and stubs generated automatically • RPC provides transparent remote invocation floatsqrt(float n) { …compute sqrt… return result;} x = sqrt(4) CPU Memory Storage CPU Memory Storage

  4. How the Demo Programs Work

  5. Demo program uses function w/no arguments This client int main() { func1()} simplefunctionclient.cpp CPU Memory Storage CPU Memory Storage

  6. Demo program uses function w/no arguments …is calling this function int main() { func1()} voidfunc1() { return;} simplefunctionclient.cpp CPU Memory Storage CPU Memory Storage Interface definition file: simplefunction.idl void func1();

  7. voidvoid() { send func1; read DONE; } simplefunction.proxy.cpp Demo program uses function w/no arguments Sample proxy int main() { func1()} voidfunc1() { return;} simplefunctionclient.cpp CPU Memory Storage CPU Memory Storage simplefunction.cpp

  8. voidvoid() { send func1; read DONE; } simplefunction.proxy.cpp Demo program uses function w/no arguments int main() { func1()} voidfunc1() { return;} simplefunctionclient.cpp CPU Memory Storage CPU Memory Storage simplefunction.cpp Proxy and stub names always match IDL file name

  9. voidvoid() { send func1; read DONE; } simplefunction.proxy.cpp Demo program uses function w/no arguments int main() { func1()} simplefunctionclient.cpp CPU Memory Storage CPU Memory Storage rpcserver is generic main program…doesn’t depend on IDL or func1 int Main() { …loop accepting connections{ while(!eof){ dispatchFunction() } } } rpcserver.cpplinked as simplefunctionserver

  10. voidvoid() { send func1; read DONE; } simplefunction.proxy.cpp Demo program uses function w/no arguments int main() { func1()} simplefunctionclient.cpp CPU Memory Storage CPU Memory Storage …but we name the executable to match the particular use (simplefunctionserver) int Main() { …loop accepting connections{ while(!eof){ dispatchFunction() } } } rpcserver.cpplinked as simplefunctionserver

  11. voidvoid() { send func1; read DONE; } simplefunction.proxy.cpp Demo program uses function w/no arguments All stubs provide a dispatchFunction int main() { func1()} simplefunctionclient.cpp CPU Memory Storage CPU Memory Storage voiddispatchFunction() { read from socket call __func1() } void __func1() { read args from stream call func1 send response } int Main() { …loop accepting connections{ while(!eof){ dispatchFunction() } } } simplefunction.stub.cpp rpcserver.cpplinked as simplefunctionserver

  12. voidvoid() { send func1; read DONE; } simplefunction.proxy.cpp Demo program uses function w/no arguments …that reads function names from the network and calls the right stub int main() { func1()} simplefunctionclient.cpp CPU Memory Storage CPU Memory Storage voiddispatchFunction() { read from socket call __func1() } void __func1() { read args from stream call func1 send response } int Main() { …loop accepting connections{ while(!eof){ dispatchFunction() } } } simplefunction.stub.cpp rpcserver.cpplinked as simplefunctionserver

  13. voidvoid() { send func1; read DONE; } invoke func1() Request DONE Response simplefunction.proxy.cpp Demo program uses function w/no arguments int main() { func1()} voidfunc1() { return;} simplefunctionclient.cpp CPU Memory Storage CPU Memory Storage simplefunction.cpp voiddispatchFunctiong() { read from socket call __func1() } void __func1() { read args from stream call func1 send response } int Main() { …loop accepting connections{ while(!eof){ dispatchFunction() } } } simplefunction.stub.cpp rpcserver.cpplinked as simplefunctionserver

  14. invoke func1() Request DONE Response Demo program uses function w/no arguments Interface definition file:simplefunction.idl int main() { func1()} voidfunc1() { return;} simplefunctionclient.cpp You’ll be implementing proxies and stubs like these…first by hand…then using your RPC generator CPU Memory Storage CPU Memory Storage simplefunction.cpp voidvoid() { send func1; read DONE; } voiddispatchFunctiong() { read from socket call __func1() } void __func1() { read args from stream call func1 send response } int Main() { …loop accepting connections{ while(!eof){ dispatchFunction() } } } simplefunction.proxy.cpp simplefunction.stub.cpp rpcserver.cpplinked as simplefunctionserver

  15. invoke func1() Request DONE Response Demo program uses function w/no arguments Interface definition file:simplefunction.idl int main() { func1()} voidfunc1() { return;} simplefunction.proxy.cpp & simplefunction.stub.cpp are provided for you as samples … Yours will have to support other IDL files with functions that take arguments and return values! simplefunctionclient.cpp CPU Memory Storage CPU Memory Storage simplefunction.cpp voidvoid() { send func1; read DONE; } voiddispatchFunctiong() { read from socket call __func1() } void __func1() { read args from stream call func1 send response } int Main() { …loop accepting connections{ while(!eof){ dispatchFunction() } } } simplefunction.proxy.cpp simplefunction.stub.cpp rpcserver.cpplinked as simplefunctionserver

More Related