SlideShare ist ein Scribd-Unternehmen logo
1 von 25
Chord
A Scalable Peer-to-peer Lookup
Service for Internet Applications
CS294-4: Peer-to-peer Systems
Markus Böhning
bohning@uclink.berkeley.edu
2
What is Chord? What does it do?
 In short: a peer-to-peer lookup service
 Solves problem of locating a data item in a collection
of distributed nodes, considering frequent node
arrivals and departures
 Core operation in most p2p systems is efficient
location of data items
 Supports just one operation: given a key, it maps
the key onto a node
3
Chord Characteristics
 Simplicity, provable correctness, and provable
performance
 Each Chord node needs routing information about
only a few other nodes
 Resolves lookups via messages to other nodes
(iteratively or recursively)
 Maintains routing information as nodes join and
leave the system
4
Mapping onto Nodes vs. Values
 Traditional name and location services provide a
direct mapping between keys and values
 What are examples of values? A value can be an
address, a document, or an arbitrary data item
 Chord can easily implement a mapping onto values
by storing each key/value pair at node to which that
key maps
5
Napster, Gnutella etc. vs. Chord
 Compared to Napster and its centralized servers,
Chord avoids single points of control or failure by a
decentralized technology
 Compared to Gnutella and its widespread use of
broadcasts, Chord avoids the lack of scalability
through a small number of important information for
rounting
6
DNS vs. Chord
DNS
 provides a host name to
IP address mapping
 relies on a set of special
root servers
 names reflect
administrative boundaries
 is specialized to finding
named hosts or services
Chord
 can provide same service:
Name = key, value = IP
 requires no special
servers
 imposes no naming
structure
 can also be used to find
data objects that are not
tied to certain machines
7
Freenet vs. Chord
 both decentralized and symmetric
 both automatically adapt when hosts leave and join
 Freenet
 does not assign responsibility for documents to specific
servers, instead lookups are searches for cached copies
+ allows Freenet to provide anonymity
− prevents guaranteed retrieval of existing documents
 Chord
− does not provide anonymity
+ but its lookup operation runs in predictable time and always
results in success or definitive failure
8
Addressed Difficult Problems (1)
 Load balance: distributed hash function, spreading
keys evenly over nodes
 Decentralization: chord is fully distributed, no
node more important than other, improves
robustness
 Scalability: logarithmic growth of lookup costs with
number of nodes in network, even very large
systems are feasible
9
Addressed Difficult Problems (2)
 Availability: chord automatically adjusts its internal
tables to ensure that the node responsible for a key
can always be found
 Flexible naming: no constraints on the structure of
the keys – key-space is flat, flexibility in how to map
names to Chord keys
10
Example Application using Chord:
Cooperative Mirroring
 Highest layer provides a file-like interface to user
including user-friendly naming and authentication
 This file systems maps operations to lower-level block
operations
 Block storage uses Chord to identify responsible node for
storing a block and then talk to the block storage server
on that node
File System
Block Store
Chord
Block Store
Chord
Block Store
Chord
Client Server Server
11
The Base Chord Protocol (1)
 Specifies how to find the locations of keys
 How new nodes join the system
 How to recover from the failure or planned
departure of existing nodes
12
Consistent Hashing
 Hash function assigns each node and key an m-bit
identifier using a base hash function such as SHA-1
 ID(node) = hash(IP, Port)
 ID(key) = hash(key)
 Properties of consistent hashing:
 Function balances load: all nodes receive roughly the
same number of keys – good?
 When an Nth node joins (or leaves) the network, only
an O(1/N) fraction of the keys are moved to a different
location
13
6
1
2
6
0
4
26
5
1
3
7
2
identifier
circle
identifier
node
X key
Successor Nodes
successor(1) = 1
successor(2) = 3successor(6) = 0
14
Node Joins and Departures
6
1
2
0
4
26
5
1
3
7
successor(6) = 7
6
1
successor(1) = 3
15
Scalable Key Location
 A very small amount of routing information suffices
to implement consistent hashing in a distributed
environment
 Each node need only be aware of its successor node
