Architectures. Architectural Styles (1)  Considering the logical organization of distributed systems into software components, also referred to as software.

Slides:



Advertisements
Similar presentations
Peer to Peer and Distributed Hash Tables
Advertisements

CHORD – peer to peer lookup protocol Shankar Karthik Vaithianathan & Aravind Sivaraman University of Central Florida.
Chord A Scalable Peer-to-peer Lookup Service for Internet Applications Ion Stoica, Robert MorrisDavid, Liben-Nowell, David R. Karger, M. Frans Kaashoek,
Chord A Scalable Peer-to-peer Lookup Service for Internet Applications Prepared by Ali Yildiz (with minor modifications by Dennis Shasha)
Technische Universität Yimei Liao Chemnitz Kurt Tutschku Vertretung - Professur Rechner- netze und verteilte Systeme Chord - A Distributed Hash Table Yimei.
Technische Universität Chemnitz Kurt Tutschku Vertretung - Professur Rechner- netze und verteilte Systeme Chord - A Distributed Hash Table Yimei Liao.
Chord: A Scalable Peer-to- Peer Lookup Service for Internet Applications Ion StoicaRobert Morris David Liben-NowellDavid R. Karger M. Frans KaashoekFrank.
The Chord P2P Network Some slides have been borowed from the original presentation by the authors.
CHORD: A Peer-to-Peer Lookup Service CHORD: A Peer-to-Peer Lookup Service Ion StoicaRobert Morris David R. Karger M. Frans Kaashoek Hari Balakrishnan Presented.
Chord: A Scalable Peer-to-peer Lookup Protocol for Internet Applications Speaker: Cathrin Weiß 11/23/2004 Proseminar Peer-to-Peer Information Systems.
Ion Stoica, Robert Morris, David Liben-Nowell, David R. Karger, M
Chord: A scalable peer-to- peer lookup service for Internet applications Ion Stoica, Robert Morris, David Karger, M. Frans Kaashock, Hari Balakrishnan.
1 1 Chord: A scalable Peer-to-peer Lookup Service for Internet Applications Dariotaki Roula
Chord A Scalable Peer-to-peer Lookup Service for Internet Applications
Robert Morris, M. Frans Kaashoek, David Karger, Hari Balakrishnan, Ion Stoica, David Liben-Nowell, Frank Dabek Chord: A scalable peer-to-peer look-up.
Robert Morris, M. Frans Kaashoek, David Karger, Hari Balakrishnan, Ion Stoica, David Liben-Nowell, Frank Dabek Chord: A scalable peer-to-peer look-up protocol.
Chord: A Scalable Peer-to-peer Lookup Service for Internet Applications Ion StoicaRobert Morris David Liben-NowellDavid R. Karger M. Frans KaashoekFrank.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
Peer to Peer File Sharing Huseyin Ozgur TAN. What is Peer-to-Peer?  Every node is designed to(but may not by user choice) provide some service that helps.
Topics in Reliable Distributed Systems Lecture 2, Fall Dr. Idit Keidar.
Chord: A Scalable Peer-to-Peer Lookup Protocol for Internet Applications Stoica et al. Presented by Tam Chantem March 30, 2007.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
Idit Keidar, Principles of Reliable Distributed Systems, Technion EE, Spring Principles of Reliable Distributed Systems Lecture 2: Peer-to-Peer.
Chord: A Scalable Peer-to-peer Lookup Service for Internet Applications Ion Stoica, Robert Morris, David Karger, M. Frans Kaashoek and Hari alakrishnan.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
Topics in Reliable Distributed Systems Fall Dr. Idit Keidar.
Peer To Peer Distributed Systems Pete Keleher. Why Distributed Systems? l Aggregate resources! –memory –disk –CPU cycles l Proximity to physical stuff.
Wide-area cooperative storage with CFS
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
Chord A Scalable Peer-to-peer Lookup Service for Internet Applications Lecture 3 1.
Architectures. Software Architecture Describe how the various software components are to be organized and how they should interact. It describe the organization.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved Chapter 2 ARCHITECTURES.
1 Distributed Systems Architectures Chapter 2. 2 Course/Slides Credits Note: all course presentations are based on those developed by Andrew S. Tanenbaum.
Content Overlays (Nick Feamster). 2 Content Overlays Distributed content storage and retrieval Two primary approaches: –Structured overlay –Unstructured.
Chord & CFS Presenter: Gang ZhouNov. 11th, University of Virginia.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
1 Reading Report 5 Yin Chen 2 Mar 2004 Reference: Chord: A Scalable Peer-To-Peer Lookup Service for Internet Applications, Ion Stoica, Robert Morris, david.
Chord: A Scalable Peer-to-peer Lookup Protocol for Internet Applications Xiaozhou Li COS 461: Computer Networks (precept 04/06/12) Princeton University.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
DISTRIBUTED SYSTEMS Principles and Paradigms Second Edition ANDREW S
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved Chapter 2 ARCHITECTURES.
Presentation 1 By: Hitesh Chheda 2/2/2010. Ion Stoica, Robert Morris, David Karger, M. Frans Kaashoek, Hari Balakrishnan MIT Laboratory for Computer Science.
DISTRIBUTED COMPUTING Introduction Dr. Yingwu Zhu.
Chord: A Scalable Peer-to-peer Lookup Service for Internet Applications.
Presented by: Tianyu Li
Chord: A Scalable Peer-to-peer Lookup Service for Internet Applications Ion Stoica, Robert Morris, David Karger, M. Frans Kaashoek, Hari Balakrishnan Presented.
SIGCOMM 2001 Lecture slides by Dr. Yingwu Zhu Chord: A Scalable Peer-to-peer Lookup Service for Internet Applications.
Peer to Peer A Survey and comparison of peer-to-peer overlay network schemes And so on… Chulhyun Park
Distributed (Operating) Systems -Architectures- Computer Engineering Department Distributed Systems Course Assoc. Prof. Dr. Ahmet Sayar Kocaeli University.
Idit Keidar, Principles of Reliable Distributed Systems, Technion EE, Spring Principles of Reliable Distributed Systems Lecture 2: Distributed Hash.
ICS362 – Distributed Systems Dr. Ken Cosh Week 2.
第 1 讲 分布式系统概述 §1.1 分布式系统的定义 §1.2 分布式系统分类 §1.3 分布式系统体系结构.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved Architectural.
Chapter 5 Naming (I) Speaker : Jyun-Yao Huang 1 Application and Practice of Distributed Systems.
Chord: A Scalable Peer-to-Peer Lookup Service for Internet Applications * CS587x Lecture Department of Computer Science Iowa State University *I. Stoica,
Chapter 29 Peer-to-Peer Paradigm Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
1 Distributed Hash tables. 2 Overview r Objective  A distributed lookup service  Data items are distributed among n parties  Anyone in the network.
The Chord P2P Network Some slides taken from the original presentation by the authors.
The Chord P2P Network Some slides have been borrowed from the original presentation by the authors.
A Scalable Peer-to-peer Lookup Service for Internet Applications
DISTRIBUTED SYSTEMS Principles and Paradigms Second Edition ANDREW S
CHAPTER 3 Architectures for Distributed Systems
DHT Routing Geometries and Chord
Prof. Leonardo Mostarda University of Camerino
DISTRIBUTED SYSTEMS Principles and Paradigms Second Edition ANDREW S
A Scalable Peer-to-peer Lookup Service for Internet Applications
DISTRIBUTED SYSTEMS Principles and Paradigms Second Edition ANDREW S
Presentation transcript:

