CS555: Distributed Systems [Fall 2017] Dept. Of Computer Science, Colorado State University

Similar documents
CS555: Distributed Systems [Fall 2017] Dept. Of Computer Science, Colorado State University

Chapter 4 Communication

Module 7 - Replication

Distributed Systems COMP 212. Lecture 15 Othon Michail

CS555: Distributed Systems [Fall 2017] Dept. Of Computer Science, Colorado State University

CS555: Distributed Systems [Fall 2017] Dept. Of Computer Science, Colorado State University

CS 455: INTRODUCTION TO DISTRIBUTED SYSTEMS [DISTRIBUTED MUTUAL EXCLUSION] Frequently asked questions from the previous class survey

CS455: Introduction to Distributed Systems [Spring 2018] Dept. Of Computer Science, Colorado State University

CS455: Introduction to Distributed Systems [Spring 2018] Dept. Of Computer Science, Colorado State University

Last Class: RPCs and RMI. Today: Communication Issues

Middleware and Interprocess Communication

Chapter 4 Communication

Frequently asked questions from the previous class survey

Unit 7: RPC and Indirect Communication

CS455: Introduction to Distributed Systems [Spring 2018] Dept. Of Computer Science, Colorado State University

Indirect Communication

Indirect Communication

CS555: Distributed Systems [Fall 2017] Dept. Of Computer Science, Colorado State University

Communication. Distributed Systems IT332

05 Indirect Communication

Dr Markus Hagenbuchner CSCI319 SIM. Distributed Systems Chapter 4 - Communication

Chapter 4 Communication

Distributed Systems Principles and Paradigms. Chapter 04: Communication

Distributed Systems Principles and Paradigms. Chapter 04: Communication

CS455: Introduction to Distributed Systems [Spring 2018] Dept. Of Computer Science, Colorado State University

Parallelism. Master 1 International. Andrea G. B. Tettamanzi. Université de Nice Sophia Antipolis Département Informatique

Introduction to Distributed Systems. Fabienne Boyer, LIG,

02 - Distributed Systems

Announcements. me your survey: See the Announcements page. Today. Reading. Take a break around 10:15am. Ack: Some figures are from Coulouris

SAI/ST course Distributed Systems

On the Creation & Discovery of Topics in Distributed Publish/Subscribe systems

Interprocess Communication Tanenbaum, van Steen: Ch2 (Ch3) CoDoKi: Ch2, Ch3, Ch5

02 - Distributed Systems

Distributed Information Processing

Communication Paradigms

Communication. Distributed Systems Santa Clara University 2016

DS 2009: middleware. David Evans

Indirect Communication

Distributed Systems Inter-Process Communication (IPC) in distributed systems

DISTRIBUTED SYSTEMS Principles and Paradigms Second Edition ANDREW S. TANENBAUM MAARTEN VAN STEEN. Chapter 1. Introduction

References. Introduction. Publish/Subscribe paradigm. In a wireless sensor network, a node is often interested in some information, but

Communication. Overview

CS505: Distributed Systems

Time and Space. Indirect communication. Time and space uncoupling. indirect communication

Distributed Systems Principles and Paradigms

Interprocess Communication

Structured communication (Remote invocation)

CS555: Distributed Systems [Fall 2017] Dept. Of Computer Science, Colorado State University

Distributed Systems. Lehrstuhl für Informatik 4. RWTH Aachen. Organization. Literature. Classification of the lecture

Consistency and Replication (part b)

Module 2 Overview of Computer Networks

Module 2 Overview of. Computer Networks

IPC. Communication. Layered Protocols. Layered Protocols (1) Data Link Layer. Layered Protocols (2)

Verteilte Systeme (Distributed Systems)

MOM MESSAGE ORIENTED MIDDLEWARE OVERVIEW OF MESSAGE ORIENTED MIDDLEWARE TECHNOLOGIES AND CONCEPTS. MOM Message Oriented Middleware

Chapter 1: Distributed Systems: What is a distributed system? Fall 2013

Today CSCI Remote Method Invocation (RMI) Distributed Objects

Introduction to Distributed Systems

Module 1 - Distributed System Architectures & Models

