31
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

Chapter 4: Communication*

  • Upload
    mickey

  • View
    71

  • Download
    1

Embed Size (px)

DESCRIPTION

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. - PowerPoint PPT Presentation

Citation preview

Page 1: Chapter 4: Communication*

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

Page 2: Chapter 4: Communication*

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

Page 3: Chapter 4: Communication*

Middleware Communication Techniques

• Remote Procedure Call• Message-Oriented Communication• Stream-Oriented Communication• Multicast Communication

Page 4: Chapter 4: Communication*

Types of Communication

• Persistent versus transient• Synchronous versus asynchronous• Discrete versus streaming

Page 5: Chapter 4: Communication*

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?

Page 6: Chapter 4: Communication*

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

Page 7: Chapter 4: Communication*

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

Page 8: Chapter 4: Communication*

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.

Page 9: Chapter 4: Communication*

Message Oriented Communication

• RPC supports access transparency, but is not always appropriate

• Message-oriented communication is more flexible

Page 10: Chapter 4: Communication*

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

Page 11: Chapter 4: Communication*

Message Primitives

• Asynchronous: e.g. MPI_bsend

• Synchronous: e.g. MPI_send, MPI_ssend, MPI_sendrecv:

Page 12: Chapter 4: Communication*

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

Page 13: Chapter 4: Communication*

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

Page 14: Chapter 4: Communication*

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

Page 15: Chapter 4: Communication*

• 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

Page 16: Chapter 4: Communication*

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

Page 17: Chapter 4: Communication*

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

Page 18: Chapter 4: Communication*
Page 19: Chapter 4: Communication*
Page 20: Chapter 4: Communication*
Page 21: Chapter 4: Communication*

Distributed System Support

• Data compression, particularly for video• Quality of the transmission• Synchronization

Page 22: Chapter 4: Communication*

Figure. 2-36An example of multicasting a stream to several receivers

Page 23: Chapter 4: Communication*

The Internet only provides best-effort services and has no guarantees on the QoS for multimedia data transmission.

Page 24: Chapter 4: Communication*

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,

Page 25: Chapter 4: Communication*
Page 26: Chapter 4: Communication*

• Figure 4-28. The effect of packet loss in (a) non interleaved transmission and (b) interleaved transmission.

Page 27: Chapter 4: Communication*

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

Page 28: Chapter 4: Communication*

• 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

Page 29: Chapter 4: Communication*

• 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.

Page 30: Chapter 4: Communication*

• 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

Page 31: Chapter 4: Communication*

Figure. 2-41The principle of synchronization as supported by high-level interfaces