Sunteți pe pagina 1din 20

Message - oriented

vs.
Stream - oriented
Communication

Seminar Applied Computer Science Problems


Witting Jürgen – csab2821@uibk.ac.at

Message - oriented vs. Stream - oriented communication

Content

Message – oriented communication


 persistent vs. transient, synchronous vs. asynchronous
 forms of communication
 examples

Stream – oriented communication


 discrete vs. continuous media
 asynchronous, synchronous, isochronous transmission mode
 QoS, setting up a stream, synchronization

1
Message - oriented
Communication
vs.
Stream - oriented
Communication

Outline

Message - oriented communication

Why messaging?

RPC and RMI - hide communication, access transparency, synchronous

 client asks a service and waits until it gets a reply


 server waits for requests, performs it and returns to waiting
 requires that the other party is up

In large distributed systems, all parties are not constantly running

 Messaging is the way

2
Message - oriented communication

General organization of a communication system

Message - oriented communication

Synchronous vs. asynchronous communication

 synchronous communication
the sender is blocked until the message is stored in a local buffer at the
receiving host or is delivered to the receiver

 asynchronous communication
the sender continues after it has submitted the message for transmission

3
Message - oriented communication

Persistent vs. transient communication

 persistent communication
a message is stored by the communication system as long as it takes to
deliver it – never lost or thrown away

 transient communication
a message is stored by the communication system only as long as the
sending and receiving application are executing

Message - oriented communication

Example - Persistent communication of letters

4
Message - oriented communication

Forms of communication

(a) persistent asynchronous communication


(b) persistent synchronous communication
9

Message - oriented communication

Forms of communication

(c) transient asynchronous communication


(d) receipt-based transient synchronous communication
10

5
Message - oriented communication

Forms of communication

(e) delivery-based transient synchronous communication


(f) response-based transient synchronous communication
11

Message - oriented communication

Examples

Message-oriented transient communication


 Berkeley Sockets
 Message Passing Interface (MPI)

Message-oriented persistent communication


 Message Queuing Model

12

6
Message - oriented transient communication

Berkeley Sockets

Socket: communication endpoint to write and read data

 interface to transport layer


 port number & IP number used to bind to a socket
 UNIX OSs are the first in providing sockets

Socket primitives for TCP/IP:


socked, bind, listen, accept, connect, send, receive, close

13

Message - oriented transient communication

Berkeley Sockets - socket primitives for TCP/IP

Primitive Meaning

Socket Create a new communication endpoint

Bind Attach a local address to a socket


Announce willingness to accept connections. By
Listen
allocating enough memory
Accept Block caller until a connection request arrives

Connect Actively attempt to establish a connection

Send Send some data over the connection

Receive Receive some data over the connection

Close Release the connection

14

7
Message - oriented transient communication

Berkeley Sockets - Connection-oriented communication pattern

15

Message - oriented transient communication

Message Passing Interface (MPI)

 designed for efficient parallel applications


 higher level interface for transient async & sync communication
 incurs minimal overhead
 communication in a group of processes (group_ID, process_ID)

Message passing primitives of MPI:


MPI_bsend, MPI_send, MPI_ssend, MPI_sendrecv, MPI_isend,
MPI_issend, MPI_recv, MPI_irecv

16

8
Message - oriented transient communication

Some of the most intuitive message-passing primitives of MPI

Primitive Meaning
MPI_bsend Append outgoing message to a local send buffer
MPI_send Send a message and wait until copied to local or remote buffer
MPI_ssend Send a message and wait until receipt starts
MPI_sendrecv Send a message and wait for reply
MPI_isend Pass reference to outgoing message, and continue
MPI_issend Pass reference to outgoing message, and wait until receipt starts
MPI_recv Receive a message; block if there are none
MPI_irecv Check if there is an incoming message, but do not block

17

Message - oriented persistent communication

Message Queuing Systems

 Message Oriented Middleware – MOM


 messages are forwarded over series communication servers
 provides queues to sender and receiver
 senders and receivers do not need to be active at the same time
 for non time critical transmission
 guarantee for delivering, no guarantee for the delivering moment
 queues are managed by queue managers

18

9
Message - oriented persistent communication

Message Queing Model

Four combinations for loosely-coupled communications using queues

19

Message - oriented persistent communication

Basic interface to a queue in a message-queuing system

Primitive Meaning

Put Append a message to a specified queue

Get Block until the specified queue is nonempty, and remove the first message

Poll 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
Notify
queue.

20

10
Message - oriented persistent communication

General architecture of a message-queuing system

Queues are managed by queue managers.


Static mapping is easier, dynamic mapping is more complex.

21

Message - oriented persistent communication

Message-Queuing System with routers

 Routers know about network, queue manager know the nearest router
 Only routers need to be updated when queues are added or removed

22

11
Message - oriented persistent communication

Message Brokers

 converts a message to the format of the destination application


 contains a database of conversion rules

23

Message - oriented
Communication
vs.
Stream - oriented
Communication

Outline

12
Stream - oriented communication

Communication as discussed so far:

- independent and complete units of information


