1 Developing Application in Distributed Computing Environment (DCE)

Slides:



Advertisements
Similar presentations
1 Communication in Distributed Systems REKs adaptation of Tanenbaums Distributed Systems Chapter 2.
Advertisements

CSE 486/586 Distributed Systems Remote Procedure Call
RPC Robert Grimm New York University Remote Procedure Calls.
Remote Procedure Call (RPC)
Remote Procedure Call Design issues Implementation RPC programming
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
Remote Procedure CallCS-4513, D-Term Remote Procedure Call CS-4513 Distributed Computing Systems (Slides include materials from Operating System.
L-7 RPC 1. Last Lecture Important Lessons - Naming Naming is a powerful tool in system design  A layer of indirection can solve many problems Name+context.
Tutorials 2 A programmer can use two approaches when designing a distributed application. Describe what are they? Communication-Oriented Design Begin with.
Implementing Remote Procedure Calls Authors: Andrew D. Birrell and Bruce Jay Nelson Xerox Palo Alto Research Center Presenter: Jim Santmyer Thanks to:
CS490T Advanced Tablet Platform Applications Network Programming Evolution.
CS603 Communication Mechanisms 18 January What is coming Remote procedure call – specific systems –DCE RPC –Java RMI –SOAP First project.
Remote Procedure Call Chin-Chih Chang. Remote Procedure Call Remote Procedure Call (RPC) is a protocol that allows programs to call procedures located.
Outcomes What is RPC? The difference between conventional procedure call and RPC? Understand the function of client and server stubs How many steps could.
RPC Project Using either sockets or TLI, implement Remote Procedure Calls between two distinct machines that are communicating over an Ethernet network.
Client-Server Communication Sockets Remote Procedure Calls Remote Method Invocation (Java)
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
CS603 Communication Mechanisms: DCE RPC (cont.) 23 January 2002.
Remote Procedure Calls. 2 Client/Server Paradigm Common model for structuring distributed computations A server is a program (or collection of programs)
© Chinese University, CSE Dept. Distributed Systems / Distributed Systems Topic 4: RPCs vs. CORBA Dr. Michael R. Lyu Computer Science & Engineering.
CSE 486/586, Spring 2013 CSE 486/586 Distributed Systems Remote Procedure Call Steve Ko Computer Sciences and Engineering University at Buffalo.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
Remote Procedure CallCS-502 Fall Remote Procedure Call CS-502, Operating Systems Fall 2007 (Slides include materials from Operating System Concepts,
Introduction to Distributed Systems Slides for CSCI 3171 Lectures E. W
CSE 486/586 CSE 486/586 Distributed Systems Remote Procedure Call Steve Ko Computer Sciences and Engineering University at Buffalo.
Communication Tran, Van Hoai Department of Systems & Networking Faculty of Computer Science & Engineering HCMC University of Technology.
CS 390- Unix Programming Environment CS 390 Unix Programming Environment Topics to be covered: Distributed Computing Fundamentals.
11 September 2008CIS 340 # 1 Topics To examine the variety of approaches to handle the middle- interaction (continued) 1.RPC-based systems 2.TP monitors.
Introduction to Distributed Systems Slides for CSCI 3171 Lectures E. W. Grundke.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
Politecnico di Milano © 2001 William Fornaciari Operating Systems R P C Remote Procedure Call Lecturer: William Fornaciari Politecnico di Milano
1 Lecture 5 (part2) : “Interprocess communication” n reasons for process cooperation n types of message passing n direct and indirect message passing n.
 Remote Procedure Call (RPC) is a high-level model for client-sever communication.  It provides the programmers with a familiar mechanism for building.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved RPC Tanenbaum.
CSE 451: Operating Systems Winter 2015 Module 22 Remote Procedure Call (RPC) Mark Zbikowski Allen Center 476 © 2013 Gribble, Lazowska,
Page 1 Remote Procedure Calls Paul Krzyzanowski Distributed Systems Except as otherwise noted, the content of this presentation.
Remote Procedure Calls CS587x Lecture Department of Computer Science Iowa State University.
1 Conventional Procedure Call read(fd,buf,nbytes) a)Parameter passing in a local procedure call: the stack before the call to read b)The stack while the.
Remote Procedure Call RPC
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
Lecture 4 Mechanisms & Kernel for NOSs. Mechanisms for Network Operating Systems  Network operating systems provide three basic mechanisms that support.
Computer Science Lecture 3, page 1 CS677: Distributed OS Last Class: Communication in Distributed Systems Structured or unstructured? Addressing? Blocking/non-blocking?
RPC Model, Stubs and Skeletons Divya Nampalli
Computer Science Lecture 4, page 1 CS677: Distributed OS Last Class: RPCs RPCs make distributed computations look like local computations Issues: –Parameter.
Lecture 5: RPC (exercises/questions). 26-Jun-16COMP28112 Lecture 52 First Six Steps of RPC TvS: Figure 4-7.
Remote Procedure Call and Remote Object Invocation TANENBAUM-Chapter 2.
Introduction to Distributed Systems Slides for CSCI 3171 Lectures E. W. Grundke.
Prof. Leonardo Mostarda University of Camerino
CSE 486/586 Distributed Systems Remote Procedure Call
Remote Method Invocation
Remote Procedure Call present by :Enas Alkhoshi
CMSC621: Advanced Operating Systems Advanced Operating Systems
CSE 451: Operating Systems Winter 2006 Module 20 Remote Procedure Call (RPC) Ed Lazowska Allen Center
Lecture 4: RPC Remote Procedure Call Coulouris et al: Chapter 5
CSE 451: Operating Systems Autumn 2003 Lecture 16 RPC
CSE 451: Operating Systems Winter 2007 Module 20 Remote Procedure Call (RPC) Ed Lazowska Allen Center
Lecture 4: RPC Remote Procedure Call CDK: Chapter 5
Remote Procedure Call (RPC) RPC – RMI - Web Services.
CSE 451: Operating Systems Winter 2004 Module 19 Remote Procedure Call (RPC) Ed Lazowska Allen Center
CSE 451: Operating Systems Spring 2012 Module 22 Remote Procedure Call (RPC) Ed Lazowska Allen Center
CSE 451: Operating Systems Autumn 2009 Module 21 Remote Procedure Call (RPC) Ed Lazowska Allen Center
Remote Procedure Call Hank Levy 1.
Lecture 6: RPC (exercises/questions)
Remote Procedure Call Hank Levy 1.
CSE 451: Operating Systems Autumn 2010 Module 21 Remote Procedure Call (RPC) Ed Lazowska Allen Center
Lecture 6: RPC (exercises/questions)
CSE 451: Operating Systems Winter 2003 Lecture 16 RPC
Remote Procedure Call Hank Levy 1.
Last Class: Communication in Distributed Systems
CSE 451: Operating Systems Messaging and Remote Procedure Call (RPC)
Presentation transcript:

