Indirect Communication

Slides:



Advertisements
Similar presentations
DISTRIBUTED COMPUTING PARADIGMS
Advertisements

From Coulouris, Dollimore, Kindberg and Blair Distributed Systems: Concepts and Design Edition 5, © Addison-Wesley 2012 Slides for Chapter 6: Indirect.
From Coulouris, Dollimore, Kindberg and Blair Distributed Systems: Concepts and Design Edition 5, © Addison-Wesley 2012 Exercises for Chapter 4: Interprocess.
Lab 2 Group Communication Andreas Larsson
Distributed Systems Fall 2010 Replication Fall 20105DV0203 Outline Group communication Fault-tolerant services –Passive and active replication Highly.
Group Communications Group communication: one source process sending a message to a group of processes: Destination is a group rather than a single process.
Group Communication Phuong Hoai Ha & Yi Zhang Introduction to Lab. assignments March 24 th, 2004.
Distributed Systems Fall 2009 Replication Fall 20095DV0203 Outline Group communication Fault-tolerant services –Passive and active replication Highly.
ECSE Software Engineering 1I HO 7 © HY 2012 Lecture 7 Publish/Subscribe.
Distributed Publish/Subscribe Network Presented by: Yu-Ling Chang.
Chapter 5: Distributed objects and remote invocation Introduction Remote procedure call Events and notifications.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
Exercises for Chapter 2: System models
Source: George Colouris, Jean Dollimore, Tim Kinderberg & Gordon Blair (2012). Distributed Systems: Concepts & Design (5 th Ed.). Essex: Addison-Wesley.
DISTRIBUTED COMPUTING PARADIGMS. Paradigm? A MODEL 2for notes
Lab 2 Group Communication Farnaz Moradi Based on slides by Andreas Larsson 2012.
Message Oriented Communication Prepared by Himaja Achutha Instructor: Dr. Yanqing Zhang Georgia State University.
From Coulouris, Dollimore, Kindberg and Blair Distributed Systems: Concepts and Design Edition 5, © Addison-Wesley 2012 Exercises for Chapter 9: Web Services.
Farnaz Moradi Based on slides by Andreas Larsson 2013.
Distributed Systems Principles and Paradigms Chapter 12 Distributed Coordination-Based Systems 01 Introduction 02 Communication 03 Processes 04 Naming.
IS473 Distributed Systems CHAPTER 5 Distributed Objects & Remote Invocation.
Chapter 5: Distributed objects and remote invocation Introduction Remote procedure call Events and notifications.
Distributed Objects & Remote Invocation
Fault Tolerant Services
Information-Centric Networks10b-1 Week 10 / Paper 2 Hermes: a distributed event-based middleware architecture –P.R. Pietzuch, J.M. Bacon –ICDCS 2002 Workshops.
AMQP, Message Broker Babu Ram Dawadi. overview Why MOM architecture? Messaging broker like RabbitMQ in brief RabbitMQ AMQP – What is it ?
Information-Centric Networks Section # 10.2: Publish/Subscribe Instructor: George Xylomenos Department: Informatics.
Seminar on Service Oriented Architecture Distributed Systems Architectural Models From Coulouris, 5 th Ed. SOA Seminar Coulouris 5Ed.1.
Replication and Group Communication. Management of Replicated Data FE Requests and replies C Replica C Service Clients Front ends managers RM FE RM Instructor’s.
Distributed Computing Paradigms1. 2 Paradigms for Distributed Applications Paradigm means “a pattern, example, or model.” In the study of any subject.
From Coulouris, Dollimore, Kindberg and Blair Distributed Systems: Concepts and Design Edition 5, © Addison-Wesley 2012 Indirect Communication.
Exercises for Chapter 2: System models From Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edition 4, © Pearson Education 2005.
From Coulouris, Dollimore, Kindberg and Blair Distributed Systems: Concepts and Design Edition 5, © Addison-Wesley 2012 System Models by Dr. Sarmad Sadik.
Indirect Communication Indirect Communication is defined as communication between entities in DS through intermediary with no direct coupling b/w sender.
September 28, 2010COMS W41561 COMS W4156: Advanced Software Engineering Prof. Gail Kaiser
Topic 4: Distributed Objects Dr. Ayman Srour Faculty of Applied Engineering and Urban Planning University of Palestine.
Reliable multicast Tolerates process crashes. The additional requirements are: Only correct processes will receive multicasts from all correct processes.
Exercises for Chapter 14: Replication
Exercises for Chapter 11: COORDINATION AND AGREEMENT
Coordination and Agreement
Replication & Fault Tolerance CONARD JAMES B. FARAON
Last Class: Introduction
03 – Remote invoaction Request-reply RPC RMI Coulouris 5
WEB SERVICES From Chapter 19 of Distributed Systems Concepts and Design,4th Edition, By G. Coulouris, J. Dollimore and T. Kindberg Published by Addison.
Chapter 3 Internet Applications and Network Programming
DISTRIBUTED SYSTEMS Principles and Paradigms Second Edition ANDREW S
Distribution and components
Chapter 9 – RPCs, Messaging & EAI
CHAPTER 3 Architectures for Distributed Systems
#01 Client/Server Computing
Slides for Chapter 2: Architectural Models
Programming Models for Distributed Application
Java Messaging Service (JMS)
Lecture 4: RPC Remote Procedure Call Coulouris et al: Chapter 5
Java Messaging Service (JMS)
Harjutus 3: Aünkroonne hajussüsteemi päring
PRESENTATION COMPUTER NETWORKS
Distributed Publish/Subscribe Network
Indirect Communication Paradigms (or Messaging Methods)
Creating a Distributed System with Remote Procedure Calls and Web Services Ch.5 B.Ramamurthy 2/17/2019 B.Ramamurthy.
Message Queuing.
Indirect Communication Paradigms (or Messaging Methods)
B. Ramamurthy Based on Paper by Werner Vogels and Chris Re
Indirect Communication Paradigms (or Messaging Methods)
Architectures of distributed systems
WEB SERVICES From Chapter 19, Distributed Systems
J2EE Lecture 13: JMS and WebSocket
#01 Client/Server Computing
Presentation transcript:

