Share
Embed
Transcript
23 slides
-
Paper • Chord: A scalable peer-to-peer lookup service for internet
applications • Oon Stoica, Robert Morris, David Karger, M. Frans Kaashoek, Hari Balakrishnan • MIT Laboratory for Computer Science • SIGCOMM 2001 -
P2Pネットワーク • P2P上のデータを検索したい • 非構造化P2Pネットワーク ◦ Gnutella, Freenet ◦ クエリが多い
• 構造化P2Pネットワーク ◦ トポロジを構造化 ◦ 柔軟な検索ができない -
Consistent hashing • 各ノードと key を m-bit identifier に割り当てる ◦
ノードの identifier は IP アドレスのハッシュ ◦ key は key のハッシュ • 右図は、m=3 の例 • ノードの参加と離脱の影響を最小化するよう設計 されている * KARGER, D., LEHMAN, E., LEIGHTON, F., LEVINE, M., LEWIN, D., AND PANIGRAHY, R. Consistent hashing and random trees: Distributed caching protocols for relieving hot spots on the World Wide Web. In Proceedings of the 29th Annual ACM Symposium on Theory of Computing (El Paso, TX, May 1997), pp. 654–663. -
DHT: Distributed Hash Table • 分散ハッシュテーブル • key を hash
することによって配置するノードを決定 https://en.wikipedia.org/wiki/Distributed_hash_table -
Chord 概要 2/2 • 仮想的なリング状に m ビットのハッシュ空間 (ID空間) を形成 ◦
各ノードはノードIDを持ち、ID空間上に配置される • key のハッシュ値によってデータの ID を決定 ◦ ID空間上最も近いIDを持つノードに保持される ◦ 右図でいうと、1と3の間のIDを持つデータは、ノード 3で保持される ※緑の◦がノード -
Chord が解決する課題 • Load Balance ◦ hash function • Decentralization
◦ fully distributed • Scalability ◦ No parameter tuning is required • Availability ◦ automatically adjusts internal tables • Flexible naming ◦ Chord key-space is flat -
Chord の計算量 • ノード数 N に対して計算量が O(logN) ◦ Chord は底が
2 で固定 ▪ テーブルの大きさ m に対して、2分探索でノードが決まる • DKS* では k分探索 に拡張 ◦ O(logkN) * L. Alima, S. El-Ansary, P. Brand, and S. Haridi. DKS(N, k, f): A Family of Low Communication, Scalable and Fault-Tolerant Infrastructures for P2P Applications. In the 3rd Int. workshop on Global and P2P Computing on Large Scale Distributed Systems, CCGRID 2003, pp. 344–350, 2003. -
Chord ノードの保持する情報 1/2 • successor ◦ ID 空間上で各ノードから時計回りに最も近いノード ◦ 例:
successor(1) = 1, successor(2) = 3 • predecessor ◦ 反時計回りに最も近いノード ◦ 例: predecessor(4) = 3 -
Chord ノードの保持する情報 2/2 • finger table ◦ 各ノードから 2^i (0<=i<m)
離れた ID に (時計回りに) 最も近い ID を持つノードへのポインタを 格納した経路表 -
finger table 1/2 • 各ノードから 2^i (0<=i<m) 離れた ID に最も近いノードへのポインタのテーブル
• 2分探索に帰着 https://www.slideshare.net/GertThijs/chord-presentation -
finger table 2/2 • N8 ノードに問い合わせが来た場合 ◦ keyのIDが successor に含まれる場合、return
successor として N14 を返却 ◦ そうでなければ、finger table 内の該当ノードを返却(この場合は、 N42 を返却) https://www.slideshare.net/GertThijs/chord-presentation -
ノードの参加と離脱 • dynamic network におけるノードの参加と離脱がゴール • 前提:Invariant の維持 ◦ Each
node’s successor is correctly maintained ◦ For every key k, node successor(k) is responsible for k • ノードの参加と離脱をシンプルにするため、predecessor ポインタをメンテする -
ノードの参加と離脱 • ノード n の追加 1. Initialize the predecessor and
fingers of node n 2. Update the fingers and predecessors of existing nodes to reflect the addition of n 3. Notify the higher layer software so that it can transfer state associated with keys that node n is now responsible for -
Node Failure • ノード障害が発生すると、Lookup ができなくなる • 各ノードは successor-list をメンテナンスする ◦
r 個の successor のリスト ◦ 最初の successor が見えなくなると、残りの successor を探しにいく -
Simulation - Load Balance • a) キー数とノード当たりのキー数の関係 • b) キー数に対するPDF
(確率密度関数) ※ノード数は10^4 -
Experimental Results • ノード数に対する Lookup のレイテンシ ◦ in California, Colorado,
Massachusetts, New York, North Carolina, and Pennsylvania ◦ 160-bit keys obtained from the SHA-1 cryptographic hash function -
まとめ • Load Balance ◦ 分散ハッシュテーブル • Decentralization ◦ fully
distributed • Scalability ◦ logN のコスト • Availability ◦ 動的なノード参加と離脱