First step of “Chord”

First step of “Chord”

First step of “Chord”

3da5b00de1285b12a17d730262cc4824?s=128

Yoshiaki Yoshida

September 23, 2016
Tweet

Transcript

  1. First step of “Chord” 2016-09-23 ࣾ಺ษڧձ @kakakakakku

  2. Cloud Computing Concepts, Part 1 by

  3. ࠷ۙ Coursera Ͱ ཤमͯ͠ΔߨٛͰֶΜͩ “Chord” ΛβοΫϦͱ঺հ͠·͢

  4. What is “Chord” ?

  5. None
  6. (ƅшƅ) ŴƅŜŖƃ ?

  7. εέʔϥϏϦςΟͷ͋Δ P2P ୳ࡧΞϧΰϦζϜʢҙ༁ʣ → ൃද͸2001೥

  8. [Related Algorithms] Tapestry Pastry Kademlia ʘ ࠓ೔͸঺հ͠ͳ͍͚Ͳଞʹ΋͋Δ ʗ

  9. [Related Implementation] Cassandra Dynamo Riak Voldemort ʘ ϛυϧ΢ΣΞΛΠϝʔδ͢Δͱ਌ۙײ༙͘ ʗ

  10. ʘ Dynamo ͷ࿦จ΋·ͨผͷػձʹ঺հ͠·͢ ʗ

  11. P2P Λ෼ྨ͢Δͱ...

  12. Unstructured Overlay Structured Overlay Chord Napster / Gnutella

  13. Goal of “Chord”

  14. େྔͷΩʔΛͲ͏෼ࢄͤ͞Δ ? େྔͷΩʔΛͲ͏ޮ཰తʹ୳ࡧͤ͞Δ ? ϊʔυͷ૿ݮʹͲ͏ରԠ͢Δ ?

  15. “Chord” = Consistent Hashing + Finger Table

  16. (ƅшƅ) Űō?

  17. Consistent Hashing ղઆ

  18. None
  19. ҰݴͰද͢ͱ Ωʔͷ࠶഑ஔͷӨڹΛ࡟ݮͨ͠ ޮ཰తͳϋογϡ๏ʢҙ༁ʣ

  20. Bad Example ʘ ࠷ॳʹμϝͳྫΛݟͯΈ·͠ΐ͏ ʗ

  21. 3 Nodes 4 Keys ΩϨΠʹ ෼ࢄͨ͠ ??? ୯७ʹ mod ͰΩʔΛϊʔυʹ഑ஔ͢Δͱ...

  22. ΋͠1୆ ނোͨ͠৔߹ ΦϨϯδҎ֎ શͯͷΩʔΛ࠶഑ஔ ͢Δඞཁ͕͋Δ

  23. Consistent Hashing ొ৔

  24. ϊʔυͱΩʔΛϋογϡԽͯ͠ Ծ૝Ϧϯά্ʹ഑ஔ͢Δ ※Ծ૝ͷҙຯ͸ࠓճ͸ׂѪ͠·͢...

  25. ֤Ωʔ͔Βݟͯ ࣌ܭճΓʹ1൪ۙ઀ͨ͠ϊʔυʹ ΩʔΛ഑ஔ͢Δͱ͍͏ߟ͑ํ ʢͦͷϊʔυ͸ Successor ͱݺͿʣ

  26. Ϧϯάۭؒ ഑ஔ ഑ஔ ഑ஔ

  27. Ϧϯάۭؒ ނোͰ࠶഑ஔ͕ඞཁͳΩʔ਺͸ ʹ࡟ݮ͞ΕΔ ഑ஔ ࠶഑ஔ ഑ஔ

  28. Αͬͯ ϊʔυ௥Ճʗނোʢҙਤతͳݮগ΋ʣ ʹରͯ͠ ہॴతͳӨڹʹ཈͑ΒΕΔ

  29. Finger Table ղઆ

  30. Chord ͷಛ௃తͳ࢓૊Έ ! ҰݴͰද͢ͱγϣʔτΧοτతͳ ?

  31. Bad Example ʘ ࠷ॳʹμϝͳྫΛݟͯΈ·͠ΐ͏ ʗ

  32. ୳ࡧ͢Δͱ͖ʹ key ͕͋Δ ୳ࡧΛϦΫΤετ ͢Δϊʔυ

  33. ϊʔυΛॱ൪ʹḷͬͯ͠·͏ͱ ઢܗ୳ࡧʹͳͬͯ͠·͏… ʘ Oh, No! ʗ

  34. Finger Table ొ৔

  35. ೚ҙͷϊʔυʹରͯ͠ ࢦ਺ؔ਺తʹ୳ࡧՄೳͳ ϩέʔγϣϯʢҙ༁ʣΛఆΊͯ ଟஈ֊ʹ୳ࡧͤ͞Δ

  36. ͜ͷྫͩͱ m=3 ͰޮՌ͕ແͦ͞͏ʹݟ͑Δ͚Ͳ... Finger Table

  37. ઢܗ୳ࡧΛճආͰ͖ΔͨΊ ۭؒͷεέʔϦϯάʹରͯ͠ ୳ࡧ࣌ؒ͸େ͖͘ࠨӈ͞Εͳ͘ͳΔ ʘ Good! ʗ

  38. “Chord” = Consistent Hashing + Finger Table ʘ βοΫϦͱཧղͯ͠΋Β͑ͨ ?

    ʗ
  39. ࣮ࡍͷ “Chord” Ͱ͸ ϊʔυΛ SHA-1(ip, port) Ͱ഑ஔͯ͠ ΩʔΛ SHA-1(key) Ͱ഑ஔ͢Δ

    ※SHA-1 ͳΒ 160 bit ͷۭؒͰදݱͰ͖Δ
  40. ·ͱΊ

  41. ೔ʑ࢖ͬͯΔٕज़͸ ੈքதͷεΰΠਓ͕ͨͪߟ͑ͨ ΞϧΰϦζϜʹࢧ͑ΒΕ͍ͯΔʂ

  42. ٕज़Λͨͩ࢖͏͚ͩͰ͸ͳ͘ ཁૉٕज़Λཧղ͢Δ͜ͱ΋ॏཁʂ

  43. To be continued …