1 Developing Application in Distributed Computing Environment (DCE)

2 RPC: Remote Procedure Call “To allow programs to call procedures located on other machines.” Effectively removing the need for the DS programmer to worry about all the details of network programming (i.e., no more sockets).

3 How RPC Works: Part 1 As far as the programmer is concerned, a “remote” procedure call looks and works identically to a “local” procedure call. In this way, transparency is achieved. Before looking a RPC in action, let’s consider a conventional “local” procedure call (LPC).

4 Local Procedures Application Main Body Procedure

5 Remote Procedures Main Body Procedure Application ClientServerNetwork

6 Conventional Local Procedure Call a) Parameter passing in a local procedure call: the stack before the call to read. b) The stack while the called procedure is active.

7 How RPC Works: Part 2 The procedure is “split” into two parts: 1.The CLIENT “stub” – implements the interface on the local machine through which the remote functionality can be invoked. 2.The SERVER “stub” – implements the actual functionality, i.e., does the real work! Parameters are “marshaled” by the client prior to transmission to the server.

8 Client and Server Stubs Principle of RPC between a client and server program.

9 The 10 Steps of a RPC 1.Client procedure calls client stub in normal way 2.Client stub builds message, calls local OS 3.Client's OS sends message to remote OS 4.Remote OS gives message to server stub 5.Server stub unpacks parameters, calls server 6.Server does work, returns result to the stub 7.Server stub packs it in message, calls local OS 8.Server's OS sends message to client's OS 9.Client's OS gives message to client stub 10.Stub unpacks result, returns to client

