2 Dist Arch (Week 2) Week 3 6
2 Dist Arch (Week 2) Week 3 6
2 Dist Arch (Week 2) Week 3 6
Systems
Chapter 2
Instructor : Dr. Farzana Jabeen
Recap : Goals of Distributed
Systems
❏ Four important goals to meet to build a
distributed system
❏ Make resource available
❏ Distribution transparency
❏ Scalability
❏ Pitfalls
2
Pitfalls
❏ network is reliable
❏ network is secure
❏ network is homogenous - topology does not change
❏ latency is zero
❏ bandwidth is infinite
❏ transport cost is zero
❏ there is one administrator
❏ https://blogs.oracle.com/developers/post/fallacie 3
s-of-distributed-systems
Today’s Lecture
Architecture of Distributed
systems
Distributed systems
● Virtually all large computer-based systems are
now distributed systems.
Figure 2-1. The (a) layered architectural style & (b) The object-based
architectural style.
Data-Centered Architectures
• Main purpose: data access and update
• Processes interact by reading and modifying data
in some shared repository (active or passive)
– Traditional data base (passive): responds to requests
– Blackboard system (active): clients solve problems
collaboratively; system updates clients when
information changes.
• Another example: web-based distributed systems
where communication is through web services
(Ch 12)
Architectural Styles
Thin Fat
Client Client
❏ Architectures
❏ Architecture Styles
❏ System Architecture
❏ Centralized Architecture
❏ Decentralized Architecture
❏ P2P network System
(Reading Assignment )
3
0
Peer-to-Peer Systems
❏ Centralized Database
❏ Napster
❏ Query Flooding
❏ Gnutella
31
Second Generation P2P System
❏ Common Primitives:
❏ Join: how to I begin participating?
❏ Publish: how do I advertise my file?
33
Decentralized Architecture
❏ Peer-to-peer architecture evolve how to organize process in an
Overlay Network
❏ Overlay network
❏ Is a computer network build on the top of another network
❏ Nodes in an overlay network can be thought of connected
by virtual or logical links
❏ Two types of overlay networks
❏ structured and Unstructured (Random connections)
Client Server – P2P Models
Overlay network
structured peer-to-peer architecture
● In a structured peer-to-peer architecture, the overlay network is constructed using a deterministic
procedure
● The most-used procedure is to organize the processes through a distributed hash table (DHT).
● distributed hash table (DHT)
● Data items or nodes are assigned a random key from a large identifier space, such as a 128-bit or
160-bit identifier
● The crux: uniquely maps the key of a data item to the identifier of a node based on some distance
metric
● Routing
○ when looking up a data item, the network address of the node responsible for that data item is returned
Outline
What is Chord?
Consistent Hashing
A Simple Key Lookup Algorithm
Scalable Key Lookup Algorithm
Node Joins and Stabilization
Node Failures
What is Chord?
❑ Joining
❑ each data item whose key is now associated with node id, is transferred from succ(id)
Routing in PEER-TO-PEER Systems - CHORD
Routing in PEER-TO-PEER Systems - CHORD
Cont..
❑ Leaving
❑ transfers its data items to succ(id)s organize themselves into an overlay network
Routing in
PEER-TO-PEER
Systems -
CHORD
Routing in
PEER-TO-
PEER
Systems -
CHORD
Chord Distance Function
distance(A, B) = B – A (for B >= A) distance(A, B) = B -
A + 2N (for B < A)
For Instance:
distance(0, 11) = ( 11 - 0 + 16 ) mod 16 = (27) mod 16 =
11
distance(11, 0) = ( 0 - 11 + 16 ) mod 16 = (5) mod 16 = 5