- moment of receiving is not important for correctness

 Stream-oriented communication is used for audio, video, sensor data ...


-> moment of receiving and correct representation is essential!

 Streams are uni-directional

 Streams are virtual connections between source and sink

 Streams are simple or complex (e.g. sound and video)

25

Stream - oriented communication

Support for Continuous Media

So far focus on transmitting discrete data -> time independent data

 Discrete (representation) media

the temporal relationships between data items is not fundamental


(text, still images, exe - files,..)

Continuous (representation) media

the temporal relationships between data items is fundamental to


correctly interpreting what the data means
(audio, video, animation, sensor data)

26

13
Stream - oriented communication

Data Stream - Transmission Modes

The following timing requirements can be used:

 Asynchronous transmission mode:


no timing constraints - data items are transmitted one after the other
(discrete data streams - file)

 Synchronous transmission mode:


maximum end-to-end delay for each unit in a data stream (sensor data)

 Isochronous transmission mode:


- max and min end-to-end delay for each data unit -> bounded jitter
- interesting for distributed multimedia systems (audio, video)

27

Stream - oriented communication

Data Streams - Multicasting a stream to several receivers

Multiple sinks:
the data stream is multicasted (and filtered) to several receivers
Problem - different requirements with respect to the quality of the stream

28

14
Stream - oriented communication

Quality of Service

 Time-dependent and non-functional requirements are called QoS req.

 describes what is needed from the underlying distributed system and


network

 Specifying QoS requirements:


- flow specification (bandwidth, transmission rate, delays, …) -> complex
- stream classification (defaults for detailed flow specification)

Example: audio and video streams may be available between high,


medium or low specification

 difficult to map QoS parameters to resources

29

Stream - oriented communication

Setting up a Stream

Once a data stream has been described, a distributed systems is in a


position to allocate resources to set up a stream that satisfies the QoS req.

RSVP (ReSource reserVation Protocol)


Host Router

RSVP
RSVP process RSVP process

Application

Policy Routing Policy


Control process Control

data
Admission Admission
Control Control
Packet Packet Packet Packet
Classifier Scheduler Classifier Scheduler
data data

30

15
Stream - oriented communication

Stream Synchronization

Two types of synchronization:

 discrete and a continuous (slide show & audio)


 two continuous data streams (video & audio, stereo)

Synchronization of streams:

 based on transmission units


process simply executes read operations on simple substreams
 based on high-level middleware-interface
to control streams and devices by an application

-> the receiving side is responsible for synchronization


31

Stream - oriented communication

Stream Synchronization

Synchronization by multiplexing

 multiplexing the different simple streams into a single stream on the


sender side

-> MPEG streams


- several standards
- collection of algorithms for compressing
- multiplexed into a program stream
- receiving side demultiplexes the stream

32

16
Message - oriented vs. stream - oriented communication

Summary

 Message – oriented communication


Message-oriented communication systems are mostly used for persistent
asynchronous communication (E-Mail-System).

 Stream – oriented communication


Streams have a temporal relationship (sequence of representation) between
two successive messages.
In continuous data streams a maximum and minimum end-to-end delay is
specified for each message -> jitter.
Other non-functional requirements (bandwidth, transmission rate, …) can be
defined with QoS.

33

Extra Slides

Example: IBM WebSphere


(IBM MQSeries)

Outline

17
Message - oriented persistent communication

Example: IBM WebSphere (IBM MQSeries)

 The basic architecture of WebSphere consists of Message Queue

 Queues are managed by queue managers.

 Messages are passed through message channels.


They are uni-directional, reliable connections (TCP)

 At both ends of a message channel is a Message Channel Agent MCA


that checks the send queue for a message, wraps it, and sends it, or
respectively listening to a channel for incoming message, unwrapping
it, and storing it in a queue

 WebSphere uses unique addresses for naming

 RPC is used for synchronous communication between Client and QM


35

Message - oriented persistent communication

Example: IBM WebSphere (IBM MQSeries)

36

18
Message - oriented persistent communication

Properties of MCA in IBM WebSphere

Some attributes associated with message channel agents-MCA.


Sending and receiving MCAs must be compatible in terms of rules of
communication between them

Attribute Description

Transport type Determines the transport protocol to be used

FIFO delivery Indicates that messages are to be delivered in the order they are sent

Message length Maximum length of a single message


Setup retry
Specifies maximum number of retries to start up the remote MCA
count
Delivery retries Maximum times MCA will try to put received message into queue

37

Message - oriented persistent communication

Message Transfer in IBM WebSphere

 Nodes of the network have systemwide unique names


 Notes have routing tables and aliases
 Nodes have routing tables whose entries are of the form
(destQM,sendQ), where destQM is the name of the remote queue
manager and sendQ is the name of the local send queue, to whose
queue the message is appended.

38

19
Message - oriented persistent communication

Primitives available in IBM WebSphere

Primitive Description
MQopen Open a (possibly remote) queue
MQclose Close a queue
MQput Put a message into an opened queue
MQget Get a message from a (local) queue

39

20

S-ar putea să vă placă și