distributed hash tables - courses.cs.washington.edu · 2014-03-05 · • hash table • data...

19
Distributed Hash Tables

Upload: others

Post on 06-Jun-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Distributed Hash Tables - courses.cs.washington.edu · 2014-03-05 · • Hash Table • data structure that maps “keys” to “values” • essential building block in software

Distributed Hash Tables

Page 2: Distributed Hash Tables - courses.cs.washington.edu · 2014-03-05 · • Hash Table • data structure that maps “keys” to “values” • essential building block in software

What is a DHT?

• Hash Table• data structure that maps “keys” to “values”

• essential building block in software systems

• Distributed Hash Table (DHT) • similar, but spread across many hosts

• Interface • insert(key, value)

• lookup(key)

Page 3: Distributed Hash Tables - courses.cs.washington.edu · 2014-03-05 · • Hash Table • data structure that maps “keys” to “values” • essential building block in software

How do DHTs work?

Every DHT node supports a single operation:

• Given key as input; route messages to node holding key

• DHTs are content-addressable

Page 4: Distributed Hash Tables - courses.cs.washington.edu · 2014-03-05 · • Hash Table • data structure that maps “keys” to “values” • essential building block in software

DHT: basic idea

K V

K V

K V

K V

K V

K V

K V

K V

K V

K V

K V

Page 5: Distributed Hash Tables - courses.cs.washington.edu · 2014-03-05 · • Hash Table • data structure that maps “keys” to “values” • essential building block in software

DHT: basic idea

Neighboring nodes are “connected” at the application-level

K V

K V

K V

K V

K V

K V

K V

K V

K V

K V

K V

Page 6: Distributed Hash Tables - courses.cs.washington.edu · 2014-03-05 · • Hash Table • data structure that maps “keys” to “values” • essential building block in software

DHT: basic idea

Operation: take key as input; route messages to node holding key

K V

K V

K V

K V

K V

K V

K V

K V

K V

K V

K V

Page 7: Distributed Hash Tables - courses.cs.washington.edu · 2014-03-05 · • Hash Table • data structure that maps “keys” to “values” • essential building block in software

DHT: basic idea

insert(K1,V1)

Operation: take key as input; route messages to node holding key

K V

K V

K V

K V

K V

K V

K V

K V

K V

K V

K V

Page 8: Distributed Hash Tables - courses.cs.washington.edu · 2014-03-05 · • Hash Table • data structure that maps “keys” to “values” • essential building block in software

insert(K1,V1)

DHT: basic idea

Operation: take key as input; route messages to node holding key

K V

K V

K V

K V

K V

K V

K V

K V

K V

K V

K V

Page 9: Distributed Hash Tables - courses.cs.washington.edu · 2014-03-05 · • Hash Table • data structure that maps “keys” to “values” • essential building block in software

(K1,V1)

DHT: basic idea

Operation: take key as input; route messages to node holding key

K V

K V

K V

K V

K V

K V

K V

K V

K V

K V

K V

Page 10: Distributed Hash Tables - courses.cs.washington.edu · 2014-03-05 · • Hash Table • data structure that maps “keys” to “values” • essential building block in software

retrieve (K1)

DHT: basic idea

Operation: take key as input; route messages to node holding key

K V

K V

K V

K V

K V

K V

K V

K V

K V

K V

K V

Page 11: Distributed Hash Tables - courses.cs.washington.edu · 2014-03-05 · • Hash Table • data structure that maps “keys” to “values” • essential building block in software

Fundamental Design Idea I• Consistent Hashing

• Map keys and nodes to an identifier space; implicit assignment of responsibility

IdentifiersA C DB

Key

Mapping performed using hash functions (e.g., SHA-1)

11111111110000000000

• What is the advantage of consistent hashing?

Page 12: Distributed Hash Tables - courses.cs.washington.edu · 2014-03-05 · • Hash Table • data structure that maps “keys” to “values” • essential building block in software

Fundamental Design Idea II

• Prefix / Hypercube routing

Source

Destination

Page 13: Distributed Hash Tables - courses.cs.washington.edu · 2014-03-05 · • Hash Table • data structure that maps “keys” to “values” • essential building block in software

How to design a DHT?

• State Assignment:• what “(key, value) tables” does a node store?

• Network Topology: • how does a node select its neighbors?

• Routing Algorithm: • which neighbor to pick while routing to a destination?

• Various DHT algorithms make different choices• CAN, Chord, Pastry, Tapestry, Plaxton, Viceroy, Kademlia,

Skipnet, Symphony, Koorde, Apocrypha, Land, ORDI …

Page 14: Distributed Hash Tables - courses.cs.washington.edu · 2014-03-05 · • Hash Table • data structure that maps “keys” to “values” • essential building block in software

State Assignment in Chord

• Nodes are randomly chosen points on a clock-wise Ring of values

• Each node stores the id space (values) between itself and its predecessor

d(100, 111) = 3

000

101

100

011

010

001

110

111

Page 15: Distributed Hash Tables - courses.cs.washington.edu · 2014-03-05 · • Hash Table • data structure that maps “keys” to “values” • essential building block in software

Chord Topology and Route Selection

• Neighbor selection: ith neighbor at 2i distance

• Route selection: pick neighbor closest to destination

000

101

100

011

010

001

110

111 d(000, 001) = 1

d(000, 010) = 2

d(000, 001) = 4

110

Page 16: Distributed Hash Tables - courses.cs.washington.edu · 2014-03-05 · • Hash Table • data structure that maps “keys” to “values” • essential building block in software

Issues

• How do you characterize the performance of DHTs?

Page 17: Distributed Hash Tables - courses.cs.washington.edu · 2014-03-05 · • Hash Table • data structure that maps “keys” to “values” • essential building block in software

Issues

• What are the fault tolerance/correctness issues?

Page 18: Distributed Hash Tables - courses.cs.washington.edu · 2014-03-05 · • Hash Table • data structure that maps “keys” to “values” • essential building block in software

Issues

• What are the security issues?

Page 19: Distributed Hash Tables - courses.cs.washington.edu · 2014-03-05 · • Hash Table • data structure that maps “keys” to “values” • essential building block in software

Issues

• What are the load balance issues?