on the circle
 Queries for a given identifier can be passed around
the circle via these successor pointers
 Resolution scheme correct, BUT inefficient: it may
require traversing all N nodes!
16
Acceleration of Lookups
 Lookups are accelerated by maintaining additional
routing information
 Each node maintains a routing table with (at most)
m entries (where N=2m
) called the finger table
 ith
entry in the table at node n contains the identity
of the first node, s, that succeeds n by at least 2i-1
on
the identifier circle (clarification on next slide)
 s = successor(n + 2i-1
) (all arithmetic mod 2)
 s is called the ith
finger of node n, denoted by
n.finger(i).node
17
Finger Tables (1)
0
4
26
5
1
3
7
1
2
4
[1,2)
[2,4)
[4,0)
1
3
0
finger table
start int. succ.
keys
1
2
3
5
[2,3)
[3,5)
[5,1)
3
3
0
finger table
start int. succ.
keys
2
4
5
7
[4,5)
[5,7)
[7,3)
0
0
0
finger table
start int. succ.
keys
6
18
Finger Tables (2) - characteristics
 Each node stores information about only a small
number of other nodes, and knows more about
nodes closely following it than about nodes farther
away
 A node’s finger table generally does not contain
enough information to determine the successor of
an arbitrary key k
 Repetitive queries to nodes that immediately
precede the given key will lead to the key’s
successor eventually
19
Node Joins – with Finger Tables
0
4
26
5
1
3
7
1
2
4
[1,2)
[2,4)
[4,0)
1
3
0
finger table
start int. succ.
keys
1
2
3
5
[2,3)
[3,5)
[5,1)
3
3
0
finger table
start int. succ.
keys
2
4
5
7
[4,5)
[5,7)
[7,3)
0
0
0
finger table
start int. succ.
keys
finger table
start int. succ.
keys
7
0
2
[7,0)
[0,2)
[2,6)
0
0
3
6
6
6
6
6
20
Node Departures – with Finger Tables
0
4
26
5
1
3
7
1
2
4
[1,2)
[2,4)
[4,0)
1
3
0
finger table
start int. succ.
keys
1
2
3
5
[2,3)
[3,5)
[5,1)
3
3
0
finger table
start int. succ.
keys
2
4
5
7
[4,5)
[5,7)
[7,3)
6
6
0
finger table
start int. succ.
keys
finger table
start int. succ.
keys
7
0
2
[7,0)
[0,2)
[2,6)
0
0
3
6
6
6
0
3
21
Source of Inconsistencies:
Concurrent Operations and Failures
 Basic “stabilization” protocol is used to keep nodes’
successor pointers up to date, which is sufficient to
guarantee correctness of lookups
 Those successor pointers can then be used to verify
the finger table entries
 Every node runs stabilize periodically to find newly
joined nodes
22
Stabilization after Join
np
succ(np)=ns
ns
n
pred(ns)=np  n joins
 predecessor = nil
 n acquires ns as successor via some n’
 n notifies ns being the new
predecessor
 ns acquires n as its predecessor
 np runs stabilize
 np asks ns for its predecessor (now n)
 np acquires n as its successor
 np notifies n
 n will acquire np as its predecessor
 all predecessor and successor
pointers are now correct
 fingers still need to be fixed, but
old fingers will still work
nil
pred(ns)=n
succ(np)=n
23
Failure Recovery
 Key step in failure recovery is maintaining correct
successor pointers
 To help achieve this, each node maintains a successor-list
of its r nearest successors on the ring
 If node n notices that its successor has failed, it replaces it
with the first live entry in the list
 stabilize will correct finger table entries and successor-list
entries pointing to failed node
 Performance is sensitive to the frequency of node joins
and leaves versus the frequency at which the stabilization
protocol is invoked
24
Chord – The Math
 Every node is responsible for about K/N keys (N
nodes, K keys)
 When a node joins or leaves an N-node network,
only O(K/N) keys change hands (and only to and
from joining or leaving node)
 Lookups need O(log N) messages
 To reestablish routing invariants and finger tables
