Distributed Hash Table - Distributed Operating Systems - Lecture Slides, Slides of Operating Systems

Distributed Operating Systems course is designed to examine the fundamental principles of distributed systems, and provide students hands-on experience in developing distributed protocols. This lecture includes: Distributed Hash Table, Peer-To-Peer Systems, Centralized Servers, Distributed Hash Tables, Chord Algorithm, Scalable Key Location, Node Joins

Typology: Slides

2013/2014

Uploaded on 02/01/2014

sailendra
sailendra 🇮🇳

4.3

(19)

113 documents

1 / 22

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Chord - A Distributed Hash Table
docsity.com
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16

Partial preview of the text

Download Distributed Hash Table - Distributed Operating Systems - Lecture Slides and more Slides Operating Systems in PDF only on Docsity!

Chord - A Distributed Hash Table

Outline

  • Lookup problem in Peer-to-Peer systems and Solutions
  • Chord Algorithm
    • Consistent Hashing
    • Scalable Key Location
    • Node joins
    • Stabilization
  • Summary

2

Solutions to lookup problem

  • Centralized servers
    • Maintain the current location of data items in a central server
    • Central server becomes crucial
    • Best for simple and small applications
  • Flooding search
    • Broadcast a request for an item among the nodes
    • No additional routing information
    • High bandwidth consumption

4

Solutions to lookup problem

  • Distributed hash tables
    • A global view of data distributed among many nodes
    • Mapping nodes and data items into a common address space
    • Each DHT node manages a small number of references to other nodes
    • Queries are routed via a small number of nodes to the target node
    • Load for retrieving items should be balanced equally among all nodes
    • Robust against random failure and attacks
    • Provides a definitive answer to a query

5

Chord Algorithm – Consistent

Hashing

identifier space : m=

node key

7

6

1

2

0

4

6 2

5

1

3

7

identifier

circle

Chord Algorithm – Simple Key Lookup

• Simple Key Lookup

8

1

2

6

0

4

6 2

5

1

3

7

 Queries are passed

around the circle

via successor

pointers

 Requires traversing

All nodes to find the

appropriate

mapping

successor(1) = 3

successor(3) = 6

successor(6) = 0

successor(0) = 1

Node 0 sends a

query for key 6

Chord Algorithm – Scalable Key Location

For. start Int. Succ.

10

Finger table

m = 3, each node n maintains at most 3 entries

0

4

6 2

5

1

3

7

finger table keys

0+

0

0+

1

0+

2

1

2

4

[1,2) 3

3

6

[2,4)

[4,0)

finger table keys

For. start Int. Succ.

3+

0

3+

1

3+

2

4

5

7

[4,5) 6

6

0

[5,7)

[7,3)

1

2

finger table keys

For. start Int. Succ.

6+

0

6+

1

6+

2

7

0

2

[7,0) 0

0

3

[0,2)

[2,6)

5

Chord Algorithm – Scalable Key Location

11

 Query

• Upon receiving a query for key id, a node

 Check whether it stores the item locally

 If not, forwards the query to the largest node in its

successor table that does not exceed id

Chord Algorithm - Node joins

  • Invariants to preserve
    • Each node’s successor is correctly maintained
    • For every key k, node succ(k) is responsible for k
  • It is desirable for the finger tables to be correct
  • Tasks to be performed by Chord
    • Initialize the predecessor and fingers of node n
    • Update the fingers and predecessor of existing nodes to reflect the

addition of n

  • Notify the higher layer software so that it can transfer state

associated with keys that node n is now responsible for

13

Chord Algorithm - Node joins

start Int. Succ.

1 [1,2) 3

2

[2,4) 3

4 [4,0) 7

14

0

4

6 2

5

1

3

7

finger table keys

finger table keys

start Int. Succ.

4 [4,5) 7

5 [5,7) 7

7 [7,3) 7

1

2

finger table keys

start Int. Succ.

0 [0,1) 0

1 [1,3) 0

3 [3,7) 3

6

4

Successor 0

Predecessor 3 5

Successor 3

Predecessor 7

Successor 7

Predecessor 0

finger table keys

start Int. Succ.

6 [6,7)

7 [7,1)

1 [1,5)

7

7

3

Successor

Predecessor

7

3

Initializing fingers and predecessor

find_succ(6);

Chord Algorithm - Node joins

start Int. Succ.

1 [1,2) 3

2

[2,4) 3

4 [4,0) 7

16

0

4

6 2

5

1

3

7

finger table keys

5

finger table keys

start Int. Succ.

4 [4,5) 7

5 [5,7) 7

7 [7,3) 7

5

1

2

finger table keys

start Int. Succ.

0 [0,1) 0

1 [1,3) 0

3 [3,7) 3

6

4

Successor 0

Predecessor 3 5

Successor 3

Predecessor 7

Successor 6

Predecessor 0

5

finger table keys

start Int. Succ.

6 [6,7)

7 [7,1)

1 [1,5)

7

7

3

Successor

Predecessor

7

3

5

Transferring Keys

Chord Algorithm - Node joins

start Int. Succ.

1 [1,2) 3

2

[2,4) 3

4 [4,0) 7

17

0

4

6 2

5

1

3

7

finger table keys

7

finger table keys

start Int. Succ.

4 [4,5) 7

5 [5,7) 7

7 [7,3) 7

7

1

2

finger table keys

start Int. Succ.

0 [0,1) 0

1 [1,3) 0

3 [3,7) 3

6

4

Successor 0

Predecessor 3 5

Successor 3

Predecessor 7

Successor 6

Predecessor 0

7

finger table keys

start Int. Succ.

6 [6,7)

7 [7,1)

1 [1,5)

7

7

3

Successor

Predecessor

7

3

7

Query without all finger tables been updated

succ(4) = 7

Chord Algorithm – Node Failure

  • Node Failure
    • Successor-list
    • If successor fails, replace it with the first live entry in the list
    • Later run stabilization to correct finger table and successor-list

19

Summary

  • Characteristics of Chord
    • Load balance

distributed hash table

  • Decentralization

fully distributed

  • Scalability

cost of lookup grows logarithmic

  • Availability

automatically adjusts internal tables

  • Flexible naming

no constraints on the structure of the keys

Routing Hops O(logN)
Arrival O(log

2

N)
Departure O(log

2

N)

20