Architectures

Architectural Styles (1)  Considering the logical organization of distributed systems into software components, also referred to as software architecture  Important styles of architecture for distributed systems Layered architectures Object-based architectures Data-centered architectures Event-based architectures 2

Architectural Styles (2) Figure 2-1. The (a) layered architectural style 3 The basic idea for the layered style is simple: components are organized in a layered fashion where a component at layer L; is allowed to call components at the underlying layer Li but not the other way around. An key observation is that control generally flows from layer to layer: requests go down the hierarchy whereas the results flow upward.

Architectural Styles (3) Figure 2-1. (b) The object-based architectural style. 4 Each object corresponds to what we have defined as a component, and these components are connected through a (remote) procedure call mechanism. This software architecture matches the client- server system architecture. The layered and object-based architectures still form the most important styles for large software systems

Reminder IPC – Pipes, TCP/IP, shared storage RPC – CORBA – RMI – Web Services – REST 5

Architectural Styles (4) 6  Data-centered architectures evolve around the idea that processes communicate through a common (passive or active) repository.  It can be argued that for distributed systems these architectures are as important as the layered and object- based architectures.  For example, a wealth of networked applications have been developed that rely on a shared distributed file system in which virtually all communication takes place through files.

Architectural Styles (5) Figure 2-2. (a) The event-based architectural style 7 In event-based architectures, processes essentially communicate through the propagation of events, which optionally also carry data. For distributed systems, event propagation has generally been associated with what are known as publish/subscribe systems. The basic idea is that processes publish events after which the middleware ensures that only those processes that subscribed to those events will receive them. The main advantage of event-based systems is that processes are loosely coupled. In principle, they need not explicitly refer to each other.

