CS551 Object Oriented Middleware (I) (Chap. 3 of EDO)

Slides:



Advertisements
Similar presentations
TCP/IP MODEL Maninder Kaur
Advertisements

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.
II. Middleware for Distributed Systems
Remote Procedure CallCS-4513, D-Term Remote Procedure Call CS-4513 Distributed Computing Systems (Slides include materials from Operating System.
Presentation 4: Principles of Object-Oriented Middleware.
CS 501: Software Engineering Fall 2000 Lecture 16 System Architecture III Distributed Objects.
OCT 1 Master of Information System Management Organizational Communications and Distributed Object Technologies Lecture 5: Distributed Objects.
II. Middleware for Distributed Systems
EEC-681/781 Distributed Computing Systems Lecture 4 Wenbing Zhao Department of Electrical and Computer Engineering Cleveland State University
© Chinese University, CSE Dept. Distributed Systems / Distributed Systems Topic 4: RPCs vs. CORBA Dr. Michael R. Lyu Computer Science & Engineering.
.NET Mobile Application Development Remote Procedure Call.
 The Open Systems Interconnection model (OSI model) is a product of the Open Systems Interconnection effort at the International Organization for Standardization.
Process-to-Process Delivery:
Presentation 4: Principles of Object-Oriented Middleware.
Presentation 4: Principles of Object-Oriented Middleware.
CS 390- Unix Programming Environment CS 390 Unix Programming Environment Topics to be covered: Distributed Computing Fundamentals.
Network Protocol Hierarchies
TCP/IP TCP/IP LAYERED PROTOCOL TCP/IP'S APPLICATION LAYER TRANSPORT LAYER NETWORK LAYER NETWORK ACCESS LAYER (DATA LINK LAYER)
Chapter 4: Interprocess Communication‏ Pages
Presentation: RMI introduction. Goals of this lesson After this 35 min. lesson you will be: Introduced to Java RMI Ready to present RMI’s position in.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved RPC Tanenbaum.
CS 501: Software Engineering Fall 1999 Lecture 12 System Architecture III Distributed Objects.
CS551 - Lecture 11 1 CS551 Object Oriented Middleware (III) (Chap. 5 of EDO) Yugi Lee STB #555 (816)
Objektorienteret Middleware (OOMI)
Presentation 4: Principles of Object-Oriented Middleware.
© Chinese University, CSE Dept. Distributed Systems / Distributed Systems Topic 3: Communication Dr. Michael R. Lyu Computer Science & Engineering.
Remote Procedure CallCS-502 Fall Remote Procedure Call (continued) CS-502, Operating Systems Fall 2007 (Slides include materials from Operating System.
Presentation 11: RMI introduction. Ingeniørhøjskolen i Århus Slide 2 af 20 Goals of this lesson After these 2x35 lessons you will be –Introduced to Java.
Objektorienteret Netværkskommunikation (ITONK1) CORBA Introduction.
Presentation 4: Principles of Object-Oriented Middleware.
Presentation: Special Repetition Recap on Distributed Principles.
© Oxford University Press 2011 DISTRIBUTED COMPUTING Sunita Mahajan Sunita Mahajan, Principal, Institute of Computer Science, MET League of Colleges, Mumbai.
Distributed Computing & Embedded Systems Chapter 4: Remote Method Invocation Dr. Umair Ali Khan.
Distributed Web Systems Distributed Objects and Remote Method Invocation Lecturer Department University.
Java Distributed Object System
03 – Remote invoaction Request-reply RPC RMI Coulouris 5
Prof. Leonardo Mostarda University of Camerino
CSE 486/586 Distributed Systems Remote Procedure Call
Remote Method Invocation
Layered Architectures
Understanding the OSI Reference Model
Ch > 28.4.
Transport Layer Unit 5.
Protocols and the TCP/IP Suite
CSE 451: Operating Systems Winter 2006 Module 20 Remote Procedure Call (RPC) Ed Lazowska Allen Center
DISTRIBUTED COMPUTING
Lecture 4: RPC Remote Procedure Call Coulouris et al: Chapter 5
Process-to-Process Delivery:
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
CPEG514 Advanced Computer Networkst
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.
Protocols and the TCP/IP Suite
Remote invocation (call)
Remote Procedure Call Hank Levy 1.
CSE 451: Operating Systems Autumn 2010 Module 21 Remote Procedure Call (RPC) Ed Lazowska Allen Center
Lecture 7: RPC (exercises/questions)
CSE 451: Operating Systems Winter 2003 Lecture 16 RPC
Process-to-Process Delivery: UDP, TCP
Computer Networks Protocols
Remote Procedure Call Hank Levy 1.
CSE 451: Operating Systems Messaging and Remote Procedure Call (RPC)
Transport Layer 9/22/2019.
Presentation transcript:

CS551 Object Oriented Middleware (I) (Chap. 3 of EDO) Yugi Lee STB #555 (816) 235-5932 leeyu@umkc.edu www.sice.umkc.edu/~leeyu CS551 - Lecture 9

Outline Computer Networks Types of Middleware TCP UDP Types of Middleware Transaction-Oriented Middleware Message-Oriented Middleware Remote Procedure Calls Object-Oriented Middleware Developing with Object-Oriented Middleware CS551 - Lecture 9

Computer Networks The communication between processes on different machines At the high levels: a connection to another process on another machine to simply send each message as a high level logical unit Simple strings or arrays of bytes (binary data). At the underlying layers: Split message into smaller units for physical transfer called PDU's (protocol data units). A wrapper with Address of sender/receiver, Error detection codes, Protocol control information CS551 - Lecture 9

Transport Layer Concerned with the transport of information through a network. Two facets in UNIX/Windows networks: TCP UDP ISO/OSI Reference Model Application Presentation Session Transport Network Data link Physical CS551 - Lecture 9

Protocols An agreement between entities on the transmission of data. Different layers of network software have different concerns. At lower levels: determining the amount of data to be sent, the size of packets and the speed of transmission. Connection Control /Data transfer Flow control/Error control Synchronization/Addressing At higher levels: cover the syntax and sequencing of logical messages. CS551 - Lecture 9

Transmission Control Protocol (TCP) Provides bi-directional stream of bytes between two distributed components by establish a virtual connection Steps: Connection establishment, Data transfer, Connection termination. Reliable: send logical messages without having to explicitly deal with these other issues (sequencing and re-transmission of lost packets). Slow: as more time is required to set up and terminate the link and buffering at both sides de-couples computation speeds. UNIX rsh, rcp and rlogin are based on TCP. CS551 - Lecture 9

TCP for Request Implementation Client Server Application Application Presentation Presentation Session Session Requests Transport Input Stream Transport Output Stream Results CS551 - Lecture 9

Connection-oriented Communication CS551 - Lecture 9

User Datagram Protocol (UDP) Enables a component to pass a message containing a sequence of bytes (packet) to another component: A program may send information to another at an indeterminate time with no explicit prior co-ordination the packet may get lost or packets may arrive in a different order to that in which they were sent. reorganize the packets and make requests for new packets when problems occur. dynamically routed; split into a number of PDUs that take different routes to their destination depending on network congestion. Unreliable but very fast protocol: restricted message length, queuing at receiver, e.g. UNIX rwho command. CS551 - Lecture 9

UDP for Request Implementation Client Server Application Application Presentation Presentation Session Session Request Datagrams Transport Transport Result Datagrams CS551 - Lecture 9

Datagram Communication CS551 - Lecture 9

Direct Use of Network Protocols implies Manual mapping of complex request parameters to byte streams Manual resolution of data heterogeneity Manual identification of components Manual implementation of component activation No guarantees for type safety Manual synchronization of interaction between distributed components No quality of service guarantees CS551 - Lecture 9

Middleware Layered between Application and OS/Network Makes distribution transparent Resolves heterogeneity of Hardware Operating Systems Networks Programming Languages Provides development and run-time environment for distributed systems. CS551 - Lecture 9

Forms of Middleware Transaction-Oriented Message-Oriented RPC Systems IBM CICS BEA Tuxedo Encina Message-Oriented IBM MQSeries DEC Message Queue NCR TopEnd RPC Systems ANSA Sun ONC OSF/DCE Object-Oriented OMG/CORBA DCOM Java/RMI EJB CS551 - Lecture 9

Remote Procedure Calls First look at RPCs to understand origin of object-oriented middleware Enable procedure calls across host boundaries Call interfaces are defined using an Interface Definition Language (IDL) RPC compiler generates presentation and session layer implementation from IDL CS551 - Lecture 9

IDL Example (Unix RPCs) const NL=64; struct Player { struct DoB {int day; int month; int year;} string name<NL>; }; program PLAYERPROG { version PLAYERVERSION { void PRINT(Player)=0; int STORE(Player)=1; Player LOAD(int)=2; }= 0; } = 105040; CS551 - Lecture 9

Resolution of data heterogeneity Marshalling and Unmarshalling ISO/OSI Presentation Layer Resolution of data heterogeneity Common data representation Transmission of data declaration Marshalling and Unmarshalling static dynamic CS551 - Lecture 9

Marshalling and Unmarshalling char * marshal() { char * msg; msg=new char[4*(sizeof(int)+1) + strlen(name)+1]; sprintf(msg,"%d %d %d %d %s", dob.day,dob.month,dob.year, strlen(name),name); return(msg); }; void unmarshal(char * msg) { int name_len; sscanf(msg,"%d %d %d %d ", &dob.day,&dob.month, &dob.year,&name_len); name = new char[name_len+1]; sscanf(msg,"%d %d %d %d %s", &dob.year,&name_len,name); Marshalling: Disassemble data structures into transmittable form Unmarshalling: Reassemble the complex data structure. CS551 - Lecture 9

Transport Layer (e.g. TCP or UDP) Method Call vs. Object Request Caller Called Called Stub Caller Stub Transport Layer (e.g. TCP or UDP) CS551 - Lecture 9

Stubs Creating code for marshalling and unmarshalling is tedious and error-prone. Code can be generated fully automatically from interface definition. Code is embedded in stubs for client and server. Client stub represents server for client, Server stub represents client for server. Stubs achieve type safety. Stubs also perform synchronization. CS551 - Lecture 9

Synchronization Goal: achieve similar synchronization to local method invocation Achieved by stubs: Client stub sends request and waits until server finishes Server stub waits for requests and calls server when request arrives CS551 - Lecture 9

Type Safety How can we make sure that servers are able to perform operations requested by clients? actual parameters provided by clients match the expected parameters of the server? results provided by the server match the expectations of client? Middleware acts as mediator between client and server to ensure type safety. Achieved by interface definition in an agreed language. CS551 - Lecture 9

Facilitating Type Safety Interface Definition Request Server Client Reply CS551 - Lecture 9

Session Layer Implements identification of RPC servers Application activation of RPC servers dispatch of operations Application Presentation Session Transport Network Data link Physical CS551 - Lecture 9

Example: RPC Server Identification print_person(char * host, Player * pers) { CLIENT *clnt; clnt = clnt_create(host, 105040, 0, "udp"); if (clnt == (CLIENT *) NULL) exit(1); if (print_0(pers, clnt)==NULL) clnt_perror(clnt, "call failed"); clnt_destroy(clnt); } CS551 - Lecture 9

Interface Definition Language Every object-oriented middleware has an interface definition language (IDL) Beyond RPCs, object-oriented IDLs support object types as parameters, failure handling and inheritance Object-oriented middleware provide IDL compilers that create client and server stubs to implement session and presentation layer CS551 - Lecture 9

Why do we use an IDL? PL PL PL PL PL PL PL IDL PL PL PL PL PL 1 2 1 2 6 3 6 3 PL PL PL PL 5 4 5 4 CS551 - Lecture 9

Smalltalk C++ Ada-95 C Java Cobol CORBA Programming Language Bindings Smalltalk C++ Ada-95 IDL Common Object Model C Java Cobol CS551 - Lecture 9

IDL Example (OO Middleware) interface Player : Object { typedef struct _Date { short day; short month; short year; } Date; attribute string name; readonly attribute Date DoB; }; interface PlayerStore : Object { exception IDNotFound{}; short save (in Player p); Player load(in short id) raises(IDNotFound); void print(in Player p); CS551 - Lecture 9

Presentation Layer Implementation In addition to RPC presentation layer implementation, object-oriented middleware needs to define a transport representation for object references deal with exceptions need to marshal inherited attributes CS551 - Lecture 9

Session Layer Implementation Object References Hosts Processes Objects CS551 - Lecture 9

Development Steps Design Interface Definition Server Stub Generation Client Stub Server Coding Client Server Registration CS551 - Lecture 9

Facilitating Access Transparency Client stubs have the same operations as server objects Hence, clients can make local call to client stub or local call to server object without changing the call. Middleware can accelerate communication if objects are local by not using the stub. CS551 - Lecture 9

Facilitating Location Transparency Object identity Object references Client requests operation from server object identified by object reference No information about physical location of server necessary How to obtain object references? CS551 - Lecture 9

Stub Generation included in generates reads Team.idl IDL-Compiler The CORBA IDL is translated into stubs and skeletons (server stubs): IDL-compiler generates four files (two for client stubs and two for server stubs) included in generates reads Team.idl IDL-Compiler Teamcl.hh Teamsv.hh Teamcl.cc Teamsv.cc CS551 - Lecture 9

Client and Server Implementation Client.cc + Teamcl.hh => to check consistency between the declaration and use of client stub implementation. Client.cc +Teamcl.cc => an executable code (Client) Similar to Server. C++ Compiler, Linker Server Client.cc Server.cc Client Team.idl included in generates reads IDL-Compiler Teamcl.hh Teamcl.cc Teamsv.cc Teamsv.hh CS551 - Lecture 9

<<interface>> Type Safe Server Object Implement. Inheritance is used in classes Play_Dispatch and Player_Impl, which are contained in the server stub for object type Player. An Interface-based implementation with the relationships of interfaces and classes involved on the server side <<uses>> <<uses>> Player_Impl <<interface>> Player_Dispatch Player_Impl Player_Dispatch <<implements>> Player_Server Player_Server CS551 - Lecture 9

Server Registration Object adapters need to be able to locate and start servers Server objects are registered in some form of implementation repository Registration processes is middleware and product-specific Object adapter performs implementation repository lookup prior to activation CS551 - Lecture 9

Key Points Middleware builds on the transport layer There are several forms of middleware Object-oriented middleware provides IDLs Object-oriented middleware implements session and presentation layer Presentation layer implementation in client/server stubs is derived from IDL Session layer is implemented in object adapters CS551 - Lecture 9