Distributed Systems Lecture 2 1. External Data Representation and Marshalling (Sec. 4.3) Request reply protocol (failure modes) (Sec. 4.

Communication in Distributed Systems Programming

DISTRIBUTED COMPUTER SYSTEMS

Advanced Topics in Distributed Systems. Dr. Ayman A. Abdel-Hamid. Computer Science Department Virginia Tech

LECTURE 6: MESSAGE-ORIENTED COMMUNICATION II: MESSAGING IN DISTRIBUTED SYSTEMS

LECTURE 6: MESSAGE-ORIENTED COMMUNICATION II: MESSAGING IN DISTRIBUTED SYSTEMS. Lecture Contents

Enterprise Integration Patterns: Designing, Building, and Deploying Messaging Solutions

Distributed Systems (5DV147)

Chapter 2 Architectures. Software Architectures

Distributed Systems. Lehrstuhl für Informatik IV RWTH Aachen. Organisation. Classification of the lecture. Literature

Architecture of Software Intensive Systems

DISTRIBUTED COMPUTER SYSTEMS ARCHITECTURES

Multimedia! 23/03/18. Part 3: Lecture 3! Content and multimedia! Internet traffic!

Part 3: Lecture 3! Content and multimedia!

Distributed Systems Course. a.o. Univ.-Prof. Dr. Harald Kosch

Chapter 2 Distributed Computing Infrastructure

Last Class: Web Caching. Today: More on Consistency

06/02/ Local & Metropolitan Area Networks 0. INTRODUCTION. 1. History and Future of TCP/IP ACOE322

CS 5520/ECE 5590NA: Network Architecture I Spring Lecture 13: UDP and TCP

Software Architecture Patterns

Large Systems: Design + Implementation: Communication Coordination Replication. Image (c) Facebook

Electronic Payment Systems (1) E-cash

Consistency and Replication. Why replicate?

User Datagram Protocol (UDP):

Architecture of distributed systems

Architecture of distributed systems

Communication in Distributed Systems

Reliable Distributed System Approaches

Process Synchroniztion Mutual Exclusion & Election Algorithms

Chapter 5: Distributed objects and remote invocation

Distributed Information Processing

CS555: Distributed Systems [Fall 2017] Dept. Of Computer Science, Colorado State University

Distributed Systems Concepts Design 5th Edition Solutions

Distributed Systems Concepts Design 4th Edition

Naming in Distributed Systems

Information Brokerage

Frequently asked questions from the previous class survey

Dept. Of Computer Science, Colorado State University

Real-Time Protocol (RTP)

DISTRIBUTED SYSTEMS. Second Edition. Andrew S. Tanenbaum Maarten Van Steen. Vrije Universiteit Amsterdam, 7'he Netherlands PEARSON.

Context-Awareness and Adaptation in Distributed Event-Based Systems

Transcription:

CS 555: DISTRIBUTED SYSTEMS [MESSAGING SYSTEMS] Shrideep Pallickara Computer Science Colorado State University Frequently asked questions from the previous class survey Distributed Servers Security risks with indirections During load balancing, do switches take location into account? Difference between a switch and a router Why Ethernet and not Infiniband? Performance considerations in contrast with MPIv6 MPI: groups and process IDs Can multicasting/broadcast be implemented on top of TCP L18.1 L18.2 Topics covered in this lecture Messaging Systems Publish-subscribe systems Queuing Systems Streams Gossip/Epidemic protocols PUBLISH-SUBSCRIBE SYSTEMS L18.3 L18.4 Publish subscribe systems This is the most widely used of all indirect communications Many systems may map to: Request/response or the remote invocation pattern of interactions However, a lot of systems don t map well into the above models Such systems are naturally modeled by the more decoupled style offered by events Roles in the publish/subscribe system Publishers publish structured events to an event service Subscribers express interest in particular events through subscriptions Subscriptions can be arbitrary patterns over structured events L18.5 L18.6 SLIDES CREATED BY: SHRIDEEP PALLICKARA L18.1

The key task of a publish/subscribe system Match subscriptions against published events Ensure delivery of event notifications to subscribers with matching subscriptions Applications of publish/subscribe systems Financial information systems Live feeds of real-time data Ubiquitous computing Monitoring applications Involving sensors and such L18.7 L18.8 Characteristics of publish/subscribe systems Heterogeneity Interoperation in a heterogeneous system becomes much simpler Need interfaces for receiving and dealing with events Asynchronicity Publishers do not have to synchronize with subscribers while sending events Publishers and subscribers are decoupled Programming model in publish/subscribe systems [1/2] Event e Publishers disseminate events through a publish(e) operation Subscribers express interest in a set of events through subscriptions: subscribe(f) f refers to a filter that defines a pattern over the set of all possible events Subscriptions can be revoked using unsubscribe (f) L18.9 L18.10 Programming model in publish/subscribe systems [2/2] Some systems also introduce the notion of advertisements Declare the nature of events Done through an advertise(f) operation Advertisements can revoked using unadvertise(f) Types of publish/subscribe systems Channel-based Publishers publish to named channels Subscribers subscribe to one of the named channels n Receive all events on that channel Topic-based Notification is expressed in terms of a number of fields One of these fields denotes the topic L18.11 L18.12 SLIDES CREATED BY: SHRIDEEP PALLICKARA L18.2

Difference between channel and topic-based approaches Topics are implicitly defined in channel based approaches Channels generally implemented as distributed objects Topics are explicitly defined in the case of topic-based approaches Topic-based approaches also enhance this using hierarchical organization of topics E.g. /Sports, /Sports/NBA, /Sports/NBA/Denver Types of publish/subscribe systems Content-based Allow expression of subscriptions over a range of fields in the event Filter here is a set of constraints over the values of event attributes Type-based Objects must be of a specific type Matching is based either on the type or subtypes Tends to be integrated tightly with programming languages L18.13 L18.14 Publish/Subscribe systems are often used for scalable, real-time disseminations Data dissemination managed by the content dissemination network (CDN) Comprises a set of software router nodes Logical Overlay CENTRALIZED VS. DISTRIBUTED PUBLISH/SUBSCRIBE SUBSTRATES L18.15 L18.16 Centralized publish/subscribe substrates Single server Publishers publish events to central server Subscriber sends subscriptions to that server The single server then performs the matching of subscriptions with the published events Disadvantages: Design lacks resilience and scalability Central server introduces performance bottleneck Distributed publish/subscribe substrates Centralized broker is replaced by a network of brokers These brokers cooperate in: The routing of events Dissemination of subscriptions Advantages: Survive multiple node failures Shown to operate well in internet-scale deployments L18.17 L18.18 SLIDES CREATED BY: SHRIDEEP PALLICKARA L18.3

Publish/Subscribe systems: Subscriptions and Matching Subscription predicates allow consumers to specify data of interest to them Could be / separated Strings, <tag, value> tuples, SQL or Regular Expression queries Matching problem is the opposite of databases Evaluate content against all the stored queries Publish/Subscribe systems: Generation and discovery Consumers often need to know what to subscribe to Discovery services used for locating schema Data published by the producers Has to be self descriptive with values for content descriptors L18.19 L18.20 Publish/subscribe systems: An example BLUE CIRCLE RED TRIANGLE Middleware CONSUMER PRODUCER OVERALL SYSTEMS ARCHITECTURE L18.21 L18.22 Architecture of publish-subscribe systems Flooding: Publishing events Matching Event notification is sent to all nodes Matching is performed by the subscriber EVENT ROUTING Flooding Filtering Rendezvous Informed Gossip A subscriber may end up discarding most of the events that it receives OVERLAY NETWORKS Broker Network Group Multicast DHT Gossip TRANSPORT PROTOCOLS TCP/IP IP Multicast 802.11g L18.23 L18.24 SLIDES CREATED BY: SHRIDEEP PALLICKARA L18.4

Flooding: Subscriptions All subscriptions are sent to all possible publishers Matching is performed by the publisher Publisher then sends matched events directly to the subscribers Filtering [1/2] Brokers forward notifications through CDN only where there is a path to a valid subscriber Achieved by Propagating subscription information through the network towards potential publishers Store associated state at each broker Each broker maintains List of neighboring brokers List of subscriptions directly serviced by that node Routing table indicating pathways to reach nodes L18.25 L18.26 Filtering [2/2] Requires implementation of matching at each node in the network Matching function Takes: Event notification and list of nodes with associated subscriptions Returns: Set of nodes where the event notification matches the subscriptions Rendezvous nodes View the set of all possible events as an event space Partition responsibility for this event space between a set of brokers in the system Rendezvous nodes are broker nodes that are responsible for a subset of the event space When an event e is published, REN(e) returns one or more rendezvous nodes Responsible for matching e against subscriptions in the system L18.27 L18.28 Publish/Subscribe Systems CORBA: Event Service, Notification Service Java Message Service JMS clients are vendor agnostic Vendors do not interoperate with each other Wire formats Advanced Message Queuing Protocol Web Services WS-Eventing, WS-Notification MESSAGE QUEUING L18.29 L18.30 SLIDES CREATED BY: SHRIDEEP PALLICKARA L18.5

Message queuing systems Applications communicate by inserting messages in queues Messages delivered to destination Even if it was down when message was sent Each application has its own private queue Message queuing guarantees: Sender Message will be eventually inserted in recipient s queue No guarantees about When If the message will be read Time-decoupled interaction Recipient behavior L18.31 L18.32 The store-and-forward approach Basic interface to a message queuing system Producers place messages on to a queue When destination is not available Queuing system responsible for resending messages from queue When destination is available Primitive put get poll notify Meaning Append a message to a specified queue Block until specified queue is non-empty, and remove the first message Check a specified queue for messages, and remove the first. Never block. Install a handler to be called when a message is put into the specified queue L18.33 L18.34 Queuing systems: Problems Typically point-to-point communications Store-and-forward does not scale particularly well STREAM ORIENTED COMMUNICATIONS L18.35 L18.36 SLIDES CREATED BY: SHRIDEEP PALLICKARA L18.6

Our focus so far Exchange of independent, autonomous messages RPC calls, replies to request, messaging Processes may be slow or fast Timing has no impact on correctness Several places where timing plays a crucial role If sound has been sampled at a certain frequency It is essential that the sound is played back at the same frequency Playing at a different rate? Incorrect version of the original sound L18.37 L18.38 Support for time-dependent information formulated as support for continuous media How is the information represented? Encoding Text: Unicode or ASCII Images: JPEG/GIF Audio: 16-bit PCM samples Continuous media Temporal relationships are fundamental to interpreting what the data means Order and spacing must be preserved L18.39 L18.40 Discrete media Temporal relationships are not fundamental to interpreting the data Asynchronous transmissions Data transmitted one after the other No other timing constraints regarding inter-packet spacing Transmissions Synchronous transmissions Maximum end-to-end delay defined for each packet No problem if samples are propagated faster Isochronous transmissions Packets must be transmitted on time Subject to maximum and minimum end-to-end delay Bounded (delay) jitter L18.41 L18.42 SLIDES CREATED BY: SHRIDEEP PALLICKARA L18.7

Streams and complexity Simple streams Single sequence of data Complex stream Several related simple streams Substreams are time-dependent Synchronization needed Computing Jitter The Jitter J is computed based on the RTP RFC J = J + ( D(i-1, i) - J)/16 D(i 1, i) = difference between the delay for i th packet and delay for the (i 1) th packet Values from the past and present play a role in the jitter calculation. L18.43 L18.44 Use of buffering to enforce QoS Packets depart from source 1 2 3 4 5 6 7 8 Packets arrive at buffer 1 2 3 4 5 6 7 8 Why interleave packet frames? Sent Lost Packet 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 Delivered Lost frames 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 Sent Lost Packet Packets removed from buffer Gap in playback 1 5 9 13 2 6 10 14 3 7 11 15 8 8 12 16 1 2 3 4 5 6 7 8 Delivered 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 L18.45 L18.46 Gossip based data dissemination Can disease spread be the basis for disseminating information? Epidemic protocols Rapidly propagate information among a large collection of nodes Using only local information No central coordinating component GOSSIP/EPIDEMIC PROTOCOLS L18.47 L18.48 SLIDES CREATED BY: SHRIDEEP PALLICKARA L18.8

Epidemic protocols The objective is to infect nodes with new information as fast as possible A node is infected if it holds data that it is willing to spread A node that Has not seen the data: susceptible Is not willing or able to spread: removed A popular propagation model is anti-entropy Node P picks node Q at random Exchange of updates P only pushes its own updates to Q P only pulls new updates from Q P and Q send updates to each other (push/pull) L18.49 L18.50 Rapidly spreading updates: Push-based Only pushing updates turns out to be a bad choice Updates can only be propagated by infected nodes If many nodes are infected? n Probability of selecting a susceptible node is small Nodes remain susceptible for a long time Rapidly spreading updates: Pull-based Spreading updates is triggered by susceptible nodes Chances that a susceptible node contacts an infectious one is higher L18.51 L18.52 In practice: Both push/pull are used Round Every node has taken the initiative to exchange updates with a random node Number of rounds to propagate a single update log(n) Gossips: Variant of the epidemic scheme Also called rumor spreading If P has been updated for data item x Finds Q and tries to update it If Q was already updated? P may lose interest in spreading the update with p=1/k L18.53 L18.54 SLIDES CREATED BY: SHRIDEEP PALLICKARA L18.9

Gossiping: An excellent way to spread news But cannot guarantee that all nodes will actually be updated When a large number of nodes participate in epidemics A fraction of users (s) can miss updates (k +1)(1 s) s = e Managing Web Content Delivery Akamai Websites redirect users to Akamaized URLs IP address associated with client used to select server-farm closest to client. Most popular content served up from caches n Benefits of caching and network proximity Server farms sync up with managed websites to track content changes. L18.55 L18.56 The contents of this slide set are based on the following references Distributed Systems: Concepts and Design. George Coulouris, Jean Dollimore, Tim Kindberg, Gordon Blair. 5th Edition. Addison Wesley. ISBN: 978-0132143011. [Chapter 6] Distributed Systems: Principles and Paradigms. Andrew S. Tanenbaum and Maarten Van Steen. 2nd Edition. Prentice Hall. ISBN: 0132392275/978-0132392273. [Chapter 4] L18.57 SLIDES CREATED BY: SHRIDEEP PALLICKARA L18.10