Message and Stream Oriented Communication

Dilum Bandara
Dilum BandaraResearch Scientist at Data61, CSIRO
Message & Stream
Oriented Communication
CS4262 Distributed Systems
Dilum Bandara
Dilum.Bandara@uom.lk
Some slides extracted from Dr. Srinath Perera & Dr. Rajkumar Buyya’s
Presentation Deck
Outline
 Message oriented communication
 Event queues
 Pub/sub networks
 MPI
 Stream-based communication
 Multicast communication
2
Definitions – Persistent
vs. Transient Communication
 Persistent communication
 Message submitted for transmission is stored by communication
system for as long as it takes to deliver it to receiver
 e.g., e-mail, SMS
 Not necessary for sender to continue execution after submitting
a message
 Not necessary for receiver to be executing at the time message
submission
 Transient communication
 Message is stored by communication system only as long as
sending & receiving applications are executing
 e.g., transport-level communication services (store-and-forward
router)
 Receiver needs to be there when a message is received
3
Definitions – Asynchronous vs.
Synchronous Communication
 Asynchronous communication
 Sender continues immediately after it has submitted
its message for transmission
 Message may be stored, in a local buffer at sending
host or at an intermediate communication server
 Synchronous communication
 Sender is blocked until its message is stored in a
local buffer at receiving host or actually delivered to
receiver
 Strongest form – Sender blocked until receiver has
processed message
4
Types of Communication
5
a) Persistent asynchronous communication (e.g., e-mail)
b) Persistent synchronous communication
Source: A.S. Tanenbaum & M.V. Steen, Distributed Systems: Principles and Paradigms
Types of Communication (Cont.)
6
c) Transient asynchronous communication (e.g., UDP)
d) Receipt-based transient synchronous communication
Source: A.S. Tanenbaum & M.V. Steen, Distributed Systems: Principles and Paradigms
Types of Communication (Cont.)
7
e) Delivery-based transient synchronous communication
f) Response-based transient synchronous communication
Source: A.S. Tanenbaum & M.V. Steen, Distributed Systems: Principles and Paradigms
Types of Communication (Cont.)
1. Persistent, asynchronous communication
 Messages are persistently stored in local host buffer,
or at an intermediate communication server
 e.g., e-mail
2. Persistent, synchronous communication
 Messages can be persistently stored only at receiving
host
 Weaker form of synchronous communication
 It isn’t necessary for receiving application to be executing
8
Types of Communication (Cont.)
3. Transient, asynchronous communication
 Messages is temporarily stored in a local buffer &
sender immediately continues
 e.g., UDP, RPC fire & forget
4. Transient, synchronous communication
I. Weakest form
 Receipt-based, transient, synchronous communication
 Sender is blocked until message is stored in a local buffer of
receiving host
 e.g., Asynchronous RPC delivery part (send with Ack)
9
Types of Communication (Cont.)
II. Weaker form
 Delivery-based, transient, synchronous communication
 e.g., Asynchronous RPC delivery part (Send with Ack)
III. Strongest form
 Response-based, transient, synchronous communication
 e.g., RPC & RMI
10
Message-Oriented Communication
 Message-oriented transient communication
 Transport-level sockets
 Message-Passing Interface (MPI)
 Message transfer latency  milliseconds to seconds
 Message-oriented persistent communication
 Message-queuing systems or Message-Oriented
Middleware (MOM)
 Provide intermediate-term storage capacity for
messages
 Doesn’t requiring either sender or receiver to be active during
message transmission
 Message transfer latency  seconds to minutes 11
Message-Queuing Model
 Applications communicate by inserting messages into a
series of queues
 Loosely-coupled communication
 Sender is given guarantee that its message will eventually be
inserted in recipient’s queue
 No guarantee on timing, or message will actually be read
12
Source: http://msdn.microsoft.com/en-
us/library/windows/desktop/ms699870%
28v=vs.85%29.aspx
Message-Queuing Model
Combinations
13
Loosely-coupled communications using Queues.
Sender & receiver can execute completely independent of each other.
Source: A.S. Tanenbaum & M.V. Steen, Distributed Systems: Principles and Paradigms
Message-Queuing Interface
 Basic interface to a queue in a message-
queuing system
14
Primitive Meaning
Put Append a message to a specified queue
Get Block until the specified queue is nonempty, & remove first
message
Poll Check a specified queue for messages, & remove first
message. Never block
Notify Install a handler to be called when a message is put into
specified queue
Architecture of a Typical Message-
Queuing System With Routers
15
Source: http://csis.pace.edu/~marchese/SE765/L7/L7.htm
Message Queue Applications
 Amazon Simple Queue Service (Amazon SQS)
 Decouple components of a cloud application
 Can transmit any volume of data, at any level of
