29 1 2011 1 JOURNAL OF APPLIED SCIENCES Electronics and Information Engineering Vol. 29 No. 1 Jan. 2011 DOI: 10.3969/j.issn.0255-8297.2011.01.012 ademlia 1 1 2 3 1. 230037 2. 230037 3. 100195 DHTademlia k. 10%. TP393 0255-8297(2011)01-0066-07 Routing Table Adaptation Mechanism for ademlia Protocol XU Qiang 1, SUN Le-chang 1, ZHANG Min 2, LIU Hai-tao 3 1. Department of Network Engineering, Electronic Engineering Institute of PLA, Hefei 230037, China 2. Department of Information Engineering, Electronic Engineering Institute of PLA, Hefei 230037, China Abstract: 3. Air Force Electronic Technology Research Institute of PLA, Beijing 100195, China To improve performance of distribute Hash table (DHT) networks under churn, we study an adaptive mechanism of the routing table for ademlia protocol. Based on a quantitative analysis, we propose an algorithm for the value to adjust the routing table size to adapt to the churn rate. The churn rate is estimated from the available data in the routing table. Simulations show that the proposed algorithm can significantly reduce lookup latency under churn and raise the network s crash point by nearly 10%. Even when the churn rate fluctuates severely, the network still has a satisfactory performance. eywords: peer-to-peer network, distributed Hash table(dht), churn, routing table, adaptive adjustment P2P. [1] P2P (churn).. (distributed Hash table, DHT) P2P DHT DHT. DHT [2]. [3].. 2010-09-10 2010-12-20 (No. 60972161) E-mail: yfnm126@126.com E-mail: sunlechangeei@yahoo.com
1 ademlia 67. [4] [4]. [5-6]. [5]. [6] Accordion.. DHT ademlia [7]. emule BitTorrent. 1 ademlia DHT ademliasha-1 160 bit (NodeID). (XOR). ademlia k (k-buckets) i [0, 160) 1 0 k (k-bucket) [2 i, 2 i+1 ) <IP address, UDP port, NodeID>. ademlia [8]. [3] 4 ademlia 1) ademlia k ademlia k. 2) ademlia k 1 h k NodeID k. 3) ademlia k LRU(least recently used). 4) ademlia. ademlia. k. k. 2 2.1 k 2 m < 2 m+1 (0 m < 160). 1 ademlia V V = 2 m+1 + (160 m) 1. i k 2 i+1 2 i = 2 i. 2 i 2 i 2 i >. V = m i=0 2i + (160 m) V = 2 m+1 + (160 m) 1.. k k.. [9]ademlia DHT [10]. DHT log N log log N O( log V ) [6] N V.. 2 P min W ademlia
68 29 log N log log N 1 H = O( log V 1 (1 P min) ). W 1 (1 P min ) W 1 1 (1 P min). ademlia W log N log log N 1 H = O( log V 1 (1 P min) ).. W. P2P [3] (log-quadratic) (Pareto) (power-law) (Weibull) (log-normal). (heavytailed) [3] α β (1) P (t online < T ) = 1 ( β T )α (α 1, β > 0) (1) t online T α β. (1) T. [6]. T last T online. (1) p (2) [6] p = P (t online > (T last + T online ) t online > T online ) = ( β T last +T online ) α T online = ( ) α (2) β ( T online ) α T last + T online (2) [6] T last = T online (p 1 a 1) (3) T online T online t online T online 2 1 α β50% T online 2 1 α β. (3) T online T last p. T last = 2 1 α β(p 1 α min 1) 50% [6] T online 2 1 a β P min P min. P min P min. T last 50% C = 0.5V T last = V 2T last. T last = 2 1 α β(p 1 α min 1) [6] V = 2 1 α +1 βc(p 1 α min 1) (4) α = 1. 1 P min = 4βC (2 m+1 +(160 m) 1)+4βC. 1 1 (4). Pmin 1.0 0.9 0.8 0.7 0.6 0.5 0.4 0.3 0.2 0.1 0 βc=10 βc=50 βc=100 βc=500 βc=1 000 βc=5 000 βc=10 000 10 20 30 40 50 60 70 80 90 100 1 P min Figure 1 Variation of P min with respect to α β. C. 1 1 βc P min. βc. βc. βc = 10 k 50%. ademlia W [11] 3. W = 3. 2 ademlia H = log N log log N O( 1 log(2 +(160 m) 1) m+1 4βC ). 1 (1 (2 m+1 )3 +(160 m) 1)+4βC 2 2 1. log N log log N = log N log log N. C
1 ademlia 69 βc. 2 3. H/hop H/hop H/hop 10 9 8 7 6 5 4 3 2 1 0 1.0 0.9 0.8 0.7 0.6 0.5 0.4 0.3 0.2 βc=10 βc=20 βc=30 βc=40 βc=50 10 20 30 40 50 60 70 80 90 100 βc=100 βc=200 βc=300 βc=400 βc=500 0.1 0 10 20 30 40 50 60 70 80 90 100 (b) (b) Case of moderate churn rate 0.16 0.15 0.14 0.13 0.12 0.11 0.10 0.09 0.08 (a) (a) Case of high churn rate βc=1 000 βc=2 000 βc=3 000 βc=4 000 βc=5 000 0 10 20 30 40 50 60 70 80 90 100 (c) (c) Case of low churn rate 2 Figure 2 Variation of routing hops with respect to under different churn rate βc < 50 2 1 α β = 1. 1 = 1 50%. 100 < βc < 500 2 1 α β = 10. ademlia 10. 1 = 10 50% 80%. 1 000 < βc < 5 000 > 10 80%. βc > 30... 2.2 2.1 (additive increase and multiple decrease).. Function u.adapt_k-buckets (A, M, T ) = 10; // P cur = 0.7; // while(u.online = true) // if(p cur >= 0.8) // if( <= 30) = + A; i=random( 1, 1); if(i >= 0) = + A; = A; u.adjust_k-buckets(); if(p cur < 0.8&&P cur >= 0.5)// if ( >= 10) P threash = 1 1 (P cur 0.5)/0.3; i=random(0, 1);
70 29 if (i >= P threash ) = + A; = M; u.adjust_ k-buckets(); = + A; if (P cur < 0.5) // if ( > 1) = M; u.adjust_ k-buckets(); u.node_lookup(u.nodeid); sleep(t); endwhile end function u T 1. A(A > 0) M(0 < M < 1) A = 1, M = 0.5. P cur P min. 1 P cur. T T. P cur > 0.8. 1 2(c). > 30 A. 0.5 P cur < 0.8. 1 2(b) < 10. 10 P threash = 1 1 (P cur 0.5)/0.3. P threash P cur P cur 0.8. P cur < 0.5.. = 1. node_lookup. k. adjust_k-buckets.. k <IP address, UDP port, NodeID, T last, T online >. [6] T last T online. (2) k T online T last+tonline. P2P. static static ademlia. k. 3 3.1. MIT P2PSimP2P P2P. P2PSim ademlia A-ademlia ing [12] P2PSim E2EGraph RedHat 9.0. 3.2 N = 1 024 R = 1 000 ms. A-ademlia static ademlia 10. (1). (1) α = 1, β 50, 500 5 000 1 C 1. NodeID. 30 s
1 ademlia 71 20(2lbNR) s. 10 β 10. /s /s /s 18 16 14 12 A-ademlia 10 0 1 2 3 4 5 6 7 8 9 10 11 (a) β=50 6.0 5.5 5.0 ademlia 4.5 A-ademlia 4.0 0 1 2 3 4 5 6 7 8 9 10 11 (b) β=500 5.0 4.8 4.6 4.4 4.2 4.0 ademlia A-ademlia ademlia 3.8 0 1 2 3 4 5 6 7 8 9 10 11 (c) β=5 000 3 Figure 3 Lookup latency under different churn rates 3 ademlia A- ademlia. A- ademlia ademlia β = 50 β = 5 000A-ademlia 2.1. A-ademlia ademlia 30%.. A-ademlia (crash point) [8] ademlia. P2P x 50% x P2P. α = 1, β = 500. λ%. 50. λ 3 3 λ 4. /% 100 90 80 70 60 50 40 30 20 0 10 20 ademlia A-ademlia 30 40 50 60 70 λ/% 4 Figure 4 Crash point of network ademlia 50% 60% A- ademlia60% 70%. 10%. ademlia A-ademlia ademlialrua- ademlia. 4. ademlia.. 10%... emule. : [1] Rhea S, Geels D, Roscoe T, ubiatowicz J. Handling churn in a DHT [C]//USENIX Annual Technical Conference, Boston, USA, 2004: 127-140. [2] ersch P, Szabo R, Cheng L, Jean, Galis A. Stochastic maintenance of overlays in structured P2P systems [J]. Computer Communications, 2008, 31(3): 603-619. [3]. P2PChurn [J]. 2009, 20(5): 1362-1379.
72 29 Zhang Yuxiang X, Yang Dong, Zhang Hongke. Research on churn problem in P2P networks [J]. Journal of Software, 2009, 20(5): 1362-1379. (in Chinese) [4]. DHT [J]. 2008, 45(l): 409-414. Hang Qingfeng, Li Zhitang, Lu Chuiwei, Wang Weidong. Analyzing the cost of DHT handling churn [J]. Journal of Computer Research and Development, 2008, 45(Suppl.): 409-414. (in Chinese) [5] Li J, Stribling J, Morris R, aashoek M F, Gill T M. A performance vs. cost frame for evaluating DHT design tradeoffs under churn [C]//IEEE Conference on Computer Communications, Miami, USA, 2005: 225-236. [6] Li J, Stribling J, Morris R, aashoek M F. Bandwidth-efficient management of DHT routing tables [C]//the 2nd Symposium on Networked System Design and Implementation, Boston, USA, 2005: 99-114. [7] Maymounkov P, Mazieres D. ademlia: a peerto-peer information system based on the XOR metric [C]//the International Workshop on Peer-to-Peer Systems, Berlin, Germany, 2002: 53-65. [8] Liu Zhiyu, Yuan Ruifeng, Li Zhenhua, Li Hongxing, Chen Guihai. Survive under high churn in structured P2P systems: evaluation and strategy [J]. Lecture Notes in Computer Science, 2006, 3394(1): 404-411. [9] ersch P, Szabo R. Mathematical modeling of routing in DHTs [M]. Heidelberg: Springer-Verlag, 2010, 3: 367-401. [10] leingerg J. The small-world phenomenon: an algorithmic perspective [C]//the 32th Annual ACM Symposium on Theory of Computing, Portland, USA, 2000: 163-170. [11] Stutzbach D, Rejaie R. Improving lookup performance over a widely-deployed DHT [C]//IEEE Conference on Computer Communications, Washington, USA, 2006: 1-12. [12] Gumadi P, Saroiu S, Steven D G. ing: estimating latency between arbitrary internet end hosts [C]//Internet Measurement Conference, Marseille, Fance, 2002: 5-18. (: )