Indirect Communication

Indirect communication->communication between entities in a distributed system through an intermediary with no direct coupling between the sender and the receiver(s). key properties stemming from the use of an intermediary: Space uncoupling-> sender does not know or need to know the identity of the receiver(s), and vice versa. Time uncoupling-> sender and receiver(s) can have independent lifetimes. In other words, the sender and receiver(s) do not need to exist at the same time to communicate.

Group communication – Messages sent to a group of processes and delivered to all members of the group The programming model one source process sending a message to a group of processes Destination is a group rather than a single process. — Broadcast – destination is everybody. — Multicast – destination is a designated group. — Unicast – destination is a single process. Useful: for many applications, the recipient of a message is a group of related process. Many services in DS are implemented by a group of processes, possibly distributed in multiple machines.

Process groups and object groups A Group is a collection of processes: G = {P1, P2, …, Pn} Messages are delivered to processes and no further support for dispatching is provided. • Messages are typically unstructured byte arrays with no support for marshalling of complex data types

object groups object group is a collection of objects (instances of same class) that process the same set of invocations concurrently, with each returning responses. Client objects need not be aware of the replication. They invoke operations on a single, local object, which acts as a proxy for the group. The proxy uses a group communication system to send the invocations to the members of the object group. Object parameters and results are marshalled as in RMI and the associated calls are dispatched automatically to the right destination objects/methods.

Types of groups Synchronous and asynchronous systems: There is a requirement to consider group communication in both environments

Implementation issues Reliability and ordering in multicast Group membership management In group communication, all members of a group must receive copies of the messages sent to the group, generally with delivery Guarantees Integrity Messages delivered at most once Validity If a correct process multicasts message m, it will eventually deliver m Agreement If a correct process delivers m, then all correct processes in the group will eventually deliver m Reliability ->two properties: integrity and validity Ordering->is not guaranteed by underlying interprocess communication primitives.

FIFO ordering: First-in-first-out (FIFO) ordering (referred as source ordering) is concerned with preserving the order from the perspective of a sender process, if a process sends one message before another, it will be delivered in this order at all processes in the group. Causal ordering: Causal ordering takes into account causal relationships between messages, if a message happens before another message in the distributed system this so-called causal relationship will be preserved in the delivery of the associated messages at all processes Total ordering: if a message is delivered before another message at one process, then the same order will be preserved at all processes.

Group membership management Providing an interface for group membership changes – membership service provides operations-> Create and destroy groups, add or remove members to a group • Failure detection –service monitors group members-> they crash, they become unreachable(communication failure) Detector mark processes as suspected or unsuspected and remove those processes that have (suspected) failed Notifying members of group membership changes Processes that join or leave – Performing group address expansion -When a process multicasts a message -> it is sent to Gid -From group id to individual group members

Figure 6.3 The role of group membership management Join Group address expansion Multicast communication send Fail Group membership management Leave Process group Instructor’s Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5 © Pearson Education 2012

