Chapter 4: Communication* Message-Oriented Communication & Stream-Oriented Communication *Referred to slides by Manhyung Han at Kyung Hee University, Hitesh Ballani at Cornell University, and Mary Ellen Weisskopf at University of Alabama in Huntsville
31
Embed
Chapter 4: Communication* Message-Oriented Communication & Stream-Oriented Communication *Referred to slides by Manhyung Han at Kyung Hee University, Hitesh.
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Chapter 4: Communication*
Message-Oriented Communication
&
Stream-Oriented Communication
*Referred to slides by Manhyung Han at Kyung Hee University, Hitesh Ballani at Cornell University, and Mary Ellen Weisskopf at University of Alabama in Huntsville
Review
• In a distributed system, processes– run on different machines– exchange information through message passing
• Successful distributed systems depend on communication models that hide or simplify message passing
Middleware Communication Techniques
• Remote Procedure Call
• Message-Oriented Communication
• Stream-Oriented Communication
• Multicast Communication
Types of Communication
• Persistent versus transient
• Synchronous versus asynchronous
• Discrete versus streaming
Persistent versus TransientCommunication
• Persistent: messages are held by the middleware comm. service until they can be delivered (e.g., email)– Sender can terminate after executing send– Receiver will get message next time it runs
• Transient: messages exist only while the sender and receiver are running – Communication errors or inactive receiver cause the
message to be discarded– Transport-level communication is transient
• RPC?
Asynchronous v Synchronous Communication
• Asynchronous: (non-blocking) sender resumes execution as soon as the message is passed to the communication/middleware software
• Synchronous: sender is blocked until – The OS or middleware notifies acceptance of the message, or– The message has been delivered to the receiver, or– The receiver processes it & returns a response
Evaluation
• Fully synchronous primitives may slow processes down, but program behavior is easier to understand
• In multithreaded processes, blocking is not as big a problem because a special thread can be created to wait for messages
• Streaming: one-way communication; a “session” consists of multiple messages from the sender that are related either by send order (TCP streams), temporal proximity (multimedia streams), etc.
Message Oriented Communication
• RPC supports access transparency, but is not always appropriate
• Message-oriented communication is more flexible
Message Passing Interface (MPI)
• Designed for parallel applications using transient communication
• MPI is – a standardized and portable message-passing
system designed by a group of researchers from academia and industry
– used in many environments, e.g., clusters– platform independent
Message Primitives
• Asynchronous: e.g. MPI_bsend
• Synchronous: e.g. MPI_send, MPI_ssend, MPI_sendrecv:
MPI Apps versus C/S
• Processes in an MPI-based parallel system act more like peers (or peer slaves to a master processor)
• Communication may involve message exchange in multiple directions
• C/S communication is more structured
Message-Oriented Middleware (MOM) - Persistent
• Processes communicate through message queues– Queues are maintained by the message-queuing system– Sender appends to queue, receiver removes from queue– Neither the sender nor receiver needs to be on-line
when the message is transmitted
4.4 Stream-Oriented Communication
• RPC and message-oriented communication are based on the exchange of discrete messages– Timing might affect performance, but not correctness
• In stream-oriented communication the message content (multimedia streams) must be delivered at a certain rate, as well as correctly– e.g., music or video
• Media: means by which information is conveyed
• Types of media– Discrete media
• No temporal dependence between data items
• ex) text, still images, object code or executable files
– Continuous media• Temporal dependence between data items
• ex) Motion - series of images
Discrete and Continuous Media
Data Streams
• Data stream = sequence of data items• Can apply to discrete, as well as continuous
media– e.g. UNIX pipes or TCP/IP connections which
are both byte oriented (discrete) streams– Messages are related by send order
• Audio and video require continuous time-based data streams
Data Streams
• Asynchronous transmission mode: the order is important, and data is transmitted one after the other, no restriction to when data is to be delivered
• Synchronous transmission mode defines a maximum end-to-end delay for individual data packets
• Isochronous transmission mode has a maximum and minimum end-to-end delay requirement (jitter is bounded)– Not too slow, but not too fast either
Distributed System Support
• Data compression, particularly for video
• Quality of the transmission
• Synchronization
Figure. 2-36An example of multicasting a stream to several receivers
The Internet only provides best-effort services and has no guarantees on the QoS for multimedia data transmission.
The Internet only provides best-effort services and has no guarantees on the QoS for multimedia data transmission.
So, distributed system support is needed, for instance,
• Figure 4-28. The effect of packet loss in (a) non interleaved transmission and (b) interleaved transmission.
Stereo audio with CD quality (two sequences of 16 bit samples)Sampling rate 44.1 KHz -> synchronize 22.6 micro sec
Lip synchronization of audio and video streams
Video stream: NTSC standard of 30Hz (a frame every 33.33 ms), Audio stream: CD Quality soundSynchronized every 1470 sound samples
• Synchronization Mechanisms(1)– read&write data units of several simple streams
– adhere to specific timing and synchronization constraints
Figure. 2-40The principle of explicit synchronization on the data units
• For example, a movie composed of– A video stream of low-quality images of 320x240
pixels, i.e., 76,800 bytes video data units;– A audio stream: audio samples group into units of
11,760 bytes, each corresponding to 33 ms of audio;– If the input process can handle 2.5 MB/sec, lip
synchronization is achieved by alternating between reading an image and reading a block of audio samples every 33 ms.
• Synchronization Mechanisms(2)– Synchronization achieved by middleware according to application instructions, e.g., desired image display rate
Figure. 2-41The principle of synchronization as supported by high-level interfaces
Figure. 2-41The principle of synchronization as supported by high-level interfaces