Upload
ahmad-imair
View
219
Download
0
Embed Size (px)
Citation preview
8/9/2019 02 Witting Msg Stream
1/20
1
Message - orientedvs.
Stream - orientedCommunication
Witting Jrgen [email protected]
Seminar Applied Computer Science Problems
2
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
Content
Message - oriented vs. Stream - oriented communication
8/9/2019 02 Witting Msg Stream
2/20
2
Message - orientedCommunication
vs.Stream - orientedCommunication
Outline
4
Message - oriented communication
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
Why messaging?
8/9/2019 02 Witting Msg Stream
3/20
3
5
Message - oriented communication
General organization of a communication system
6
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
8/9/2019 02 Witting Msg Stream
4/20
4
7
Message - oriented communication
Persistent vs. transient communication
persistent communication
a message is stored by the communication system as long as it takes todeliver it never lost or thrown away
transient communication
a message is stored by the communication system only as long as thesending and receiving application are executing
8
Message - oriented communication
Example - Persistent communication of letters
8/9/2019 02 Witting Msg Stream
5/20
5
9
Message - oriented communication
Forms of communication
(a) persistent asynchronous communication
(b) persistent synchronous communication
10
Message - oriented communication
Forms of communication
(c) transient asynchronous communication
(d) receipt-based transient synchronous communication
8/9/2019 02 Witting Msg Stream
6/20
6
11
Message - oriented communication
Forms of communication
(e) delivery-based transient synchronous communication
(f) response-based transient synchronous communication
12
Message - oriented communication
Examples
Message-oriented transient communication
Berkeley Sockets
Message Passing Interface (MPI)
Message-oriented persistent communication
Message Queuing Model
8/9/2019 02 Witting Msg Stream
7/20
7
13
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
14
Message - oriented transient communication
Berkeley Sockets - socket primitives for TCP/IP
Release the connectionClose
Receive some data over the connectionReceive
Send some data over the connectionSend
Actively attempt to establish a connectionConnect
Block caller until a connection request arrivesAccept
Announce willingness to accept connections. Byallocating enough memory
Listen
Attach a local address to a socketBind
Create a new communication endpointSocket
MeaningPrimitive
8/9/2019 02 Witting Msg Stream
8/20
8
15
Message - oriented transient communication
Berkeley Sockets - Connection-oriented communication pattern
16
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
8/9/2019 02 Witting Msg Stream
9/20
9
17
Message - oriented transient communication
Some of the most intuitive message-passing primitives of MPI
Check if there is an incoming message, but do not blockMPI_irecv
Receive a message; block if there are noneMPI_recv
Pass reference to outgoing message, and wait until receipt startsMPI_issend
Pass reference to outgoing message, and continueMPI_isend
Send a message and wait for replyMPI_sendrecv
Send a message and wait until receipt startsMPI_ssend
Send a message and wait until copied to local or remote bufferMPI_send
Append outgoing message to a local send bufferMPI_bsend
MeaningPrimitive
18
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
8/9/2019 02 Witting Msg Stream
10/20
10
19
Message - oriented persistent communication
Message Queing Model
Four combinations for loosely-coupled communications using queues
20
Message - oriented persistent communication
Basic interface to a queue in a message-queuing system
Install a handler to be called when a message is put into the specifiedqueue.
Notify
Check a specified queue for messages, and remove the first. Never block.Poll
Block until the specified queue is nonempty, and remove the first messageGet
Append a message to a specified queuePut
MeaningPrimitive
8/9/2019 02 Witting Msg Stream
11/20
11
21
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.
22
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
8/9/2019 02 Witting Msg Stream
12/20
12
23
Message - oriented persistent communication
Message Brokers
converts a message to the format of the destination application contains a database of conversion rules
Message - orientedCommunication
vs.Stream - oriented
Communication
Outline
8/9/2019 02 Witting Msg Stream
13/20
13
25
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)
26
Stream - oriented communication
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 tocorrectly interpreting what the data means(audio, video, animation, sensor data)
Support for Continuous Media
8/9/2019 02 Witting Msg Stream
14/20
14
27
Stream - oriented communication
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)
Data Stream - Transmission Modes
28
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
8/9/2019 02 Witting Msg Stream
15/20
15
29
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 andnetwork
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
30
Stream - oriented communication
Setting up a Stream
Once a data stream has been described, a distributed systems is in aposition to allocate resources to set up a stream that satisfies the QoS req.
RSVP (ReSource reserVation Protocol)
Application
RSVP process
Packet
Classifier
Packet
Scheduler
AdmissionControl
PolicyControl
data
Routing
process
RSVP process
Packet
Classifier
Packet
Scheduler
PolicyControl
RSVP
AdmissionControl
data data
Host Router
8/9/2019 02 Witting Msg Stream
16/20
16
31
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
32
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
8/9/2019 02 Witting Msg Stream
17/20
17
33
Message - oriented vs. stream - oriented communication
Summary
Message oriented communication
Message-oriented communication systems are mostly used for persistentasynchronous communication (E-Mail-System).
Stream oriented communication
Streams have a temporal relationship (sequence of representation) betweentwo successive messages.
In continuous data streams a maximum and minimum end-to-end delay isspecified for each message -> jitter.
Other non-functional requirements (bandwidth, transmission rate, ) can bedefined with QoS.
Extra Slides
Example: IBM WebSphere(IBM MQSeries)
Outline
8/9/2019 02 Witting Msg Stream
18/20
18
35
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 MCAthat checks the send queue for a message, wraps it, and sends it, or
respectively listening to a channel for incoming message, unwrappingit, and storing it in a queue
WebSphere uses unique addresses for naming
RPC is used for synchronous communication between Client and QM
36
Message - oriented persistent communication
Example: IBM WebSphere (IBM MQSeries)
8/9/2019 02 Witting Msg Stream
19/20
8/9/2019 02 Witting Msg Stream
20/20
39
Message - oriented persistent communication
Primitives available in IBM WebSphere
Get a message from a (local) queueMQget
Put a message into an opened queueMQput
Close a queueMQclose
Open a (possibly remote) queueMQopen
DescriptionPrimitive