Distributed Systems Ch6 PDF
Document Details
Uploaded by EntertainingTrombone
2024
Tags
Summary
These notes cover indirect communication in distributed systems, focusing on various techniques such as group communication, publish-subscribe systems, message queues, and distributed shared memory. The document explains the concepts involved in each technique and their characteristics.
Full Transcript
Distributed Systems (2024-2025) – 2nd semester Ch6 Indirect communication Introduction In direct communication: sender and receivers exits in the same time and know of each other. Indirect communication :sender and receivers are uncoupled....
Distributed Systems (2024-2025) – 2nd semester Ch6 Indirect communication Introduction In direct communication: sender and receivers exits in the same time and know of each other. Indirect communication :sender and receivers are uncoupled. Sender → intermediary → Receiver ◦ Time uncoupling: a sender can send a message even if the receiver is sill not available. the message is stored and picked up at a later ◦ Space uncoupling: a sender can send a message but not know to whom it is sending nor if more than one, if anyone, will receive the message. Indirect communication techniques Group communication communication? Publish subscribe systems Indirect Message queues Distributed shared memory(DSM) Group communication Group communication offers a service whereby a message is sent to a group and then this message is delivered to all members of the group. Group communication Features: The group is well defined and managed. Ordered delivery of messages Fault tolerant, delivery guarantees Handles multiple senders Group communication Different Comm. Methods Point-to-Point Communication No one keeps track of who is listening. Unicast One-to-All Communication Abuse of Network Bandwidth, at the same Broadcast time. One-to-multiple Communication The sender is sending a message to a specific group, the system keeps track Multicast of who should receive the message. Nor order of messages when we have several senders. Group communication Closed and open groups ◦ A group is closed if only members of the group may multicast to it. ◦ A group is open if processes outside the group may send to it. Group communication Ordering of messages Reliability and ordering in multicast Integrity: The message received is the same as the one sent. No messages are delivered twice. Validity: Any outgoing message is eventually delivered. + Agreement If the message is delivered to one process, then it is delivered to all processes in the group. Group communication Basic multicast: Agreement? 2 1 3 crash X Agreement 4 Group communication Implementation issues Ordering of messages ◦ FIFO ordering: First-in-first-out (FIFO) ordering (or source ordering) if a process sends one message before another, it will be delivered in this order at all processes in the group. ◦ Causal ordering: if a message happens before another message in the distributed system this so-called causal relationship will be preserved in the delivery of the associated messages at all processes. if m → m’, all correct processes that deliver m’ will deliver m before m’. ◦ Total ordering: In total ordering, if a message is delivered before another message at one process, then the same order will be preserved at all processes. Group communication Implementation issues Ordering of messages p1 m1 p2 m2 p3 FIFO ordering p1 m1 p2 m2 p3 Causal ordering Group communication Implementation issues Group membership service Group address Four tasks: expansion ◦ Interface for group membership changes Group Leave ◦ Failure detector send ◦ Membership change Fail Group membership notification Multicast management ◦ Group address expansion Communication Join Group Group communication Group membership service Multicast is a weak case of a group membership service: Does not itself provide group members with information about current membership. multicast delivery is not coordinated with membership changes. Publish-subscribe systems A publish-subscribe system: is a system where publishers publish structured events and subscribers express interest through subscriptions. The task of the publish-subscribe system is to match subscriptions against published events and ensure the correct delivery of event notifications. Publish-subscribe systems Dealing room system information provider Publish-subscribe systems Characteristics of publish- subscribe systems Heterogeneity: ◦ Objects publish the types of events they offer, and that other objects subscribe to patterns of events and provide an interface for receiving and dealing with the resultant notifications. Asynchronicity: ◦ Notifications are sent asynchronously by event generating publishers to all the subscribers that have expressed an interest in them. Publish-subscribe systems Delivery guarantees ◦A variety of different delivery guarantees can be provided for notifications depend on: ◦ The application requirements. ◦ The failure model will relate to the one described for communication type. Publish-subscribe systems The programming model The programming model is based on a small set of operations. Subscribe (filter) ◦ Subscribers declare their interests in terms of subscriptions. Advertise & publish ◦ Publishers optionally declare the styles of events they will generate through advertisements. ◦ Publishers disseminate an event e through a published operation. Notify ◦ The events are delivered using a notify operation Unsubscribe ◦ Subscribers can later revoke this interest through a corresponding unsubscribe operation. Publish-subscribe systems The programming model Publishers Subscribers publish Publish-subscribe system Publish-subscribe systems Subscription (filter) model ◦ Channel-based approaches ◦ Topic-based approaches ◦ Content-based approaches ◦ Type-based approaches Message queues (MQ) Message queues ◦ The sender places the message into a queue, and it is then removed by a single process. ◦ Sender and receiver have to know the identity of the queue. ◦ The middleware (queue) should be always active. 2. Get message from the 1. Put message into the queue always active queue Sender MQ Receiver Message queues The programming model ◦ Producer processes can send messages to a specific queue. ◦ Then consumer processes can receive messages from this queue. ◦ Three styles of receive: Blocking receive, which will block until an appropriate message is available. Non-blocking receive (a polling operation), which will check the status of the queue and return a message if available, or a not available indication otherwise. Notify operation, which will issue an event notification when a message is available in the associated queue. Message queues The programming model Message queues Reliable delivery ◦Messages are persistent, that is, message queues will store the messages indefinitely (until they are consumed). ◦Integrity: The message received is identical to the one sent. No messages are delivered twice. ◦Validity, any message sent is eventually received. Shared memory approaches ◦Distributed shared memory (DSM): is an abstraction used for sharing data between computers that do not share physical memory. ◦It is as though the processes access a single shared memory, but in fact the physical memory is distributed. ◦Processes access DSM by reading and updates to what appears to be ordinary memory. Shared memory approaches Shared Virtual Memory Read/Write Read/Write Read/Write Shared Virtual Memory Summary of indirect communication styles Groups Publish- Message DSM subscribe queues systems Space Yes Yes Yes Yes uncoupled Time- Possible Possible Yes Yes uncoupled Communication 1-to-many 1-to-many 1-to-1 1-to-many pattern Scalability Limited Possible Possible Limited