10 Passing Value Parameters Steps involved in doing remote computation through RPC.

11 RPC Runtime in DCE User Code Source Code Client Stub RPC Run time Server Stub

12 DCE: “Binding” a Client to a Server Client-to-server binding in DCE. A “directory service” provides a way for the client to look-up server. 2-15

13 General Terms 1.Binding Information: Client should know which servers are offering interface and how to connect to one of those servers. Server End Point (SEP): stored in database called End Point Map (Name Server) and maintained by End Point Mapper Service of dced ( daemon process) To access this information we have a data structure called binding handler. How to define interfaces?

14 Interface Definition Language (IDL) RPCs typically require development of custom protocol interfaces to be effective. Protocol interfaces are described by means of an Interface Definition Language (IDL). IDLs are “language-neutral” – they do not presuppose the use of any one programming language. That said, most IDLs look a lot like C …

15 Interface Definition /* arith.idl */ [ uuid(C9B5A B-61C0-A51B-38502A0ECDF9) Version(1.9) ] interface arith { –typedef name char[80]; –const int arith_ok = 0; –const int arith_err = -1; –void sum_num([in] int a, [in] int b, [out] int *c); } idl arith.idl : arith.h, arith_cstub.o, arith_sstub.o

16 Data Types Basic: integer, float, boolean, void, byte, error_status_t (error reporting), handler_t (binding handler). Complex: structures, unions, arrays, emun, pipes (huge data), strings. Three types of pointers: –Reference: minimal support, non null –Full: all the functionality –Unique

17 Writing a Client and a Server 2-14

18 Writing Client /* arithmetic client */ #include #include “arith.h” main(){ int a, b, sum; rpc_ns_habdle_t import_context; //contact name server error_status_t status; //set to exit code

19 Writing Client (Cont.) // importing the binding handle rpc_ns_binding_import_begin (rpc_c_ns_syntax_default, “/.:/arith_group”, arith_v1_9_c_ifspec, NULL, &import_context, &status); // start interaction with name server rpc_ns_binding_import_next (import_context, binding_handle, &status); // returns binding handle rpc_ns_binding_import_done (&import_context, &status); //completion/freeing

20 Writing Client (Cont.) // call the RPC a = 1; b = 2; sum_num (a, b, &sum); //call remote procedure printf (“the sum of %d and %d is %d \n”, a, b, sum);

21 Writing Server Primary Operations: –Registering the interface with RPC Runtime Library –Creating binding information –Exporting the interface to name servers –Registering server endpoints –Listening for RPCs –Clean Up

22 Writing Server (Cont.) #include #include “arith.h” main(){ // registering the interface rpc_server_register_if (arith_v1_9_c_ifspec, NULL, NULL, &status); //rpc runtime must know about the i/f that server supports, 2 nd and 3 rd for more than one i/f

23 Writing Server (Cont.) // Creating binding information rpc_server_use_all_postseqs (rpc_c_postseq_max_calls_default, &status); rpc_server_inq_bindings (&binding_vector, &status); // contains all the info req. to cantact server.

24 Writing Server (Cont.) // Exporting the interface rpc_ns_binding_export (rpc_c_ns_syntax_default, “/.:/arith_konark”, arith_v1_9_c_ifspec, binding_vector, NULL, &status); rpc_ns_group_mbr_add (rpc_c_ns_syntax_default, “/.:/arith_group”, rpc_c_ns_syntax_default, “/.:/arith_konark”, &status); // adding into server database

25 Writing Server (Cont.) // Registering server endpoints rpc_ep_register(arith_v1_9_c_ifspec, binding_vector, NULL, “Arithmetic Interface”, &status); // Listening for RPCs rpc_server_listen(2, &status);

26 Writing Server (Cont.) // Clean Up rpc_server_inq_bindings (&binding_vector, &status); rpc_ep_unregister(arith_v1_9_c_ifspec, binding_vector, NULL, &status); rpc_binding_vector_free (&binding_vector, &status);

27 Binding Executables cc –o client client.c arith_cstub.o –ldce –lcma cc –o server server.c arith_sstub.o –ldce –lcma dce and cma are DCE libraries.