1 / 42

Interprocess Communication and Middleware

Interprocess Communication and Middleware. Sockets and Ports. Node 2. Node 1. Source: G. Coulouris et al., Distributed Systems: Concepts and Design. Crossing Hosts/Platforms. Source: G. Coulouris et al., Distributed Systems: Concepts and Design. Purposes of Middleware.

crevan
Download Presentation

Interprocess Communication and Middleware

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. Interprocess CommunicationandMiddleware

  2. Sockets and Ports Node 2 Node 1 Information Management NTU Source: G. Coulouris et al., Distributed Systems: Concepts and Design

  3. Crossing Hosts/Platforms Information Management NTU Source: G. Coulouris et al., Distributed Systems: Concepts and Design

  4. Purposes of Middleware • Higher-level abstractions (RPC, RMI, …) • Location transparency • Independent of communication protocols • Independent of hardware/operating systems • Use of several programming languages Information Management NTU

  5. Local vs. Remote Modules • Variables • Variables of a remote module cannot be directly accessed. • Parameter-passing Mechanisms • Call by reference, for input parameters, is not feasible for a remote procedure/method. • Pointers • Pointers of a remote module are not very useful for the local module. * For a module in some process, any other module in a different process, not necessarily a different computer, is a remote module. Information Management NTU

  6. The Middleware layer * The operating system includes common network protocols (TCP/IP, …). Information Management NTU Source: G. Coulouris et al., Distributed Systems: Concepts and Design

  7. Marshalling (Serialization) in CORBA CDR Information Management NTU Source: G. Coulouris et al., Distributed Systems: Concepts and Design

  8. Request-Reply Communication Information Management NTU Source: G. Coulouris et al., Distributed Systems: Concepts and Design

  9. Request-Reply Communication Using HTTP An HTTP request message: An HTTP reply message: HTTP is not only a request-reply protocol but also has been used as the transport of other request-reply protocols. Information Management NTU Source of figures: G. Coulouris et al., Distributed Systems: Concepts and Design

  10. Distributed Objects • Client/Server: two-tier, three-tier, … • Interfaces and Interface Definition Languages (IDLs) • Object References (or Identifiers) and Remote Method Invocation (RMI) • Object Activations and Persistency • Exceptions: timeouts, … • Synchronization, Replication, Migration, Garbage Collection, … Information Management NTU

  11. Interactions among Distributed Objects Information Management NTU Source: G. Coulouris et al., Distributed Systems: Concepts and Design

  12. A Remote Object and Its Interface Information Management NTU Source: G. Coulouris et al., Distributed Systems: Concepts and Design

  13. A CORBA IDL Example Information Management NTU Source: G. Coulouris et al., Distributed Systems: Concepts and Design

  14. Client Proxy and Server Skeleton A client proxy is also known as a client stub and server skeleton as server stub. The remote reference module is mainly for translating between local and remote object references. Information Management NTU Source: G. Coulouris et al., Distributed Systems: Concepts and Design

  15. 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. • These RMI components are generated automatically by an interface compiler. Information Management NTU

  16. RMI/RPC Semantics and Transparency Remote invocations may be made syntactically identical to local invocations, but they have far more implications that both the client and the server designers have to deal with. Information Management NTU Source of the table: G. Coulouris et al., Distributed Systems: Concepts and Design

  17. Event-Based Systems • The publish-subscribe paradigm • publisher • event and event type • subscriber • notification • Heterogeneity • Asynchrony Information Management NTU

  18. External Dealer’s computer Dealer’s computer source Dealer Notification Notification Dealer Information Notification Notification provider Notification Notification Notification Dealer’s computer Dealer’s computer Notification Information provider Notification Notification Dealer Dealer External source A Dealing Room System Information Management NTU Source: G. Coulouris et al., Distributed Systems: Concepts and Design

  19. Event service subscriber object of interest 1. notification object of interest observer subscriber 2. notification notification object of interest observer subscriber 3. notification An Architecture for Event Notification Information Management NTU Source: G. Coulouris et al., Distributed Systems: Concepts and Design

  20. The Roles for Observers/Agents • Forwarding • Filtering • Patterns of Events • Notification Mailboxes Information Management NTU

  21. Java Remote Interfaces Information Management NTU Source: G. Coulouris et al., Distributed Systems: Concepts and Design

  22. Parameter Passing in Java • By reference (passed as remote object references) • For parameters whose type is defined as a remote interface, one that extends Remote • By value • For parameters of serializable types, including primitive types and classes that implement the serializable interface Information Management NTU

  23. A Java Server Information Management NTU Source: G. Coulouris et al., Distributed Systems: Concepts and Design

  24. A Java Server (cont.) Information Management NTU Source: G. Coulouris et al., Distributed Systems: Concepts and Design

  25. A Java Client Information Management NTU Source: G. Coulouris et al., Distributed Systems: Concepts and Design

  26. CORBA • Defined by OMG to facilitate the development of distributed object-oriented systems. • Language-independency is achieved through the use of a standard interface definition language---the CORBA IDL. • 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. Information Management NTU

  27. The CORBA Architecture * ** * The implementation repository allows server objects to be activated on demand. ** The interface repository gives run-time type information, mainly for dynamic invocations. Information Management NTU Source of the figure: G. Coulouris et al., Distributed Systems: Concepts and Design

  28. The Object Adapter • Creates remote object references for CORBA objects • Maps the names of CORBA objects to their servants • Dispatches each remote invocation via a skeleton to the appropriate server object • Activate objects Information Management NTU

  29. 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. Information Management NTU

  30. 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. Information Management NTU

  31. Shape and Shapelist in CORBA IDL Information Management NTU Source: G. Coulouris et al., Distributed Systems: Concepts and Design

  32. Java Interface Generated from ShapeList Information Management NTU Source: G. Coulouris et al., Distributed Systems: Concepts and Design

  33. Java Implementation of Shapelist Information Management NTU Source: G. Coulouris et al., Distributed Systems: Concepts and Design

  34. Java Implementation of ShapeList (cont.) Information Management NTU Source: G. Coulouris et al., Distributed Systems: Concepts and Design

  35. Java Implementation of a ShapeList Client Information Management NTU Source: G. Coulouris et al., Distributed Systems: Concepts and Design

  36. CORBA Services • Naming Service • locate objects by their names • Trading Service • locate objects by their attributes • Event Service and Notification Service • Security Service • Transaction Service • Persistent Object Service Information Management NTU

  37. The CORBA Naming Service • Allows (1) a name to be bound to an object and (2) that object to be found subsequently by resolving that name. • A name is a sequence of name components and is resolved within a given naming context. • The IDL interface NamingContext defines the core of the naming service. • A NamingContext object acts much like a directory in a filing system. Information Management NTU

  38. CORBA Naming Graph initial naming context initial naming context initial naming context XX ShapeList B V P C T D E S R Q U Information Management NTU Source: G. Coulouris et al., Distributed Systems: Concepts and Design

  39. The NamingContext Interface (partial) struct NameComponent { string id; string kind; }; typedef sequence <NameComponent> Name; interface NamingContext { void bind (in Name n, in Object obj); binds the given name and remote object reference in my context. void unbind (in Name n); removes an existing binding with the given name. void bind_new_context(in Name n); creates a new naming context and binds it to a given name in my context. Object resolve (in Name n); looks up the name in my context and returns its remote object reference. void list (in unsigned long how_many, out BindingList bl, out BindingIterator bi); returns the names in the bindings in my context. }; Information Management NTU Source: G. Coulouris et al., Distributed Systems: Concepts and Design

  40. COM/DCOM • COM stands for Component Object Model. Its distributed version is referred to as DCOM. • It is a programming model for binary components reuse and a foundation of OLE (Object Linking and Embedding) and ActiveX controls. • COM interfaces are defined in the interface definition language IDL and compiled by MIDL.EXE. Information Management NTU

  41. COM Objects • All COM objects implement the IUnknown interface (defined in unknwn.idl) or one of its extended interfaces. • Methods of IUnknown: • QueryInterface: checks if the named interface is supported and, if so, returns the corresponding interface reference • AddRef • Release • A COM object may implement multiple interfaces. Information Management NTU

  42. GUIDS • To eliminate name collisions, all COM interfaces are assigned a unique binary name at design time that is the physical name of the interface. • These physical names are called Globally Unique Identifiers (GUIDs). • GUIDs are 128-bit extremely large numbers that are guaranteed to be unique in both time and space. Information Management NTU

More Related