Architectural Styles (6) Figure 2-2. (b) The shared data- space architectural style. 8 Event-based architectures can be combined with data-centered architectures, yielding what is also known as shared data spaces. The essence of shared data spaces is that processes are now also decoupled in time: they need not both be active when communication takes place. Furthermore, many shared data spaces use a SQL-like interface to the shared repository in that sense that data can be accessed using a description rather than an explicit reference, as is the case with files.

ESB An Enterprise Service Bus, ESB, is an application that gives access to other applications and services. Its main task is to be the messaging and integration backbone of an enterprise. 9

System Architectures 10  How many distributed systems are actually organized by considering where software components are placed.  Deciding on software components, their interaction, and their placement leads to an instance of a software architecture, also called a system architecture.  Two Types of architecture:  Centralized architecture  Decentralized architecture

Centralized Architectures (1) 11  In the basic client-server model, processes in a distributed system are divided into two (possibly overlapping) groups.  A server is a process implementing a specific service, for example, a file system service or a database service.  A client is a process that requests a service from a server by sending it a request and subsequently waiting for the server's reply. This client-server interaction, also known as request- reply behavior

Centralized Architectures (2) Figure 2-3. General interaction between a client and a server. 12

Centralized Architectures (3) 13  Communication between a client and a server can be implemented by means of a simple connectionless protocol when the underlying network is fairly reliable as in many local-area networks  When a client requests a service, it simply packages a message for the server, identifying the service it wants, along with the necessary input data. The message is then sent to the server.  Server will always wait for an incoming request, subsequently process it, and package the results in a reply message that is then sent to the client.

Centralized Architectures (4) 14  Advantage of connectionless protocol:  efficient  As long as messages do not get lost or corrupted, the request/reply protocol works fine.  Making the protocol resistant to occasional transmission failures is not trivial.  Solution: the client must resend the request when no reply message comes in.  Problem: the client cannot detect whether the original request message was lost, or that transmission of the reply failed.

Centralized Architectures (5) 15  If the reply was lost, then resending a request may result in performing the operation twice.  Examples:  If the operation was "transfer $10,000 from my bank account," then, it would be better to report an error instead.  If the operation was "tell me how much money I have left," then, it would be perfectly acceptable to resend the request.

Centralized Architectures (6) 16  As an alternative, many client-server systems use a reliable connection-oriented protocol.  Although this solution is not appropriate in a local- area network due to relatively low performance, it works perfectly in wide-area systems in which communication is inherently unreliable.

Centralized Architectures (7) 17  Example: Virtually all Internet application protocols are based on reliable TCP/IP connections. In this case, whenever a client requests a service, it first sets up a connection to the server before sending the request. The server generally uses that same connection to send the reply message, after which the connection is torn down. Trouble: setting up and tearing down a connection is relatively costly, especially when the request and reply messages are small.

Application Layering (1) Recall previously mentioned layers of architectural style The user-interface level The processing level The data level 18

Application Layering (2) Figure 2-4. The simplified organization of an Internet search engine into three different layers. 19

Multitiered Architectures (1) The simplest organization is to have only two types of machines: A client machine containing only the programs implementing (part of) the user-interface level A server machine containing the rest, –the programs implementing the processing and data level 20

Multitiered Architectures (2) Figure 2-5. Alternative client-server organizations (a)–(e). 21

