Download presentation
Presentation is loading. Please wait.
Published byRegina Summers Modified over 8 years ago
1
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved. 0-13-239227-5 1 DISTRIBUTED SYSTEMS Principles and Paradigms Second Edition ANDREW S. TANENBAUM MAARTEN VAN STEEN Chapter 13 Distributed Coordination-Based Systems
2
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved. 0-13-239227-5 2 Introduction To Coordination Models Figure 13-1. A taxonomy of coordination models (adapted from Cabri et al., 2000).
3
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved. 0-13-239227-5 3 Direct Coordination The referential coupling generally appears in the form of explicit referencing in communication A process can communicate only if it knows the name or identifier of the other processes it want to exchange information with
4
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved. 0-13-239227-5 4 Mailbox Coordination In this case, there is no need for two communication take place Communication takes place by putting messages in a (possibly shared) mailbox Persistent message-oriented communication Necessary to explicitly address the mailbox that hold the messages that are to be exchanged
5
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved. 0-13-239227-5 5 Meeting Oriented The referential coupling generally appears in the form of explicit referencing in communication When a process wants to coordinate its activities with other processes, it cannot directly refer to another process There is a concept of a meeting in which processes temporarily group together to coordinate their activities
6
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved. 0-13-239227-5 6 Generative Communication The key idea in generative communication is that a collection of independent processes make use of a shared persistent dataspace of tuples Tuples are tagged data records consisting of a number typed fields Processes can put any type of record into the shared dataspace
7
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved. 0-13-239227-5 7 Overall Approach Figure 13-2. The principle of exchanging data items between publishers and subscribers.
8
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved. 0-13-239227-5 8 Overall Approach The key idea in generative communication is that a collection of independent processes make use of a shared persistent dataspace of tuples Tuples are tagged data records consisting of a number typed fields Processes can put any type of record into the shared dataspace
9
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved. 0-13-239227-5 9 Example: Jini and JavaSpaces Figure 13-3. The general organization of a JavaSpace in Jini.
10
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved. 0-13-239227-5 10 Example: Jini and JavaSpaces class public Tuple implements Entry { public Integer id, value; public Tuple(Integer id, Integer value) { this.id = id; this.value = value; } Then a template declared as Tuple template = new Tuple (null, new Integer(42)); will match the tuple Tuple item = new Tuple (“MyName”, new Integer(42));
11
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved. 0-13-239227-5 11 Example: TIB/Rendezvous Figure 13-4. The principle of a publish/subscribe system as implemented in TIB/Rendezvous. messaeg string : news.comp.os.books. template string : news.comp.*.books.
12
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved. 0-13-239227-5 12 A Gossip-Based Publish/Subscribe System A subscription s takes the form of a tuple of (attribute, value/range) pairs, such as s = Assume that every node i enters only one subscription s i S = ∪ S i (S m ∩S i ≠Ø) = >(S m S i ) In that case, when a data item is published, the system need merely find the S m to which that item belongs, form which point it forward the item to the associated node
13
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved. 0-13-239227-5 13 Example: A Gossip-Based Publish/Subscribe System Figure 13-5. Grouping nodes for supporting range queries in a peer-to-peer publish/subscribe system.
14
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved. 0-13-239227-5 14 Example: A Gossip-Based Publish/Subscribe System Each node maintains a list of references to other neighbors (a partial view) which it periodically exchanges with one of its neighbors If node i exchanges information with node j Select the one with the lowest identifier i 1 > j The next one to be selected is i 2 > i 1, i 2 contains elements not yet covered by node i 1 The process continues until all nodes that have an overlapping interest with node i have been inspected, leading to an ordered list i 1 < i 2 < … < i n Note that a node i k is in this list. If it covers region that i and j not yet jointly cover by nodes with a lower identifier than it, it is the first node that node j should forward a data to it
15
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved. 0-13-239227-5 15 Mobility and Coordination Assumed that there is a fixed basic infrastructure with access points for mobile nodes Under this assumption, how to ensure that published messages are not delivered more than once to a subscriber Keep track of the messages they have already received and simply discard duplicates Keep track of which messages have been sent to which subscribers
16
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved. 0-13-239227-5 16 Example: Lime Figure 13-6. Transient sharing of local dataspaces in Lime.
17
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved. 0-13-239227-5 17 Example: Lime When a process P executes a write operation, the associated tuple is stored in the process’s local dataspace. In practical, it stays until there is a matching take operation Read and take operations can have an additional parameter specifying form which process a tuple is expected To better control how tuples are distribute: reactions A reaction specifies an action to executed when a tuple matching a given template is found in the local dataspace Each tuple has an associated code fragment telling exactly how that tuple should be moved between dataspaces
18
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved. 0-13-239227-5 18 Content-Based Routing Routers can take routing decisions by considering the content of a message In order to read messages, an applications will have previously provided the server with a description of the kind of data it is interest in The server, in turn, will notify the application when relevant data has arrived
19
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved. 0-13-239227-5 19 Content-Based Routing (1) Figure 13-7. Naive content-based routing.
20
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved. 0-13-239227-5 20 Content-Based Routing (1) Let every server broadcast its subscriptions to all other server Every server will be able to compile a list of (subject, destination) pairs When the messages reaches a router, the latter can use the list to decide on the paths that the message should follow
21
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved. 0-13-239227-5 21 Content-Based Routing (2) Figure 13-8. A partially filled routing table.
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.