JGroups toolkit components of the JGroups implementation: JGroups is a toolkit for reliable group communication written in Java JGroups supports process groups ->in which processes can join or leave a group, send a message to all members of the group or indeed to a single member, and receive messages from the group The toolkit supports a variety of reliability and ordering guarantees components of the JGroups implementation: Channels ->an primitive interface for application developers, offering the core functions of joining, leaving, sending and receiving. Building blocks offer higher-level abstractions, building on the underlying service offered by channels. Examples of building blocks in JGroups are- MessageDispatcher, RpcDispatcher, NotificationBus Protocol stack provides the underlying communication protocol, constructed as a stack of composable protocol layers.

Figure 6.4 The architecture of JGroups Instructor’s Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5 © Pearson Education 2012

Publish-subscribe systems(distributed event-based systems) A publish-subscribe system is a system where publishers publish structured events to an event service and subscribers express interest in particular events through subscriptions which can be arbitrary patterns over the structured events.Eg: book,news,job subscription Applications of publish-subscribe systems Examples include:• financial information systems, areas with live feeds of real-time data • support for cooperative working, where a number of participants need to be informed of events of shared interest; • support for ubiquitous computing, including the management of events emanating from the ubiquitous infrastructure (for example, location events); • a broad set of monitoring applications, including network monitoring in the Internet. Publish-subscribe is a key component of Google’s infrastructure (dissemination of events related to advertisements, such as ‘ad clicks’, to interested parties)

Dealing room system: Consider a simple dealing room system whose task is to allow dealers using computers to see the latest information about the market prices of the stocks they deal in. The market price for a single named stock is represented by an associated object. The information arrives in the dealing room from several different external sources in the form of updates to some or all of the objects representing the stocks and is collected by processes we call information providers. Dealers are typically interested only in their own specialist stocks.

Implemented by processes with two different tasks: Task1:information provider process continuously receives new trading information(event)from a single external source. The information provider publishes such events to the publish-subscribe system for delivery to all of the dealers who have expressed an interest in the corresponding stock There will be a separate information provider process for each external source. Task 2: A dealer process creates a subscription representing each named stock that the user asks to have displayed. Each subscription expresses an interest in events related to a given stock at the relevant information provider. It then receives all the information sent to it in notifications and displays it to the user.

Figure 6.7 Dealing room system Dealer’s computer Information provider Dealer External source Notification Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 4 © Pearson Education 2005

Characteristics of publish-subscribe systems Heterogeneity: Event-generating objects publish the types of events they offer, and that other objects subscribe to patterns of events and provide an interface for receiving and dealing with the resultant notifications Asynchronicity: Notifications are sent asynchronously by event-generating publishers to all the subscribers

subscription (filter) model: The programming model The programming model in publish-subscribe systems is based on a small set of operations, captured in Figure 6.8. Publishers disseminate an event e through a publish(e) operation and subscribers express an interest in a set of events through subscriptions. subscription (filter) model: Channel-based: publishers publish events to named channels and subscribers then subscribe to one of these named channels to receive all events sent to that channel. Topic-based (also referred to as subject-based):Subscriptions are then defined in terms of the topic of interest. Content-based: Content-based approaches are a generalization of topic- based approaches Type-based: subscriptions are defined in terms of types of events and matching is defined in terms of types or subtypes of the given filter.

Figure 6.8 The publish-subscribe paradigm Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 4 © Pearson Education 2005

Implementation issues Centralized versus distributed implementations Centralized(simplest approach) The implementation in a single node with a server on that node acting as an event broker. Publishers then publish events to this broker, and subscribers send subscriptions to the broker and receive notifications in return. Interaction with the broker is then through a series of point-to-point messages; implemented using message passing or remote invocation. distributed implementations the centralized broker is replaced by a network of brokers that cooperate to offer the desired functionality as illustrated in Figure 6.9 Possible to have a fully peer-to-peer implementation This is a very popular implementation strategy for recent systems. In this approach, there is no distinction between publishers, subscribers and brokers; all nodes act as brokers, cooperatively implementing the required event routing functionality

Figure 6.9 A network of brokers Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 4 © Pearson Education 2005

Overall systems architecture

Figure 6.10 The architecture of publish-subscribe systems Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 4 © Pearson Education 2005

Flooding: sending an event notification to all nodes in the network and then carrying out the appropriate matching at the subscriber end Filtering: This is referred to as filtering-based routing. Brokers forward notifications through the network only where there is a path to a valid subscriber. Advertisements: pure filtering-based approach can generate a lot of traffic(flooding) due to propagation of subscriptions ->This burden can be reduced by propagating the advertisements towards subscribers in a similar (actually, symmetrical) way to the propagation of subscriptions. Rendezvous: Another approach to control the propagation of subscriptions (and to achieve a natural load balancing) is the rendezvous approach. rendezvous nodes->broker nodes responsible for a given subset of the event space. rendezvous-based routing algorithm

