Remote Proceure Call (continued)远程过程调用续_第1页
Remote Proceure Call (continued)远程过程调用续_第2页
Remote Proceure Call (continued)远程过程调用续_第3页
Remote Proceure Call (continued)远程过程调用续_第4页
Remote Proceure Call (continued)远程过程调用续_第5页
已阅读5页,还剩21页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、remote procedure callcs-502 fall 20071remote procedure call(continued)cs-502, operating systemsfall 2007(slides include materials from operating system concepts, 7th ed., by silbershatz, galvin, & gagne, modern operating systems, 2nd ed., by tanenbaum, and distributed systems: principles & p

2、aradigms, 2nd ed. by tanenbaum and van steen)remote procedure callcs-502 fall 20072remote procedure call (rpc) the most common framework for newer protocols and for middleware used both by operating systems and by applications nfs is implemented as a set of rpcs dcom, corba, java rmi, etc., are just

3、 rpc systems reference birrell, andrew d., and nelson, bruce, “implementing remote procedure calls,” acm transactions on computer systems, vol. 2, #1, february 1984, pp 39-59. (.pdf) remote procedure callcs-502 fall 20073remote procedure call (rpc) fundamental idea: server process exports an interfa

4、ce of procedures or functions that can be called by client programs similar to library api, class definitions, etc. clients make local procedure/function calls as if directly linked with the server process under the covers, call is converted into a message exchange with remote server process all mes

5、saging details handled automatically by stub compilerremote procedure callcs-502 fall 20074rpc stubs summary client-side stub looks like local server function same interface as local function bundles arguments into a message, sends to server-side stub waits for reply, un-bundles results returns serv

6、er-side stub looks like local client function to server listens on a socket for message from client stub un-bundles arguments to local variables makes a local function call to server bundles result into reply message to client stubremote procedure callcs-502 fall 20075result a very useful abstractio

7、n the hard work of building messages, formatting, uniform representation, etc., is buried in the stubs where it can be automated! designers of client and server can concentrate on semantics of application programs behave in familiar wayremote procedure callcs-502 fall 20076rpc model a server defines

8、 the service interface using an interface definition language (idl) the idl specifies the names, parameters, and types for all client-callable server procedures a stub compiler reads the idl declarations and produces two stub functions for each server function server-side and client-side marshalling

9、 arguments done completely within stubs little-endian vs. big-endian handled by stubsremote procedure callcs-502 fall 20077representation of data idl must also define representation of data on network big-endian vs. little-endian multi-byte integers strings, character codes floating point, complex,

10、example: suns xdr (external data representation) each stub converts machine representation to/from network representation clients and servers must not try to cast data!remote procedure callcs-502 fall 20078issue #2 pointers and referencesread(int fd, char* buf, int nbytes) pointers are only valid wi

11、thin one address space cannot be interpreted by another process even on same machine! pointers and references are ubiquitous in c, c+ even in java implementations!remote procedure callcs-502 fall 20079pointers and references restricted semantics option: call by value sending stub dereferences pointe

12、r, copies result to message receiving stub conjures up a new pointer option: call by result sending stub provides buffer, called function puts data into it receiving stub copies data to callers buffer as specified by pointerremote procedure callcs-502 fall 200710pointers and references restricted se

13、mantics (continued) option: call by value-result callers stub copies data to message, then copies result back to client buffer server stub keeps data in own buffer, server updates it; server sends data back in reply not allowed: call by reference aliased argumentsremote procedure callcs-502 fall 200

14、711transport of remote procedure call option tcp connection-based, reliable transmission useful but heavyweight, less efficient necessary if repeating a call produces different result alternative udp if message fails to arrive within a reasonable time, callers stub simply sends it again okay if repe

15、ating a call produces same resultremote procedure callcs-502 fall 200712asynchronous rpc analogous to spawning a thread caller must eventually wait for result analogous to joinremote procedure callcs-502 fall 200713asynchronous rpc (continued) analogous to spawning a thread caller must eventually wa

16、it for result analogous to join or be interrupted (software interrupt)remote procedure callcs-502 fall 200714rpc binding binding is the process of connecting the client to the server the server, when it starts up, exports its interface identifies itself to a network name server tells rpc runtime tha

17、t it is alive and ready to accept calls the client, before issuing any calls, imports the server rpc runtime uses the name server to find the location of the server and establish a connection the import and export operations are explicit in the server and client programsremote procedure callcs-502 f

18、all 200715remote procedure call is used between processes on different machines e.g., client-server model between processes on the same machine more structured than simple message passing between subsystems of an operating system windows xp (called local procedure call)remote procedure callcs-502 fa

19、ll 200716questions?remote procedure callcs-502 fall 200717practical rpc systems dce (distributed computing environment) open software foundation basis for microsoft dcom tanenbaum & van steen, 4.2.4 suns onc (open network computing) very similar to dce widely used rpcgen http:/ remote procedure

20、callcs-502 fall 200718practical rpc systems (continued) java rmi (remote method invocation) java.rmi standard package java-oriented approach objects and methods corba (common object request broker architecture) standard, multi-language, multi-platform middleware object-oriented heavyweight remote pr

21、ocedure callcs-502 fall 200719implementation model for dceremote procedure callcs-502 fall 200720validating a remote service purpose avoid binding to wrong service or wrong version dce globally unique id generated in template of idl file sun onc program numbers registered with sun version # and proc

22、edure # administered locallyremote procedure callcs-502 fall 200721rpc binding sun onc service registers with portmapper service on server os program # and version # optional static port # client must know host name or ip address clnt_create(host, prog, vers, proto) i.e., rpc to portmapper of host requesting to bind to prog, vers using protocol proto (tcp or udp) (additional functions for authentication, etc.) invokes remote functions by nameremote procedure callcs-502 fall 200722implementation model for oncprogram & vers

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

最新文档

评论

0/150

提交评论