Interprocess Communication and Middleware
description
Transcript of Interprocess Communication and Middleware
![Page 1: Interprocess Communication and Middleware](https://reader036.fdocuments.us/reader036/viewer/2022070413/56814cfb550346895dba15dc/html5/thumbnails/1.jpg)
Interprocess Communicationand
Middleware
![Page 2: Interprocess Communication and Middleware](https://reader036.fdocuments.us/reader036/viewer/2022070413/56814cfb550346895dba15dc/html5/thumbnails/2.jpg)
Sockets and Ports
Source: G. Coulouris et al., Distributed Systems: Concepts and Design
Node 1 Node 2
![Page 3: Interprocess Communication and Middleware](https://reader036.fdocuments.us/reader036/viewer/2022070413/56814cfb550346895dba15dc/html5/thumbnails/3.jpg)
Crossing Hosts/Platforms
Source: G. Coulouris et al., Distributed Systems: Concepts and Design
![Page 4: Interprocess Communication and Middleware](https://reader036.fdocuments.us/reader036/viewer/2022070413/56814cfb550346895dba15dc/html5/thumbnails/4.jpg)
Provisions of Middleware
• Higher-level abstractions (RPC, RMI, …)
• Location transparency
• Independent of communication protocols
• Independent of hardware/operating systems
• Use of several programming languages
![Page 5: Interprocess Communication and Middleware](https://reader036.fdocuments.us/reader036/viewer/2022070413/56814cfb550346895dba15dc/html5/thumbnails/5.jpg)
The Middleware layer
Source: G. Coulouris et al., Distributed Systems: Concepts and Design
* The operating system includes common network protocols (TCP/IP, …).
![Page 6: Interprocess Communication and Middleware](https://reader036.fdocuments.us/reader036/viewer/2022070413/56814cfb550346895dba15dc/html5/thumbnails/6.jpg)
Request-Reply Communication
Source: G. Coulouris et al., Distributed Systems: Concepts and Design
![Page 7: Interprocess Communication and Middleware](https://reader036.fdocuments.us/reader036/viewer/2022070413/56814cfb550346895dba15dc/html5/thumbnails/7.jpg)
Request-Reply Communication Using HTTP
Source: G. Coulouris et al., Distributed Systems: Concepts and Design
HTTP request message:
HTTP reply message:
![Page 8: Interprocess Communication and Middleware](https://reader036.fdocuments.us/reader036/viewer/2022070413/56814cfb550346895dba15dc/html5/thumbnails/8.jpg)
Serialization (Marshalling)
Source: G. Coulouris et al., Distributed Systems: Concepts and Design
![Page 9: Interprocess Communication and Middleware](https://reader036.fdocuments.us/reader036/viewer/2022070413/56814cfb550346895dba15dc/html5/thumbnails/9.jpg)
Distributed Objects
The object-based programming model is extended
to allow objects in different processes to interact
with one another.• Client/Server• Object References• Interfaces• Remote Method Invocation• Exceptions
![Page 10: Interprocess Communication and Middleware](https://reader036.fdocuments.us/reader036/viewer/2022070413/56814cfb550346895dba15dc/html5/thumbnails/10.jpg)
A CORBA IDL Example
Source: G. Coulouris et al., Distributed Systems: Concepts and Design
![Page 11: Interprocess Communication and Middleware](https://reader036.fdocuments.us/reader036/viewer/2022070413/56814cfb550346895dba15dc/html5/thumbnails/11.jpg)
Local and Remote Method Invocations
Source: G. Coulouris et al., Distributed Systems: Concepts and Design
![Page 12: Interprocess Communication and Middleware](https://reader036.fdocuments.us/reader036/viewer/2022070413/56814cfb550346895dba15dc/html5/thumbnails/12.jpg)
A Remote Object and Its Interface
Source: G. Coulouris et al., Distributed Systems: Concepts and Design
![Page 13: Interprocess Communication and Middleware](https://reader036.fdocuments.us/reader036/viewer/2022070413/56814cfb550346895dba15dc/html5/thumbnails/13.jpg)
Client Proxy (Stub) and Server Skeleton (Stub)
Source: G. Coulouris et al., Distributed Systems: Concepts and Design
![Page 14: Interprocess Communication and Middleware](https://reader036.fdocuments.us/reader036/viewer/2022070413/56814cfb550346895dba15dc/html5/thumbnails/14.jpg)
The RMI Software
• Proxy: the local representative of the remote object.
• Dispatcher: relays a request to the appropriate skeleton method.
• Skeleton: unmarshals the request and invokes the corresponding method in the remote object.
![Page 15: Interprocess Communication and Middleware](https://reader036.fdocuments.us/reader036/viewer/2022070413/56814cfb550346895dba15dc/html5/thumbnails/15.jpg)
RPC/RMI Semantics
Source: G. Coulouris et al., Distributed Systems: Concepts and Design
![Page 16: Interprocess Communication and Middleware](https://reader036.fdocuments.us/reader036/viewer/2022070413/56814cfb550346895dba15dc/html5/thumbnails/16.jpg)
Java Remote Interfaces
Source: G. Coulouris et al., Distributed Systems: Concepts and Design
![Page 17: Interprocess Communication and Middleware](https://reader036.fdocuments.us/reader036/viewer/2022070413/56814cfb550346895dba15dc/html5/thumbnails/17.jpg)
A Java Server
Source: G. Coulouris et al., Distributed Systems: Concepts and Design
![Page 18: Interprocess Communication and Middleware](https://reader036.fdocuments.us/reader036/viewer/2022070413/56814cfb550346895dba15dc/html5/thumbnails/18.jpg)
A Java Server (cont’d)
Source: G. Coulouris et al., Distributed Systems: Concepts and Design
![Page 19: Interprocess Communication and Middleware](https://reader036.fdocuments.us/reader036/viewer/2022070413/56814cfb550346895dba15dc/html5/thumbnails/19.jpg)
A Java Client
Source: G. Coulouris et al., Distributed Systems: Concepts and Design
![Page 20: Interprocess Communication and Middleware](https://reader036.fdocuments.us/reader036/viewer/2022070413/56814cfb550346895dba15dc/html5/thumbnails/20.jpg)
CORBA
• Defined by OMG to hide the intricacies of network programming.
• An ORB (Object Request Broker) receives invocations from a client and deliver them to a target object.
• The main communication protocol is GIOP (General Inter-ORB Protocol), known as IIOP when implemented over the Internet.
![Page 21: Interprocess Communication and Middleware](https://reader036.fdocuments.us/reader036/viewer/2022070413/56814cfb550346895dba15dc/html5/thumbnails/21.jpg)
The CORBA Architecture
Source: G. Coulouris et al., Distributed Systems: Concepts and Design
![Page 22: Interprocess Communication and Middleware](https://reader036.fdocuments.us/reader036/viewer/2022070413/56814cfb550346895dba15dc/html5/thumbnails/22.jpg)
CORBA Object Interfaces
• Each object has an interface defined in IDL.
• An interface defines the operations that can be called by the clients.
• An interface can be implemented in one language and called from by another.
• The CORBA IDL includes features such as inheritance of interfaces, exceptions, and compound data types.
![Page 23: Interprocess Communication and Middleware](https://reader036.fdocuments.us/reader036/viewer/2022070413/56814cfb550346895dba15dc/html5/thumbnails/23.jpg)
CORBA Programming with Java
• Define the interfaces using IDL and compile them into Java interfaces.
• Implement the interfaces with Java classes.
• Write a server main function that creates instances of these classes and then inform the underlying CORBA implementation.
• Register the server.
• Write a client main function to connect to the server and to use server’s objects.
![Page 24: Interprocess Communication and Middleware](https://reader036.fdocuments.us/reader036/viewer/2022070413/56814cfb550346895dba15dc/html5/thumbnails/24.jpg)
CORBA IDL Interfaces: Shape and ShapeList
Source: G. Coulouris et al., Distributed Systems: Concepts and Design
![Page 25: Interprocess Communication and Middleware](https://reader036.fdocuments.us/reader036/viewer/2022070413/56814cfb550346895dba15dc/html5/thumbnails/25.jpg)
Java Interface Generated from the CORBA Interface ShapeList
Source: G. Coulouris et al., Distributed Systems: Concepts and Design
![Page 26: Interprocess Communication and Middleware](https://reader036.fdocuments.us/reader036/viewer/2022070413/56814cfb550346895dba15dc/html5/thumbnails/26.jpg)
Java Implementation of Shapelist
Source: G. Coulouris et al., Distributed Systems: Concepts and Design
![Page 27: Interprocess Communication and Middleware](https://reader036.fdocuments.us/reader036/viewer/2022070413/56814cfb550346895dba15dc/html5/thumbnails/27.jpg)
Java Implementation of ShapeList (cont’d)
Source: G. Coulouris et al., Distributed Systems: Concepts and Design
![Page 28: Interprocess Communication and Middleware](https://reader036.fdocuments.us/reader036/viewer/2022070413/56814cfb550346895dba15dc/html5/thumbnails/28.jpg)
Java Implementation of a ShapeList Client
Source: G. Coulouris et al., Distributed Systems: Concepts and Design