after node joining or leaving, only O(log2
N)
messages are required
25
Experimental Results
 Latency grows slowly with
the total number of nodes
 Path length for lookups is
about ½ log2N
 Chord is robust in the face
of multiple node failures

Weitere ähnliche Inhalte

Was ist angesagt?

RPC: Remote procedure call
RPC: Remote procedure callRPC: Remote procedure call
RPC: Remote procedure callSunita Sahu
 
Distributed computing
Distributed computingDistributed computing
Distributed computingshivli0769
 
Presentation on Breadth First Search (BFS)
Presentation on Breadth First Search (BFS)Presentation on Breadth First Search (BFS)
Presentation on Breadth First Search (BFS)Shuvongkor Barman
 
Agreement Protocols, distributed File Systems, Distributed Shared Memory
Agreement Protocols, distributed File Systems, Distributed Shared MemoryAgreement Protocols, distributed File Systems, Distributed Shared Memory
Agreement Protocols, distributed File Systems, Distributed Shared MemorySHIKHA GAUTAM
 
remote procedure calls
  remote procedure calls  remote procedure calls
remote procedure callsAshish Kumar
 
Synchronization in distributed computing
Synchronization in distributed computingSynchronization in distributed computing
Synchronization in distributed computingSVijaylakshmi
 
Client Centric Consistency Model
Client Centric Consistency ModelClient Centric Consistency Model
Client Centric Consistency ModelRajat Kumar
 
distributed shared memory
 distributed shared memory distributed shared memory
distributed shared memoryAshish Kumar
 
Distributed system lamport's and vector algorithm
Distributed system lamport's and vector algorithmDistributed system lamport's and vector algorithm
Distributed system lamport's and vector algorithmpinki soni
 
Distributed system architecture
Distributed system architectureDistributed system architecture
Distributed system architectureYisal Khan
 
Processes and Processors in Distributed Systems
Processes and Processors in Distributed SystemsProcesses and Processors in Distributed Systems
Processes and Processors in Distributed SystemsDr Sandeep Kumar Poonia
 
Error control, parity check, check sum, vrc
Error control, parity check, check sum, vrcError control, parity check, check sum, vrc
Error control, parity check, check sum, vrcHuawei Technologies
 
Naming in Distributed Systems
Naming in Distributed SystemsNaming in Distributed Systems
Naming in Distributed SystemsNandakumar P
 
Threads (operating System)
Threads (operating System)Threads (operating System)
Threads (operating System)Prakhar Maurya
 
Synchronization - Election Algorithms
Synchronization  - Election AlgorithmsSynchronization  - Election Algorithms
Synchronization - Election AlgorithmsOsaMa Hasan
 

Was ist angesagt? (20)

Thread
ThreadThread
Thread
 
RPC: Remote procedure call
RPC: Remote procedure callRPC: Remote procedure call
RPC: Remote procedure call
 
Distributed computing
Distributed computingDistributed computing
Distributed computing
 
Semaphores
SemaphoresSemaphores
Semaphores
 
Replication in Distributed Systems
Replication in Distributed SystemsReplication in Distributed Systems
Replication in Distributed Systems
 
Presentation on Breadth First Search (BFS)
Presentation on Breadth First Search (BFS)Presentation on Breadth First Search (BFS)
Presentation on Breadth First Search (BFS)
 
Agreement Protocols, distributed File Systems, Distributed Shared Memory
Agreement Protocols, distributed File Systems, Distributed Shared MemoryAgreement Protocols, distributed File Systems, Distributed Shared Memory
Agreement Protocols, distributed File Systems, Distributed Shared Memory
 
remote procedure calls
  remote procedure calls  remote procedure calls
remote procedure calls
 
Synchronization in distributed computing
Synchronization in distributed computingSynchronization in distributed computing
Synchronization in distributed computing
 
Client Centric Consistency Model
Client Centric Consistency ModelClient Centric Consistency Model
Client Centric Consistency Model
 
distributed shared memory
 distributed shared memory distributed shared memory
distributed shared memory
 
