Download presentation
Presentation is loading. Please wait.
1
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
2
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
3
Middleware Communication Techniques
Remote Procedure Call Message-Oriented Communication Stream-Oriented Communication Multicast Communication
4
Types of Communication
Persistent versus transient Synchronous versus asynchronous Discrete versus streaming
5
Persistent versus Transient Communication
Persistent: messages are held by the middleware comm. service until they can be delivered (e.g., ) 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? If the router can’t forward the message it will drop it.
6
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
7
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
8
Discrete versus Streaming Communication
Discrete: communicating parties exchange discrete 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.
9
Message Oriented Communication
RPC supports access transparency, but is not always appropriate Message-oriented communication is more flexible RPC is usually synchronous, and is transient.
10
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
11
Message Primitives Asynchronous: e.g. MPI_bsend
Synchronous: e.g. MPI_send, MPI_ssend, MPI_sendrecv:
12
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
13
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
14
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
15
Discrete and Continuous Media
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
16
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
17
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
21
Distributed System Support
Data compression, particularly for video Quality of the transmission Synchronization
22
An example of multicasting a stream to several receivers
Filter to reduce the data rate of the media content Figure. 2-36 An example of multicasting a stream to several receivers
23
The Internet only provides best-effort services and has no guarantees on the QoS for multimedia data transmission.
24
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,
26
Figure The effect of packet loss in (a) non interleaved transmission and (b) interleaved transmission.
27
Lip synchronization of audio and video streams
Stereo audio with CD quality (two sequences of 16 bit samples) Sampling rate 44.1 KHz -> synchronize 22.6 micro sec NTSC: short for National Television System Committee NTSC is the video system or standard used in North America and most of South America. In NTSC, 30 frames are transmitted each second. Each frame is made up of 525 individual scan lines. Lip synchronization of audio and video streams Video stream: NTSC standard of 30Hz (a frame every ms), Audio stream: CD Quality sound Synchronized every 1470 sound samples
28
Synchronization Mechanisms(1)
Figure. 2-40 The principle of explicit synchronization on the data units Synchronization Mechanisms(1) read&write data units of several simple streams adhere to specific timing and synchronization constraints
29
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.
30
Synchronization Mechanisms(2)
Figure. 2-41 The principle of synchronization as supported by high-level interfaces Synchronization Mechanisms(2) Synchronization achieved by middleware according to application instructions, e.g., desired image display rate
31
The principle of synchronization as supported by high-level interfaces
Figure. 2-41 The principle of synchronization as supported by high-level interfaces MPEG: moving picture expert group MPEG is a standard for lossy compression of video and audio. MPEG transport stream (MPEG-TS, MTS or TS) is a standard format for transmission and storage of audio, video,
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.