SlideShare ist ein Scribd-Unternehmen logo
1 von 13
Distributed Hash Tables (DHT)
                Harisankar H
            PhD student, DOS lab,
           Dept. of CSE, IIT Madras
                 11/8/2012

       http://harisankarh.wordpress.com
Motivation
• Bittorrent
  – Given a file id, find the list of nodes currently
    associated with the file
     • File id -> node mapping
     • e.g., get(“sfdsfdsf…”) -> {203.12.123.45,201.128.249.123,…}
• Domain Naming System(DNS)
  – Find IP address of server associated with a domain
    name
     • Domain name -> IP address mapping
     • e.g., get(“google.co.in”) -> {209.234.67.32}
Abstract problem
– Realize a hash table functionality in a
  decentralized manner
   • Interface
      – put(key,value)
      – get(key) -> value
   • Realize using nodes which can join and leave at any
     time


      ....                                  ....




                    [try yourself!]
Simple solutions
• Flooding
   – Put() -> store in any node
      • Cost: O(1)
   – Get() -> send query to all nodes
      • Cost: O(N)
• Full replication
   – Put() -> store in all nodes
      • Cost: O(N)
   – Get() -> check in any one node
      • Cost: O(1)


            [more solutions? try yourself!]
Partitioning in a small setting
• Assign different keys to different nodes
• Need a key to node mapping
  – getnode(key) -> node id
• How to distribute the keys ?
  – assume that every node knows when a node
    join/leave the system
  – Assume key range: 0 to (2k – 1), k-bit key


                 [try yourself!]
Consistent hashing
                           2k – 1   0             40


                                                               Key:51



                                                   70




• Nodes assigned ids in the same space( 0 to 2k – 1)
• Each node is responsible for the key range between
   – Its node id and the id of previous node in the id space
• Responsibilities split accordingly when nodes join and leave
   – Responsibility of each node ≈ K/N
   – <k,v> pairs transferred during node join/leave ≈ K/N
Issues
• In a large internet-scale setting
   – Millions of nodes
   – Low bandwidth
• Costly to inform all the nodes when a node
  joins/leaves the system
   – O(N) messages
• Problem
   – How to realize consistent hashing in a large internet-
     scale setting ?
      • How to implement node join/leave, key put/get ?
      • Assume that you know the IP address of one of the nodes
        which is already part of the system

                      [try yourself!]
Distributed Hash Tables(e.g., Chord)
• Each node(id = n) maintains list of nodes
  responsible for ids: (n + 2i)mod 2k, 0 <= i <= k-1
Key lookup
• Each key lookup query is forwarded to the
  node in the finger table which immediately
  precedes it
Performance
• Key lookup/put
   – O(logN) hops/messages
• Node join/leave
   – O(logN) messages
       • Uses information from neighbours and periodic refreshing
• O(logN) entries in the finger table
                 [proof: try yourself!]
• Scales to large number of nodes in dynamic settings
   – Used in bittorrent
• Different types of DHTs
   – Pastry, Kademlia
Amazon Dynamo
• Key-value store inspired from DHTs
   – Used for Amazon shopping cart
       • Cart id -> added items
• Key features
   – 1 hop key lookup(O(N) neighbours per node)
       • Latency-sensitive application
   – Uses virtual nodes for handling heterogeneity and better load
     dispersion
       • Virtual nodes already proposed in Chord
   – Each data item replicated for availability
       • Versioning using vector clocks
   – Handles several implementation issues
• Cassandra’s architecture inspired from Dynamo
Further research related to DHTs
• Search using DHTs
• Active key-value store
   – Incremental processing
   – Distributed processing
• P2P Computational grid
   – Vishwa: DHT used for coordinator assignment and storing
     task-related data
• Node-capability aware object placement
   – Virat
• P2P file system
   – ENFS
• …
References
1.      Consistent hashing
       1.   Karger, D. etal. (1999). "Web Caching with Consistent
            Hashing". Computer Networks 31 (11): 1203–1213.
2.      Chord
       1.   Ion Stoica etal. “Chord: A Scalable Peer-to-Peer Lookup Protocol for
            Internet Applications”. IEEE/ACM TRANSACTIONS ON NETWORKING,
            VOL. 11, NO. 1, FEBRUARY 2003
3.      Dynamo
       1.   DeCandia etal., “Dynamo: Amazon’s Highly Available Key-value
            Store”, SOSP’07




     Image credits: DHT figures taken from Chord[2] paper

Weitere ähnliche Inhalte

Mehr von Harisankar H

Hariintro exebit 2014
Hariintro exebit 2014Hariintro exebit 2014
Hariintro exebit 2014Harisankar H
 
Large scale graph processing
Large scale graph processingLarge scale graph processing
Large scale graph processingHarisankar H
 
Addressing scalability challenges in peer-to-peer search
Addressing scalability challenges in peer-to-peer searchAddressing scalability challenges in peer-to-peer search
Addressing scalability challenges in peer-to-peer searchHarisankar H
 
Google Spanner : our understanding of concepts and implications
Google Spanner : our understanding of concepts and implicationsGoogle Spanner : our understanding of concepts and implications
Google Spanner : our understanding of concepts and implicationsHarisankar H
 
Learn Australia through multimedia
Learn Australia through multimediaLearn Australia through multimedia
Learn Australia through multimediaHarisankar H
 

Mehr von Harisankar H (6)