Distributed system lamport's and vector algorithm
Distributed system lamport's and vector algorithmDistributed system lamport's and vector algorithm
Distributed system lamport's and vector algorithm
 
Distributed system architecture
Distributed system architectureDistributed system architecture
Distributed system architecture
 
Processes and Processors in Distributed Systems
Processes and Processors in Distributed SystemsProcesses and Processors in Distributed Systems
Processes and Processors in Distributed Systems
 
Error control, parity check, check sum, vrc
Error control, parity check, check sum, vrcError control, parity check, check sum, vrc
Error control, parity check, check sum, vrc
 
Naming in Distributed Systems
Naming in Distributed SystemsNaming in Distributed Systems
Naming in Distributed Systems
 
Threads (operating System)
Threads (operating System)Threads (operating System)
Threads (operating System)
 
convex hull
convex hullconvex hull
convex hull
 
Routing protocols
Routing protocolsRouting protocols
Routing protocols
 
Synchronization - Election Algorithms
Synchronization  - Election AlgorithmsSynchronization  - Election Algorithms
Synchronization - Election Algorithms
 

Ähnlich wie Chord Algorithm

Paul presentation P2P Chord v1
Paul presentation P2P Chord v1Paul presentation P2P Chord v1
Paul presentation P2P Chord v1Paul Yang
 
Chord 120427053647-phpapp01 (1)
Chord 120427053647-phpapp01 (1)Chord 120427053647-phpapp01 (1)
Chord 120427053647-phpapp01 (1)Hadeel Ibrahim
 
Routing Protocols of Distributed Hash Table Based Peer to Peer Networks
Routing Protocols of Distributed Hash Table Based Peer to Peer NetworksRouting Protocols of Distributed Hash Table Based Peer to Peer Networks
Routing Protocols of Distributed Hash Table Based Peer to Peer NetworksIOSR Journals
 
5.1.3. Chord.pptx
5.1.3. Chord.pptx5.1.3. Chord.pptx
5.1.3. Chord.pptxAnusuya123
 
Distributed Coordination
Distributed CoordinationDistributed Coordination
Distributed CoordinationLuis Galárraga
 
2018a 1324654jhjkhkhkkjhk
2018a 1324654jhjkhkhkkjhk2018a 1324654jhjkhkhkkjhk
2018a 1324654jhjkhkhkkjhkJasser Kouki
 
Introduction to Computer Networks
Introduction to Computer NetworksIntroduction to Computer Networks
Introduction to Computer NetworksVenkatesh Iyer
 
Intro 2 Computer Networks
Intro 2 Computer NetworksIntro 2 Computer Networks
Intro 2 Computer Networksrakeshgoswami
 
Cassandra Architecture
Cassandra ArchitectureCassandra Architecture
Cassandra ArchitecturePrasad Wali
 
Efficiency analysis of public key management scheme for wsn using TinyOS
Efficiency analysis of public key management scheme for wsn using TinyOSEfficiency analysis of public key management scheme for wsn using TinyOS
Efficiency analysis of public key management scheme for wsn using TinyOSvik001ind
 
cryptography and network security chap 3
cryptography and network security chap 3cryptography and network security chap 3
cryptography and network security chap 3Debanjan Bhattacharya
 
Chord Presentation at Papers We Love SF, August 2016
Chord Presentation at Papers We Love SF, August 2016Chord Presentation at Papers We Love SF, August 2016
Chord Presentation at Papers We Love SF, August 2016Tom Faulhaber
 
Chord- A Scalable Peer-to-Peer Lookup Service for Internet Applications
Chord- A Scalable Peer-to-Peer Lookup Service for Internet ApplicationsChord- A Scalable Peer-to-Peer Lookup Service for Internet Applications
Chord- A Scalable Peer-to-Peer Lookup Service for Internet ApplicationsChandan Thakur
 
Tapestry
TapestryTapestry
TapestrySutha31
 
Peer to peer Paradigms
Peer to peer ParadigmsPeer to peer Paradigms
Peer to peer Paradigmshassan ahmed
 
