Chord presentation
1. Chord: A Scalable Peer- to-peer Lookup Protocol for Internet Applications Ion Stoica, Robert Morris, David Liben-Nowell, David R.Karger, M. Frans Kaashoek, Frank Dabek Hari Balakrishnan
2. About Chord• Protocol and algorithm for distributed hash table (DHT)• Structured-decentralized P2P overlay network
3. About Chord• Supports just one operation: lookup(key) • Given a key, it maps the key onto a node • Returns the IP-address of the node• Associate a value with each key and store the pair on the resulting node: • Distributed hash table• Uses consistent hashing for this operation
4. Chord properties (1)• Load balancing: • spreads keys evenly over nodes• Decentralized: • fully distributed, all nodes equally important • does not take into account heterogeneity of nodes
5. Chord properties (2)• Scalability: • lookup cost: O(log(N))• Availability: • automatically updates lookup tables as nodes join, leave, fail• Flexible naming: • Flat key-space, no constraint on structure of keys
6. Traditional hashing• Given an object, assign it to a bin from a set of N bins• Each bin: roughly same amount of objects• Problem: • If N changes, all objects need to be reassigned
7. Consistent hashing• Evenly distributes K objects across N bins, about K/N each• When N changes: • Not all objects need to be moved • Only O(K/N) need to• Uses a base hash function, such as SHA-1
8. Chord protocol• Assign each node and key an m-bit identifier using SHA-1: • node: hash the IP-address • key: hash the key• Identifiers are ordered on an identifier circle module 2m, the Chord ring: • circle of numbers from 0 to 2m-1
9. Assigning keys to nodes • Assigning key k to a node: • first node whose identifier is equal to or follows the identifier of key k in the identifier space • successor node of k: successor(k) • first node clockwise from k on Chord ring
10. Chord ring (m=6) N1 N56 N8 K10 K54 N51 N14 N48 N21 N42 K24 K38 N38 N32 K30
11. Minimal disruption• Minimal disruption when node joins/leaves• n joins: • certain keys assigned to successor(n) are now assigned to n• n leaves: • all keys assigned to n are now assigned to successor(n)
12. Simple Chord lookup• Simplest Chord lookup algorithm: • Each node only needs to know its successor on Chord ring • Query for identifier id is passed around Chord ring until successor(id) is found • Result returned along reverse path• Easy but not efficient: # messages O(N)
13. Simple Chord lookup N1 lookup(K54)/ ask node n to fi nd the successor of id N8 K54 N56n.find successor(id) the successor // ask node n to find if// of id successor]) (id ∈ (n, n.find_successor(id) return successor; N51 N14 else return (n, successor]) if (id ∈ successor; N48 // forward the query around the circle else return successor.fiquery around the // forward the nd successor(id); // circle return successor.find_successor(id); N21 N42 (a) N38 N32 (b)seudocode to fi nd the successor node of an identifi er id. Remote procedure calls and variable lookups a query from node 8 for key 54, using the pseudocode in Figure 3(a).
14. Finger table• Chord maintains additional routing info: • not essential for correctness • but allows acceleration of lookups• Each node maintains finger table with m entries: • n.finger[i] = successor(n + 2i-1)
15. Finger tablele (but slow) pseudocode to fi nd the successor node of an identifi er id. Reme path taken by a query from node 8 for key 54, using the pseudocode in Figu N1 Finger table N8 +1 N8 + 1 N14 N8 + 2 N14 K54 N +2 N8 + 4 N14 +4 N8 + 8 N21 N51 N51 +32 +8 N14 N8 +16 N32 N8 +32 N42 N48 +16 N48 N21 N42 N N38 N32
16. Improved lookup• Lookup for id now works as follows: • If id falls between n and successor(n), successor(n) is returned • Otherwise, lookup is performed at node n’, which is the node in the finger table of n that most immediately precedes id• Since each node has finger entries at power of two intervals around the identifier circle, each node can forward a query at least halfway along the remaining distance between the node and the target identifier.• Thus O(log(N)) nodes need to be contacted
17. N32 (b) Chord protocol successor node of an identifi er id. Remote procedure calls and variable lookups arfor key 54, using the pseudocode in Figure 3(a).1 N1 Finger table lookup(54) // ask node n to find the successor N8 // of id +1 N8 + 1 N14 N8 n.find_successor(id) N8 + 2 N14 K54 N56 if (id ∈ (n, successor]) N14 N8 + 4 +2 return successor; + 8 N21 +4 N8 else N51 +8 N14 N8 +16 N32 N14 n′ = closest_preceding_node(id); N8 +32 N4216 return n′.find_successor(id); N48 // search the local table for the // highest predecessor of id n.closest_preceding_node(id) N21 N21 for i = m downto 1 if (finger[i] ∈ (n, id)) N42 return finger[i]; return n; N38 N32(a) (b)
18. Coping with joining/leaving • Essential that successor pointers stay up to date • Each node periodically runs stabilization protocol which updates Chord’s successor pointers and finger tables • For node n to join, it must
คอร์ดนำเสนอ
1 คอร์ด: ปรับขนาด Peer- to-peer ค้นหา Protocol สำหรับการประยุกต์ใช้อินเทอร์เน็ตไอออน Stoica, โรเบิร์ตมอร์ริส, เดวิด Liben-Nowell เดวิด R.Karger เมตร Frans Kaashoek แฟรงค์ Dabek ฮาริบาลาค
2 เกี่ยวกับคอร์ด•พิธีสารและอัลกอริทึมสำหรับตารางการกระจายกัญชา (DHT) •โครงสร้างกระจายอำนาจซ้อนทับ P2P เครือข่าย
3 เกี่ยวกับคอร์ด•รองรับเพียงหนึ่งในการดำเนินงาน: การค้นหา (Key) •ได้รับที่สำคัญก็แผนที่สำคัญบนโหนด•ส่งกลับที่อยู่ IP ของโหนด•เชื่อมโยงค่ากับแต่ละคีย์และเก็บคู่บนโหนดที่เกิด: • กระจายตารางแฮช•ใช้คร่ำเครียดที่สอดคล้องกันสำหรับการดำเนินการนี้
4 คุณสมบัติคอร์ด (1) •สมดุลภาระ: •คีย์กระจายอย่างสม่ำเสมอตลอดโหนด•การกระจายอำนาจ: •กระจายอย่างเต็มที่ทุกโหนดความสำคัญเท่าเทียมกัน•ไม่ได้คำนึงถึงความแตกต่างของโหนดบัญชี
5 คุณสมบัติคอร์ด (2) • Scalability: •ค่าใช้จ่ายในการค้นหา: O (เข้าสู่ระบบ (N)) •จำหน่าย: •การปรับปรุงโดยอัตโนมัติตารางการค้นหาเป็นโหนดเข้าร่วมออกล้มเหลว•การตั้งชื่อมีความยืดหยุ่น: คีย์พื้นที่•แบน, ข้อ จำกัด ไม่เกี่ยวกับโครงสร้างของคีย์
6 คร่ำเครียดแบบดั้งเดิม•ได้รับวัตถุกำหนดให้ถังจากชุดของถังขยะยังไม่มีข้อความที่•แต่ละถัง: จำนวนเดียวกันประมาณของวัตถุ•ปัญหา: •หากมีการเปลี่ยนแปลง N, วัตถุทั้งหมดจะต้องมีพระราชเสาวนีย์
7 คร่ำเครียดสอดคล้อง•สม่ำเสมอจำหน่ายวัตถุ K ข้ามถังขยะ N, เกี่ยวกับ K / N แต่ละ•เมื่อยังไม่มีการเปลี่ยนแปลง: •ไม่วัตถุทั้งหมดจะต้องมีการย้าย•เฉพาะ O (K / N) ต้อง•ใช้ฟังก์ชั่นฐานกัญชาเช่น SHA- 1
8 โพรโทคอคอร์ด•กำหนดแต่ละโหนดและที่สำคัญตัวระบุ M-bit ใช้ SHA-1: •โหนด: กัญชาอยู่ IP •สำคัญ: สับ•การตัวบ่งชี้ที่สำคัญมีการสั่งซื้อในโมดูล 2M วงกลมระบุแหวนคอร์ด: •วงกลมของ ตัวเลขจาก 0 ถึง 2m-1
9 การกำหนดปุ่มไปยังต่อมน้ำ•การกำหนดคีย์ K เพื่อโหนด: •โหนดแรกที่มีการระบุเท่ากับหรือดังนี้ระบุของคีย์ K ในพื้นที่ระบุ•โหนดตัวตายตัวแทนของ K: ทายาท (k) •ครั้งแรกโหนดตามเข็มนาฬิกาจาก K แหวนคอร์ด
10 แหวนคอร์ด (M = 6) N1 N56 N8 K10 K54 N51 N14 N48 N21 N42 K24 K38 K30 N38 N32
11 ความยุ่งยากน้อยที่สุด•ความยุ่งยากน้อยที่สุดเมื่อโหนดร่วม / ใบ• n ร่วม: ปุ่ม•บางอย่างได้รับมอบหมายให้ทายาท (N) ที่ได้รับมอบหมายในขณะนี้เพื่อ n •ไม่มีใบ: •คีย์ทั้งหมดได้รับมอบหมายให้ n ที่ได้รับมอบหมายในขณะนี้เพื่อทายาท (N)
12 ง่ายคอร์ดค้นหา•ขั้นตอนวิธีการค้นหาแบบง่ายคอร์ด: •แต่ละโหนดเพียงความต้องการที่จะรู้ว่าทายาทบนคอร์ดแหวน•คำถามสำหรับ ID ระบุจะถูกส่งผ่านไปรอบ ๆ เวทีคอร์ดจนกว่าทายาท (ID) พบ•ผลลัพธ์ที่ตามเส้นทางย้อนกลับ•ง่าย แต่ไม่ได้มีประสิทธิภาพ: ข้อความ # O (n)
13 คอร์ดง่ายค้นหาค้นหา N1 (K54) / ขอโหนด n ไปยัง FI ND ทายาทของ id N8 K54 N56n ได้. Fi ND ทายาท (ID) สืบ // ถามโหนด N เพื่อหาถ้า // ทายาทของ id]) (Id ∈ (n , n.find_successor (ID) ผลตอบแทนทายาท; N51 N14 อื่นผลตอบแทน (n สืบ]) ถ้า (Id ∈ทายาท. N48 // ส่งแบบสอบถามรอบวงกลมอื่นกลับทายาท Fi แบบสอบถามรอบ // ส่งต่อทายาท ND (บัตร ); // วงกลมผลตอบแทน successor.find_successor (ID). N21 N42 (ก) N38 N32 (ข) seudocode ไปยัง FI ND โหนดทายาทของระบุ ID Fi ER เรียกขั้นตอนระยะไกลและตัวแปร lookups แบบสอบถามจากโหนด 8 สำหรับคีย์ 54 . โดยใช้รหัสจำลองในรูปที่ 3 (ก)
14. ตารางนิ้ว•คอร์ดรักษาข้อมูลการกำหนดเส้นทางเพิ่มเติม: •ไม่จำเป็นสำหรับความถูกต้อง• แต่ช่วยเร่งความเร็วของ lookups •แต่ละโหนดรักษาตารางนิ้วกับรายการ M: • n.finger [I] = ทายาท (n + 2i-1)
15 นิ้ว tablele ( แต่ช้า) pseudocode ไปยัง FI ND โหนดทายาทของระบุ ID Fi เอ้อ. เส้นทาง Reme ดำเนินการโดยการสอบถามจากโหนด 8 สำหรับคีย์ 54 โดยใช้ pseudocode ใน Figu N1 ลายนิ้วมือ ตาราง N8 1 N8 + 1 N14 N8 + 2 N14 K54 N 2 N8 +4 N14 4 N8 + 8 N21 N51 N51 N14 8 32 16 N8 N32 N8 32 N42 N48 N48 N21 16 N N42 N38 N32
16 การค้นหาที่ดีขึ้น•ค้นหาสำหรับ ID ตอนนี้ทำงานดังนี้•หาก ID อยู่ระหว่าง n และทายาท (N) ทายาท (N) จะถูกส่งกลับ•มิฉะนั้นการค้นหาจะดำเนินการที่โหนด n 'ซึ่งเป็นโหนดในตารางนิ้วของ n ว่าส่วนใหญ่ทันทีแจ๋ว ID •เนื่องจากแต่ละโหนดมีรายการนิ้วที่อำนาจของทั้งสองช่วงเวลารอบวงกลมระบุแต่ละโหนดสามารถส่งแบบสอบถามอย่างน้อยครึ่งหนึ่งตามระยะทางที่เหลืออยู่ระหว่างโหนดและระบุเป้าหมาย. •ดังนั้น O (log (ยังไม่มีข้อความ )) โหนดจำเป็นต้องได้รับการติดต่อ
17 N32 (ข) โหนดคอร์ดโปรโตคอลทายาทของ ER ID ระบุ Fi เรียกขั้นตอนระยะไกลและ lookups ตัวแปรสำคัญ arfor 54 โดยใช้รหัสจำลองในรูปที่ 3 (ก) 0.1 N1 ค้นหาตารางนิ้ว (54) // ขอโหนด N เพื่อหาผู้สืบทอด N8 // ของ id 1 N8 + 1 N14 N8 n .find_successor (ID) N8 + 2 N14 K54 N56 ถ้า (Id ∈ (n สืบ]) N14 N8 +4 2 ผลตอบแทนทายาท; + 8 N21 4 N8 อื่น N51 N14 8 N8 16 N32 N14 n '= closest_preceding_node (ID); N8 32 N4216 ผลตอบแทน n'.find_successor (ID); // N48 ค้นหาตารางท้องถิ่นสำหรับ // บรรพบุรุษสูงสุดของ id n.closest_preceding_node (ID) N21 N21 สำหรับ i = 1 เมตร downto ถ้า (นิ้ว [ I] ∈ (n, ID)) N42 นิ้วกลับมา [I]; ผลตอบแทน n; N38 N32 (ก) (ข)
18. การรับมือกับการเข้าร่วม / ออก•สิ่งสำคัญที่ชี้ทายาทอยู่ถึงวันที่•แต่ละโหนดระยะวิ่งโปรโตคอลการรักษาเสถียรภาพ ที่ปรับปรุงคอร์ดชี้ทายาทและตารางนิ้ว•สำหรับโหนด n ที่จะเข้าร่วมนั้นจะต้อง
การแปล กรุณารอสักครู่..
