![Page 1: Chord: A Scalable Peer-to-Peer Lookup Protocol for Internet Applications](https://reader035.vdocument.in/reader035/viewer/2022062520/56815a9c550346895dc81d7a/html5/thumbnails/1.jpg)
Chord: A Scalable Peer-to-Peer Lookup Protocol for Internet Applications
Stoica et al.
Presented by Tam Chantem
March 30, 2007
![Page 2: Chord: A Scalable Peer-to-Peer Lookup Protocol for Internet Applications](https://reader035.vdocument.in/reader035/viewer/2022062520/56815a9c550346895dc81d7a/html5/thumbnails/2.jpg)
03/30/07 Chord: Stoica et al. 2
Outline
• Problem• Approach• Results• Conclusion
![Page 3: Chord: A Scalable Peer-to-Peer Lookup Protocol for Internet Applications](https://reader035.vdocument.in/reader035/viewer/2022062520/56815a9c550346895dc81d7a/html5/thumbnails/3.jpg)
03/30/07 Chord: Stoica et al. 3
Peer-to-Peer Applications
• More and more popular• Decentralized• Information is everywhere
![Page 4: Chord: A Scalable Peer-to-Peer Lookup Protocol for Internet Applications](https://reader035.vdocument.in/reader035/viewer/2022062520/56815a9c550346895dc81d7a/html5/thumbnails/4.jpg)
03/30/07 Chord: Stoica et al. 4
Peer-to-Peer Applications
• More and more popular• Decentralized• Information is everywhere
– How to find data?
![Page 5: Chord: A Scalable Peer-to-Peer Lookup Protocol for Internet Applications](https://reader035.vdocument.in/reader035/viewer/2022062520/56815a9c550346895dc81d7a/html5/thumbnails/5.jpg)
03/30/07 Chord: Stoica et al. 5
Peer-to-Peer Applications
• More and more popular• Decentralized• Information is everywhere
– How to find data?– As nodes come and go…
![Page 6: Chord: A Scalable Peer-to-Peer Lookup Protocol for Internet Applications](https://reader035.vdocument.in/reader035/viewer/2022062520/56815a9c550346895dc81d7a/html5/thumbnails/6.jpg)
03/30/07 Chord: Stoica et al. 6
Some Solutions
• Exhaustive search• Centralized directory servers
![Page 7: Chord: A Scalable Peer-to-Peer Lookup Protocol for Internet Applications](https://reader035.vdocument.in/reader035/viewer/2022062520/56815a9c550346895dc81d7a/html5/thumbnails/7.jpg)
03/30/07 Chord: Stoica et al. 7
Some Solutions
• Exhaustive search• Centralized directory servers
Not Scalable
![Page 8: Chord: A Scalable Peer-to-Peer Lookup Protocol for Internet Applications](https://reader035.vdocument.in/reader035/viewer/2022062520/56815a9c550346895dc81d7a/html5/thumbnails/8.jpg)
03/30/07 Chord: Stoica et al. 8
Some Solutions
• Exhaustive search• Centralized directory servers
• Partial search• Caching
Not Scalable
![Page 9: Chord: A Scalable Peer-to-Peer Lookup Protocol for Internet Applications](https://reader035.vdocument.in/reader035/viewer/2022062520/56815a9c550346895dc81d7a/html5/thumbnails/9.jpg)
03/30/07 Chord: Stoica et al. 9
Some Solutions
• Exhaustive search• Centralized directory servers
• Partial search• Caching
Not Scalable
False negative, Inconsistency
![Page 10: Chord: A Scalable Peer-to-Peer Lookup Protocol for Internet Applications](https://reader035.vdocument.in/reader035/viewer/2022062520/56815a9c550346895dc81d7a/html5/thumbnails/10.jpg)
03/30/07 Chord: Stoica et al. 10
Chord
• Distributed hash table across nodes
• Given a key, map key to node storing the data
• Flat naming for keys and nodes
![Page 11: Chord: A Scalable Peer-to-Peer Lookup Protocol for Internet Applications](https://reader035.vdocument.in/reader035/viewer/2022062520/56815a9c550346895dc81d7a/html5/thumbnails/11.jpg)
03/30/07 Chord: Stoica et al. 11
Using Chord
Application A
Chord
1. Lookup(key) 2. IP = 292.164.2.3
3. Contact 292.164.2.3
Node i
![Page 12: Chord: A Scalable Peer-to-Peer Lookup Protocol for Internet Applications](https://reader035.vdocument.in/reader035/viewer/2022062520/56815a9c550346895dc81d7a/html5/thumbnails/12.jpg)
03/30/07 Chord: Stoica et al. 12
Hashing in Chord
• Consistent hash function: m-bit IDs– Hash key key ID– Hash node’s IP address node ID
• Use hashing to map key ID to node ID
![Page 13: Chord: A Scalable Peer-to-Peer Lookup Protocol for Internet Applications](https://reader035.vdocument.in/reader035/viewer/2022062520/56815a9c550346895dc81d7a/html5/thumbnails/13.jpg)
03/30/07 Chord: Stoica et al. 13
Chord Ring
• Organize nodes based on their ID
N8
N14
N32N38
N42
N56
![Page 14: Chord: A Scalable Peer-to-Peer Lookup Protocol for Internet Applications](https://reader035.vdocument.in/reader035/viewer/2022062520/56815a9c550346895dc81d7a/html5/thumbnails/14.jpg)
03/30/07 Chord: Stoica et al. 14
Key Mapping
• Key k First node n, n’s ID k
• Balance load with high probability
![Page 15: Chord: A Scalable Peer-to-Peer Lookup Protocol for Internet Applications](https://reader035.vdocument.in/reader035/viewer/2022062520/56815a9c550346895dc81d7a/html5/thumbnails/15.jpg)
03/30/07 Chord: Stoica et al. 15
Key Mapping Example
N8
N14
N32N38
N42
N56
K54
K38
K10
K24
K30
![Page 16: Chord: A Scalable Peer-to-Peer Lookup Protocol for Internet Applications](https://reader035.vdocument.in/reader035/viewer/2022062520/56815a9c550346895dc81d7a/html5/thumbnails/16.jpg)
03/30/07 Chord: Stoica et al. 16
Key Location
• Linear time if nodes keep track of one successor
• Keep track of more successors to get logarithmic time– m successors if ID is m-bit long
• Use finger table
![Page 17: Chord: A Scalable Peer-to-Peer Lookup Protocol for Internet Applications](https://reader035.vdocument.in/reader035/viewer/2022062520/56815a9c550346895dc81d7a/html5/thumbnails/17.jpg)
03/30/07 Chord: Stoica et al. 17
Finger Table
• Want to reduce distance from node that makes query to target node by half each time
• The ith entry of the table of n is node that succeeds n by at least 2i-1 nodes finger[i] = successor(n + 2i-1) % m
![Page 18: Chord: A Scalable Peer-to-Peer Lookup Protocol for Internet Applications](https://reader035.vdocument.in/reader035/viewer/2022062520/56815a9c550346895dc81d7a/html5/thumbnails/18.jpg)
03/30/07 Chord: Stoica et al. 18
Constructing a Finger Table
• We don’t know whether a node exists
![Page 19: Chord: A Scalable Peer-to-Peer Lookup Protocol for Internet Applications](https://reader035.vdocument.in/reader035/viewer/2022062520/56815a9c550346895dc81d7a/html5/thumbnails/19.jpg)
03/30/07 Chord: Stoica et al. 19
Constructing a Finger Table
• We don’t know whether a node exists
• So to fill an entry:– Compute: key = successor(n + 2i-1) % m
– Do lookup(key)– Fill entry with the node that has key
![Page 20: Chord: A Scalable Peer-to-Peer Lookup Protocol for Internet Applications](https://reader035.vdocument.in/reader035/viewer/2022062520/56815a9c550346895dc81d7a/html5/thumbnails/20.jpg)
03/30/07 Chord: Stoica et al. 20
Constructing a Finger Table
• We don’t know whether a node exists
• So to fill an entry:– Compute: key = successor(n + 2i-1) % m
– Do lookup(key)– Fill entry with the node that has key
• Also keep track of predecessor
![Page 21: Chord: A Scalable Peer-to-Peer Lookup Protocol for Internet Applications](https://reader035.vdocument.in/reader035/viewer/2022062520/56815a9c550346895dc81d7a/html5/thumbnails/21.jpg)
03/30/07 Chord: Stoica et al. 21
Locating a Key
• Go to largest node that precedes key
N8 + 1 N14
N8 + 2 N14
N8 + 4 N14
N8 + 8 N32
N8 + 16 N32
N8 + 32 N42
![Page 22: Chord: A Scalable Peer-to-Peer Lookup Protocol for Internet Applications](https://reader035.vdocument.in/reader035/viewer/2022062520/56815a9c550346895dc81d7a/html5/thumbnails/22.jpg)
03/30/07 Chord: Stoica et al. 22
Looking up K54 by N8
N8
N14
N32N38
N42
N56
K54
K38
K10
K24
K30
![Page 23: Chord: A Scalable Peer-to-Peer Lookup Protocol for Internet Applications](https://reader035.vdocument.in/reader035/viewer/2022062520/56815a9c550346895dc81d7a/html5/thumbnails/23.jpg)
03/30/07 Chord: Stoica et al. 23
Looking up K54 by N8
N8
N14
N32N38
N42
N56
K54
K38
K10
K24
K30
![Page 24: Chord: A Scalable Peer-to-Peer Lookup Protocol for Internet Applications](https://reader035.vdocument.in/reader035/viewer/2022062520/56815a9c550346895dc81d7a/html5/thumbnails/24.jpg)
03/30/07 Chord: Stoica et al. 24
Looking up K54 by N8
N8
N14
N32N38
N42
N56
K54
K38
K10
K24
K30
![Page 25: Chord: A Scalable Peer-to-Peer Lookup Protocol for Internet Applications](https://reader035.vdocument.in/reader035/viewer/2022062520/56815a9c550346895dc81d7a/html5/thumbnails/25.jpg)
03/30/07 Chord: Stoica et al. 25
Accounting for Volatility
• Node relies on successor(s) for correctness
• How can we ensure this when nodes leave/join the network?
![Page 26: Chord: A Scalable Peer-to-Peer Lookup Protocol for Internet Applications](https://reader035.vdocument.in/reader035/viewer/2022062520/56815a9c550346895dc81d7a/html5/thumbnails/26.jpg)
03/30/07 Chord: Stoica et al. 26
Key Remapping
N8
N14
N32N38
N42
N56
K54
K38
K10
K24
K30
![Page 27: Chord: A Scalable Peer-to-Peer Lookup Protocol for Internet Applications](https://reader035.vdocument.in/reader035/viewer/2022062520/56815a9c550346895dc81d7a/html5/thumbnails/27.jpg)
03/30/07 Chord: Stoica et al. 27
Key Remapping
N8
N14
N32
N42
N56
K54
K38
K10
K24
K30
N38
![Page 28: Chord: A Scalable Peer-to-Peer Lookup Protocol for Internet Applications](https://reader035.vdocument.in/reader035/viewer/2022062520/56815a9c550346895dc81d7a/html5/thumbnails/28.jpg)
03/30/07 Chord: Stoica et al. 28
Key Remapping
N8
N14
N32N38
N42
N56
K54K10
K24
K30
![Page 29: Chord: A Scalable Peer-to-Peer Lookup Protocol for Internet Applications](https://reader035.vdocument.in/reader035/viewer/2022062520/56815a9c550346895dc81d7a/html5/thumbnails/29.jpg)
03/30/07 Chord: Stoica et al. 29
Joining
N8
N14
N32N38
N42
N56
K54
K38K10
K24
K30
New Node
![Page 30: Chord: A Scalable Peer-to-Peer Lookup Protocol for Internet Applications](https://reader035.vdocument.in/reader035/viewer/2022062520/56815a9c550346895dc81d7a/html5/thumbnails/30.jpg)
03/30/07 Chord: Stoica et al. 30
Joining
N8
N14
N32N38
N42
N56
K54
K38K10
K24
K30
New Node
Requests
![Page 31: Chord: A Scalable Peer-to-Peer Lookup Protocol for Internet Applications](https://reader035.vdocument.in/reader035/viewer/2022062520/56815a9c550346895dc81d7a/html5/thumbnails/31.jpg)
03/30/07 Chord: Stoica et al. 31
Joining
N8
N14
N32N38
N42
N56
K54
K38K10
K24
K30
New Node
Successor info
![Page 32: Chord: A Scalable Peer-to-Peer Lookup Protocol for Internet Applications](https://reader035.vdocument.in/reader035/viewer/2022062520/56815a9c550346895dc81d7a/html5/thumbnails/32.jpg)
03/30/07 Chord: Stoica et al. 32
Joining
N8
N14
N32N38
N42
N56
K54
K38K10
K24
K30
N26
![Page 33: Chord: A Scalable Peer-to-Peer Lookup Protocol for Internet Applications](https://reader035.vdocument.in/reader035/viewer/2022062520/56815a9c550346895dc81d7a/html5/thumbnails/33.jpg)
03/30/07 Chord: Stoica et al. 33
Joining
N8
N14
N32N38
N42
N56
K54
K38K10
K24
K30
N26
![Page 34: Chord: A Scalable Peer-to-Peer Lookup Protocol for Internet Applications](https://reader035.vdocument.in/reader035/viewer/2022062520/56815a9c550346895dc81d7a/html5/thumbnails/34.jpg)
03/30/07 Chord: Stoica et al. 34
Periodic Stabilizing
N8
N14
N32N38
N42
N56
K54
K38K10
K30
N26
predecessor?
K24
![Page 35: Chord: A Scalable Peer-to-Peer Lookup Protocol for Internet Applications](https://reader035.vdocument.in/reader035/viewer/2022062520/56815a9c550346895dc81d7a/html5/thumbnails/35.jpg)
03/30/07 Chord: Stoica et al. 35
Periodic Stabilizing
N8
N14
N32N38
N42
N56
K54
K38K10
K30
N26
N26K24
![Page 36: Chord: A Scalable Peer-to-Peer Lookup Protocol for Internet Applications](https://reader035.vdocument.in/reader035/viewer/2022062520/56815a9c550346895dc81d7a/html5/thumbnails/36.jpg)
03/30/07 Chord: Stoica et al. 36
Periodic Stabilizing
N8
N14
N32N38
N42
N56
K54
K38K10
K24
K30
N26
![Page 37: Chord: A Scalable Peer-to-Peer Lookup Protocol for Internet Applications](https://reader035.vdocument.in/reader035/viewer/2022062520/56815a9c550346895dc81d7a/html5/thumbnails/37.jpg)
03/30/07 Chord: Stoica et al. 37
Hard Cases
• Data may not be found while pointers are being moved
• In reality, may not have time for stabilization
![Page 38: Chord: A Scalable Peer-to-Peer Lookup Protocol for Internet Applications](https://reader035.vdocument.in/reader035/viewer/2022062520/56815a9c550346895dc81d7a/html5/thumbnails/38.jpg)
03/30/07 Chord: Stoica et al. 38
Performance
• Good load balancing
• Logarithmic path length for lookups
• ~0.15% of lookups fail– When join/leave rate is 0.40 per second– Ask incorrect successor
![Page 39: Chord: A Scalable Peer-to-Peer Lookup Protocol for Internet Applications](https://reader035.vdocument.in/reader035/viewer/2022062520/56815a9c550346895dc81d7a/html5/thumbnails/39.jpg)
03/30/07 Chord: Stoica et al. 39
Chord
• Locate distributed data based on key
• Features:– Load balancing– High availability– Scalability
![Page 40: Chord: A Scalable Peer-to-Peer Lookup Protocol for Internet Applications](https://reader035.vdocument.in/reader035/viewer/2022062520/56815a9c550346895dc81d7a/html5/thumbnails/40.jpg)
03/30/07 Chord: Stoica et al. 40
Discussion
• Strengths and weaknesses of Chord?
• How can we improve Chord?
• Chord instead of DNS?