Data Encryption standard in cryptography
Data Encryption standard in cryptographyData Encryption standard in cryptography
Data Encryption standard in cryptographyNithyasriA2
 

Ähnlich wie Chord Algorithm (20)

Paul presentation P2P Chord v1
Paul presentation P2P Chord v1Paul presentation P2P Chord v1
Paul presentation P2P Chord v1
 
Chord 120427053647-phpapp01 (1)
Chord 120427053647-phpapp01 (1)Chord 120427053647-phpapp01 (1)
Chord 120427053647-phpapp01 (1)
 
Routing Protocols of Distributed Hash Table Based Peer to Peer Networks
Routing Protocols of Distributed Hash Table Based Peer to Peer NetworksRouting Protocols of Distributed Hash Table Based Peer to Peer Networks
Routing Protocols of Distributed Hash Table Based Peer to Peer Networks
 
5.1.3. Chord.pptx
5.1.3. Chord.pptx5.1.3. Chord.pptx
5.1.3. Chord.pptx
 
Distributed Coordination
Distributed CoordinationDistributed Coordination
Distributed Coordination
 
2018a 1324654jhjkhkhkkjhk
2018a 1324654jhjkhkhkkjhk2018a 1324654jhjkhkhkkjhk
2018a 1324654jhjkhkhkkjhk
 
Introduction to Computer Networks
Introduction to Computer NetworksIntroduction to Computer Networks
Introduction to Computer Networks
 
Intro 2 Computer Networks
Intro 2 Computer NetworksIntro 2 Computer Networks
Intro 2 Computer Networks
 
Cassandra Architecture
Cassandra ArchitectureCassandra Architecture
Cassandra Architecture
 
Efficiency analysis of public key management scheme for wsn using TinyOS
Efficiency analysis of public key management scheme for wsn using TinyOSEfficiency analysis of public key management scheme for wsn using TinyOS
Efficiency analysis of public key management scheme for wsn using TinyOS
 
Cryptography and Network Security William Stallings Lawrie Brown
Cryptography and Network Security William Stallings Lawrie BrownCryptography and Network Security William Stallings Lawrie Brown
Cryptography and Network Security William Stallings Lawrie Brown
 
cryptography and network security chap 3
cryptography and network security chap 3cryptography and network security chap 3
cryptography and network security chap 3
 
Chord Presentation at Papers We Love SF, August 2016
Chord Presentation at Papers We Love SF, August 2016Chord Presentation at Papers We Love SF, August 2016
Chord Presentation at Papers We Love SF, August 2016
 
Chord DHT
Chord DHTChord DHT
Chord DHT
 
Chord- A Scalable Peer-to-Peer Lookup Service for Internet Applications
Chord- A Scalable Peer-to-Peer Lookup Service for Internet ApplicationsChord- A Scalable Peer-to-Peer Lookup Service for Internet Applications
Chord- A Scalable Peer-to-Peer Lookup Service for Internet Applications
 
Tapestry
TapestryTapestry
Tapestry
 
Peer to peer Paradigms
Peer to peer ParadigmsPeer to peer Paradigms
Peer to peer Paradigms
 
Chord
ChordChord
Chord
 
Data Encryption standard in cryptography
Data Encryption standard in cryptographyData Encryption standard in cryptography
Data Encryption standard in cryptography
 
Distributed Hash Table
Distributed Hash TableDistributed Hash Table
Distributed Hash Table
 

Kürzlich hochgeladen

The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...ranjana rawat
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...Call Girls in Nagpur High Profile
 
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Bookingroncy bisnoi
 
Bhosari ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For ...
Bhosari ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For ...Bhosari ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For ...
Bhosari ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For ...tanu pandey
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Call Girls in Nagpur High Profile
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlysanyuktamishra911
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdfankushspencer015
 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)simmis5
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdfKamal Acharya
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfJiananWang21
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Bookingdharasingh5698
 
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELLPVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELLManishPatel169454
 
Unit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfUnit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfRagavanV2
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Christo Ananth
 
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...SUHANI PANDEY
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapRishantSharmaFr
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordAsst.prof M.Gokilavani
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueBhangaleSonal
 