Multitiered Architectures (3) Figure 2-6. An example of a server acting as client. 22

Structured Peer-to-Peer Architectures (1) Figure 2-7. The mapping of data items onto nodes in Chord. 23

Chord protocol Consistent hashing function assigns each node and key an m-bit identifier using SHA-1 base hash function. Node’s IP address is hashed. Identifiers are ordered on a identifier circle modulo 2 m called a chord ring. succesor(k) = first node whose identifier is >= identifier of k in identifier space. 24

Chord Protocol Assumes communication in underlying network is both symmetric and transitive. Assigns keys to nodes with consistent hashing Hash function balances the load When N th node joins or leaves only O(1/N) fraction of keys moved. 25

Chord protocol 26 m = 6 10 nodes

Theorem For any set of N nodes and K keys, with high probability: 1.Each node is responsible for at most (1+e)K/N keys. 2.When an (N+1) st node joins or leaves the network, responsibility for O(K/N) keys changes hands. e = O(log N) 27

Simple Key Location Scheme 28 N1 N8 N14 N21 N32 N38 N42 N48 K45

Scalable Lookup Scheme N8+1N14 N8+2N14 N8+4N14 N8+8N21 N8+16N32 N8+32N42 29 N1 N8 N14 N21 N32 N38 N42 N48 N51 N56 Finger Table for N8 finger 1,2,3 finger 4 finger 6 finger [k] = first node that succeeds (n+2 k-1 )mod2 m finger 5

Scalable Lookup Scheme // ask node n to find the successor of id n.find_successor(id) if (id belongs to (n, successor]) return successor; else n0 = closest preceding node(id); return n0.find_successor(id); // search the local table for the highest predecessor of id n.closest_preceding_node(id) for i = m downto 1 if (finger[i] belongs to (n, id)) return finger[i]; return n; 30

Lookup Using Finger Table 31 N1 N8 N14 N21 N32 N38 N42 N51 N56 N48 lookup(54)

Scalable Lookup Scheme Each node forwards query at least halfway along distance remaining to the target Theorem: With high probability, the number of nodes that must be contacted to find a successor in a N-node network is O(log N) 32

Dynamic Operations and Failures Need to deal with: – Node Joins and Stabilization – Impact of Node Joins on Lookups – Failure and Replication – Voluntary Node Departures 33

Node Joins and Stabilization Node’s successor pointer should be up to date – For correctly executing lookups Each node periodically runs a “Stabilization” Protocol – Updates finger tables and successor pointers 34

Node Joins and Stabilization Contains 6 functions: – create() – join() – stabilize() – notify() – fix_fingers() – check_predecessor() 35

Create() Creates a new Chord ring n.create() predecessor = nil; successor = n; 36

Join() Asks m to find the immediate successor of n. Doesn’t make rest of the network aware of n. n.join(m) predecessor = nil; successor = m.find_successor(n); 37

Stabilize() Called periodically to learn about new nodes Asks n’s immediate successor about successor’s predecessor p – Checks whether p should be n’s successor instead – Also notifies n’s successor about n’s existence, so that successor may change its predecessor to n, if necessary n.stabilize() x = successor.predecessor; if (x  (n, successor)) successor = x; successor.notify(n); 38

Notify() m thinks it might be n’s predecessor n.notify(m) if (predecessor is nil or m  (predecessor, n)) predecessor = m; 39

Fix_fingers() Periodically called to make sure that finger table entries are correct – New nodes initialize their finger tables – Existing nodes incorporate new nodes into their finger tables n.fix_fingers() next = next + 1 ; if (next > m) next = 1 ; finger[next] = find_successor(n + 2 next-1 ); 40

Check_predecessor() Periodically called to check whether predecessor has failed – If yes, it clears the predecessor pointer, which can then be modified by notify() n.check_predecessor() if (predecessor has failed) predecessor = nil; 41

Theorem 3 If any sequence of join operations is executed interleaved with stabilizations, then at some time after the last join the successor pointers will form a cycle on all nodes in the network 42

Stabilization Protocol Guarantees to add nodes in a fashion to preserve reach ability By itself won’t correct a Chord system that has split into multiple disjoint cycles, or a single cycle that loops multiple times around the identifier space 43