Hariintro exebit 2014
Hariintro exebit 2014Hariintro exebit 2014
Hariintro exebit 2014
 
Large scale graph processing
Large scale graph processingLarge scale graph processing
Large scale graph processing
 
Addressing scalability challenges in peer-to-peer search
Addressing scalability challenges in peer-to-peer searchAddressing scalability challenges in peer-to-peer search
Addressing scalability challenges in peer-to-peer search
 
MapReduce basics
MapReduce basicsMapReduce basics
MapReduce basics
 
Google Spanner : our understanding of concepts and implications
Google Spanner : our understanding of concepts and implicationsGoogle Spanner : our understanding of concepts and implications
Google Spanner : our understanding of concepts and implications
 
Learn Australia through multimedia
Learn Australia through multimediaLearn Australia through multimedia
Learn Australia through multimedia
 

Kürzlich hochgeladen

General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...Poonam Aher Patil
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...christianmathematics
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docxPoojaSen20
 
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-IIFood Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-IIShubhangi Sonawane
 
Role Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptxRole Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptxNikitaBankoti2
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfPoh-Sun Goh
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxRamakrishna Reddy Bijjam
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17Celine George
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxVishalSingh1417
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxnegromaestrong
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxDenish Jangid
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.MaryamAhmad92
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Shubhangi Sonawane
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibitjbellavia9
 

Kürzlich hochgeladen (20)

General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-IIFood Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
 
Role Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptxRole Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptx
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 

Slides used in course lecture on distributed hash tables

  • 1. Distributed Hash Tables (DHT) Harisankar H PhD student, DOS lab, Dept. of CSE, IIT Madras 11/8/2012 http://harisankarh.wordpress.com
  • 2. Motivation • Bittorrent – Given a file id, find the list of nodes currently associated with the file • File id -> node mapping • e.g., get(“sfdsfdsf…”) -> {203.12.123.45,201.128.249.123,…} • Domain Naming System(DNS) – Find IP address of server associated with a domain name • Domain name -> IP address mapping • e.g., get(“google.co.in”) -> {209.234.67.32}
  • 3. Abstract problem – Realize a hash table functionality in a decentralized manner • Interface – put(key,value) – get(key) -> value • Realize using nodes which can join and leave at any time .... .... [try yourself!]
  • 4. Simple solutions • Flooding – Put() -> store in any node • Cost: O(1) – Get() -> send query to all nodes • Cost: O(N) • Full replication – Put() -> store in all nodes • Cost: O(N) – Get() -> check in any one node • Cost: O(1) [more solutions? try yourself!]
  • 5. Partitioning in a small setting • Assign different keys to different nodes • Need a key to node mapping – getnode(key) -> node id • How to distribute the keys ? – assume that every node knows when a node join/leave the system – Assume key range: 0 to (2k – 1), k-bit key [try yourself!]
  • 6. Consistent hashing 2k – 1 0 40 Key:51 70 • Nodes assigned ids in the same space( 0 to 2k – 1) • Each node is responsible for the key range between – Its node id and the id of previous node in the id space • Responsibilities split accordingly when nodes join and leave – Responsibility of each node ≈ K/N – <k,v> pairs transferred during node join/leave ≈ K/N
  • 7. Issues • In a large internet-scale setting – Millions of nodes – Low bandwidth • Costly to inform all the nodes when a node joins/leaves the system – O(N) messages • Problem – How to realize consistent hashing in a large internet- scale setting ? • How to implement node join/leave, key put/get ? • Assume that you know the IP address of one of the nodes which is already part of the system [try yourself!]
  • 8. Distributed Hash Tables(e.g., Chord) • Each node(id = n) maintains list of nodes responsible for ids: (n + 2i)mod 2k, 0 <= i <= k-1
  • 9. Key lookup • Each key lookup query is forwarded to the node in the finger table which immediately precedes it
  • 10. Performance • Key lookup/put – O(logN) hops/messages • Node join/leave – O(logN) messages • Uses information from neighbours and periodic refreshing • O(logN) entries in the finger table [proof: try yourself!] • Scales to large number of nodes in dynamic settings – Used in bittorrent • Different types of DHTs – Pastry, Kademlia
  • 11. Amazon Dynamo • Key-value store inspired from DHTs – Used for Amazon shopping cart • Cart id -> added items • Key features – 1 hop key lookup(O(N) neighbours per node) • Latency-sensitive application – Uses virtual nodes for handling heterogeneity and better load dispersion • Virtual nodes already proposed in Chord – Each data item replicated for availability • Versioning using vector clocks – Handles several implementation issues • Cassandra’s architecture inspired from Dynamo
  • 12. Further research related to DHTs • Search using DHTs • Active key-value store – Incremental processing – Distributed processing • P2P Computational grid – Vishwa: DHT used for coordinator assignment and storing task-related data • Node-capability aware object placement – Virat • P2P file system – ENFS • …
  • 13. References 1. Consistent hashing 1. Karger, D. etal. (1999). "Web Caching with Consistent Hashing". Computer Networks 31 (11): 1203–1213. 2. Chord 1. Ion Stoica etal. “Chord: A Scalable Peer-to-Peer Lookup Protocol for Internet Applications”. IEEE/ACM TRANSACTIONS ON NETWORKING, VOL. 11, NO. 1, FEBRUARY 2003 3. Dynamo 1. DeCandia etal., “Dynamo: Amazon’s Highly Available Key-value Store”, SOSP’07 Image credits: DHT figures taken from Chord[2] paper