throughput, without losing messages or requiring
other services to be always available
16
Source: http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/as-using-sqs-queue.html
Message Queue Applications (Cont.)
 Java Message Service (JMS) queues
 Based on Java Enterprise Edition (JEE)
 Loosely coupled, reliable, & asynchronous
 Other applications
 E-mail
 Workflow & Groupware
 Batch processing
 Job queues
 Stream/complex-event processing
17
Pub/Sub Networks
 Publishers publish messages
 Usually to a topic
 Subscribers may express
interest for a subset of
messages
 Pub/Sub system makes sure
interested parties get
corresponding messages
 80-90% implementations are
topic based
 Content based is hard
18
Source: http://msdn.microsoft.com/en-
us/library/ff649664.aspx
19
Eventing in Pub/Sub
 Decouple
 Time – both parties need not be online same time
 Space – don’t know each other’s addresses
 Synchronization – don’t have to wait for each other
 Models
 Event producer  Event consumer
 Event producer  Broker  Event consumer
 Actually it’s Event producer  Event Bus  Notifier
 Event bus can be 1+ nodes
 Decoupling makes it is hard to debug
20
Pub/Sub Brokers
 RSS feeds
 Apache ActiveMQ, Qpid
 OGCE WS-Messenger
 For web services
 WSO2 Event Server
 Microsoft BizTalk Server
 Distributed brokers
 Narada Broker (www.naradabrokering.org)
 Whihdum (http://code.google.com/p/wihidum/)
21
Message Brokers
 Applications need to understand messages they
receive
 Options
 Standard message formats
 Not suitable as message-queuing applications typically
operate at a higher level of abstraction
 Convert messages using a Message Broker
 Convert incoming messages to a format that can be
understood by destination application
22
Message Brokers
23
Source: http://www.fi.muni.cz/~xkolar2/dp/html/index.html
Message Broker Architecture
24
Source: A.S. Tanenbaum & M.V. Steen, Distributed Systems: Principles and Paradigms
Message Bus
 A.k.a. Enterprise Service Bus (ESB)
 Tasks
 Monitor & control routing of message exchange between services
 Resolve contention between communicating service components
 Control deployment & versioning of services
 Marshal use of redundant services
25
Source: http://msdn.microsoft.com/en-us/library/ff647328.aspx
Complex Event Processing System
26
WSO2 Siddhi CEP Architecture
27
Source: S. Suhothayan et al., “Siddhi: A Second Look at Complex Event Processing Architectures”, Nov. 2011
Siddhi Pipeline Architecture
28
Source: S. Suhothayan et al., “Siddhi: A Second Look at Complex Event Processing Architectures”, Nov. 2011
Message-Passing Interface (MPI)
 Designed for communication among parallel
applications
 Primarily used in HPC systems with high-speed
interconnection networks
 Provides an interface with advanced features
such as different forms of buffering &
synchronization
 Provides hardware independence
 Supports many types/forms of communication
 Algorithm/application specific performance
optimization 29
MPI Operations
30
Source: http://www.broadinstitute.org/gatk/about/#high-performance
Source: http://mpitutorial.com/mpi-reduce-and-allreduce/
MPI_Allreduce
31
Global sum followed
by distribution of result
Source: Peter Pacheco, "An Introduction
to Parallel Programming"
Butterfly-Structured Global Sum
32
Source: Peter Pacheco, "An Introduction to Parallel Programming"
MPI Primitives
33
Primitive Meaning
MPI_bsend Append outgoing message to local send buffer.
MPI_send Send a message & wait until copied to local or remote
buffer.
MPI_ssend Send a message & wait until receipt starts.
MPI_sendrecv Send a message & wait for reply.
MPI_isend Pass reference to outgoing message, and continue.
MPI_issend Pass reference to outgoing message, & wait until receipt
starts.
MPI_recv Receive a message; block if there is none.
MPI_irecv Check if there is an incoming message, but do not block.
Stream Oriented Communication
 Continuous streams of data
 e.g., real media stream
 Modes
 Asynchronous – no time limit
 Synchronous – max time limit
 Isochronous – both max & lower limit
 Simple stream – One type of streams
 Complex stream – Many streams
 e.g., movie with video, 2 audio, & subtitles
 QoS – bit rate, delay, jitter, etc.
 Enforcing QoS is a main challenge 34
Streams (Cont.)
 Enforcing QOS
 Mark packets as high priority
 Use buffers to reduce jitter (play from buffer)
35Source: T. Banka et al., “An architecture and a programming interface for application-aware data
dissemination using overlay networks,” COMSWARE 2007
Streams (Cont.)
 Stream synchronization
 Read alternatively
 Control interface to control rates
 Distribution – merge at sender
36
Multicast Communication
 Network level – IP multicast
 Very efficient within LAN
 No global routing support
 Application level
 Main challenge is to setup a path
 Options
 Tree based
 Mesh based
 Can recover from failures
 Often used in parallel computing clusters
 Group communication
 Ordered reliable multicast 37
Tree-Push & Mesh-Pull
38
Source:
J. Liu et al., "Opportunities and challenges of peer-to-peer
internet video broadcast,” 2008.
X. Zhang et al., "CoolStreaming/DONet: a data-driven overlay
network for efficient live media streaming," INFOCOM 2005.
1 of 38

Recommended

Clock synchronization in distributed system by
Clock synchronization in distributed systemClock synchronization in distributed system
Clock synchronization in distributed systemSunita Sahu
28.8K views25 slides
Message passing in Distributed Computing Systems by
Message passing in Distributed Computing SystemsMessage passing in Distributed Computing Systems
Message passing in Distributed Computing SystemsAlagappa Govt Arts College, Karaikudi
11.9K views39 slides
Fault tolerance in distributed systems by
Fault tolerance in distributed systemsFault tolerance in distributed systems
Fault tolerance in distributed systemssumitjain2013
83K views21 slides
Communication primitives by
Communication primitivesCommunication primitives
Communication primitivesStudent
24.7K views18 slides
Agreement Protocols, distributed File Systems, Distributed Shared Memory by
Agreement Protocols, distributed File Systems, Distributed Shared MemoryAgreement Protocols, distributed File Systems, Distributed Shared Memory
Agreement Protocols, distributed File Systems, Distributed Shared MemorySHIKHA GAUTAM
25.4K views91 slides
Stream oriented communication by
Stream oriented communicationStream oriented communication
Stream oriented communicationShyama Bhuvanendran
8.1K views24 slides

More Related Content

What's hot

Resource management by
Resource managementResource management
Resource managementDr Sandeep Kumar Poonia
6.4K views68 slides
distributed shared memory by
 distributed shared memory distributed shared memory
distributed shared memoryAshish Kumar
100.7K views108 slides
Replication in Distributed Systems by
Replication in Distributed SystemsReplication in Distributed Systems
Replication in Distributed SystemsKavya Barnadhya Hazarika
17.5K views27 slides
Architecture of Mobile Computing by
Architecture of Mobile ComputingArchitecture of Mobile Computing
Architecture of Mobile ComputingJAINIK PATEL
84.8K views15 slides
Physical and Logical Clocks by
Physical and Logical ClocksPhysical and Logical Clocks
Physical and Logical ClocksDilum Bandara
9.6K views35 slides
Distributed System ppt by
Distributed System pptDistributed System ppt
Distributed System pptOECLIB Odisha Electronics Control Library
24.4K views37 slides

What's hot(20)

distributed shared memory by Ashish Kumar
 distributed shared memory distributed shared memory
distributed shared memory
Ashish Kumar100.7K views
Architecture of Mobile Computing by JAINIK PATEL
Architecture of Mobile ComputingArchitecture of Mobile Computing
Architecture of Mobile Computing
JAINIK PATEL84.8K views
Physical and Logical Clocks by Dilum Bandara
Physical and Logical ClocksPhysical and Logical Clocks
Physical and Logical Clocks
Dilum Bandara9.6K views
message passing by Ashish Kumar
 message passing message passing
message passing
Ashish Kumar23.7K views
Distributed shred memory architecture by Maulik Togadiya
Distributed shred memory architectureDistributed shred memory architecture
Distributed shred memory architecture
Maulik Togadiya13.6K views
Data link layer by Mukesh Chinta
Data link layer Data link layer
Data link layer
Mukesh Chinta62.2K views
Communications is distributed systems by SHATHAN
Communications is distributed systemsCommunications is distributed systems
Communications is distributed systems
SHATHAN25K views
Pgp pretty good privacy by Pawan Arya
Pgp pretty good privacyPgp pretty good privacy
Pgp pretty good privacy
Pawan Arya69.9K views
Lamport’s algorithm for mutual exclusion by Neelamani Samal
Lamport’s algorithm for mutual exclusionLamport’s algorithm for mutual exclusion
Lamport’s algorithm for mutual exclusion
Neelamani Samal19.5K views
2. Distributed Systems Hardware & Software concepts by Prajakta Rane
2. Distributed Systems Hardware & Software concepts2. Distributed Systems Hardware & Software concepts
2. Distributed Systems Hardware & Software concepts
Prajakta Rane4.9K views
Design issues for the layers by jayaprakash
Design issues for the layersDesign issues for the layers
Design issues for the layers
jayaprakash40.4K views
ELEMENTS OF TRANSPORT PROTOCOL by Shashank Rustagi
ELEMENTS OF TRANSPORT PROTOCOLELEMENTS OF TRANSPORT PROTOCOL
ELEMENTS OF TRANSPORT PROTOCOL
Shashank Rustagi46.6K views
Types of Load distributing algorithm in Distributed System by DHIVYADEVAKI
Types of Load distributing algorithm in Distributed SystemTypes of Load distributing algorithm in Distributed System
Types of Load distributing algorithm in Distributed System
DHIVYADEVAKI10.9K views

Similar to Message and Stream Oriented Communication

1 messagepassing-121015032028-phpapp01 by
1 messagepassing-121015032028-phpapp011 messagepassing-121015032028-phpapp01
1 messagepassing-121015032028-phpapp01Zaigham Abbas
243 views46 slides
Enterprise messaging with jms by
Enterprise messaging with jmsEnterprise messaging with jms
Enterprise messaging with jmsSridhar Reddy
1.4K views148 slides
On MQ Series & JMS by
On MQ Series & JMSOn MQ Series & JMS
On MQ Series & JMSAshokkumar T A
217 views58 slides
Inter Process Communication Presentation[1] by
Inter Process Communication Presentation[1]Inter Process Communication Presentation[1]
Inter Process Communication Presentation[1]Ravindra Raju Kolahalam
55.7K views18 slides
Message Oriented Middleware by
Message Oriented MiddlewareMessage Oriented Middleware
Message Oriented MiddlewareManuswath K.B
3K views68 slides
data communication by
data communicationdata communication
data communicationAbirami Thangavel
1K views44 slides

Similar to Message and Stream Oriented Communication(20)

1 messagepassing-121015032028-phpapp01 by Zaigham Abbas
1 messagepassing-121015032028-phpapp011 messagepassing-121015032028-phpapp01
1 messagepassing-121015032028-phpapp01
Zaigham Abbas243 views
Enterprise messaging with jms by Sridhar Reddy
Enterprise messaging with jmsEnterprise messaging with jms
Enterprise messaging with jms
Sridhar Reddy1.4K views
Message Oriented Middleware by Manuswath K.B
Message Oriented MiddlewareMessage Oriented Middleware
Message Oriented Middleware
Manuswath K.B3K views
Distributed System by Pratik Tambekar by Pratik Tambekar
Distributed System by Pratik TambekarDistributed System by Pratik Tambekar
Distributed System by Pratik Tambekar
Pratik Tambekar79 views
Cs556 section3 by farshad33
Cs556 section3Cs556 section3
Cs556 section3
farshad33432 views
[@NaukriEngineering] Messaging Queues by Naukri.com
[@NaukriEngineering] Messaging Queues[@NaukriEngineering] Messaging Queues
[@NaukriEngineering] Messaging Queues
Naukri.com2.4K views
Websphere MQ admin guide by Ram Babu
Websphere MQ admin guideWebsphere MQ admin guide
Websphere MQ admin guide
Ram Babu9.9K views
MOM - Message Oriented Middleware by Peter R. Egli
MOM - Message Oriented MiddlewareMOM - Message Oriented Middleware
MOM - Message Oriented Middleware
Peter R. Egli29.4K views
AndroidThing (Internet of things) by Mayur Solanki
AndroidThing (Internet of things)AndroidThing (Internet of things)
AndroidThing (Internet of things)
Mayur Solanki83 views
CHP-4.pptx by FamiDan
CHP-4.pptxCHP-4.pptx
CHP-4.pptx
FamiDan19 views
WSO2 Product Release Webinar Introducing the WSO2 Message Broker by WSO2
WSO2 Product Release Webinar   Introducing the WSO2 Message BrokerWSO2 Product Release Webinar   Introducing the WSO2 Message Broker
WSO2 Product Release Webinar Introducing the WSO2 Message Broker
WSO22K views

More from Dilum Bandara

Modeling Multi-Layer Access Control Policies of a Hyperledger-Fabric-Based Ag... by
Modeling Multi-Layer Access Control Policies of a Hyperledger-Fabric-Based Ag...Modeling Multi-Layer Access Control Policies of a Hyperledger-Fabric-Based Ag...
Modeling Multi-Layer Access Control Policies of a Hyperledger-Fabric-Based Ag...Dilum Bandara
230 views19 slides
A Decision Model for Choosing Patterns in Blockchain-based Applications by
A Decision Model for Choosing Patterns in Blockchain-based ApplicationsA Decision Model for Choosing Patterns in Blockchain-based Applications
A Decision Model for Choosing Patterns in Blockchain-based ApplicationsDilum Bandara
210 views16 slides
Smart Contract Testing by
Smart Contract TestingSmart Contract Testing
Smart Contract TestingDilum Bandara
363 views19 slides
Smart Contract Security Testing by
Smart Contract Security TestingSmart Contract Security Testing
Smart Contract Security TestingDilum Bandara
672 views21 slides
What's not a cloud by
What's not a cloudWhat's not a cloud
What's not a cloudDilum Bandara
516 views7 slides
Blockchain - A Catalyst for Solving Age-old Distributed Systems Problems by
Blockchain - A Catalyst for Solving Age-old Distributed Systems ProblemsBlockchain - A Catalyst for Solving Age-old Distributed Systems Problems
Blockchain - A Catalyst for Solving Age-old Distributed Systems ProblemsDilum Bandara
224 views18 slides

More from Dilum Bandara(20)

Modeling Multi-Layer Access Control Policies of a Hyperledger-Fabric-Based Ag... by Dilum Bandara
Modeling Multi-Layer Access Control Policies of a Hyperledger-Fabric-Based Ag...Modeling Multi-Layer Access Control Policies of a Hyperledger-Fabric-Based Ag...
Modeling Multi-Layer Access Control Policies of a Hyperledger-Fabric-Based Ag...
Dilum Bandara230 views
A Decision Model for Choosing Patterns in Blockchain-based Applications by Dilum Bandara
A Decision Model for Choosing Patterns in Blockchain-based ApplicationsA Decision Model for Choosing Patterns in Blockchain-based Applications
A Decision Model for Choosing Patterns in Blockchain-based Applications
Dilum Bandara210 views
Smart Contract Security Testing by Dilum Bandara
Smart Contract Security TestingSmart Contract Security Testing
Smart Contract Security Testing
Dilum Bandara672 views
Blockchain - A Catalyst for Solving Age-old Distributed Systems Problems by Dilum Bandara
Blockchain - A Catalyst for Solving Age-old Distributed Systems ProblemsBlockchain - A Catalyst for Solving Age-old Distributed Systems Problems
Blockchain - A Catalyst for Solving Age-old Distributed Systems Problems
Dilum Bandara224 views
Protocols for Fast Delivery of Large Data Volumes by Dilum Bandara
Protocols for Fast Delivery of Large Data VolumesProtocols for Fast Delivery of Large Data Volumes
Protocols for Fast Delivery of Large Data Volumes
Dilum Bandara208 views
Content-Centric Networking (CCN) by Dilum Bandara
Content-Centric Networking (CCN)Content-Centric Networking (CCN)
Content-Centric Networking (CCN)
Dilum Bandara977 views
Internet Architecture and Design Philosophy by Dilum Bandara
Internet Architecture and Design PhilosophyInternet Architecture and Design Philosophy
Internet Architecture and Design Philosophy
Dilum Bandara904 views
Transactions and Concurrency Control by Dilum Bandara
Transactions and Concurrency ControlTransactions and Concurrency Control
Transactions and Concurrency Control
Dilum Bandara4.2K views
Content Delivery Networks (CDN) by Dilum Bandara
Content Delivery Networks (CDN)Content Delivery Networks (CDN)
Content Delivery Networks (CDN)
Dilum Bandara3.1K views
CAP Theorem and Split Brain Syndrome by Dilum Bandara
CAP Theorem and Split Brain SyndromeCAP Theorem and Split Brain Syndrome
CAP Theorem and Split Brain Syndrome
Dilum Bandara1.1K views
Communication in Distributed Systems by Dilum Bandara
Communication in Distributed SystemsCommunication in Distributed Systems
Communication in Distributed Systems
Dilum Bandara933 views
02 - Topologies of Distributed Systems by Dilum Bandara
02 - Topologies of Distributed Systems02 - Topologies of Distributed Systems
02 - Topologies of Distributed Systems
Dilum Bandara3.1K views
01 - Introduction to Distributed Systems by Dilum Bandara
01 - Introduction to Distributed Systems01 - Introduction to Distributed Systems
01 - Introduction to Distributed Systems
Dilum Bandara1.2K views
Use of Technology in Toll Collection & Management by Dilum Bandara
Use of Technology in Toll Collection & ManagementUse of Technology in Toll Collection & Management
Use of Technology in Toll Collection & Management
Dilum Bandara578 views
Big data, Security, or Privacy in IoT: Choice is Yours by Dilum Bandara
Big data, Security, or Privacy in IoT: Choice is YoursBig data, Security, or Privacy in IoT: Choice is Yours
Big data, Security, or Privacy in IoT: Choice is Yours
Dilum Bandara277 views
OWASP Top 10 2017 - New Vulnerabilities by Dilum Bandara
OWASP Top 10 2017 - New VulnerabilitiesOWASP Top 10 2017 - New Vulnerabilities
OWASP Top 10 2017 - New Vulnerabilities
Dilum Bandara243 views

Recently uploaded

Unlocking Research Visibility.pdf by
Unlocking Research Visibility.pdfUnlocking Research Visibility.pdf
Unlocking Research Visibility.pdfKhatirNaima
11 views19 slides
Design_Discover_Develop_Campaign.pptx by
Design_Discover_Develop_Campaign.pptxDesign_Discover_Develop_Campaign.pptx
Design_Discover_Develop_Campaign.pptxShivanshSeth6
55 views20 slides
2023Dec ASU Wang NETR Group Research Focus and Facility Overview.pptx by
2023Dec ASU Wang NETR Group Research Focus and Facility Overview.pptx2023Dec ASU Wang NETR Group Research Focus and Facility Overview.pptx
2023Dec ASU Wang NETR Group Research Focus and Facility Overview.pptxlwang78
188 views19 slides
sam_software_eng_cv.pdf by
sam_software_eng_cv.pdfsam_software_eng_cv.pdf
sam_software_eng_cv.pdfsammyigbinovia
11 views5 slides
ASSIGNMENTS ON FUZZY LOGIC IN TRAFFIC FLOW.pdf by
ASSIGNMENTS ON FUZZY LOGIC IN TRAFFIC FLOW.pdfASSIGNMENTS ON FUZZY LOGIC IN TRAFFIC FLOW.pdf
ASSIGNMENTS ON FUZZY LOGIC IN TRAFFIC FLOW.pdfAlhamduKure
10 views11 slides
Integrating Sustainable Development Goals (SDGs) in School Education by
Integrating Sustainable Development Goals (SDGs) in School EducationIntegrating Sustainable Development Goals (SDGs) in School Education
Integrating Sustainable Development Goals (SDGs) in School EducationSheetalTank1
11 views29 slides

Recently uploaded(20)

Unlocking Research Visibility.pdf by KhatirNaima
Unlocking Research Visibility.pdfUnlocking Research Visibility.pdf
Unlocking Research Visibility.pdf
KhatirNaima11 views
Design_Discover_Develop_Campaign.pptx by ShivanshSeth6
Design_Discover_Develop_Campaign.pptxDesign_Discover_Develop_Campaign.pptx
Design_Discover_Develop_Campaign.pptx
ShivanshSeth655 views
2023Dec ASU Wang NETR Group Research Focus and Facility Overview.pptx by lwang78
2023Dec ASU Wang NETR Group Research Focus and Facility Overview.pptx2023Dec ASU Wang NETR Group Research Focus and Facility Overview.pptx
2023Dec ASU Wang NETR Group Research Focus and Facility Overview.pptx
lwang78188 views
ASSIGNMENTS ON FUZZY LOGIC IN TRAFFIC FLOW.pdf by AlhamduKure
ASSIGNMENTS ON FUZZY LOGIC IN TRAFFIC FLOW.pdfASSIGNMENTS ON FUZZY LOGIC IN TRAFFIC FLOW.pdf
ASSIGNMENTS ON FUZZY LOGIC IN TRAFFIC FLOW.pdf
AlhamduKure10 views
Integrating Sustainable Development Goals (SDGs) in School Education by SheetalTank1
Integrating Sustainable Development Goals (SDGs) in School EducationIntegrating Sustainable Development Goals (SDGs) in School Education
Integrating Sustainable Development Goals (SDGs) in School Education
SheetalTank111 views
MongoDB.pdf by ArthyR3
MongoDB.pdfMongoDB.pdf
MongoDB.pdf
ArthyR351 views
Design of Structures and Foundations for Vibrating Machines, Arya-ONeill-Pinc... by csegroupvn
Design of Structures and Foundations for Vibrating Machines, Arya-ONeill-Pinc...Design of Structures and Foundations for Vibrating Machines, Arya-ONeill-Pinc...
Design of Structures and Foundations for Vibrating Machines, Arya-ONeill-Pinc...
csegroupvn13 views
REACTJS.pdf by ArthyR3
REACTJS.pdfREACTJS.pdf
REACTJS.pdf
ArthyR337 views

Message and Stream Oriented Communication

  • 1. Message & Stream Oriented Communication CS4262 Distributed Systems Dilum Bandara Dilum.Bandara@uom.lk Some slides extracted from Dr. Srinath Perera & Dr. Rajkumar Buyya’s Presentation Deck
  • 2. Outline  Message oriented communication  Event queues  Pub/sub networks  MPI  Stream-based communication  Multicast communication 2
  • 3. Definitions – Persistent vs. Transient Communication  Persistent communication  Message submitted for transmission is stored by communication system for as long as it takes to deliver it to receiver  e.g., e-mail, SMS  Not necessary for sender to continue execution after submitting a message  Not necessary for receiver to be executing at the time message submission  Transient communication  Message is stored by communication system only as long as sending & receiving applications are executing  e.g., transport-level communication services (store-and-forward router)  Receiver needs to be there when a message is received 3
  • 4. Definitions – Asynchronous vs. Synchronous Communication  Asynchronous communication  Sender continues immediately after it has submitted its message for transmission  Message may be stored, in a local buffer at sending host or at an intermediate communication server  Synchronous communication  Sender is blocked until its message is stored in a local buffer at receiving host or actually delivered to receiver  Strongest form – Sender blocked until receiver has processed message 4
  • 5. Types of Communication 5 a) Persistent asynchronous communication (e.g., e-mail) b) Persistent synchronous communication Source: A.S. Tanenbaum & M.V. Steen, Distributed Systems: Principles and Paradigms
  • 6. Types of Communication (Cont.) 6 c) Transient asynchronous communication (e.g., UDP) d) Receipt-based transient synchronous communication Source: A.S. Tanenbaum & M.V. Steen, Distributed Systems: Principles and Paradigms
  • 7. Types of Communication (Cont.) 7 e) Delivery-based transient synchronous communication f) Response-based transient synchronous communication Source: A.S. Tanenbaum & M.V. Steen, Distributed Systems: Principles and Paradigms
  • 8. Types of Communication (Cont.) 1. Persistent, asynchronous communication  Messages are persistently stored in local host buffer, or at an intermediate communication server  e.g., e-mail 2. Persistent, synchronous communication  Messages can be persistently stored only at receiving host  Weaker form of synchronous communication  It isn’t necessary for receiving application to be executing 8
  • 9. Types of Communication (Cont.) 3. Transient, asynchronous communication  Messages is temporarily stored in a local buffer & sender immediately continues  e.g., UDP, RPC fire & forget 4. Transient, synchronous communication I. Weakest form  Receipt-based, transient, synchronous communication  Sender is blocked until message is stored in a local buffer of receiving host  e.g., Asynchronous RPC delivery part (send with Ack) 9
  • 10. Types of Communication (Cont.) II. Weaker form  Delivery-based, transient, synchronous communication  e.g., Asynchronous RPC delivery part (Send with Ack) III. Strongest form  Response-based, transient, synchronous communication  e.g., RPC & RMI 10
  • 11. Message-Oriented Communication  Message-oriented transient communication  Transport-level sockets  Message-Passing Interface (MPI)  Message transfer latency  milliseconds to seconds  Message-oriented persistent communication  Message-queuing systems or Message-Oriented Middleware (MOM)  Provide intermediate-term storage capacity for messages  Doesn’t requiring either sender or receiver to be active during message transmission  Message transfer latency  seconds to minutes 11
  • 12. Message-Queuing Model  Applications communicate by inserting messages into a series of queues  Loosely-coupled communication  Sender is given guarantee that its message will eventually be inserted in recipient’s queue  No guarantee on timing, or message will actually be read 12 Source: http://msdn.microsoft.com/en- us/library/windows/desktop/ms699870% 28v=vs.85%29.aspx
  • 13. Message-Queuing Model Combinations 13 Loosely-coupled communications using Queues. Sender & receiver can execute completely independent of each other. Source: A.S. Tanenbaum & M.V. Steen, Distributed Systems: Principles and Paradigms
  • 14. Message-Queuing Interface  Basic interface to a queue in a message- queuing system 14 Primitive Meaning Put Append a message to a specified queue Get Block until the specified queue is nonempty, & remove first message Poll Check a specified queue for messages, & remove first message. Never block Notify Install a handler to be called when a message is put into specified queue
  • 15. Architecture of a Typical Message- Queuing System With Routers 15 Source: http://csis.pace.edu/~marchese/SE765/L7/L7.htm
  • 16. Message Queue Applications  Amazon Simple Queue Service (Amazon SQS)  Decouple components of a cloud application  Can transmit any volume of data, at any level of throughput, without losing messages or requiring other services to be always available 16 Source: http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/as-using-sqs-queue.html
  • 17. Message Queue Applications (Cont.)  Java Message Service (JMS) queues  Based on Java Enterprise Edition (JEE)  Loosely coupled, reliable, & asynchronous  Other applications  E-mail  Workflow & Groupware  Batch processing  Job queues  Stream/complex-event processing 17
  • 18. Pub/Sub Networks  Publishers publish messages  Usually to a topic  Subscribers may express interest for a subset of messages  Pub/Sub system makes sure interested parties get corresponding messages  80-90% implementations are topic based  Content based is hard 18 Source: http://msdn.microsoft.com/en- us/library/ff649664.aspx
  • 19. 19
  • 20. Eventing in Pub/Sub  Decouple  Time – both parties need not be online same time  Space – don’t know each other’s addresses  Synchronization – don’t have to wait for each other  Models  Event producer  Event consumer  Event producer  Broker  Event consumer  Actually it’s Event producer  Event Bus  Notifier  Event bus can be 1+ nodes  Decoupling makes it is hard to debug 20
  • 21. Pub/Sub Brokers  RSS feeds  Apache ActiveMQ, Qpid  OGCE WS-Messenger  For web services  WSO2 Event Server  Microsoft BizTalk Server  Distributed brokers  Narada Broker (www.naradabrokering.org)  Whihdum (http://code.google.com/p/wihidum/) 21
  • 22. Message Brokers  Applications need to understand messages they receive  Options  Standard message formats  Not suitable as message-queuing applications typically operate at a higher level of abstraction  Convert messages using a Message Broker  Convert incoming messages to a format that can be understood by destination application 22
  • 24. Message Broker Architecture 24 Source: A.S. Tanenbaum & M.V. Steen, Distributed Systems: Principles and Paradigms
  • 25. Message Bus  A.k.a. Enterprise Service Bus (ESB)  Tasks  Monitor & control routing of message exchange between services  Resolve contention between communicating service components  Control deployment & versioning of services  Marshal use of redundant services 25 Source: http://msdn.microsoft.com/en-us/library/ff647328.aspx
  • 27. WSO2 Siddhi CEP Architecture 27 Source: S. Suhothayan et al., “Siddhi: A Second Look at Complex Event Processing Architectures”, Nov. 2011
  • 28. Siddhi Pipeline Architecture 28 Source: S. Suhothayan et al., “Siddhi: A Second Look at Complex Event Processing Architectures”, Nov. 2011
  • 29. Message-Passing Interface (MPI)  Designed for communication among parallel applications  Primarily used in HPC systems with high-speed interconnection networks  Provides an interface with advanced features such as different forms of buffering & synchronization  Provides hardware independence  Supports many types/forms of communication  Algorithm/application specific performance optimization 29
  • 31. MPI_Allreduce 31 Global sum followed by distribution of result Source: Peter Pacheco, "An Introduction to Parallel Programming"
  • 32. Butterfly-Structured Global Sum 32 Source: Peter Pacheco, "An Introduction to Parallel Programming"
  • 33. MPI Primitives 33 Primitive Meaning MPI_bsend Append outgoing message to local send buffer. MPI_send Send a message & wait until copied to local or remote buffer. MPI_ssend Send a message & wait until receipt starts. MPI_sendrecv Send a message & wait for reply. MPI_isend Pass reference to outgoing message, and continue. MPI_issend Pass reference to outgoing message, & wait until receipt starts. MPI_recv Receive a message; block if there is none. MPI_irecv Check if there is an incoming message, but do not block.
  • 34. Stream Oriented Communication  Continuous streams of data  e.g., real media stream  Modes  Asynchronous – no time limit  Synchronous – max time limit  Isochronous – both max & lower limit  Simple stream – One type of streams  Complex stream – Many streams  e.g., movie with video, 2 audio, & subtitles  QoS – bit rate, delay, jitter, etc.  Enforcing QoS is a main challenge 34
  • 35. Streams (Cont.)  Enforcing QOS  Mark packets as high priority  Use buffers to reduce jitter (play from buffer) 35Source: T. Banka et al., “An architecture and a programming interface for application-aware data dissemination using overlay networks,” COMSWARE 2007
  • 36. Streams (Cont.)  Stream synchronization  Read alternatively  Control interface to control rates  Distribution – merge at sender 36
  • 37. Multicast Communication  Network level – IP multicast  Very efficient within LAN  No global routing support  Application level  Main challenge is to setup a path  Options  Tree based  Mesh based  Can recover from failures  Often used in parallel computing clusters  Group communication  Ordered reliable multicast 37
  • 38. Tree-Push & Mesh-Pull 38 Source: J. Liu et al., "Opportunities and challenges of peer-to-peer internet video broadcast,” 2008. X. Zhang et al., "CoolStreaming/DONet: a data-driven overlay network for efficient live media streaming," INFOCOM 2005.

Editor's Notes

  1. RSS - Really Simple Syndication ES - Event Server
  2. LDM - Local Data Manager