rendezvous-based routing algorithm SN(s) takes a given subscription, s, and returns one or more rendezvous nodes take responsibility for that subscription. Each rendezvous node maintains a subscription list filters and forwards all matching events to the set of subscribing nodes. 2. when an event e is published, function EN(e) returns one or more rendezvous nodes, ->responsible for matching e against subscriptions in the system

Figure 6.11 Filtering-based routing upon receive publish(event e) from node x 1 matchlist := match(e, subscriptions) 2 send notify(e) to matchlist; 3 fwdlist := match(e, routing); 4 send publish(e) to fwdlist - x; 5 upon receive subscribe(subscription s) from node x 6 if x is client then 7 add x to subscriptions; 8 else add(x, s) to routing; 9 send subscribe(s) to neighbours - x; 10 Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 4 © Pearson Education 2005

Figure 6.12 Rendezvous-based routing upon receive publish(event e) from node x at node i rvlist := EN(e); if i in rvlist then begin matchlist :=match(e, subscriptions); send notify(e) to matchlist; end send publish(e) to rvlist - i; upon receive subscribe(subscription s) from node x at node i rvlist := SN(s); if i in rvlist then add s to subscriptions; else send subscribe(s) to rvlist - i; Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 4 © Pearson Education 2005

Figure 6.13 Example publish-subscribe system Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 4 © Pearson Education 2005

Message queues Important category of indirect communication systems. Whereas groups and publishsubscribe provide a one-to-many style of communication, message queues provide a point-to-point service using the concept of a message queue as an indirection, thus achieving the desired properties of space and time uncoupling. Message queues are also referred to as Message-Oriented Middleware(MOM) MOM-is a tool provide asynchronous communication between sender and receiver If enough bandwidth is not there for establishing RPC communication, then can go for MOM

It offers to communication in distributed systems through queues. The programming model It offers to communication in distributed systems through queues. In particular,producer processes can send messages to a specific queue and other (consumer) processes can then receive messages from this queue. Three styles of receive are generally supported: • a blocking receive, which will block until an appropriate message is available; • a non-blocking receive (a polling operation), which will check the status of the queue and return a message if available, or a not available indication otherwise; • a notify operation, which will issue an event notification when a message is available in the associated queue. - 4 modes of sender and receiver execution Sender running, Receiver running sending and reading message Sender running, receiver passive messages sent Sender passive, receiver running- messages read Sender passive ,receiver passive messages stored in queue

Queue manager: manages queue(load balancing) The queuing policy is normally first-in-first-out (FIFO), but most message queue implementations also support the concept of priority, with higher- priority messages delivered first. Consumer processes can also select messages from the queue based on properties of a message Queue manager: manages queue(load balancing) Message brokerit’s a s/w based on asyn, store & fwd msg Application publish msg to broker and another application subscribe(msg)

Implementation issues The key implementation issue for message queuing systems is the choice between centralized and distributed implementations of the concept. Some implementations are centralized, with one or more message queues managed by a queue manager located at a given node. The advantage of this scheme is simplicity, but such managers can become rather heavyweight components and have the potential to become a bottleneck or a single point of failure. To illustrate distributed architectures Case study: WebSphere MQ

Case study: The Java Messaging Service (JMS) The Java Messaging Service (JMS) is a specification of a standardized way for distributed Java programs to communicate indirectly. It provide a way for java program to create , send, receive, read an messages of enterprise messaging system JMS  API to an enterprise messaging service and set of semantics describe interface & general behavior of messaging service JMS distinguishes between the following key roles: • A JMS client is a Java program or component that produces or consumes messages, a JMS producer is a program that creates and produces messages and a JMS consumer is a program that receives and consumes messages. • A JMS provider is any of the multiple systems that implement the JMS specification. • A JMS message is an object that is used to communicate information between JMS clients (from producers to consumers).

When client interact with MOM platform, it first make connection to message broker Then client can create one/more sessions and can send message JMS msg has 3 parts->header,set of properties,body of message Message producer is an object that publish msg Message consumer is an object that subscribe the messages

Figure 6.14 The message queue paradigm Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 4 © Pearson Education 2005

Figure 6.15 A simple networked topology in WebSphere MQ Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 4 © Pearson Education 2005

Figure 6.16 The programming model offered by JMS Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 4 © Pearson Education 2005