Kürzlich hochgeladen (20)

Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
 
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
 
Bhosari ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For ...
Bhosari ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For ...Bhosari ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For ...
Bhosari ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For ...
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdf
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdf
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
 
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELLPVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
 
Unit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfUnit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdf
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leap
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
 
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torque
 

Chord Algorithm

  • 1. Chord A Scalable Peer-to-peer Lookup Service for Internet Applications CS294-4: Peer-to-peer Systems Markus Böhning bohning@uclink.berkeley.edu
  • 2. 2 What is Chord? What does it do?  In short: a peer-to-peer lookup service  Solves problem of locating a data item in a collection of distributed nodes, considering frequent node arrivals and departures  Core operation in most p2p systems is efficient location of data items  Supports just one operation: given a key, it maps the key onto a node
  • 3. 3 Chord Characteristics  Simplicity, provable correctness, and provable performance  Each Chord node needs routing information about only a few other nodes  Resolves lookups via messages to other nodes (iteratively or recursively)  Maintains routing information as nodes join and leave the system
  • 4. 4 Mapping onto Nodes vs. Values  Traditional name and location services provide a direct mapping between keys and values  What are examples of values? A value can be an address, a document, or an arbitrary data item  Chord can easily implement a mapping onto values by storing each key/value pair at node to which that key maps
  • 5. 5 Napster, Gnutella etc. vs. Chord  Compared to Napster and its centralized servers, Chord avoids single points of control or failure by a decentralized technology  Compared to Gnutella and its widespread use of broadcasts, Chord avoids the lack of scalability through a small number of important information for rounting
  • 6. 6 DNS vs. Chord DNS  provides a host name to IP address mapping  relies on a set of special root servers  names reflect administrative boundaries  is specialized to finding named hosts or services Chord  can provide same service: Name = key, value = IP  requires no special servers  imposes no naming structure  can also be used to find data objects that are not tied to certain machines
  • 7. 7 Freenet vs. Chord  both decentralized and symmetric  both automatically adapt when hosts leave and join  Freenet  does not assign responsibility for documents to specific servers, instead lookups are searches for cached copies + allows Freenet to provide anonymity − prevents guaranteed retrieval of existing documents  Chord − does not provide anonymity + but its lookup operation runs in predictable time and always results in success or definitive failure
  • 8. 8 Addressed Difficult Problems (1)  Load balance: distributed hash function, spreading keys evenly over nodes  Decentralization: chord is fully distributed, no node more important than other, improves robustness  Scalability: logarithmic growth of lookup costs with number of nodes in network, even very large systems are feasible
  • 9. 9 Addressed Difficult Problems (2)  Availability: chord automatically adjusts its internal tables to ensure that the node responsible for a key can always be found  Flexible naming: no constraints on the structure of the keys – key-space is flat, flexibility in how to map names to Chord keys
  • 10. 10 Example Application using Chord: Cooperative Mirroring  Highest layer provides a file-like interface to user including user-friendly naming and authentication  This file systems maps operations to lower-level block operations  Block storage uses Chord to identify responsible node for storing a block and then talk to the block storage server on that node File System Block Store Chord Block Store Chord Block Store Chord Client Server Server
  • 11. 11 The Base Chord Protocol (1)  Specifies how to find the locations of keys  How new nodes join the system  How to recover from the failure or planned departure of existing nodes
  • 12. 12 Consistent Hashing  Hash function assigns each node and key an m-bit identifier using a base hash function such as SHA-1  ID(node) = hash(IP, Port)  ID(key) = hash(key)  Properties of consistent hashing:  Function balances load: all nodes receive roughly the same number of keys – good?  When an Nth node joins (or leaves) the network, only an O(1/N) fraction of the keys are moved to a different location
  • 14. 14 Node Joins and Departures 6 1 2 0 4 26 5 1 3 7 successor(6) = 7 6 1 successor(1) = 3
  • 15. 15 Scalable Key Location  A very small amount of routing information suffices to implement consistent hashing in a distributed environment  Each node need only be aware of its successor node on the circle  Queries for a given identifier can be passed around the circle via these successor pointers  Resolution scheme correct, BUT inefficient: it may require traversing all N nodes!
  • 16. 16 Acceleration of Lookups  Lookups are accelerated by maintaining additional routing information  Each node maintains a routing table with (at most) m entries (where N=2m ) called the finger table  ith entry in the table at node n contains the identity of the first node, s, that succeeds n by at least 2i-1 on the identifier circle (clarification on next slide)  s = successor(n + 2i-1 ) (all arithmetic mod 2)  s is called the ith finger of node n, denoted by n.finger(i).node
  • 17. 17 Finger Tables (1) 0 4 26 5 1 3 7 1 2 4 [1,2) [2,4) [4,0) 1 3 0 finger table start int. succ. keys 1 2 3 5 [2,3) [3,5) [5,1) 3 3 0 finger table start int. succ. keys 2 4 5 7 [4,5) [5,7) [7,3) 0 0 0 finger table start int. succ. keys 6
  • 18. 18 Finger Tables (2) - characteristics  Each node stores information about only a small number of other nodes, and knows more about nodes closely following it than about nodes farther away  A node’s finger table generally does not contain enough information to determine the successor of an arbitrary key k  Repetitive queries to nodes that immediately precede the given key will lead to the key’s successor eventually
  • 19. 19 Node Joins – with Finger Tables 0 4 26 5 1 3 7 1 2 4 [1,2) [2,4) [4,0) 1 3 0 finger table start int. succ. keys 1 2 3 5 [2,3) [3,5) [5,1) 3 3 0 finger table start int. succ. keys 2 4 5 7 [4,5) [5,7) [7,3) 0 0 0 finger table start int. succ. keys finger table start int. succ. keys 7 0 2 [7,0) [0,2) [2,6) 0 0 3 6 6 6 6 6
  • 20. 20 Node Departures – with Finger Tables 0 4 26 5 1 3 7 1 2 4 [1,2) [2,4) [4,0) 1 3 0 finger table start int. succ. keys 1 2 3 5 [2,3) [3,5) [5,1) 3 3 0 finger table start int. succ. keys 2 4 5 7 [4,5) [5,7) [7,3) 6 6 0 finger table start int. succ. keys finger table start int. succ. keys 7 0 2 [7,0) [0,2) [2,6) 0 0 3 6 6 6 0 3
  • 21. 21 Source of Inconsistencies: Concurrent Operations and Failures  Basic “stabilization” protocol is used to keep nodes’ successor pointers up to date, which is sufficient to guarantee correctness of lookups  Those successor pointers can then be used to verify the finger table entries  Every node runs stabilize periodically to find newly joined nodes
  • 22. 22 Stabilization after Join np succ(np)=ns ns n pred(ns)=np  n joins  predecessor = nil  n acquires ns as successor via some n’  n notifies ns being the new predecessor  ns acquires n as its predecessor  np runs stabilize  np asks ns for its predecessor (now n)  np acquires n as its successor  np notifies n  n will acquire np as its predecessor  all predecessor and successor pointers are now correct  fingers still need to be fixed, but old fingers will still work nil pred(ns)=n succ(np)=n
  • 23. 23 Failure Recovery  Key step in failure recovery is maintaining correct successor pointers  To help achieve this, each node maintains a successor-list of its r nearest successors on the ring  If node n notices that its successor has failed, it replaces it with the first live entry in the list  stabilize will correct finger table entries and successor-list entries pointing to failed node  Performance is sensitive to the frequency of node joins and leaves versus the frequency at which the stabilization protocol is invoked
  • 24. 24 Chord – The Math  Every node is responsible for about K/N keys (N nodes, K keys)  When a node joins or leaves an N-node network, only O(K/N) keys change hands (and only to and from joining or leaving node)  Lookups need O(log N) messages  To reestablish routing invariants and finger tables after node joining or leaving, only O(log2 N) messages are required
  • 25. 25 Experimental Results  Latency grows slowly with the total number of nodes  Path length for lookups is about ½ log2N  Chord is robust in the face of multiple node failures