Impact of Node Joins on Lookups Correctness – If finger table entries are reasonably current Lookup finds the correct successor in O(log N) steps – If successor pointers are correct but finger tables are incorrect Correct lookup but slower – If incorrect successor pointers Lookup may fail 44

Impact of Node Joins on Lookups Performance – If stabilization is complete Lookup can be done in O(log N) time – If stabilization is not complete Existing nodes finger tables may not reflect the new nodes – Doesn’t significantly affect lookup speed Newly joined nodes can affect the lookup speed, if the new nodes ID’s are in between target and target’s predecessor – Lookup will have to be forwarded through the intervening nodes, one at a time 45

Theorem 4 If we take a stable network with N nodes with correct finger pointers, and another set of up to N nodes joins the network, and all successor pointers (but perhaps not all finger pointers) are correct, then lookups will still take O(log N) time with high probability 46

Failure and Replication Correctness of the protocol relies on the fact of knowing correct successor To improve robustness – Each node maintains a successor list of ‘r’ nodes – This can be handled using modified version of stabilize procedure – Also helps higher-layer software to replicate data 47

Theorem 5 If we use successor list of length r = O(log N) in a network that is initially stable, and then every node fails with probability ½, then with high probability find_successor returns the closest living successor to the query key 48

Theorem 6 In a network that is initially stable, if every node fails with probability ½, then the expected time to execute find_successor is O(log N) 49

Voluntary Node Departures Can be treated as node failures Two possible enhancements – Leaving node may transfers all its keys to its successor – Leaving node may notify its predecessor and successor about each other so that they can update their links 50

Structured Peer-to-Peer Architectures (2) Figure 2-8. (a) The mapping of data items onto nodes in CAN. 51

From (0.2,0.3) to (0.9,0.6)? There are several possibilities, but if we want to follow the shortest path according to a Euclidean distance, we should follow the route (0.2,0.3) →(0.6,0.7) →(0.9,0.6), which has a distance of The alternative route (0.2,0.3) → (0.7,0.2) → (0.9,0.6) has a distance of

Structured Peer-to-Peer Architectures (3) Figure 2-8. (b) Splitting a region when a node joins. 53

Unstructured Peer-to-Peer Architectures (1) Figure 2-9. (a) The steps taken by the active thread. 54

Unstructured Peer-to-Peer Architectures (2) Figure 2-9. (b) The steps take by the passive thread 55

Topology Management of Overlay Networks (1) Figure A two-layered approach for constructing and maintaining specific overlay topologies using techniques from unstructured peer-to-peer systems. 56

Topology Management of Overlay Networks (2) Figure Generating a specific overlay network using a two-layered unstructured peer-to-peer system [adapted with permission from Jelasity and Babaoglu (2005)]. 57

Superpeers Figure A hierarchical organization of nodes into a superpeer network. 58

Edge-Server Systems Figure Viewing the Internet as consisting of a collection of edge servers. 59

Collaborative Distributed Systems (1) Figure The principal working of BitTorrent [adapted with permission from Pouwelse et al. (2004)]. 60

Collaborative Distributed Systems (2) Components of Globule collaborative content distribution network: A component that can redirect client requests to other servers. A component for analyzing access patterns. A component for managing the replication of Web pages. 61

Interceptors Figure Using interceptors to handle remote-object invocations. 62

General Approaches to Adaptive Software Three basic approaches to adaptive software: Separation of concerns Computational reflection Component-based design 63

The Feedback Control Model Figure The logical organization of a feedback control system. 64

Example: Systems Monitoring with Astrolabe Figure Data collection and information aggregation in Astrolabe. 65

Example: Differentiating Replication Strategies in Globule (1) Figure The edge-server model assumed by Globule. 66

Example: Differentiating Replication Strategies in Globule (2) Figure The dependency between prediction accuracy and trace length. 67

Example: Automatic Component Repair Management in Jade Steps required in a repair procedure: Terminate every binding between a component on a nonfaulty node, and a component on the node that just failed. Request the node manager to start and add a new node to the domain. Configure the new node with exactly the same components as those on the crashed node. Re-establish all the bindings that were previously terminated. 68