<%BANNER%>

A Scalable and Flexible Unstructured Search System and Distributed Data Structure for Peer to Peer Networks

Permanent Link: http://ufdc.ufl.edu/UFE0042080/00001

Material Information

Title: A Scalable and Flexible Unstructured Search System and Distributed Data Structure for Peer to Peer Networks
Physical Description: 1 online resource (125 p.)
Language: english
Creator: Choi, Tae
Publisher: University of Florida
Place of Publication: Gainesville, Fla.
Publication Date: 2010

Subjects

Subjects / Keywords: complex, computer, distributed, loadbalance, network, p2p, structured, unstructured
Electrical and Computer Engineering -- Dissertations, Academic -- UF
Genre: Electrical and Computer Engineering thesis, Ph.D.
bibliography   ( marcgt )
theses   ( marcgt )
government publication (state, provincial, terriorial, dependent)   ( marcgt )
born-digital   ( sobekcm )
Electronic Thesis or Dissertation

Notes

Abstract: Peer-to-Peer concepts provide new possibilities. Many large scale Internet services are already introduced with the help of P2P networks. However, The P2P approach to systems design has not made a big impact in practice because designing a new system with P2P concepts is still more of a research problem than a software development problem. The main goal of this dissertation is to provide components that can be combined to build new system easily. The use of P2P techniques in system design is increased by solving a number of problems that currently present barriers. To address the problems in developing P2P systems, the dissertation focuses on four principal goals: (a) building efficient network size estimation algorithms (b) modeling and evaluating an efficient general search system (c) testing the search system in a real P2P environment, and (d) designing a new search technique apt for P2P database services To address the goal (a), I propose four network size estimation algorithms. The accuracy of network size algorithm has an great impact on several applications on P2P networks including data retrieval. The methods utilize node density within various length in network. The node density makes one estimate of the number of nodes in the whole system by N=LD, where N, L, and D represent the estimated network size, the length of address space, and the node density, respectively. Each estimation method requires different communication costs and achieves different performance. Thus, a user can select one of the methods with respect to his purpose and expected performance. For the pursuit of goal (b), I present Deetoo, an algorithm to perform completely general queries on a P2P network. My interest lies in building efficient unstructured P2P networks. Stated differently, I can apply the proposed model for any type of query without the necessity of mapping the queries onto a fixed DHT structure. Deetoo leverages one-dimensional routable small-world networks, and multicasting trees built on those networks, to build an unstructured query system which can support general queries, such as high-dimensional proximity queries or regular expression matching. Lastly, this dissertation introduces how to apply P2P unstructured search to P2P database systems. The most important feature of database systems is that the search engine has to always return a correct answer. Deetoo is not sufficient for database systems due to the randomized nature. Thus, I propose Exact Deetoo which is similar to Deetoo but Exact Deetoo achieves 100% query success probability. The total communication cost for both caching and querying is not controllable in Exact Deetoo, However, the trade-off between caching cost and the querying cost can be managed by assigning more columns than rows or vice versa. The correctly maintained network decides the cost to achieve 100% success probability. There exists a trade-off between the exact response and the higher maintenance cost for a network structure in Exact Deetoo. Each of the proposed algorithms are carefully tested and evaluated by simulation, experiments, as well as theoretical proofs. The proposed algorithms are applicable to be built on top of many existing P2P overlays, and make it easy for developers to adopt each component.
General Note: In the series University of Florida Digital Collections.
General Note: Includes vita.
Bibliography: Includes bibliographical references.
Source of Description: Description based on online resource; title from PDF title page.
Source of Description: This bibliographic record is available under the Creative Commons CC0 public domain dedication. The University of Florida Libraries, as creator of this bibliographic record, has waived all rights to it worldwide under copyright law, including all related and neighboring rights, to the extent allowed by law.
Statement of Responsibility: by Tae Choi.
Thesis: Thesis (Ph.D.)--University of Florida, 2010.
Local: Adviser: Boykin, P. Oscar.
Electronic Access: RESTRICTED TO UF STUDENTS, STAFF, FACULTY, AND ON-CAMPUS USE UNTIL 2011-08-31

Record Information

Source Institution: UFRGP
Rights Management: Applicable rights reserved.
Classification: lcc - LD1780 2010
System ID: UFE0042080:00001

Permanent Link: http://ufdc.ufl.edu/UFE0042080/00001

Material Information

Title: A Scalable and Flexible Unstructured Search System and Distributed Data Structure for Peer to Peer Networks
Physical Description: 1 online resource (125 p.)
Language: english
Creator: Choi, Tae
Publisher: University of Florida
Place of Publication: Gainesville, Fla.
Publication Date: 2010

Subjects

Subjects / Keywords: complex, computer, distributed, loadbalance, network, p2p, structured, unstructured
Electrical and Computer Engineering -- Dissertations, Academic -- UF
Genre: Electrical and Computer Engineering thesis, Ph.D.
bibliography   ( marcgt )
theses   ( marcgt )
government publication (state, provincial, terriorial, dependent)   ( marcgt )
born-digital   ( sobekcm )
Electronic Thesis or Dissertation

Notes

Abstract: Peer-to-Peer concepts provide new possibilities. Many large scale Internet services are already introduced with the help of P2P networks. However, The P2P approach to systems design has not made a big impact in practice because designing a new system with P2P concepts is still more of a research problem than a software development problem. The main goal of this dissertation is to provide components that can be combined to build new system easily. The use of P2P techniques in system design is increased by solving a number of problems that currently present barriers. To address the problems in developing P2P systems, the dissertation focuses on four principal goals: (a) building efficient network size estimation algorithms (b) modeling and evaluating an efficient general search system (c) testing the search system in a real P2P environment, and (d) designing a new search technique apt for P2P database services To address the goal (a), I propose four network size estimation algorithms. The accuracy of network size algorithm has an great impact on several applications on P2P networks including data retrieval. The methods utilize node density within various length in network. The node density makes one estimate of the number of nodes in the whole system by N=LD, where N, L, and D represent the estimated network size, the length of address space, and the node density, respectively. Each estimation method requires different communication costs and achieves different performance. Thus, a user can select one of the methods with respect to his purpose and expected performance. For the pursuit of goal (b), I present Deetoo, an algorithm to perform completely general queries on a P2P network. My interest lies in building efficient unstructured P2P networks. Stated differently, I can apply the proposed model for any type of query without the necessity of mapping the queries onto a fixed DHT structure. Deetoo leverages one-dimensional routable small-world networks, and multicasting trees built on those networks, to build an unstructured query system which can support general queries, such as high-dimensional proximity queries or regular expression matching. Lastly, this dissertation introduces how to apply P2P unstructured search to P2P database systems. The most important feature of database systems is that the search engine has to always return a correct answer. Deetoo is not sufficient for database systems due to the randomized nature. Thus, I propose Exact Deetoo which is similar to Deetoo but Exact Deetoo achieves 100% query success probability. The total communication cost for both caching and querying is not controllable in Exact Deetoo, However, the trade-off between caching cost and the querying cost can be managed by assigning more columns than rows or vice versa. The correctly maintained network decides the cost to achieve 100% success probability. There exists a trade-off between the exact response and the higher maintenance cost for a network structure in Exact Deetoo. Each of the proposed algorithms are carefully tested and evaluated by simulation, experiments, as well as theoretical proofs. The proposed algorithms are applicable to be built on top of many existing P2P overlays, and make it easy for developers to adopt each component.
General Note: In the series University of Florida Digital Collections.
General Note: Includes vita.
Bibliography: Includes bibliographical references.
Source of Description: Description based on online resource; title from PDF title page.
Source of Description: This bibliographic record is available under the Creative Commons CC0 public domain dedication. The University of Florida Libraries, as creator of this bibliographic record, has waived all rights to it worldwide under copyright law, including all related and neighboring rights, to the extent allowed by law.
Statement of Responsibility: by Tae Choi.
Thesis: Thesis (Ph.D.)--University of Florida, 2010.
Local: Adviser: Boykin, P. Oscar.
Electronic Access: RESTRICTED TO UF STUDENTS, STAFF, FACULTY, AND ON-CAMPUS USE UNTIL 2011-08-31

Record Information

Source Institution: UFRGP
Rights Management: Applicable rights reserved.
Classification: lcc - LD1780 2010
System ID: UFE0042080:00001


This item has the following downloads:


Full Text

PAGE 1

ASCALABLEANDFLEXIBLEUNSTRUCTUREDSEARCHSYSTEM ANDDISTRIBUTEDDATASTRUCTURESFORPEER-TO-PEERNETWORKS By TAEWOONGCHOI ADISSERTATIONPRESENTEDTOTHEGRADUATESCHOOL OFTHEUNIVERSITYOFFLORIDAINPARTIALFULFILLMENT OFTHEREQUIREMENTSFORTHEDEGREEOF DOCTOROFPHILOSOPHY UNIVERSITYOFFLORIDA 2010

PAGE 2

c r 2010TaeWoongChoi 2

PAGE 3

ACKNOWLEDGMENTS Therearemanypeoplewhoareresponsibleformyresearch.Mo stofallIwouldlike toexpressmygratitudetomysupervisor,Dr.OscarBoykin,fo rhispatientguidanceand invaluableadvice,fornumerousdiscussionsandencourage mentthroughoutthecourse oftheresearch. Iwouldalsoliketothankallthemembersofmyadvisorycommi ttee,Dr.Renato Figueiredo,Dr.TaoLi,andDr.WilliamHager,fortheirvalua bletimeandinterestin servingonmysupervisorycommittee. AndIamindebtedtoallthemembersofACIS(AdvancedComputing and InformationSystems)fortheircompanionshipandsupportth roughoutthetimespent workingonmyresearch. Finally,Iwouldliketoexpressmygreatestgratitudetomyf amilyespeciallymywife, Yeonhwa,forherrelentlesssupportandlove. 3

PAGE 4

TABLEOFCONTENTS page ACKNOWLEDGMENTS .................................. 3 LISTOFTABLES ...................................... 7 LISTOFFIGURES ..................................... 8 ABSTRACT ......................................... 11 CHAPTER 1INTRODUCTION ................................... 13 2LITERATUREREVIEW ............................... 17 2.1NetworkSizeEstimationonStructuredP2PSystems ............ 17 2.2SearchinP2PSystems ............................ 19 3NETWORKSIZEESTIMATIONINPEER-TO-PEERNETWORKS ....... 23 3.1Introduction ................................... 23 3.2NetworkSizeEstimationinP2PNetworks:TheoreticalBackgr ound ... 25 3.2.1TheAlgorithm .............................. 25 3.2.2NodeJoiningAlgorithmforMoreEvenlyDistributedNetw ork .... 27 3.2.3CommunicationCost .......................... 28 3.3SimulationResults ............................... 29 3.3.1SimulationMethodology ........................ 29 3.3.2NetworkTopology ............................ 29 3.3.3SimulationResults ........................... 29 3.4Conclusion ................................... 31 4DEETOO:SCALABLEUNSTRUCTUREDSEARCHBUILTONASTRUCTURED OVERLAY ....................................... 38 4.1Introduction ................................... 38 4.2TheDeetooSearchAlgorithm ......................... 41 4.2.1AnUnstructured“Hash”Table ..................... 41 4.2.2ADistributedUnstructuredTable ................... 42 4.2.3BoundedBroadcast .......................... 44 4.2.4DataInsertionandQuery ....................... 45 4.2.5NodeJoins,Leaves,andStabilization ................ 46 4.2.6EstimatingNetworkSize ........................ 47 4.3AnalysisofDeetoo ............................... 48 4.3.1ExactAnalysisforSuccessProbability ................ 49 4.3.2SearchTime .............................. 52 4.3.3StabilizationCost ............................ 54 4

PAGE 5

4.4SimulationResults ............................... 56 4.4.1PerformanceEvaluation ........................ 56 4.4.2NumericalAnalysisforSuccessProbability ............. 57 4.4.3Robustness ............................... 59 4.5ApplicableSearches .............................. 60 4.5.1ObjectInsertion: ............................ 61 4.5.2Search .................................. 62 4.5.3ObjectDeletion: ............................. 63 4.6Conclusion ................................... 63 5UNSTRUCTUREDSEARCHONPLANET-LABWITHDEETOO ........ 71 5.1Introduction ................................... 71 5.2SystemModel ................................. 74 5.2.1Brunet-NetworkTopology ....................... 74 5.2.2NetworkSizeEstimation ........................ 75 5.2.3MapReduce-BasedCache/QuerySystem .............. 75 5.2.3.1P2Pnetworkmodule .................... 77 5.2.3.2MapReducecoremodule .................. 77 5.2.3.3Generatingatreemodule .................. 77 5.2.3.4Mappingmodule ....................... 78 5.2.3.5Reducingmodule ...................... 79 5.3ExperimentalEnvironment ........................... 80 5.4EvaluationandResults ............................ 81 5.4.1NetworkSizeEstimation ........................ 81 5.4.2QuerySuccessProbability ....................... 82 5.4.3Latency ................................. 82 5.4.4CommunicationCost .......................... 83 5.4.5Replicationvs.SuccessProbability .................. 83 5.4.6LoadBalancing ............................. 84 5.5Conclusion ................................... 85 6EXACTDEETOO:SEMANTIC-FREESEARCHONSTRUCTUREDPEER-TO-PEER SYSTEMS ...................................... 95 6.1Introduction ................................... 95 6.2TheAlgorithm .................................. 97 6.2.1Join ................................... 98 6.2.2Split ................................... 100 6.2.3Trading-offCache/QueryCosts .................... 100 6.3SimulationResults ............................... 101 6.3.1BoxProperties ............................. 102 6.3.2JoinCost ................................ 103 6.3.3CachingandQueryingCost ...................... 104 6.3.4LoadBalancing ............................. 105 6.3.5Latency ................................. 106 5

PAGE 6

6.3.6QueryResult .............................. 106 6.4Conclusion ................................... 107 7CONCLUSION .................................... 118 REFERENCES ....................................... 120 BIOGRAPHICALSKETCH ................................ 125 6

PAGE 7

LISTOFTABLES Table page 3-1Statisticsofestimatednetworksize(randomaddresssel ection). ........ 33 3-2Statisticsofestimatednetworksize(evenaddressselec tion). .......... 33 5-1Latency ........................................ 86 7

PAGE 8

LISTOFFIGURES Figure page 3-1Treegenerationbyboundedbroadcasting ..................... 33 3-2Addressselectionofnewlyjoinednode ...................... 34 3-3Meanestimationwithactualsizeof5000nodes .................. 34 3-4Meanestimationwithactualsizeof500000nodes ................ 35 3-5Standarddeviationofeachestimation(N=5000) ................. 35 3-6Standarddeviationofeachestimation(N=5000000) ............... 36 3-7Communicationcostwith5000nodes ....................... 36 3-8Communicationcostwith500000nodes ...................... 37 3-9Communicationcostvs.MSEwithlog-estimation(actualn etworksize:50,000) 37 4-1Thecachingandqueryingspace. .......................... 64 4-2Virtualring1forcaching. .............................. 64 4-3Virtualring2forquerying. .............................. 64 4-4Thecompletesearchingspace. ........................... 64 4-5Treegenerationbyboundedbroadcasting ..................... 65 4-6Objectinjection .................................... 65 4-7Boundedbroadcastintherange .......................... 65 4-8Completionofobjectreplication ........................... 65 4-9Initiationofaqueryforobject o ........................... 65 4-10Boundedbroadcastingwithin Q ........................... 65 4-11Objectretrieval n(o) ................................. 65 4-12Estimatednetworksizedistribution ......................... 66 4-13Probabilityoflong-rangeconnection ........................ 66 4-14Querysuccessprobability .............................. 66 4-15Querymissrate ................................... 67 4-16Communicationcostforquery ........................... 67 8

PAGE 9

4-17Searchtime ...................................... 68 4-18Successratecomparison .............................. 68 4-19Statetransitiondiagram ............................... 69 4-20Successprobabilityunderchurn .......................... 69 4-21Stabilizationcost ................................... 70 4-22Sequentialsearch .................................. 70 5-1P2P(Brunet)networkoverview ........................... 86 5-2MapReducefunctionmodulesforquerysystem .................. 87 5-3Simpleexampleofmap-reducetree ........................ 87 5-4Estimatednetworksize( =1.0 ) .......................... 88 5-5Estimatednetworksize( =3.0 ) .......................... 88 5-6Querysuccessprobability( =1.0 ) ........................ 89 5-7Querysuccessprobability( =3.0 ) ........................ 89 5-8Latencyintermsoftreedepth( =1.0 ) ...................... 90 5-9Latencyintermsoftreedepth( =3.0 ) ...................... 90 5-10MeasuredLatency .................................. 91 5-11Communicationcost( =1.0 ) ............................ 91 5-12Communicationcost( =3.0 ) ............................ 92 5-13Totalbytestransferredforeachquery ....................... 92 5-14Communicationcostforcachingvs.querysuccessproba bility( =1.0 ) .... 93 5-15Communicationcostforcachingvs.querysuccessproba bility( =3.0 ) .... 93 5-16Loaddistribution ................................... 94 5-17Thenumberofcachedobjectspernode ...................... 94 6-1Example2-dimensional4-by-4space ....................... 108 6-2Onenodeinthebox ................................. 109 6-3Twonodesinthebox ................................. 109 6-4Threenodesinthebox ............................... 109 9

PAGE 10

6-5Fournodesinthebox ................................ 109 6-6Splitboxesinarow ................................. 110 6-7Examplesofasymmetricmatrixspace ....................... 110 6-8Thenumberofboxes ................................ 111 6-9Thenumberofboxesinlogscale .......................... 111 6-10Thenumberofboxesandthenumberoffullboxes ................ 112 6-11Theaveragenumberofnodeperbox ....................... 112 6-12Joincost(N=100,000) ............................... 113 6-13Joincost(N=100,000) ............................... 113 6-14Cachingcost ..................................... 114 6-15Queryingcost ..................................... 114 6-16Thenumberofreplicationperuniqueobject(50knodes) ............. 115 6-17Thenumberofreplicationperuniqueobject(20knodes) ............. 115 6-18Thenumberofobjectspernode(50knodes) ................... 116 6-19Thenumberofobjectspernode(20knodes) ................... 116 6-20Latency(treedepth) ................................. 117 6-21Thenumberofrespondingnodes ......................... 117 10

PAGE 11

AbstractofDissertationPresentedtotheGraduateSchool oftheUniversityofFloridainPartialFulllmentofthe RequirementsfortheDegreeofDoctorofPhilosophy ASCALABLEANDFLEXIBLEUNSTRUCTUREDSEARCHSYSTEM ANDDISTRIBUTEDDATASTRUCTURESFORPEER-TO-PEERNETWORKS By TaeWoongChoi August2010 Chair:P.OscarBoykinMajor:ElectricalandComputerEngineering Peer-to-Peerconceptsprovidenewpossibilities.Manylar ge-scaleInternetservices arealreadyintroducedwiththehelpofP2Pnetworks.However ,TheP2Papproachto systemsdesignhasnotmadeabigimpactinpracticebecaused esigninganewsystem withP2Pconceptsisstillmoreofaresearchproblemthanasof twaredevelopment problem.Themaingoalofthisdissertationistoprovidecom ponentsthatcanbe combinedtobuildnewsystemseasily.TheuseofP2Ptechnique sinsystemdesign isincreasedbysolvinganumberofproblemsthatcurrentlyp resentbarriers.To addresstheproblemsindevelopingP2Psystems,thedisserta tionfocusesonfour principalgoals:(a)buildingefcientnetworksize-estim ationalgorithms(b)modelingand evaluatinganefcientgeneralsearchsystem(c)testingth esearchsysteminarealP2P environment,and(d)designinganewsearchtechniqueaptfo rP2Pdatabaseservices. ToaddressGoal(a),Iproposefournetworksizeestimationa lgorithms.The accuracyofnetworksizealgorithmhasagreatimpactonseve ralapplicationsonP2P networksincludingdataretrieval.Themethodsutilizenod edensitywithinvarious lengthsinanetwork.Thenodedensitymakesoneestimateoft henumberofnodesin thewholesystemby ^ N=LD ,where ^ N L ,and D representtheestimatednetworksize, thelengthofaddressspace,andthenodedensity,respectiv ely.Eachestimationmethod requiresdifferentcommunicationcostsandachievesdiffe rentperformance.Thus,auser canselectoneofthemethodswithrespecttohispurposeande xpectedperformance. 11

PAGE 12

Forthepursuitofgoal(b),IpresentDeetoo,analgorithmto performcompletely generalqueriesonaP2Pnetwork.Myinterestliesinbuilding efcientunstructured P2Pnetworks.Stateddifferently,Icanapplytheproposedmod elforanytypeofquery withoutthenecessityofmappingthequeriesontoaxedDHTs tructure.Deetoo leveragesone-dimensionalroutablesmall-worldnetworks ,andmulticastingtreesbuilt onthosenetworks,tobuildanunstructuredquerysystemwhi chcansupportgeneral queries,suchashigh-dimensionalproximityqueriesorreg ularexpressionmatching. Lastly,thisdissertationintroduceshowtoapplyP2Punstru cturedsearchtoP2P databasesystems.Themostimportantfeatureofdatabasesy stemsisthatthesearch enginehastoalwaysreturnacorrectanswer.Deetooisnotsu fcientfordatabase systemsduetotherandomizednature.Thus,IproposeExactDe etoo,whichissimilar toDeetoo,butExactDeetooachieves100%querysuccessproba bility.Thetotal communicationcostforbothcachingandqueryingisnotcont rollableinExactDeetoo; however,thetrade-offbetweencachingcostandthequeryin gcostcanbemanaged byassigningmorecolumnsthanrowsorviceversa.Thecorrec tlymaintainednetwork decidesthecosttoachieve100%successprobability.There existsatrade-offbetween theexactresponseandthehighermaintenancecostforanetw orkstructureinExact Deetoo. Eachoftheproposedalgorithmsarecarefullytestedandeval uatedbysimulation, experiments,aswellastheoreticalproofs.Theproposedal gorithmsareapplicabletobe builtontopofmanyexistingP2Poverlaysandmakeiteasyford eveloperstoadopteach component. 12

PAGE 13

CHAPTER1 INTRODUCTION Peer-to-Peer(P2P)systemsareoverlaynetworksinwhichnode sshareresources, suchasmemory,CPUpower,andbandwidth.EachnodeinaP2Psyste moperates simultaneouslyasbothaserverandaclientinadistributed fashion.Nodesnavigate theunderlyingnetworkwithoutknowledgeoftheglobalstru cture.Sincethesuccess ofapplicationslikeNapsterandGnutella,P2Plesharingsy stemshavebecome someofthemostcommonInternetapplications.AnInternetst udyreportedthatover 73%ofallInternettrafcwastheresultofP2Ple-sharingpl atforms 1 .P2Pisthe singlelargestconsumerapplicationofbandwidthonnetwor ks.P2Ptrafcsignicantly outweighsWebtrafcandstillcontinuestogrow[ 1 ].However,asidefromafewone-off applications,P2Phasnotmadeaverylargeimpactinsystemsd esign.Theproblem thatP2Paddressesishowtobuildreliable,large-scalesyst emswithoutahighcost ormanagementloadonanyoneindividualororganization.Th isisaveryappealing vision.Manyhavethedesiretodistributetoalargeaudienc ewithouthavingtopay proportionaltothenumberofpeoplethatreceivethemedia. Additionally,manysmallandmedium-sizedorganizationsneedcomputinginfrastruc tures,suchasnetwork lestorageorjobscheduling,butdonothavetheresourcest opayafull-timesystem administrator.P2Pdesignapproachesshoulddramaticallyi ncreasethereachof distributedcomputingsystemsbykeepingcostsincredibly low. P2Phasnotyetdeliveredonitspromisebecause,inmostcases ,todeploya P2P-basedsystemdevelopersmuststartalmostfromscratch,o rworkwithvery simpleprimitives,suchasadistributedhashtable(DHT)[ 2 – 5 ].Thestart-from-nothing approachisusedbysuchapplicationsasGnutella[ 6 ],Bittorrent[ 7 ],andSkype[ 8 ], whichareamongthefewwidelyusedP2Psystems.Incontrast,t odevelopclient-server 1 Accordingtohttp://www.ipoque.com/ 13

PAGE 14

basedapplicationsdevelopers,haveaccesstotheBerkeleys ocketslibrary[ 9 ]and WebframeworkssuchasthosebasedonJava[ 10 ],Python-basedDjango[ 11 ]or Ruby-basedRails[ 12 ].Suchframeworksandabstractionsmakeiteasytodeploylar ge client-serversystemswithouthavingtostartfromscratch ,i.e.,sendingInternetprotocol (IP)packetsbetweenhostslikemostP2Papplicationsdo. ThisdissertationenablesanewgenerationofP2Psystemsbyd evelopingnewP2P abstractionsandsearchframeworksthatfreedevelopersfr omtheproblemofstarting fromnothingtobuildeachapplication.Idelivernewresear chresultsaboutdistributed datastructuresaswellasnewsearchparadigmsbeyondDHTs. Theresearchdescribed bythisdissertationaddressesbarriersthatarepreventin gthewide-scaleadoptionof P2Pbysystemsdesigners. BythenatureofP2Pnetworks,eachnodedoesnotmaintaingloba linformation, suchasthenumberofpeersinanetwork.InP2Pnetworks,keepi ngtrackofnetwork sizeisoftenachallengingproblembecausethenodesaredis tributed,andthus,typically knowonlyasubsetofthenodesinthesystem.However,therea remanyapplications whereeachnodeneedstoknowthesizeofP2Pnetwork,atleasta pproximately. Systemmonitoringandobtainingglobalstatisticsbecomesm uchmorecomplex.I proposefournetworksize-estimationalgorithms.Theaccu racyofanetworksize algorithmhasangreatimpactonseveralapplicationsonP2Pn etworksincluding dataretrieval.Themethodsutilizenodedensityovervario uslengthsinanetwork. Thenodedensitymakesoneestimatethenumberofnodesinthe wholesystemby ^ N=LD ,where ^ N L ,and D representtheestimatednetworksize,thelengthofaddress space,andthenodedensity,respectively.Eachestimationm ethodrequiresdifferent communicationcostsandachievesdifferentperformance.T hus,ausercanselectone ofthemethodswithrespecttohispurposeandexpectedperfo rmance. EarlyP2Papplicationsusedsimplebroadcastingmethodforth eirquerysystems. InsystemslikeGnutella,nodesconnecttoasubsetofneighb orsandsendqueriestoall 14

PAGE 15

neighbors.Toimplementsuchooding-basedquerysystemsi ssimple,buttheooding iscostlyinthataquerymessageshouldbedeliveredtoalmos tallnodesinthesystem. Incontrast,DistributedHash-table(DHT)systemsarevery efcientforkey-basedlookup. OneofthedownsidesofDHTsystemsisthedifcultyofimplem entation,becausethey mapthedatastructureofahashtableontothestructureofth eP2Pnetwork.Also, DHT-basedsystemsdonothaveagoodsolutionforgeneralque riesbecauseitishard tomapmanyinterestingqueriesontotheDHT.Forexample,re gularexpressionscannot bemappedtometricspace. InthisdissertationIpresentDeetoo,anefcientquery-re solutionalgorithm.The heartofthisworkissimpledataobjectreplicationandasea rchalgorithm.Inthismodel, theusual1-Doverlaytopologyistransformedintoarectang ularmatrix.Replication andqueryresolutionareexecutedbyboundedbroadcastingo verthecolumnsand rowsonthematrixspace,respectively.Deetoo'sprobabili sticapproachachievesa constantsuccessrate.Distributedsystemsshouldavoidma ssivecommunicationcost. Deetoostores O( p N) replicasperobjectwithahighprobability.Unlikethestru ctured network,Deetoodoesnotrequirethateachreplicatedobjec tbemappedintoaDHT. Aquerygenerates O( p N) messages.Thisimpliesmoremessageswhencompared toDHTs,whichhaveonlyO( logN )complexity,butoffersamajorimprovementover ooding-basedsearcheswith O(N) .Thestoragecostassociatedwiththe O( p N) size ofthereplicasetinDeetooisacceptable,especiallywhenh andlingmetadatainstead oflargemultimediales.Deetooistherstsysteminwhicha rbitraryunstructured queriescanbemappedtoastructuredP2Psystemwithquerycos t O( p N) .Deetoo's searchingalgorithmcancoexistonthesameP2Pnetworkwitha DHT,sowithDeetoo userscanstillhavestructuredaswellasunstructuredquer ies.Also,userscancontrol successrateandsearchcostwithDeetoobyadjustingthedeg reeofreplicationwitha user-speciedvalue.Ourprotocolsearchtimeoutperforms otherunstructuredmodels byforminganefcientlocaltree:Deetoocompletessearche sin O(log 2 N) timebyusing 15

PAGE 16

Kleinberg'ssmall-worldnetworkmodel.Lastly,duetothefa ctthatDeetooisbuilton astructuredoverlay,objectscanbeupdatedordeletedafte rbeingpublishedonthe system.Thisrepresentsanadvantageoverrandomwalkbased schemespreviously proposedintheliterature. Deetooisascalable,self-organizing,andexibleunstruc turedsearchsystemon topofastructuredoverlay.Userscancontrolahitratebyin creasingordecreasinga replicationfactor.However,Deetooisnotsuitableforsys temsrequiringacomplete searchresolution,suchasdistributedP2Pdatabasesystems ,sincevirtuallythe communicationcostincreasesupto O(N) .ExactDeetooisdesignedtoaddressthe problemofDeetoo'sinabilitytoachieve100%hitswithoutp ayinghighercommunication costthanDeetoo's.ThedesignofExactDeetooenablesacolle ctionofaddressbins tobeoccupiedbyatleastonenode.Thecollectionofaddress binsiscalleda box .By maintainingtheoccupancyofeachbox,aqueryingnodealway sndsamatchfromthe nodesinaboxnomatterwhereitinitiatesaquery.WhileDeeto o'sjoincostremainsin verysmall,ExactDeetoorequireshigherjoincost.However, oncenodesarejoineda network,themessageoverheadrequiredforeitheracaching oraqueryingmessageis p N 16

PAGE 17

CHAPTER2 LITERATUREREVIEW 2.1NetworkSizeEstimationonStructuredP2PSystems Thesimplesolutionforestimatingnetworksizeisthatther equestingpeersends asimplebroadcastingmessagetoallthenodesinthesystem. Thebenetfromthis methodisthatitguaranteestheaccuracyofthenetworksize anditcanbeappliedany typeofnetworktopologyfromrandomtostructured.However ,themethodisimpractical inrealsystemsduetonetworkdynamicsaswellasthehighmes sageoverheadforvery largenetworks( O(N) costcomplexity).Inaddition,thetimetoacquirethenetwo rksize informationistoohigh.Toaddresstheproblemsofbroadcas tingoveranentirenetwork, severalapproacheshavebeenproposedtoestimatethesizeo fP2Pnetworks,which areeitherrandomorstructured. FortherandomP2Ptopology,severalgossip-basedestimatio nmethodshavebeen proposed.Kempeetal.[ 13 ]suggestedapush-basedgossipaggregationscheme.The suggestedmethodrequirestokeeptrackofanormalizationf actorandthisresultsin acomplicatedupdateandexchangeprocess.Thesimilarpush -basedgossipingwas introducedbyJelasityetal.[ 14 ].Inthismethod,onenodeinitializesitscountervalueto 1,whileothernodessetitto0initially.Thenthecounterva lueisupdatedtothemeanof itsownpreviousvalueandthepreviousvaluefromthecommun icatingnodewhenapair ofnodescommunicates.Aftermassivemessagechangesbetwee nnodes,allthenodes sharethesamecountervalue.Themethodrequires O(N 1+2 = d ) ofmessageoverheads forad-dimensionalrandomgraphand O(NlogN) forexpandergraphs.However,this methodisnotsuitableforhighlydynamicnetworkswhereund erlyingdirectedgraphis notstronglyconnected,asthisalgorithmishighlysensiti vetonodefailuresintheearly stageofthealgorithm.Massouli eetal.[ 15 ]proposedtwomeasurementtechniques thatareapplicabletoarbitraryoverlaynetworks.Therst method,calledtheRandom Tourmethod,initiatesamessagethatexecutesarandomwalk untilitndstheinitiating 17

PAGE 18

node.Theyusedacontinuoustimerandomwalk,whichyieldsu nbiasedsamples insteadofadiscretetimerandomwalk.TheRandomTourtsfo rsmallnetworkssince costincreaseslinearlyasanetworkgrows.Thesecondmetho discalledSampleand Collide.Themethodutilizes“InvertedBirthdayParadox”[ 16 ].Themethodsproposed inbothpapersselectuniformrandomsamples,andthenusess uchrandomsamplesto produceanestimateofsystemsize,basedonhowmanyrandoms amplesarerequired beforetwosamplesreturnthesamepeer.Thecostof[ 16 ]is l p N ,where N isthe numberofnodesinthesystemand l issomerealnumber,andforatargetrelativeerror of 1 = p N .[ 15 ]improvesthecostto p lN byselectinguniformrandomsamplestoachieve thesameaccuracy. InstructuredP2Poverlaynetworks,nodeidentiersaresele cteduniformlyat random,whichmeansthedistancesbetweenapairofnodesare thesamealloverthe identierspace.Horowitzetal.[ 17 ]proposedtheestimationmethodbycalculating thedensityofidentiersinaring-basedstructure.Theirm ethodcostslesssincethe initiatingnodeonlyneedstocommunicatewithitsneighbor nodes.Buttheresulting estimationisnotaccurate,theexpectedaccuracybeingint herange[ n = 2,n ].Mahajan etal.[ 18 ]haveasimilarideausingthedensityofnodeidentiersinP astry'sleaf-set, buttheydonotprovideanalyticalorsimulationresults.Sim ilarworksarefoundin [ 14 19 20 ].In[ 21 – 23 ],aspanningtreefromanoverlaynetworkisgeneratedto estimatethesizeofthenetwork.Theestimatedvaluesareag gregatedalongthetree. Themethodusingaspanningtreetakes (N) ofcommunicationcost.Whilethemethod isaccurate,theydidnotconsiderthenetworkdynamics.Anin terestingapproachis proposedin[ 24 ].Theyestimatethenetworksizebyobservingnodedegrees. The assumptionforthemethodisapower-lawstructureforthedi stributionofnodedegree. Bawaetal.[ 16 ]alsointroducedasimilarapproachobservingnodedegrees ontopof Erd os-R enyirandomgraph.Thecostofthelattermethodis O(logN) 18

PAGE 19

2.2SearchinP2PSystems SearchmethodsforP2Psystemscanbecategorizedintotwobroa dsystems: DHT-basedstructuredlook-upsandunstructuredsearchesu singoodingorrandom walks.HighlystructuredP2PnetworkswithDHTlook-upalgor ithms[ 2 – 5 ]areefcient inthatthesenetworksachievelowquerycostsof logN .Thisisbecausetheyplace dataobjectsatparticularpointsonthenetworktopologywh icharedeterminedbyan object'skey.Beehive[ 25 ]achievesconstantlook-uplatencyontopofaDHTthrough proactivereplication.Despitetheirefciency,thepossi bilityofoperation,evenwith extremelyunreliablenodes,hasnotbeenyetexamined.Inad dition,itisimpossiblefor Beehivetohandlehigh-dimensionalcomplexqueries.Extensi veresearchhasbeen conductedtoaddressthelimitsoftheexactsearchproblems inDHT.Oneexampleis pSearch[ 26 ].Arollingindexreducesthenumberofdimensionsformappi ngpurposes ontotheoverlayanddividesthesemanticvector(SV)intosubvectors.Eachsub-vector hasthesamenumberofdimensionsastheCANoverlaydoes.Altho ughpSearchis simpleandsupportshigh-dimensionalqueries,itrequires controlonthedataobjectsof eachnode.Especially,whennodesjoinandleavefrequently, pSearchincursmassive overhead.Therefore,itismoresuitablefornetworkswiths tablenodesratherthanfor highlydynamicnetworks.pSearchstillrequiresmappingsea rchindexintostructured P2Poverlay,andthislimitsthesupportofgeneralquery.Cub it[ 27 ]provideskeyword searchcapabilityoveraDHT.Cubitefcientlyndsmultipl eclosestdatasetsforagiven query.However,itrequiresthecreationofakeywordmetric spaceandonlyreturns multiplesimilarresultstocompensatefortyposinqueries Morecomplexqueryresolutionmethodshavebeenexploredfo rP2Presource discoveryforgrids.SWORD[ 28 ],Mercury[ 29 ],andMAAN[ 30 ]areproposedtosupport multi-attributerangequeriesontopofstructuredoverlay s.InSWORDandMAAN, aDHTiscreatedforeachattribute.ThenumberofcreatedDHT sisthesameas thenumberofattributes.Mercuryalsomaintainsalogicalo verlayforeachattribute 19

PAGE 20

butitdoesnotuseDHTs.Forfewparametersandverynarrowra ngequeries,these systemscanoutperformDeetoo.Otherwise,forlargenumber sofparametersand largerqueryranges,Deetoocanperformbetterasitalwaysr equiresthesame O( p N) complexityregardlessofqueryordatatype.Anotherdrawbac kofDHT-basedrange querysystemsisthatmaintainingmultipleoverlayscostsn etworktrafcbecauseupdate trafcincreasesasthenumberofattributesareincreased. Deetoocreatestwooverlays andupdatetrafctakesplaceonlyinthecachingoverlay.Mo reover,becausedatais notstructured,Deetoo'squeryisnotlimitedtorangequery .Sincethedataobjects aswellasquerymessagesneedtobemappedontonetworkstruc tureinDHT-based systems,thereisnoeasywayforDHTsystemstosupportcompl exqueriessuchas multi-dimensionalqueries.Deetoodoesnotdemandanykeyw ordmappingintoDHTs andcanexecutemoregeneralquerieslikeregularexpressio nsearches. UnlikeDHTs,unstructuredP2Psystemsmostlydependonoodi ngformessage transfers.Thebigadvantageofooding-basedP2Psystemsis thecapacityfor high-dimensionalsearch.AnearlyversionofGnutellawasba sedonnaiveooding. Becauseoodingproducesaverylargenumberofmessagesover anentirenetwork, pureoodinglimitsnetworksize.Toaddressthisscalingpr oblem,varioustypesof solutionshavebeenproposed.KaZaa[ 31 ]andiXChange[ 32 ]introducedcentral server-likesuper-peers.However,super-peerscausebott lenecks,securityissues, andsinglepointoffailureproblemsduetotheirserver-lik echaracteristics.Recently, researcheffortshavealsofocusedonlocality-basedoodi ng.Systemsadopting interest-basedlocality[ 33 – 35 ]assumethattwopeershavingcommoninterestsshare piecesofadataobject.Underthisassumption,ashortcutco nnectionisestablished betweentwopeershavingcommoninterests,andqueriesfrom onepeeraredelivered totheotherthroughthisshortcutlinkintherststageofo oding.Locality-based oodingrequireswarm-upprocedurestogatherqueryhistor yforshortcutconnections. LightFlood[ 36 ]usesaneighbor-degree-basedlocalityscheme.LightFloo dformsa 20

PAGE 21

tree-likesub-overlaycalledFloodNetusingneighbors'de greeinformation.Oncethe sub-overlayisformed,therearetwooverlaynetworksinthe system:theoriginalP2P overlayandFloodNet.Theoodingtakestwostages.Message saretransmittedusing pureoodingwithrelativelysmallTTLvaluesintherststa ge.Thepeersthatreceive thequerywithzeroTTLtriggerthesecondstageofoodingin theFloodNet.Although LightFloodissimpleandhelpsstopgeneratingmassivemess agesforqueriesata certainpoint,searchingunpopularobjectsrequirestheen tirenetworktobevisited;in addition,LightFloodneedstobewarmedup. Arandomwalk-basedsearchtechniqueisintroducedbyAdamic etal.in[ 37 ]. Theirworkreducessearchcostbythefactorofthenumberofr eplicas,buttheydo notconsiderreplicaplacement.Althoughrandomwalksearch eshaveanadvantage overoodingintermsofsearchcost,theyhassomescalabili typroblemsbecause almostallthequeriestendtoconcentrateonthehigh-degre enodes.Toaddress thisproblem,objectreplicationusingthesquare-rootpri nciple[ 38 39 ]andtopology reconstruction[ 40 ]havebeenproposed.Bothreducesearchtimebutincurconsid erable communicationcosttomaintainfreshtopologiesordatarep licationcopies.Popularity-biased randomwalk[ 41 ]achievesthesquare-rootprinciplewithoutthecostofdat amovement ortopologyreconstruction.Sarsharetal.[ 42 ]combinedoodingandrandomwalkingin power-lawnetworks.Intheirwork,aquerycanberesolvedin time O(logN) .However, O(N 2logk max k max ) messagesaretransmittedforasinglequery,where k max denotesthe maximumdegree;thus,when k max = p N thisbecomes O( p NlogN) Liuetal.[ 43 ]studiedboundedbroadcastinginwirelesssensornetworks .A balancedpushandpullstrategyachieves O( p N) searchcostinthebestscenario. However,comb-needledatadiscoverytechniquerequiresno destoestimatecacheand queryfrequency.Allnodesinthenetworkshouldkeeptheirlo cationinformationinthe grid.Thoughtheydonotanalyzesearchtime,itispossiblet oestimateit.Bythenature ofthehop-by-hopmessagetransfer,thecomb-needledatadi scoverytakeslineartime 21

PAGE 22

intheboundedrangewhichare O( p N) .Thedynamicpathsquorumsystem[ 44 ]is scalableandoperatesinadynamicsetting.Thequorumsetsa redividedintoreading quorumsandwritingquorumsinagrid,andeachreadingquoru mintersectseach writingquorum.Theyanalyzedprobecomplexityandavailab ility,especiallyinadynamic environment.Theprobecomplexitiesofthenon-adaptive(w ithoutstabilization)and adaptive(withstabilization)algorithmsis ( p NlogN) and ( p N) ,respectively. 22

PAGE 23

CHAPTER3 NETWORKSIZEESTIMATIONINPEER-TO-PEERNETWORKS 3.1Introduction SincePeer-to-Peersystemsaredecentralized,eachnodedoe snotmaintainglobal information,suchasthenumberofpeersinanetwork.InP2Pne tworks,keepingtrack ofnetworksizeisoftenachallengingproblembecauseeachn odetypicallyknowsonlya subsetofthenodesinthesystem.However,therearemanyapp licationsforwhicheach nodeneedstoknowthesizeoftheP2Pnetwork,atleastapproxi mately.Thesystem monitoringandobtainingglobalstatisticsbecomemuchmor ecomplex.Forinstance, datareplicationapplicationslargelydependonthenumber ofnodesindetermining thereplicationrateofdataobjectsandqueries.Thenumber ofnodesisusedforload balancingaswellasforlimitingbroadcasts.Theaccuracyo fnetworksizeinformationis oftenveryimportanttotheseapplications.Insearchappli cations,bothunderestimation andoverestimationaffectperformanceinsuccessprobabil ityandcommunicationcost.If anodeunderestimatesthesizeofthenetwork,thesuccesspr obabilitygoesdownbelow averagewhilethecommunicationcostisreduced.Theexacto ppositeresultisexpected ifabiggersizeisestimated. Thesimplewaytocountthenumberofnodesinasystemistobro adcasta simplemessagetoallthenodesinthenetwork.However,this methodgenerates highcommunicationcostinthatallnodesinthesystemmustb evisited,anditrequires extremelylargetimeoverheads.Thus,itisnotsuitablefor large-scalenetworks. Moreover,Icannotcountontheresultsofbroadcastinginac ompletenetworkmay notapplyinP2Pnetworks,consideringthatnodesinP2Pnetwor ksjoinandleave frequently.Themainpurposeofthisdissertationistoobta inagoodestimationwithout payingtoomuchcommunicationandtimecost. Inthisdissertation,Iproposefourdifferentnetworksize estimationmethods usingonlylocalinformationtoreducenetworksizeestimat ionerror.Alltheproposed 23

PAGE 24

approachesarebasedontheassumptionthatallnodesareuni formlydistributedinan addressspace.Inotherwords,theexpecteddistancebetwee nanytwonodesisequal. Basedonthisassumption,Iestimatethenumberofnodesbycal culatingthenode densitywithinagivenlengthusingthealgorithm.Let D bethenodedensityand l and i bethelengthandthenumberofnodesinthelength.Then,anod edensityisobtained by D=i = l .Usingnodedensity,networksizecanbeestimatedby ^ N=LD ,where L is thelengthofaddressspace,forexample, L=2 160 usedinChord.Ialsocombinetwo ormoremethodstoincreasetheaccuracyofestimation.Apro peralgorithmshouldbe appliedaccordingtoitsobjectivesandapplications. Therstmethodcalculatesanaveragedistancebetweentwon odesbylookingat theleftandtherightneighborsinaring. Thesecondestimationdependsontherstmethod'sestimati on( N 0 ) .Theinitiating nodecontactsanodewhichis logN 0 hopsaway.Thenumberofnodesbetween thesetwonodesis logN 0 andthedistancecanbeeasilycalculatedbycomparing theaddresses.Communicationcostforthismethodis logN 0 Thethirdmethodscollectstheresultsofmethod2fromanode 'sshortcut neighbors.Thentheinitiatingnodetakesthemedianofther esults. Thelastmethodusesboundedbroadcastingwhoseboundis p N Methods2,3,and4demandpreviousestimation.Anyofthemeth odscanbe moreoptimalthantheothersunderspecialcircumstances,s uchasnetworkmodel. Forexample,ifnodesareperfectlydistributeduniformlya trandominaddressspace, therstmethodisenoughtomeasurethenetworksizewiththe leastamountofcost becausedistancesbetweenanytwonodesareequal.However, inapracticalnetwork, nodesarenotperfectlydistributeduniformlyatrandomina ddressspace.Inother words,thedistancesbetweentwopairsofnodesarenotthesa meinapracticalsystem. Thus,asthesizeofsamplingisincreased,theaccuracyofth enetworksizeestimation tendstobehigherbycalculatingtheaveragedistancebetwe entwonodes.Increasing samplingsizealsocauseshighercommunicationcost. 24

PAGE 25

Anotherapproachtolimitnetworksizeestimationerrorsist omakeanetworkhave moreuniformlydistributedpeersbycontrollingjoiningme thod.Whenanewnodejoins anetwork,theapproachprovidestwopossibleaddressesand letsthenodeselectthe onethatmaximizedthesumofdistancestoitsadjacentnodes .Asaresult,themethod makesdistancesbetweeneverytwonodesmoreevenlydistrib uted,thoughsimply choosingarandomaddressismuchsimpler. Icomparetheaccuracyandthecommunicationcostusingeach methodindividually andcombinedmethodsinsimulation. 3.2NetworkSizeEstimationinP2PNetworks:TheoreticalBackg round Inthissection,fourdifferentmethodsfornetworksizeest imationarepresented. Exceptthethirdmethod(medianofshortcutneighbors'estim ation),eachalgorithm calculatesadensityinaddressspace.Anodedensity( D )canbeobtainedby n ab = d ab where n ab isthenumberofnodesbetweennode a andnode b ,and d ab isdistance betweennode a andnode b .Thenodedensity( D )isusedtoestimatetotalnumberof nodesinanetworkby ^ N=DL ,where L isthelengthofaddressspace,forexample, L= 2 160 .Asthenumberofsamplesincreases,theaccuracyofestimati onalsoincreases. Thus,experimentswereconductedundervarioussettingsto getthebestestimation ofthenetworksizewithoutpayingtoomuchcommunicationco st.Ifmorenodesare involvedincalculatingthenodedensityamongthenodes,th elevelofaccuracygoes up,thoughitrequiresmoretimeandbandwidth.Onthecontra ry,thevarianceofthe estimatednetworksizeismuchhigherwhenonlytwonearestn eighborsareusedfor thecalculation.Accuracyofsizeestimationislostinthisc ase,thoughasavingsintime andbandwidthisobserved.Simulationresultsconrmthatth evarianceofestimated networksizegoeslowerwhenmorenodesareinvolvedinthees timation. 3.2.1TheAlgorithm Therstalgorithm, localestimation ,doesnotrequireanymessageexchange betweennodes.Sinceeachpeerkeepsitsneighborpeers'info rmation,suchas 25

PAGE 26

neighborpeers'addresses,itcancalculatenodedensityus ingthisinformation.Let d r and d l representthedistancetotherightneighborandthedistanc etotheleftneighbor, respectively.Then,nodedensityis D= 2 d r +d l .Finally,theestimationiscompletedby N 0 =LD .Thismethodhasacriticalweaknesseventhoughnomessageo verheadis generated.Thevarianceofestimatednetworksizefromeach nodeisverybigbecause thisalgorithmcountsontheuniformityofthenode'sinternodedistancestoitsneighbor nodes.Thus,thismethodisutilizedastheinitialestimati onfortherestofthemethods. However,ifthereexistsanetworkmodelwhoseinter-nodedi stancesarefairlyuniformly distributed,thismethodisthebestalgorithminthatthere sultisaccuratewithout messageoverheads. Thesecondmethod, logestimation ,hasmorenodesinvolvedinthenodedensity calculation.Theinitiatingnodesendsapingmessagetoits left(orright)neighborwith logN 0 1 TTL,time-to-live,basedontheinitialestimation N 0 .TheTTLisdecreased by1whilethemessageispassedtothenextleft(orright)nei ghbor.TheTTLreaches 0ina logN 0 -hop-awaynodefromtheinitiatingnode.Thenodesendsames sageback withitsaddressinformationtotheinitiatingnode.Theini tiatingnodecalculatesthe distance(say, d log )tothe logN 0 -hop-awaynodebasedontheaddress.Thenodedensity isobtainedby D= logN d log Thethirdmethod, medianestimation ,takesthemedianoftheestimated networksizesusinglogestimationoftheinitiatingnode's long-rangeconnections. Thenearest-neighborsestimationisexcludedbecausethed istributionofinter-node distancesfromadjacentpeersalreadyaffectsthecalculat ionofnodedensityfromthe initiatingnode.Theestimatednetworksizesoftheadjacen tpeersandtheinitiatingnode tendtobesimilar.Medianispreferredtomeaninthisalgori thmbecausemedianisa bettermeasureofcentraltendenciesthatdiscountstheimp ortanceofnumbersoutside thedatarange. 26

PAGE 27

Thelastmethod, square-rootestimation ,utilizesboundedbroadcastingwhich limitsthebroadcastingto p f rep N 0 nodes.Similartothelog-estimation,theinitial estimation( N 0 )istheresultoflocalestimationand f rep isareplicationfactor.Abounded broadcastisaccomplishedwiththefollowingrecursivealg orithm:tobroadcasta messageovertheregion[ ],theroutingalgorithmndsanynodeinthegivenrange rstlyviagreedyrouting,inwhichanodendstheclosestno detothedestinationas itsnextnode.Notethatthenumberofnodesintherange[ ]is p f rep N 0 .Letus assumethatanode istherstnodeintherangerecognizedbygreedyrouting,th en themessageissenttonode .Suppose has F connectionstonodesintherange [ ] .The i th suchneighborisdenotedas b i .Thenode sendsaboundedbroadcast overasub-range, [b i ,b i+1 ) ,to b i ,exceptthenalneighbor.Differentlystated, b i isin chargeofbounded-broadcastinginthesub-range [b i ,b i+1 ) .Ifthereisnoconnectionto anodeinthesub-range,therecursionisendedandthenodest aysinthetreeasaleaf node.Tothenalneighbor( b F ), sendsaboundedbroadcastto [b F ] .Whenanode receivesamessagetoarangethatcontainsitsownaddressth emessageisdelivered tothatnodeinadditiontobeingroutedtoothers.Figure 3-1 showshowthisbounded broadcastformsalocaltreerecursivelyinarangeof[ ].Thetimerequiredforthisis O(log 2 N) .ByDeetoo'srecursiveboundedbroadcastingalgorithm,all nodesintherange areinvolvedinformingthelocaltreebecauseonlyanodewit hnoconnectioninthe sub-rangetothenodewhichisresponsibleforbounded-broa dcastingcanstoprecursion outofeachbranchofthetree.3.2.2NodeJoiningAlgorithmforMoreEvenlyDistributedNet work AlthoughIassumedthateachnodeisdistributeduniformlyat random,inareal network,inter-nodedistancevaries.Moreover,nodesinP2P networksjoinandleave frequently.Itisimpossibletomaintainequallydistribut edinter-nodedistanceseven ifthedistributionofinitialnetworkisquiteuniformlydi stributed.Thehighvarianceof inter-nodedistanceshasanegativeinuenceonestimation ofnetworksizebecause 27

PAGE 28

itisdirectlyagainsttheassumptionofequaldistribution .Tocompensateforthe non-uniformityofinter-nodedistances,Iintroduceanewj oiningalgorithm.Whena newnodejoinsanetwork,thefollowingstepsaretaken: 1. selecttwodifferentrandomaddresses, 2. ateachaddress,calculateminimumringdistancestoneighb oringnodeswhich haveleftclosestaddressandrightclosestaddress, 3. ndaproperplaceonthevirtualringspacebyselectingthea ddressthathasthe largerminimumdistancetoaneighbornode, 4. obtainaaddressesforandmakeconnectionstotwoadjacentn eighborsandone short-cutneighborbasedonKleinberg'sinverse r th -powerdistribution, 5. asanalstep,copyobjectsfromneighborsinthesamesetofs ub-rings(inthe samecolumnsinmatrixspace). Figure 3-2 showshowanewnodendsitsrightplace.Fromrandomlyselec ted positions A and B ,thenearestneighborsare node1 and node3 .Betweenthesetwo nodes, node3 hasabiggerdistanceto A thanthedistancefrom node1 to B .Thus,a newnodetakesaposition A asitsnewaddress.Ourjoiningalgorithmmakesinter-node distancesmoreevenlydistributedbecauseitalwaysminimi zesthemaximuminter-node distance.3.2.3CommunicationCost Toevaluatecommunicationcostismeaningfulbecauseitisa nimportantfactorof networkscalability.Thereasonwhyasimplebroadcastingm ethodcannotbeappliedto alargenetworkisthatthismethodisimpractical.Thenumbe rofroundtripmessages cannotberegardedasthecommunicationcostforsimpleanal ysis.Localestimation requiresnomessageexchangebecauseinthenetworkmodel,e achnodemaintains theneighbornodes'information,includingtheiraddresse s.Thedistancetotheneighbor nodecanbedirectlycalculatedbycomparingtheaddresses. Thecostforthelog estimationis logN 0 .Becausethecostislogarithmicoftheinitialestimation,t heeffect ofthevarianceoftheinitialestimationisrelativelysmal l.Themedianestimationitself 28

PAGE 29

requires d n 2 messages,where d n denotesthedegreeofanode n .However,because thisalgorithmusestheresultoflogestimationfromthenod e'sshortcutneighbors,the overallcostisthesumoflogestimationandmedianestimati on,whichis d n logN 0 .The costforsquare-rootestimationis p f rep N 0 3.3SimulationResults Inthissection,theperformanceofnetworksizeestimation isevaluatedvia simulation.Simulationresultsfromeachmethodarecompare dintermsofestimated networksizedistributionandcommunicationcosts.3.3.1SimulationMethodology Toevaluatetheperformanceofthework,thealgorithmissim ulatedusing Netmodeler[ 45 ],whichisafreesoftwareandopensourcelibrarywrittenin C++. Theonlyalgorithmtorequireaparameteristhesquare-root estimation.Thereplication factor, f rep issetto1.Allestimationprocessesareinitiatedoneveryno desinthe networkregardlessofthealgorithm.Forthesquare-rootes timation,messagesare boundedbroadcastedwithinrandomlychosenranges.Eachsim ulationisrepeatedin thenetworksizeof5,000nodesand500,000nodes.3.3.2NetworkTopology ThenetworkmodelfortheworkisbasedonKleinberg'sone-dim ensionalconstruction [ 46 ].Inthismodel,nodesinaringareorganizedsuchthateachn odehasasetof ”local“contactsandone”long-range“contact.Asmallworl dmodeliswidelyusedfor P2Psystemsbecauseitallowsareducedpathdiscoverywithon lylocalinformation byformingalocaltreeinthesearchspace.Inadditiontothe searchefciency,asmall worldmodelrequireslowmaintenancecost.3.3.3SimulationResults Inthissection,thenetworksizesestimatedbyfourmethods describedinthe previoussectionarecomparedviasimulation.Inthetopolo gymodelontopof Netmodeler,thealgorithmsintwonetworkmodelsarecompar ed.Thedifference 29

PAGE 30

betweennetworkmodelsisnodethejoiningprocess.Inthera ndomaddressmodel,a newlyjoiningnodeselectsarandomaddressandthisaddress speciesthelocationof thenodeinaringtopology.Inthemoreevenlydistributedne tworkmodel,anewnode choosesitsaddressfromtworandomlyselectedaddressesas describedinsection 3.2.2 .Estimationisrepeatedbyallnodesinthenetworkandaverag ed.Themain metricsforevaluatingtheproposedalgorithmsincludeave rageestimatednetworksize andcommunicationcost.Highaccuracyofnetworksizeestim ationcanbeachievedif morenodesareinvolvedintheestimation.Intheotherhand, theinvolvementofmore nodescauseshighercommunicationcost.Simulationresults showavividtrade-off betweentheaccuracyandthecost. Table 3-1 showstheresultsofestimationalgorithmswhentherandoma ddress selectionjoiningalgorithmisused,andtheresultsofesti mationwithanewjoining methodforamoreuniformlydistributednetworkisshowninT able 3-2 .Theestimates obtainedbynearestestimationdeviatebyalargeamount,an dtheestimationerroris thebiggestamongthemethods.Theresultsconrmthattheac curacyincreasesas thenumberofnodesusedincalculatingthenodedensityisin creased.Thestandard deviationisreducedby40to60%whenmoreuniformaddressse lectionisusedforthe network'sjoiningalgorithm. TheaccuracyofestimationalgorithmsarecomparedinFigur e 3-3 withnetwork sizeof5,000andinFigure 3-4 withnetworksizeof500,000.Thedifferencesamong methodsaremorevividwhenthestandarddeviationsarecomp aredasshowninFigure 3-5 andFigure 3-6 Figure 3-7 and 3-8 showcommunicationcostwithnetworksizesof5,000and 500,000,respectively.Inthegures,method1isthe nearestestimation ,method 2isthe logestimation ,method3isthe medianestimation ,andmethod4isthe square-rootestimation .Thecommunicationcostformethod2andmethod3is calculatedcumulatively.Sincemethod2dependsontheresul tsofmethod1,thecost 30

PAGE 31

formethod2iscalculatedby cost(m1) logN 0 .Similarly,thecostsformethod1and method2areaddedforthecalculationofthecostofmethod3. Thecommunication costofmethod1,2,and3doesnotvary.Thecostformethod2is decidedbythe initialestimationbymethod1.Thecostformethod1andmeth od3isdecidedbythe degreeofnodesinthenetwork.Theaveragedegreeofnodeswa sobservedtobe around4regardlessofthenetworksize.Inotherwords,each nodemaintainstwodirect neighborsinaringand2long-distanceconnections. Theaveragecostforsquare-rootestimationbetweenthetwo networkmodelsis close,butthevarianceofmoreuniformmodelislowerthanth atoftherandommodel. Thelowvarianceoftheinitialestimationbymethod1explai nsthelowvarianceof square-rootestimation. Figure 3-9 showsthemeasuredresultsofMeanSquareError(MSE)-cost relationshipusinglogestimation.Toseethetrade-offbet weenthecostandthemean squareerrorinlogestimation,thetestisrepeatedwithdif ferentweights,namely w A wlogN -awaynodeisselectedtocalculatethedensitybetweenthen odeandthe requestingnode.Asshowninthegure,thebiggertheweight, thesmallertheerror. However,therewasnobigimprovementbeyondtheweightof3. 3.4Conclusion Ipresentfournetworksizeestimationalgorithms.Exceptth emedianestimation method,allalgorithmsestimatethenumberofnodesinanetw orkusingthenode density.Eachmethodprovidesdistinctiveaccuracyandcost .Thus,userscanselect oneofthefourestimationalgorithmsbyanapplication'sde mand.Thenearest estimationissuitableforoverlaysthatareuniformlydist ributedinanaddressspace. ThelogestimationisinspiredbyDHT-basedsystems.Themed ianestimationperforms betterifanodehasmoreshortcutneighbors.Thesquareroot estimationcanpiggy-back onDeetoo'scacheorquerymessages.Bycombiningallorsever aloftheabove methods,ausercancanachieveacombinationofaccuracyand cost. 31

PAGE 32

Toimprovetheaccuracyoftheestimationalgorithms,anewn odejoiningalgorithm isprovidedwhichincreasestheuniformityofinter-nodedi stances.Withthehelpofnew joiningalgorithm,lowervarianceofeachestimationmetho disobserved. Finally,thecostandtheaccuracyofeachproposedmethodar eevaluatedby simulations.Thesimulationresultsconrmedthetrade-of fbetweenthecostandthe accuracy. 32

PAGE 33

Table3-1.Statisticsofestimatednetworksize(randomaddr essselection). ActualSize Method Average Std.deviation 5000 1 10182 20391.08 2 4950 1820.45 3 4772 1210.91 4 5000 643.77 500000 1 996912 2028568.64 2 498570 143811.02 3 486665 97687.96 4 499976 21300.36 Table3-2.Statisticsofestimatednetworksize(evenaddres sselection). ActualSize Method Average Std.deviation 5000 1 7287 7409.59 2 4692 1132.86 3 4617 810.11 4 4985 467.00 500000 1 752250 1213434.81 2 480644 95900.29 3 474566 65750.32 4 499986 14096.09 Figure3-1.Treegenerationbyboundedbroadcasting 33

PAGE 34

Figure3-2.Addressselectionofnewlyjoinednode M1 M2 M3 M4 20000 10000 0 10000 20000 30000 40000Estimated Network Size 101824949 4771 5000 7287469146174985 Estimated Network Size (5,000 nodes) random more uniform Figure3-3.Meanestimationwithactualsizeof5000nodes 34

PAGE 35

M1 M2 M3 M4 2000000 1000000 0 1000000 2000000 3000000 4000000Estimated Network Size 996912498569486665499975 752249480644474566499986 Estimated Network Size (500,000 nodes) random more uniform Figure3-4.Meanestimationwithactualsizeof500000nodes M1 M2 M3 M4 0 5000 10000 15000 20000 25000std N 20391 1820 1210 643 7409 1132 810 466 Standard Deviation of Estimated Network Size (N=5,000) random more uniform Figure3-5.Standarddeviationofeachestimation(N=5000) 35

PAGE 36

M1 M2 M3 M4 0 500000 1000000 1500000 2000000 2500000std N 2028568 143811 97687 21300 1213434 95900 65750 14096 Standard Deviation of Estimated Network Size (N=500,000) random more uniform Figure3-6.Standarddeviationofeachestimation(N=500000 0) M1 M2 M3 M4 0 20 40 60 80 100Number of Messages 0 8 19 66 0 8 19 68 Communication Cost (5,000 nodes) randommore uniform Figure3-7.Communicationcostwith5000nodes 36

PAGE 37

M1 M2 M3 M4 0 200 400 600 800 1000Number of Messages 0 12 28 664 0 12 28 681 Communication Cost (500,000 nodes) randommore uniform Figure3-8.Communicationcostwith500000nodes 100000 1e+06 1e+07 10 100 1000 10000 MSEcost cost vs. Mean square error (50,000 nodes) logN-hop 2logN-hop 3logN-hop 4logN-hop 5logN-hop 6logN-hop 7logN-hop Figure3-9.Communicationcostvs.MSEwithlog-estimation( actualnetworksize: 50,000) 37

PAGE 38

CHAPTER4 DEETOO:SCALABLEUNSTRUCTUREDSEARCHBUILTONASTRUCTURED OVERLAY 4.1Introduction P2Pquerysystemsmaybecategorizedintothreedifferentarc hitectures:centralized, decentralized/structured,anddecentralized/unstructu red[ 39 ].First,centralizednetworks relyonanindexingserverforupdates.EarlyP2Psystemssucha sNapsterfallintothis category.Withinthisarchitecture,eachnodesendsaqueryn ottoanotherpeer,butto thecentralindexingserver,tondanodethatmatchesthequ ery.Thesecentralized P2Pnetworksareclearlynotscalable(unlesstheyreplicate sufcientback-upservers) andtheyarenotfundamentallyabletoavoidthesingle-poin toffailureproblem. Structurednetworksuseanoverlaytopologythatisstructur edbutwithoutcentral control.Indistributedhashtable(DHT)basedP2Poverlays[ 2 – 5 ],eachobjecthasa uniqueidenticationkeythatplaysaroleinplacinganobje ctintothenetwork.Aquery canalsopinpointtheobjectindexedbyakey.DHT-basedover laysarenotonlyefcient butalsopartiallyresistanttofailureofthenodesorlinks .Thechiefdisadvantageof structurednetworksisthatqueriesmustbemappedontothes tructureofthenetwork. Sinceitisnotstraightforward(orperhapsnotpossible)tom apsomequeriesonto low-dimensionalspacessuchasthoseformedbycommonP2Psys tems,notallquery systemscanbeeasilyimplementedonstructurednetworks.An examplemightbe regularexpressionmatching.Furthermore,additionalste psneedtobetakentodeal withtheproblemofhot-spotsinthenetwork,whichformwhen demandforspecic objectsincreasessuddenly. Unstructurednetworksuseooding-basedroutingandrando mwalkstolocatea resourceandtoresolveaquery.Thesesystemsdonotrequire auniquekeyforeach object.Therefore,anytypeofquerycanbeeasilymappedtoa nunstructuredP2P system.Unstructuredsystemswithkey-wordsearchingarep revalentinP2Ple-sharing networks.Whilethesesystemsareresilienttobothnodejoin sandfailuresduetotheir 38

PAGE 39

simplicity,unstructuredle-sharingnetworkshaveascal ingproblem.Asthenetwork sizegrows,eachparticipatingnodecanbecomeoverloadedw ithahugeamountof querymessages,whichcanscaletoacomplexityof O(N) sinceallthenodesneedtobe visitedforasinglequery. InthisdissertationIpresentDeetoo,anefcientquery-re solutionalgorithmbased uponKleinberg'sone-dimensionalconstruction[ 46 ].Theideaistoorganizenodesin aringinwhicheachnodehasasetof“local”contactsandone“ long-range”contact. Asmall-worldmodelallowsareducedpathdiscoverywithonl ylocalinformationby formingalocaltreeinthesearchspace.Inadditiontothese archefciencyandlow maintenancecost,IcanreuseexistingP2Pcodedesignedfora ringtopologyby adaptingaone-dimensionalsmall-worldnetworkmodel.The heartoftheworkis simpledataobjectreplicationandasearchalgorithm.Inth ismodel,theusual1-D overlaytopologyistransformedintoarectangularmatrixa sdescribedinSection 4.2 Replicationandqueryresolutionareexecutedbyboundedbr oadcastingoverthe columnsandrowsonthematrixspacerespectively. ThischapterevaluatesthenovelDeetooalgorithmsfromath eoreticalstandpoint andthroughsimulation.Ifocusonthebehaviorofthesearch algorithmsforeachof thefollowingmetrics:successfulsearchingprobability( hitrate),communicationcost (bandwidthconsumptionornumberofgeneratedmessages),a ndsearchtime(depthof themulticastingtree).Measuresofthequeryaccuracyarei mportantbecauseprecise informationretrievalisoneofthemainpurposesofP2Pnetwo rks.Distributedsystems shouldavoidmassivecommunicationcost.Deetoostores O( p N) replicasperobject withahighprobability.Unlikethestructurednetwork,Dee toodoesnotrequirethateach replicatedobjectbemappedintoaDHT.Aquerygenerates O( p N) messages.This impliesmoremessageswhencomparedtoDHTs,whichhaveonly O( logN )complexity, butoffersamajorimprovementoverooding-basedsearches with O(N) .Assumethat datacanbecachedon C ofany N nodes.Sincethereisnostructureassumed,andif 39

PAGE 40

loadisevenlybalancedacrossthenodes,cachingdoesnotde pendonthedatabeing cachedandIassumethat C nodesareselectedatrandom.Similarly,whenIquery,I cancheck Q ofthe N nodes,againatrandom.ThustheprobabilityImissthestore d dataisapproximately: 1 C N Q = 1 C N N C CQ N exp( CQ N ) (4–1) So,Ineed CQ=O(N) inordertohaveaconstantprobabilityofsuccessinthismod el. Thispresentsanintuitivetrade-off,themorenodesonwhic hIcachedata,thefewerI needtochecktondit.Let p c beafractionofnodesthathascaching, p q beafraction ofnodesthathasquerying, beareplicationfactor,and K beatotalcostbothforthe cacheandthequery.Notethat p c +p q =1 .Thereplicationfactorissetto =CQ = N Then, K=p c C+p q Q (4–2) =p c N Q +p q Q (4–3) Bysolvingtheequationfortheminimum K ,theminimumcostforqueryis: Q= r p c p q N (4–4) Similarly, C= r p q p c N (4–5) Tominimize C+Q ,whichisthecosttocacheanobjectandqueryforitonce, thebestchoiceisfor C and Q tobe O( p N) when p c =p q .Thissimpleanalysis suggeststhatanyunstructuredload-balancedsystemwillb erequireatleastthis muchcommunication.Ofcourse,logarithmiccomplexitywou ldbenice,butformany practicalsystems,thenumberofnodesmightwellbe 100 to 10,000 whichmean C and Q valuesontheorderof 10 to 100 .Suchoverheadcostswouldbecompletelyacceptable formanyapplications,especiallywhenIhandlemetadatain steadoflargemultimedia 40

PAGE 41

les.Deetooistherstsystemthatarbitraryunstructured queriescanbemappedto astructuredP2Psystemwithquerycost O( p N) .Oursearchingalgorithmcancoexist onthesameP2PnetworkwithaDHT,sowithDeetoouserscanstil lhavestructured aswellasunstructuredqueries.Also,userscancontrolsucc essrateandsearchcost withDeetoobyadjustingthedegreeofreplicationwithause r-speciedvalue.In[ 39 ], Lvetal.showedthatsquare-rootreplicationdistribution istheoreticallyoptimalinterms ofminimizingtheoverallsearchtrafc.Ourprotocolsearc htimeoutperformsother unstructuredmodelsbyforminganefcientlocaltree:Deet oocompletessearchesin O(log 2 N) timebyusingKleinberg'ssmall-worldnetworkmodel.Lastly ,duetothefact thatDeetooisbuiltonastructuredoverlay,objectscanbeu pdatedordeletedafter beingpublishedonthesystem.Thisrepresentsanadvantage overrandomwalkbased schemespreviouslyproposedintheliterature. 4.2TheDeetooSearchAlgorithm InthissectionIdescribethedatastructureandsearchalgo rithmIuseforDeetoo. ItakeasimilarapproachtotheideaofDHTP2Pnetworks:taket hehashtabledata structure,andbuildadistributeddataversionofthisdata structurewherememory locationsspreadacrossmanynodes.TounderstandtheDeeto oP2Psystem,Iwill rstdescribealocaldatastructureandthendescribeadist ributedversionofthatdata structure.4.2.1AnUnstructured“Hash”Table Consideratabledatastructurethathas B binsarrangedina k l array( B=kl ).I cansay b ij isthebininrow i column j .Toaddanobjectintothistable,selectarandom columnandinserttheobjectintoeachbininthatcolumn.Whic histosay,choosea randomvalue r 2 (1,l) ,andinserttheobjectinthesetofbins C r = f b ir j i 2 (1,k) g Tosearchforanobject,selectarandomrowandcheckeachbin inthatrowforthe object.Equivalently,choosearandomvalue p 2 (1,k) andlookfortheobjectintheset ofbins Q p = f b pj j j 2 (1,l) g .Sinceeveryrowandcolumnintersectatexactlyonebin, 41

PAGE 42

C r \ Q p = f b pr g ,aquerywillalwaysndonebinintowhichanobjectwasinser ted.The numberofbinaccessestoinsertanobjectis k .Thenumberofbinaccessestoqueryfor anobjectis l .Atrade-offbetweencostofinsertionandcostofsearching exists. Asalocaldatastructure,theabovemayhavelittlevalue:itc osts k timesmoreto storethananunsortedlist,andthetotalnumberofcomparis onsneededforasearch isstill M ifthereare M objectsinthetable.However,asadistributeddatastructu re designedtodistributeloadandminimizecommunication,it isusefulsinceonly l bins needtobesearched.Thisdatastructureachievestotallyba lancedloaddistributionin thenetworkbecauseeachobjectisreplicatedoverabounded regionirrespectiveofits popularity.Oncurrentunstructuredsystems,queriescanc oncentratedonaspecic peerhavingmanyobjects.Besides,popularobjectsarelikel ytobeavailableatseveral nodesandtheprobabilityofsucceedinginqueriesforitism uchhigher.Inotherwords, queriesforrareobjectsarebarelyanswered.BecauseDeetoo algorithmdistributes objectsevenlyoverthenetwork,Icanavoidcreatinghot-sp otsandimproveprobability ofndingrareobjects.InthenextsectionIdescribehowtom akeadistributedversionof thisdatastructurewhichcansupportgeneraldataobjectsa ndqueries.Iwilldescribea randomizedversionoftheabovewherequeriessucceedwitha highprobability. 4.2.2ADistributedUnstructuredTable OursettingwillbethestandardP2Psetting:thereare N nodeswhichcan communicate,storeobjectsandperformqueries.Inadditio ntonodes,thereare alsobins.Binsmayormaynotbeoccupiedbyaparticularnode. Thenumberofbins isassumedtobexedatsomeverylargenumber,forinstance 2 160 .Thebinsare arrangedinarectangulararray,whichinDeetooIwillassum etobesquare.Inthedata structureofSection 4.2.1 ,eachrowandcolumnintersectatexactlyonebinthatmayor maynotbeoccupiedbyanode.Insteadofqueryingandinserti ngalongonerowand onecolumn,Iwilldosooverasufcientnumberofrowsandcol umnssuchthatthe probabilityofhavingmorethanonenodeintheoverlappings etisverylikelytobeone. 42

PAGE 43

Figure 4-1 depictsthe 2 D arrayIusetocache(insert)andquery(search). InFigure 4-1 ,thearea A representstheintersectionofaparticularcacheandquery operation.Iseeinthatarea,forexample,therearethreeno des,andsothequerywill besuccessful.Ineedtoshowseveralthingstoseethatthisa lgorithmwillworkina distributedsetting: 1. Showhowtoefcientlysendcacheandquerymessagestoentire columnsand rowsrespectively. 2. Showhowtodealwithnodesjoiningandleavingthenetwork. TodealwiththeabovetwoproblemsIleverageexistingworko nbuildingroutable 1 D P2PnetworkssuchasChord[ 3 ]andthesmall-worldmodel[ 46 ].Ratherthanbuilda P2Pnetworkthatisexplicitlytwodimensional,Ibuildtwosu b-graphs,eachofwhichisa 1-Dring,whichIcancallthequeryringandthecachering.Eac hP2Pnodehasexactly oneaddress,andhenceposition,oneachring.Thisisdepict edinFigures 4-2 4-3 ,and 4-4 ;thesedrawingsillustratehowone-dimensionalringsforq ueryingandcachinglocally overlayatopofthe2-DDeetooarray.Anodeiscachedatlocat ion i withprobability c i andaquerynodeisplacedatlocation i withprobability q i inthequeryring. N(x) and N(x 0 ) denotenodeswhoseaddressesare x and x 0 ,respectively. x 0 istransposed addressof x Inordertoachievetheeffectoforderingthecacheringbyin creasingalongthe columnsandthequeryringtoincreasealongtherows,thebin addressforagivennode inthequeryringmustbethetransposeoftheaddressontheca chering,asdepictedin Figures 4-2 and 4-3 .Assumethatthesizeoftheaddressspace,andhencenumberof bins,is B=m 2 .Theaddressmappingalgorithmisasfollows:Let x denoteanaddress onthecachering.Theaddress x canbeexpressedbycolumnelement, x i ,androw element, x j ,suchthat x=mx i +x j .Atranslatedaddressonthequeryring x 0 isobtained byexchangingcolumnelementandrowelement: x 0 =mx j +x i 43

PAGE 44

So,eachP2Pnodethenhastwoaddressesinvirtual1-Dringsand followsthe usualprocedureforjoiningeachofthetworingsasdescribe din 4.2.5 .Noticethaton thecachering,thenodesinthesamecolumns(andadjacentco lumns)haveadjacent addresses.Onthequeryring,nodesinthesamerow(andadjac entrows)haveadjacent addresses.Becausetheringsareefcientlyroutable,itisa lsoefcienttosenda messagetoarandomlyselectednodenearthestartofacolumn orrow.Similarly,to reachallelementsofaroworcolumn,Icanuseaboundedbroad castononeofthetwo rings.4.2.3BoundedBroadcast InDeetoo,aboundedbroadcastisaccomplishedwiththefoll owingrecursive algorithm:Tobroadcastamessageovertheregion [ ] ,theroutingalgorithmndsany nodeinthegivenrangerstlyviagreedyrouting,inwhichan odendstheclosestnode tothedestinationasitsnextnode.Letusassumethatanode istherstnodeinthe rangerecognizedbygreedyrouting,thenthemessageissent tonode .Suppose has F connectionstonodesintherange [ ] .Idenotethe i th suchneighboras b i .The node sendsaboundedbroadcastoverasub-range, [b i ,b i+1 ) ,to b i ,exceptthenal neighbor.Differentlystated, b i isinchargeofbounded-broadcastinginthesub-range [b i ,b i+1 ) .Ifthereisnoconnectiontoanodeinthesub-range,therecu rsionisended andthenodestaysinthetreeasaleafnode.Tothenalneighb or( b F ), ,sendsa boundedbroadcastto [b F ] .Whenanodereceivesamessagetoarangethatcontains itsownaddressthemessageisdeliveredtothatnodeinaddit iontobeingroutedto others.Figure 4-5 showshowthisboundedbroadcastformsalocaltreerecursiv elyina rangeof[ ].Thetimerequiredfortheboundedbroadcastingis O(log 2 N) asshown inSection 4.3.2 .ByDeetoo'srecursiveboundedbroadcastingalgorithm,all nodesin therangeareinvolvedinformingthelocaltreebecauseonly anodewithnoconnection inthesub-rangetothenodewhichisresponsibleforbounded -broadcastingcanstop recursionoutofeachbranchofthetree. 44

PAGE 45

4.2.4DataInsertionandQuery Deetooisasearchalgorithmonaspecicnetworkstructure. Whenanobjectis insertedatanode a asinFigure 4-6 ,Deetooselects,atrandom,arangeinwhicha querymessageistobebroadcastedlocally.Node a startsgreedyroutingtondanode n inthisrandomrangeand n startsboundedbroadcastingwithinalimitedrange( C ) onthecachingringtoreplicatetheobject(Figure 4-7 ).Boundedbroadcastingsizefor caching( C )isgivenby C= q B N ,where ,areplicationfactor,isaconstant(details aboutthisformulationisfollowedinSection 4.3 ).Allnodesintherangeofbounded broadcasting(allnodesintheshadedareainFigure 4-8 )eventuallyreceiveacopyofan object, o Queryresolutionfollowsthesameboundedbroadcastingste ps.Theonlydifference isthatthequeryresolutionisexecutedinthequeryingspac einwhicheverynode's addressistransposed(statedinSection 4.2.2 )inthecachingspace.Bounded broadcastingsizeforaquery, Q ,followsthesameformulationasthecachingsize C asshownabove.Figures 4-9 4-10 ,and 4-11 showthestepsinvolvedinaquery:node a 0 issuesaqueryforanobject o ,node n 0 initiatesaboundedbroadcastwithin Q ,and node n(o) resolvesaquery,nally, n 0 retrievesanobjectfromanode n(o) ..Sinceall nodesinthearea A haveacopyofanobject o n 0 canretrieveadesiredobjectfrom anyofthenodesin A .Byfollowingthesesteps,aquerycanberesolvedifatleasto ne nodeexistsin A .Notethatausercanselectboundedbroadcastingsizebyadj ustingthe replicationfactor, .Thebiggerthe ,thehighertheprobabilitytohitanodein A ,atthe expenseoflargernumberofmessagesandreplicas. Usersmaywanttoinsertobjectsintoanetwork,ordeletethe mfromanetwork.The followingexplainshowDeetoomanagesbothinsertionandde letion. ObjectInsertion:Whenanewobjectisinsertedtothenetwork ,copiesofthe objectarecreatedalongsomesetsofcolumnsinthematrixsp ace(thenumber ofcolumnsisinverselyproportionaltothesquare-rootoft henetworksize)using boundedbroadcasting.UnlikeaDHT,eachobjectdoesnothav etohaveaunique 45

PAGE 46

identicationnumber,andeachinsertedobjectdoesnothav etomapakeytothe “closest”node. ObjectDeletion:Objectsdonotstayforeverinthenetworks .Whenanobjectis obsolete,Deetooprovidesadeletionthatusesbothcaching andquerying.First, aqueryforanobjectwhichneedstobedeletedisperformedin ordertoretrieve theobject'srange.Notethateachobjectwritesitsrangein formationinitselforits metadatawhenitiscached.Aftertheobject'srangeisacquir ed,the`DELETE' messageisbroadcastedwithintherangeinthesamewaytheob jectwascached. Asaresult,Deetooguaranteesallreplicatedobjectsthatar esupposedtobe storedinthenodesintherangetoberemoved. 4.2.5NodeJoins,Leaves,andStabilization Inthissection,Idescribehowanodejoinsandleavesthenet work.Deetoorequires thateachdataobjectiscachedoverthedesiredrangeinanet work.However,anew nodejoinsthenetworkwithnocachedobjects.Successprobab ilitymuststayconstant regardlessofnodejoinsorleaves.Thus,itisnecessarytha tallobjectsbereplicated ifanewnode'saddressfallsinaobject'scachedrange.Deet ooreliesonanewnode copyingobjectsfromitsnewneighbors.Idenethisreplica tingprocessasstabilization inthischapter. Eachobjectmustkeepitsrangeinformationaswellastheobje ctitselformetadata fortheobjectwhereitwasinitiallyinsertedtothenetwork sothatasnodesjoinand leavetheobjectscanbemaintainedontheirrandomlyselect edcolumn.Afteranode obtainsaproperaddresssuccessfully,thenodesendsreque ststoitsnewlyconnected neighborsinordertoreplicateobjectsinthenetwork.Stabi lizationplaysaroleinthis stageofreplication.Thefollowingdescribeshowallobjec tsinthesameboundaryare copiedtothenewsuccessfullyjoinednodefromneighbors. 1. Retrievetheobject'srangefromtheneighbor'sobjectlist 2. Recalculaterangewithagivenreplicationfactor. 3. Copytheobjectfromtheneighbornodetothenewlyjoinednod eonlyifthenew node'saddressliesontherecalculatedrange. 4. Repeat1through3forallobjectsfrombothadjacentneighbo rs. 46

PAGE 47

IfIassumethatthereexist m uniqueobjectsinthenetworkwhosesizeis N ,each nodemaintains m p N objectsonaverage,where isareplicationfactor.Inthe stageofstabilization,thenodeisabletoreceiveobjectsf rombothneighbors.The maximumnumberofobjectswhichneedtobetransferredislim itedto O( 1 p N ) .Ianalyze stabilizationcostinSection 4.3.3 .Ialsosimulatestabilizationcostatthetimeofnew nodejoinsunderchurnandcomparethesimulationresultwit hananalyticalmodel. ThesimulationresultshowsthatDeetoorequiresverylowst abilizationcost.Whena nodeleavesorfails,theprotocoldoesnotneedtodoanythin gbecauseallobjectshave alreadybeencopiedtoallnodesinthesamesetofcolumns.Th us,neighbornodes keepexactlythecopiesoftheobjectsheldbyleavingorfail ingnodes. 4.2.6EstimatingNetworkSize EachnodeinaDeetoonetworkisdistributedwithoutanyserve r-clientinteraction, whichmakesitimpossibleforthepeerstoknowexactlyhowma nyotherpeersexist. However,eachnodeisrequiredtoknowthenetworksizeincer tainprocesses.For example,Icannotdecideacachingoraqueryingsizewithout knowingthenumberof peersinthenetwork.Theaccuracyofnetworksizeestimatio niskeytodecidingthe optimalcachingandqueryingrange.Bothunderestimationan doverestimationaffect performanceinsuccessprobabilityandcommunicationcost .Ifanodeunderestimates thesizeofthenetwork,thesuccessprobabilitygoesdownbe lowaveragewhilethe communicationcostisreduced.Theexactoppositeresultis expectedifabiggersize isestimated.IntheDeetoosimulation,thealgorithmsdesc ribedinChapter 3 areused. Iexperimentedundervarioussettingstogetthebestestima tionofthenetworksize.If morenodesareinvolvedincalculatingtheaveragedistance betweentwonodes,the levelofaccuracygoesupthoughitrequiresmoretimeandban dwidth.Onthecontrary, thevarianceoftheaveragedistanceismuchhigherwhenonly twodirectneighborsare usedforthecalculation.Iloseaccuracyofsizeestimation inthiscasethoughIsave timeandbandwidth. 47

PAGE 48

Iobservedthatthecalculationoftheaveragedistanceusin g logN hopsis acceptableconsideringbothaccuracyandcost.Figure 4-12 showsestimatednetwork sizedistributionundermynetworksizeestimatingalgorit hm.Inthesimulation,Isetthe actualnetworksizeto1,000.Theaverageestimatednetwork sizesare1430.97and 1695.95forcachingandquerying,respectively.Thestanda rddeviationsare1248.56 and1630.41,respectively.Themediansare1077and1144,re spectively.Notethatthe errormarginofoverestimationismuchlargerthanthatofun derestimation,whichcauses theaveragetobeslightlylargerthantheactualsizeofnetw ork.Networksizeestimation forcacheismoreaccuratethanthatforquery,becausenewno de'saddressselection isbasedoncachingaddress.Thesuccessprobabilitiesdepe ndonthedistributionof networksizeestimation.InFigure 4-18 ,thesimulationresultsshowthatthenetwork sizeestimationworkswellinthatthesuccessprobabilityi sveryclosetothetheoretical expectation.Successprobabilitydecreasesslightlyasnet worksizegrows,while expectedsuccessprobabilitystaysconstant.Thisisbecau sebiggernetworkshave biggererrormarginonestimation. 4.3AnalysisofDeetoo Ouranalysisfocusesontheprobabilityofaquerybeingsucc essfullyresolved, P s ,andthecommunicationcost, K ,toshowthattheDeetooprotocolforunstructured P2Pnetworksisefcientandscalable.Ibuildthefollowinga ssumptionstosimplifymy analyticalmodeling.First,Ihaveaxedsizeoftheaddress es.Thusaddressspace, B ,isxed,whichis m m forcacheandqueryrespectivelyasshowninFigure 4-1 Second,IassumethatthecachingprobabilityIcacheatlocat ion i c i ,andthequerying probabilityIputaqueryatlocation j q j ,arebothuniformlydistributed.Third,Iassume thatthecachingandqueryingprobabilityarethesameatany location.Finally,atmost onenodeperabininmatrixspaceisallowedforallnodestoha veauniqueaddress. 48

PAGE 49

4.3.1ExactAnalysisforSuccessProbability InDeetoo,queriesareunstructuredandload-balanced,whi chmeansthatthe probabilitythatagivennodereceivesaqueryisindependen tofthequeryandequalfor allnodes.Foreachobjectandquerypair,thereisaregionof size A inthegridaddress spacethatreceivesboththequeryandthecache.Theonlyway thequerywillnotbe resolvedisthattheregionhasnonode.Sinceeverycongurat ionof N nodesinthe addressspaceofsize B isequallylikely,theprobabilitythereisamissiscalcula tedas following:First,Iprovideanexactanalysisformissproba bility.Assumethatthereare N binswith C beingoccupied,andIsearch Q totrytondanoccupiedbin.Theprobability Ifailtosearchiscalculatedasfollowing: All C occupiedbinsmustbedisjointfromthe Q Icheckandthenumberofpossible combinationis N Q C .Notethatif Q+C N N Q C =0 Thenumberofwaystoarrangeoccupiedbinsis N C Thus,theprobabilityofmisshitis: P miss = N Q C N C (4–6) = (N Q)! N! (N C)! (N C Q)! (4–7) Thereisfourpossiblecasesforthecombinationofthesizeo f C and Q .Ianalyze theupperboundandthelowerboundforeachcase. case0:If Q=0 and C=0 P miss =1 case1:If Q+C > N P miss =0 case2:If Q+C=N P miss = 1 ( N C ) .since N N C 2 N for C 1 2 N P miss 1 N (4–8) 49

PAGE 50

case3:Q+C+E=N,where E 1 .Inthiscase,atleastonebinisnotoccupiedor searched.IuseSterling'sboundstoanalyzetheboundsforth iscase: e 1 12n+1 < n! p 2 nn n e n < e 1 12n (4–9) Thecasesarefairlytrivialtoevaluateexceptthesparseca se(case3),whichistosay thequery/cacheoverlapregionandthenumberofnodesarebo thsmallcomparedto thetotalnumberofbins E canbethoughtofasthenumberofemptybinsinthecaseof amiss.Lookattheupperboundrst. P miss < p N Q(N Q) N Q e (N Q) e 1 12(N Q) p N C(N C) N C e p (N C)e 1 12(N C) p NN N e N e 1 12N+1 p N C Q(N C Q) N C Q e N+C+Q e 1 12(N C Q)+1 = s (N Q)(N C) N(N C Q) (N Q)(N C) N(N C Q) N N C Q N Q Q N C Q N C C e r = (N Q)(N C) N(N C Q) N+ 1 2 N C Q N Q Q N C Q N C C e r = (N Q)(N C) NE E+Q+C+ 1 2 E N Q Q E N C C e r = (N Q)(N C) NE E+ 1 2 N C N Q N Q N C e r Duetotheconvexityof log(1 x) ,weknowthat (1 x) < e x (4–10) (1+x) < e x (4–11) Thus, N C N Q = 1 C N Q < e CQ = N (4–12) N Q N C = 1 Q N C < e CQ = N (4–13) 1+ QC NE E < e CQ = N (4–14) 50

PAGE 51

Finally, P miss < 1+ QC NE E+ 1 2 e 2QC N e r (4–15) < e QC N r 1+ QC NE e r (4–16) where e r =e 1 12(N Q) 1 12(N C) + 1 12N+1 + 1 12(N C Q)+1 (4–17) < e 1 12E+1 (4–18) ThusifIset C and Q suchthat CQ= B = N ,Ihave P miss < e p 1+ = Ee 1 12E+1 Onecanndasimilarlowerbound: P miss = p N Q(N Q) N Q e (N Q) e 1 12(N Q) p N C(N C) N C e p (N C)e 1 12(N C) p NN N e N e 1 12N p N C Q(N C Q) N C Q e N+C+Q e 1 12(N C Q) = s (N Q)(N C) N(N C Q) (N Q)(N C) N(N C Q) N N C Q N Q Q N C Q N C C e = (N Q)(N C) N(N C Q) N+ 1 2 N C Q N Q Q N C Q N C C e = (N Q)(N C) NE E+Q+C+ 1 2 E N Q Q E N C C e = (N Q)(N C) NE E+ 1 2 N C N Q N Q N C e = 1+ QC NE E 1 C N Q 1 Q N C e r 1+ QC NE where e > e 1 12(N Q)+1 e 1 12(N C)+1 e 1 12N e 1 12E (4–19) > e 1 12(E+Q)+1 (4–20) > e 1 12E (4–21) 51

PAGE 52

since 12E < 12(E+C)+1 and e 1 12(E+C)+1 + 1 12E > 1 .Weknowthatthefollowinginequality withsomepositiverealnumber (1+x) > 1+ x (4–22) So, 1+ QC NE E > 1+ QC N (4–23) Thus,thelowerboundisobtained: P miss > 1+ QC N 1 C N Q 1 Q N C r 1+ QC NE e 1 12E (4–24) > (1+ ) 1 Q Q 1 C C r 1+ E e 1 12E (4–25) Thelowerboundshowsthat P miss 1 as 0 .If CQ = N goestozeroas N getslarge, P miss 1 ,andthisresultcanbeextendedtoanysystemwithindepende nt queriesandcachingandwhereeachnodeisequallylikelytob eusedforeachquery orcache,henceDeetooisoptimalintermsoftheasymptotico fquery/cachecost trade-off.When E islarge,asisthecaseforlargenetworkswithlargeaddress spaces andnon-negligiblecaching, P miss e .So,weareabletohavesuccessprobability solelyasafunctionoftheconstantreplicationfactor ,andindependentofthenumber ofthenodes.4.3.2SearchTime Searchtimecanbeanalyzedbycomputingtheaveragedepthoft hetreeformedby theboundedbroadcastpresentedinSection 4.2.3 .WhenIassumethateachnodehas aconnectiontoitsnearestneighborsonbothringsaswellas oneshortcutconnection toanodeatdistance d withprobabilityproportionalto 1 = d ,Icanshowthattheexpected depthofthetreeis O(log 2 N) .Ourproofisanalogoustocomputingtheaveragetimeto reachanodeusinggreedyroutingasin[ 5 47 ],whilesearchtimeofDeetoomeasures theaveragemaximumdepthofthelocaltrees. 52

PAGE 53

FromtheKleinberg'smodel,eachnodehasalong-rangecontac tatdistance r with probability p r = 1 logN 1 r asinFigure 4-13 .Let p m betheprobabilitythatnode a hasa long-rangecontactinthemiddle, mL region(node r ).Then, p m isinverseproportionalto thedistancebetween a and r p m = 1+m 2 L X r= 1 m 2 L p r (4–26) = 1+m 2 L X r= 1 m 2 L 1 logN 1 r (4–27) 1 logN log 1+m 1 m (4–28) Since mL isasubsetof L m 2 (0,1) .Let T(i) bethesearchtimeinregionofsize i Eachlongrangeconnectioneithergoestoanodeinthemiddler egionornot.IfImake itintothemiddleregion,theremainingareatosearchisatm ostthelengthof 1 2 L+ m 2 L Thus,ifthelong-rangeconnectiongoestothemiddle,theti meis T(L) 1+T(( 1+m 2 )L) Otherwise,Igotothenextneighborso T(L)=1+T(L 1) .Iknowthat T(L 1) < T(L) If p m istheprobabilityofmakingitintothemiddle,onaverage,I needtotry 1 = p m neighborsbeforeIamlikelytondaconnectiontothemiddle .Puttingthistogether,the averagesearchtimeis T(L) 1 p m +T(( 1+m 2 )L) .Therstpartoftherightsideofthe equationrepresentstimetoreachaconnectioninthemiddle ( x inFigure 4-13 )andthe secondpartistimefortherestoftheregion( y inFigure 4-13 .Fortherestoftheregion, atmost r morestepsarerequiredtocoverthewholeregion L .Iknow T(logN) logN Solvingfor r suchthat ( 1+m 2 ) r L=logN r 1 2 log( N) log( 1+m 2 ) (4–29) 53

PAGE 54

Themaximumdepthisdecidedto r stepsmultipliedbythenumberofthenodesto reachaconnectioninthemiddle. T(L) 1 p m r (4–30) = logN log( 1+m 1 m ) 1 2 log( N) log( 1+m 2 ) (4–31) 1 2 (log 2 ( N) log log( N)) log( 1+m 1 m )log( 1+m 2 ) (4–32) Icalculateanupperboundwiththeaboveinequalitybygetti ngthemaximumofthe denominator.Atavalueof m 0.517 ,thedenominatoroftherightsideoftheabove inequalityhasaminimum.Inconsequence,theupperboundfo r T(L) isminimized. Iverifythisclaimusingsimulationswhicharepresentedin Figure 4-17 .Forthe comparison,theminimumofupperbound,where m issetto0.5,iscalculatedand comparedwiththesimulationresult.4.3.3StabilizationCost Iregardthenumberofobjectsthatneedtobecopiedtoanewly joinednodeas thestabilizationcostbecausethereisnoothermajormessa getransmissionexceptthis copyingforaleavingorjoiningnode.Iassumethatthealgor ithmcheckswhetheran objectisalreadyreplicatedfromeitherneighborornot.If anodeidentiestheobject,it discontinuestheobjecttransmission.Thisensuresthatan odepreventsunnecessary messagegenerationandanetworksavesbandwidth.Objectsw hichalreadyexistin anewnodeaswellasoutofobject'srangeareexcludedfromtr ansmission.Anew nodeexamineseachobject'srangewheneveritisreadytobec opied.InP2Pnetworks, networksizeoftenvaries.Thus,asthenetworksizechanges ,theobject'srangeis recalculated.Cachinginaredenedrangeconstrainsthenu mberofcachedreplicasto remain O( p N) Let C s representthestabilizationcost, k thenumberofuniqueobjectsinthe network, N 1 theleftneighbor,and N 2 therightneighbor.Let i symbolizeaprobabilityof 54

PAGE 55

theobjectinnode N i ij isaprobabilityoftheobjectinboth N i and N j and j j i denotesa probabilityoftheobjectin N j giventhattheobjectisin N i C s =kP(objectinN 1 orN 2 ) (4–33) =k(P(objectinN 1 )+P(objectinN 2 ) (4–34) P(objectinbothN 1 andN 2 ) (4–35) =k( 1 + 2 12 ) (4–36) =k( 1 + 2 1 2 j 1 ) (4–37) Theprobabilities, i and ij ,arecalculatedasfollows: 1 = 2 = L B (4–38) = p Nd ave d ave N (4–39) = r N (4–40) 12 = 1 2 j 1 (4–41) = r N 1 d ave L (4–42) = r N 1 1 p N (4–43)(4–44) Thus, C s =k 2 r N r N 1 1 p N (4–45) =k( r N + 1 N ) (4–46) =O k r N (4–47) where d ave denotestheaveragedistancebetweentwonodes, N B ,and L representthe numberofnodes,theringdistance(theaveragedistancetim estotalnumberofnodes), 55

PAGE 56

andthelengthofboundedbroadcastingrange(theaveragedi stancetimesthenumber ofnodesintherange),respectively. 4.4SimulationResults Inthissection,Iconrmthetheoreticalresultsdiscussed intheprevioussectionvia simulations.IusedNetmodeler[ 45 ]forsimulatingtheDeetooalgorithm.Inthetopology modelontopofNetmodeler,eachbinmaybeoccupiedbyatmost onenodeandthe nodesformtworings,oneforthecacheandtheotherforquery .Then,eachnodeis connectedtoalong-rangeneighboraccordingtotheinverse r th -powerdistributionfor thesmall-worldnetworkmodel.Forsimplicity,thesizeoft hequeryrangeisassumed tobethesameasthesizeofthecacherange.Allcachingandque ryingprocessesare initiatedonrandomlyselectednodesandmessagesarebroad castedwithinrandomly chosenranges.4.4.1PerformanceEvaluation Inthesimulationsthesizeoftheaddressspaceissetto32bi tswhichhas 2 32 bins. Icountthenumberofhopsasanindicationofcommunicationc ostandassumethat theper-hopcommunicationcostsforcacheandqueryarethes ame.Oursimulations areperformedonnetworksofsize10to 10 6 .Thenumberofcolumns, C ,ischosen suchthat C isequaltothenumberofrows, Q C 2 = N .Thus,Isimulatevariousvalues of toobservetheeffectofincreasingordecreasingthecacheo rqueryrangesize ( = C 2 N ).Iperformedsimulationswith =0.1to5.0,withintermediatestepsofsize0.1. 100stringobjectsweregeneratedbyusingarandomstringge nerator.Eachobject wasinitiallyinsertedonauniformlyrandomlyselectednod e.Forqueries,Icountonly exactmatchingobjectseventhoughDeetoocanperformparti almatches.Eachtest wasrepeated100timesandtheresultswereaveraged.Figure 4-14 showsthatquery successprobabilityisconstantregardlessofthenetworks ize.Theconstantsuccess rateisdesirablesinceDeetoocanperformthesearchwithpr eferredsuccessprobability byadjustingbroadcastingrangewithdifferent .Thesuccessprobabilitiesscaleas 56

PAGE 57

1 e .Inthelegendofthegure,“th”istheory,theotherissimul ated.Inthegure,I alsocomparethesimulationresultswiththetheoreticalre sults.Iobservethatthelarger the is,thehigherthesuccessprobabilityis.InFigure 4-15 ,querysuccessprobability declinesexponentiallyasexpected( exp( ) ).Figure 4-16 showscommunicationcost withrespecttonetworksize.Querycostscales O( p N) asIanalyzed.”th”isforthe theoreticalresult,andtheotheristhesimulationresulti nthegure.Thereisatrade-off betweensuccessprobabilityandthecommunicationcost.AsI increaseareplication factor, ,Iachievehighersuccessprobabilityintheexpenseofcomm unicationcost. Forthesearchtime,Imeasuredthenumberofout-of-rangeli nksbeforendinga nodeintherange(bygreedyrouting)andthedepthofthemult icastingtree.Message transmissiontimesateachlinkareassumedtobeallthesame .Figure 4-17 compares simulationresultswithcalculationswith =1.AsmentionedinSection 4.3.2 ,0.5is substitutedfor m .Notethatx-axisscaleslogarithmically.Oursimulations howsaloose upperboundforsearchtime,butitisobviousthatthescalin gofsimulationresultismore than logN ,butlessthan log 2 N 4.4.2NumericalAnalysisforSuccessProbability AsdescribedinSection 4.3.1 ,thesuccessprobabilityremainsconstantregardless ofthenumberofnodesinDeetoonetwork.However,theaccura cyofnetworksize estimationaffectssuccessprobability.Thesimulationre sultsshowslighttrend downwardofsuccessprobabilityasnetworksizegrows.Them ainreasonforthe slightdecreaseofsuccessprobabilityisthatnetworkgrow thmakesvarianceofsize estimationincrease.Inabiggernetwork,therearehigherc hancesforanodeto underestimateitsnetworksizerelativetoasmallnetwork. Underestimationismuch moreharmfulforsuccessprobabilitybecauseunderestimat ionofthenetworksize resultsinanarrowercachingorqueryingrangeforboundedb roadcasting.Withthe estimatednetworksizedistribution,Ianalyzedtheimpact ofestimationonsuccess probabilitynumerically.Idene w c and w q asthewidthofthethecolumnsforcaching 57

PAGE 58

andqueryingrespectively.Sincedifferentnodeswilliniti ateacacheandamatching query,Icanconsiderwhathappenswhenthetwonodeshavedif ferenceestimatesof thenetworksize. w c p B= p N (4–48) w c = r N B (4–49) Similarly, w q = q N B .Thus,thenumberofbinsinoverlapis: w c w q = p N 1 N 2 B (4–50) Assumethat N 1 and N 2 arenetworksizeestimationforcacheandquery,respective ly. Thesuccessprobabilitygivenanetworksize N is: P success j N= 1 N B p N 1 N 2 B (4–51) = 1 N B N B ( p N 1 N 2 N ) (4–52) 1 e p N 1 N 2 N (4–53) Finally,Icalculatethesuccessprobabilitywithgivennet worksizeandestimated distributionforbothcacheandquery.Todothis,Ineedtokn owtheprobabilityof estimatingthesizeofthenetworkgiventheactualsize, P(N 1 j N) : h P success j N i = 1 X N 1 =0 1 X N 2 =0 P(N 1 j N)P(N 2 j N) 1 e p N 1 N 2 N (4–54) Usingthesimulationdatatoobtain P(N i j N) ,Figure 4-18 comparessuccess probabilitiesamongtheory,simulation,andnumericaleva luation.Thegureshows thatboththenumericallyevaluatedsuccessprobabilityan dthesimulationresultsfor successprobabilitydecreaseslightlyasnetworksizegrow scomparedtothetheoretical result,whichassumesaglobalknowledgeofthenetworksize .Biggererrormarginfor 58

PAGE 59

abiggernetworkinestimatingnetworksizeexplainsslight lossofsuccessprobability. Eventhoughthereissomenoiseinthesimulationresults,Ise ethatthesimulationresult matchesthenumericalevaluationnearlyexactly:thisisth esourceoftheerror.Mean squareerrorbetweennumericalevaluationandsimulationr esultis3.93e-05. 4.4.3Robustness DuetothenatureofP2Pnetworks,eachpeercanleaveorfailat anytime. Thereforeitisimportanttoanalyzetheeffectofnodefailu res.Iwillshowthatdata objectsarestillaccessiblewithoutgeneratingexcessive managingoverheadsunder dynamicnetworks.IextendedNetmodelertomodelmassivech urnonnodes.The simulatorsettingisdescribedbelow.Isetthenetworksize rst.Eachnodejoinsthe networksequentiallyfollowingauniformdistribution.Up oncompletingnetworkformation withagivensize,eachnoderepeatedlyleavesandjoins.Ano de'srejointimeandleave timeisexponentiallydistributedwithsamemean.Theconse quenceofthisdistribution makestheaveragenumberofalivenodesinthesystemremains halfoftotalnumberof thenodesoriginallyjoined.AsseenintheFigure 4-19 ,anode'sstatetransitsbetween ONandOFFwithprobabilityof0.5becausejointimeandleave timedistributionhas sameaverage.Inotherwords,theprobabilitythateachnode isactiveattimetis 1 2 .In thesimulationsetting,everynodestaystobeturnedONunti lnetworksizereachesa givennumber.Ittakestimeanetworksizeissaturatedatthe halfofinitialnetworksize onaverage. Afterallnodesjoinednetwork,100dataobjectswereinserte d.Querieswere executed100timesperdataobject.Boththecacheeventsandt hequeryeventsoccur inatimedistributedexponentially.Forsimplicity,arepl icationfactor, ,issetto1forthe followingsimulationsunderchurn. Figure 4-20 demonstrateshowthechurnaffectssuccessprobability.No tethat successprobabilityremainsconstant.Also,thesuccesspro babilitystillfollowsthe 59

PAGE 60

theoryasdescribedinSection 4.3.1 .ThisresultshowsthatDeetooisrobustagainst networkdynamics. Undertheheavychurninthenetwork,messagetransfersform aintenance purposesarenotnegligible.Whenanewnodejoinsthenetwork ,itisresponsible formaintainingdataobjectsifitsaddressiswithinobject s'range.Icountedwhatfraction ofthetotalobjectsweretransferredtoanewnode.Assumetha tthereare k objects, andeacharereplicatedover p N nodes,Ihave k p N totalobjectsinthesystem.These objectsareplacedonnodesintherangeselecteduniformlya trandom,sotheexpected numberofobjectsoneachnodeis k = p N .Thus,joiningcostisdirectlyproportionalto 1 = p N Figure 4-21 showsthathowmanyreplicationoccurredperuniquedataobj ectafter joiningnewnodes.Forthemeasureofstabilizationcost,th esizeofnetworkissetto 1,000nodesinitially.Notethatstabilizationcostgrowsn otastimecontinues,butas thenumberofuniqueobjectsincreases.UnlikeDHT-basedst abilization,theprocessis muchsimpler,andcostsless. Withverylowmaintenancecost,Deetooiscapableofefcient dataretrievaleven underheavychurn. 4.5ApplicableSearches StructuredP2Psystemsprovideanefcientkey-valuelook-up duetotheirhash tabledatastructure.Despitetheirefciency,aDHT'sdata structuremakesitchallenging toanswernewtypesofqueries.Whenanewtypeofobjectorquer yisintroduced, networktopologiesorcachingstrategiesneedtoberedene donstructuredsystems. Bycomparison,unstructuredsystemscancontrolnewobjects orquerieswithoutany modication.Unstructuredsystemsmakeitpossibletoinse rtandretrievedifferent kindsofobjectssimultaneouslyoverthesamenetwork.Theo bjecttypemaybetext, meta-data,image,audio,orvideo.Forexample,Deetoocoul dbeusedforregular expressionmatching,content-basedsearchtondsimilarm ultimediaobjectstoresolve 60

PAGE 61

somequeryobject,ortoperformSQLqueries,XQueryorXPathsea rchesofXML documents.InthefollowingsubsectionIdescribethesearc hprocessusingregular expressionsontopofDeetoo. Inthissection,Ipresentapracticalsearchexamplewhichi soneofmanyapplicable searcheswithDeetoo.Regularexpressionsareusedforsear chingstringsofthe textbasedonpatterns.Objectsmightbestrings,metadatao fmultimediawhichare composedofstrings,orobjects'titles.Managingdataisno teasyindecentralized anddistributednetworkswhichhavenocentralcontrol.Ina distributedmanner,there arecriticalissuestobeovercome.Oneissueishowtoavoidt ransmissionofmultiple identicaldatafromdifferentpeerstosavebandwidthusage .Anotherissueishow todeletealltheduplicatedobjectsfromtheentirenetwork whentheyareobsolete. BecauseobjectsarespreadoverthenetworkduetoDeetoo'sca chingpropertythrough boundedbroadcasting,itisveryimportantthatalltherepl icatedobjectsshouldbe deletedwhenanoriginalobjectneedstobedeleted.Itisass umedthateachnode maintainsobjectrecordswhichincludeeachobject'sID,ra ngeinformation(start address,endaddress),andareplicationfactor( )aswellascontent.TheIDidenties dataobjectanditisusefulfordeletingobjects.Therangei nformationindicatestherst addressandthelastofboundedbroadcastinginacachingnet work.Iexplainhowto applyoperationsforregularexpressionsearchontopofDee too. 4.5.1ObjectInsertion: Objectsorlesareeasilyinsertedintoanetworkbybounded broadcastingas describedinSection 4.2.3 O( p N) replicatedobjectsresideinthenetworkafter insertion.Onceanobjectiscachedinthenetwork,Deetoore quirestoadjustthe object'srangeinformationasthenetworksizechanges.Ever ytimeanewnodejoinsthe network,thenodeestimatesnetworksize.Beforeitcopiesan objectfromitsneighbor, itcalculatestheobject'srangebasedontheestimatednetw orksize.Withareplication factor( )intheobject'srecordandtheestimatednetworksize( N est ),onecancalculate 61

PAGE 62

anewrange( R= q B N est ).Themidpointoftherange( M )canbeobtainedbyadding startandendaddressesoftherangefromtheobject'srecord anddividingby2.Finally, M+ R 2 and M R 2 arethenewstartandendaddressoftherange.Thenitcompare sit totheobject'srangeinformationintherecord.Inaccordan cewitharecalculatedrange, copiedobjectsmaybediscardedfromnodesoraddedtonodes.4.5.2Search Whenanodetriestondobjectsincorrespondingtoagivenpat tern,thenode bounded-broadcaststhepatterninarandomlyselectedrang e.Usersareabletoselect asearchingmethod.Therearethreesearchingoptions,simu ltaneous,sequential,and deleting. Simultaneoussearchusesboundedbroadcasting.Apatternis transmittedto thenodesintherange.Allmatchingresultsaretransferredt oaqueryingnode simultaneously.Thissearchmethodrunsintime O(log 2 N) andthequeryingnode receivesmultiplereplies. Sequentialsearchisdesignedtoavoidmultipleanswersfrom multiplepeers.A querysequentiallyvisitsanodeinatreeundersimulaneous option.First,aquerystarts bondedbroadcastingtoformalocaltree.Childrennodeshav ingthematchingobject sendresultsbackimmediatelyandtheparentnodewaitsfort herstresponsefrom itschildrennodes.Uponreceivingtherstresponse,thepa rentnodestopswaiting forandtransferstheresulttoaqueryingnode.Thisprocess takesplacerecursively likedepth-rstsearch(DFS).Figure 4-22 isanexampleofalocaltreeformedby boundedbroadcasting.Node0sendsaquerytonode1insteado fsendingtoall childrennode(node1,3,8,13).Ifnoresponsefromnode1isr eceived,itsendsaquery tonode3.Node0obtainstherstresponse,node0stopsactio nandforwardsthe responsetoaqueryingnodeimmediately. Thesequentialsearchoptionleadstoanincreasethesearch ingtimebecause nodesinthetreearevisitedsequentially.Thesearchtimef orsequentialsearchislinear 62

PAGE 63

intherangesize,whichis O( p N innetworksize,whilethesimultaneoussearchtakes atmost log 2 N asdescribedSection 4.3.2 .Attheexpenseofincreasedsearchingtime, Deetoopreventsthegenerationofalargenumberofmessages ,andtherebyitsaves bandwidthutilization.Thisoptionisespeciallyusefulfo rapopularobjectoraloosely denedregularexpressionsearch. Thedeletingoptionisusedtodeleteobjectsfromanetwork. Theusageofdeleting optionisdescribedinthefollowingparagraph.4.5.3ObjectDeletion: Datadeletionismorecomplicatedthanaforementionedoper ations.Thisisbecause dataaredistributedoverthenetwork.Inaddition,peersca nnotexactlyidentifyhow manyreplicateddataexistinthenetwork.Thus,theDeetooa lgorithmrequirestwo stagesofoperationsfordeletingdataobjectsfromanetwor k.First,Deetoosearches withthedeletingoptioninanarbitraryboundedbroadcasti ngregioninaquerying ring.Thedeletingoptiondistinguishesasearchfordeleti onfromaplainsearch.If thereexistsanynodewithamatchingobject,thenodetrigge rsthesecondstage, returningobject'sIDbacktotheaskingnode.Intheseconds tage,thenodestarts boundedbroadcastingtheDELETEcommandwiththeobject'sIDu singthenode's rangeinformation,andeverynodereceivingthemessagedis cardstheobjectwhoseID matches.Unliketherststage,thesecondstagetakesplace inacachingringbecause rangeinformationindicatesthecachingaddresses.Iallow anaskingnodetouseexact matchingsearchratherthanregularexpressionsearch.Ifr egularexpressionsearchis utilizedfortheobjectdeletion,certainsimilarobjectst hatarenotintendedtobedeleted canbeeliminated.Consequentlyitwouldresultinunexpect eddataloss. 4.6Conclusion Inthischapter,IintroducedDeetoo,ascalableroutingpee r-to-peerprotocolfor unstructurednetworkswhichprovidesefcientcachingand lookupfunctionalitywith O(1) queryhit-rate, O( p N) replication, O( p N) querycost,and O(log 2 N) searchtime. 63

PAGE 64

Deetoo,allowsobjectstobeupdatedanddeleted,andcanbeu sedtohandle generalqueries.Specically,anyproblemthatcanbemapped ontoselecting(withhigh probability)objectswhichmatchsomequerycanberunoverD eetoo. Figure4-1.Thecachingandqueryingspace. Figure4-2.Virtualring1for caching. Figure4-3.Virtualring2for querying. Figure4-4.Thecomplete searchingspace. 64

PAGE 65

Figure4-5.Treegenerationbyboundedbroadcasting Figure4-6.Objectinjection Figure4-7.Bounded broadcastintherange Figure4-8.Completionof objectreplication Figure4-9.Initiationofa queryforobjecto Figure4-10.Bounded broadcastingwithin Q Figure4-11.Objectretrieval n(o) 65

PAGE 66

0 2000 4000 6000 8000 10000 12000 1400016000 Estimated Network Size 0 20 40 60 80 100 120 140Number of Occurrence On caching network 0 2000 4000 6000 8000 10000 1200014000 Estimated Network Size 0 20 40 60 80 100 120Number of Occurrence On querying network Figure4-12.Estimatednetworksizedistribution Figure4-13.Probabilityoflong-rangeconnection 0 0.2 0.4 0.6 0.8 1 0 100000 200000 300000 400000 500000 600000 700000 800000 900000 1e+06 Hit RateNumber of Nodes 100 items, 100 samples per item alpha=0.1 a=0.1 th alpha=0.5 a=0.5 th alpha=1.0 a=1.0 th alpha=1.5 a=1.5 th alpha=2.0 a=2.0 th alpha=2.5 a=2.5 th alpha=3.0 a=3.0 th alpha=3.5 a=3.5 th alpha=4.0 a=4.0 th alpha=4.5 a=4.5 th alpha=5.0 a=5.0 th Figure4-14.Querysuccessprobability 66

PAGE 67

0.001 0.01 0.1 1 0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 failure ratealpha 1,000,000 nodes simulation theory Figure4-15.Querymissrate 1 10 100 1000 10000 10 100 1000 10000 100000 1e+06 Average Number of MessagesNumber of Nodes 100 items, 100 samples per item alpha=0.1 a=0.1 th alpha=0.5 a=0.5 th alpha=1.0 a=1.0 th alpha=1.5 a=1.5 th alpha=2.0 a=2.0 th alpha=2.5 a=2.5 th alpha=3.0 a=3.0 th alpha=3.5 a=3.5 th alpha=4.0 a=4.0 th alpha=4.5 a=4.5 th alpha=5.0 a=5.0 th Figure4-16.Communicationcostforquery 67

PAGE 68

0 20 40 60 80 100 120 140 160 180 200 10 100 1000 10000 100000 1e+06 Communication CostNumber of Nodes a = 1 calculation simulation Figure4-17.Searchtime 0 0.2 0.4 0.6 0.8 1 0 100000 200000 300000 400000 500000 600000 700000 800000 900000 1e+06 Hit RateNumber of Nodes alpha = 1 theory evaluation simulation Figure4-18.Successratecomparison 68

PAGE 69

Figure4-19.Statetransitiondiagram 0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.54.0 time1e7 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0hit rate Hit Rate simulationtheory Figure4-20.Successprobabilityunderchurn 69

PAGE 70

0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.54.0 time1e7 0 1 2 3 4 5 6 7stabilization cost stabilization cost, = 1 simulationexpectation Figure4-21.Stabilizationcost Figure4-22.Sequentialsearch 70

PAGE 71

CHAPTER5 UNSTRUCTUREDSEARCHONPLANET-LABWITHDEETOO 5.1Introduction P2Papplicationsarehighlyscalablecurrentlyanddominate Internettrafc.One ofthemostpopularapplicationsinP2Pislesharing.Anefci entsearchsystemis akeycomponentinbuildingmanyP2Papplications.Therearec urrentlytwotypesof P2Psearchtechniques:structuredandunstructured.Unstru cturedsearchsystems usingnaiveoodingorrandomwalkareinefcientwithrespe cttosearchcostsince potentiallyeverynodeinthenetworkmayhavetobevisitedw hensearchingforrare objects.Onthecontrary,DHT-basedstructuredsearchsyst emstakeonlylogarithmic hopsinthesizeofthenetworkwhileguaranteeingobjectret rievalinthenetwork.The disadvantagesofusingDHT-basedapproachesarehighermai ntenancecostand complexity.Inadditiontothehighermaintenancecomplexi ty[ 2 3 48 ],DHTsdonot haveagoodsolutionforgeneralqueriesbecauseitishardto mapinterestingqueries ontotheDHT.However,buildingsuchasearchsystemisnotea sybecause,inmost cases,todeployaP2P-basedsystemdevelopersmuststartalmo stfromscratch.In otherwords,developersmustbuildanentiresystemincludi ngfunctionsforsending Internetprotocolpackets,managingconnections,andtrav ersingNATs.Forinstance, tobuildChord[ 3 ],35,030linesofcodearerequiredtobuildanentiresystem including asearchfunction.AnotherP2Psystem,Pastry[ 48 ],needs25,915linesofcodeand Brunet[ 49 ]iscomposedof34,369lines.Asearchfunctionisincludedi nallcurrently deployedP2Psystems,butthefunctionisexclusivelyapplic abletoitsownsystem.I builtDeetoowithlessthan1,000linesofcodeonBrunet.Deet oowillenablesystem designerstopluginaquerymatchingmodelanduseanoffthes helfP2Psystem.By addinglessthan1,000linestoanexistingP2Psystem,develo perscanbuildanovel searchsystem. 71

PAGE 72

InChapter 4 ,Deetoo[ 50 ]isproposedforgeneralsearchsystemtoaddress theproblemsinbothunstructuredandstructuredsearchsys tems.Deetooisan unstructuredsearchsystembuiltontopofstructuredP2Pnet works.Theuserscan achieveconstantquerysuccessprobabilitywithoutregard ofnetworksize.Usersneed onlyselectareplicationfactortosatisfytheirdesiredhi t-rate/costtrade-off.Deetoois moreefcientthanooding-basedquerysystemsandsupport svarioustypesofqueries, suchasregularexpressionqueries,unlikeDHT-basedquery systems. Inthischapter,IdescribeanimplementationofDeetooinar ealP2Penvironment andcomparetotheoreticalexpectationaswellassimulatio nresultstoverifythe performanceofDeetoo.IbuiltDeetooasserviceontopofBrun et[ 51 ]anddeployed Deetoo-enablednodesinPlanet-Lab[ 52 ]. Planet-Labisaglobalnetworkresearchtestbedthatconsist sof1089nodesat505 sitesglobally.Manyresearchersinacademicinstitutions aswellasinindustrialresearch labsbenetfromPlanet-Labtotesttheirnewtechnologiesin severalresearchelds, includingP2Pnetworks,distributedlesystems,networkpe rformancemeasurement, networksecurity,andmanyotherareas.Developerscanenco untermanypractical problemswhentheyimplementtheirproposeddesignsinarea lnetworkenvironment. Planet-Labhelpstoaddressthosekindsofproblemsbyprovid ingareallivetestbed tohelpsolvepracticalissueswiththedesign.Theexperime ntsinthischapterare conductedonPlanet-LabusingBrunetP2Poverlays. BrunetisisalibraryforP2Pnetworking,whichprovidestheco reservicesof routing,objectstorage/lookup,andoverlayconnectionma nagementsupportingmultiple transports(TCP,UDP,andtunnels)andNATtraversal.Manyd ifferenttypesofservices suchasIPOP[ 53 ],WOW[ 54 ],Grid-appliance[ 55 ],andSocialVPNs[ 56 ]arealready builtonBrunet,andsomeofthemprovidetheirserviceasopen software.WhileDeetoo canbebuiltontopofmanyP2Papplications,Brunetisusedfort heunderlyingsubstrate fortheP2PnetworkmanagementinDeetooimplementation.Brun et'snetworktopology 72

PAGE 73

followsSymphony[ 5 ]basedonaone-dimensionalringsimilartoChord[ 3 ].Deetoois implementedontopofBrunetasaservicethatprovidesobject cachingandquerying functionality. Deetoo'scomputationalcomponentforcachingandquerying isimplemented usingMapReduce[ 57 ]approach.Tohandlelarge-scale,data-intensivecomputa tionin distributedsystemseffectively,parallelprocessingind atapartitioningandcomputation isagoodwaytoboostthespeedofdataprocessing.TheMapRed uceconceptcomes rightfromsupportingsuchparallelcomputation.MapReduc eiscomposedoftwo computationfunctions,MapandReduce.Maptransformsanin puttoanewvalueas anoutputofthesametype.Reducetakestheresultsbothfrom MapandReduceas argumentsandpassestheresultingvalueswithsamekeytoth enode'sancestor.With MapReduce,auserneedstodenemapandreducefunctionsand theMapReduce platformhandlestheparallelexecutionandinteractionam ongMapReducemodules.For thepurposeoftakingadvantageofparallelprocessing,aMa pReducetechniqueisused intheimplementationofDeetooontopofBrunet.Thedetailso fMapReduceinDeetoo aredescribedinSection 5.2.3 TomeasurethesearchperformancewithDeetoo,severalmetr icsareused, 1. Querysuccessprobability:thenumberofsuccessfullyretr ieveddataoverthe numberofsearchtrials. 2. Communicationcost:thenumberofnodesaccessedbyacachin gnodeanda queryingnodefordatareplicationandsearch,respectivel y. 3. Searchtime(latency):thetreedepthbuiltbyboundedbroadc astinagivenrange 4. Trade-offbetweencostandsuccessprobability:cachingco stversusquery successprobability 5. Estimatednetworksize 6. Loadbalancing 73

PAGE 74

5.2SystemModel WhileDeetooisapplicabletomanyring-basedP2Poverlays,De etoo'sfunctionality isbuiltontopofBrunetP2Poverlaynetworks.TheuseofBruneto verlaymakesit easytodealwithmanydifcultissuesrelatedtonetworkman agementincludingthe managementofconnectionsandNATtraversals.Thenetworkt opologyofBrunetand howBrunetmanagesconnectionsandroutingaredescribedint hesection. 5.2.1Brunet-NetworkTopology TheBrunetP2Plibraryprovidesmechanismsforbuildingandma intaining structuredP2Pnetworksofoverlaynodes.ThestructureofBru netisthesameas Symphony'sstructure,inwhicheachnodemaintainsconnecti onswithitsnearest-neighbor nodesinP2Paddressspace.Theseconnectionsarecalled structurednear connections .Inadditiontothestructurednearconnections,eachnodea lsoconnects to k distantnodes.Thesenodesarecalled structuredshortcutconnections ,and nodesatdistance d withproportionalto 1 d areselectedasshortcutconnections.The shortcutconnectionscontributetothedecreasedaccessti meforboundedbroadcasting. Withthehelpofshortcuts,thehopdistanceinagivenrangeof boundedbroadcasting islimitedto O( 1 k log 2 n) ,givenanetworkof n nodes[ 47 ].Typically k logn ,sotimeis O(logn) TheDeetooservicecreatestwovirtualnodesononephysical overlaynode.Each virtualnodejoinseitheracachingnetworkoraqueryingnet work,andtheysharealist ofcachedobjects.Byreceivingacachingmessage,acachingn odewritesanobject's informationinthecachelist.Cachingnodesalsoconductst abilizationasconnections changeandasnetworksizechanges.Thevariationofnetwork sizeestimationresults inthechangeofthebroadcastingrangeofcachedobjects.Th us,stabilizationis requiredtomaintainthecorrectnumberofreplicasofeacho bject.Thequeryingnode isresponsibleforrespondingtoquerymessages.Uponrecei vingaquerymessage, 74

PAGE 75

thenoderstreadsthequerytypeandthenexecutesaproperq ueryresolvingaction. Figure 5-1 showshowtwovirtualnetworksarebuiltontopofBrunet. 5.2.2NetworkSizeEstimation Theaccuracyofnetworksizeestimationisimportantindist ributedsystemssuch asP2Pnetworks.InDeetoo'sboundedbroadcasting,theperfo rmanceofDeetoo's searchalgorithmdependslargelyontheaccuracyofestimat ionbecausetherange ofbounded-broadcastingisdeterminedbytheestimatednet worksize.Toaddress theissueofnetworksizeestimation,asequentialupdateis introduced.First,anode calculatesnodedensityusingonlydirectneighbors(onele ftandonerightconnection) afteritjoinsanetwork.Basedonthenodedensity,thenodege tstherstestimation, whichis N 0 .Inthenextestimationstep,thenodesendsasimplepingmes sagetoa logN 0 -hopawaynodeandretrievestheremotenode'saddressinfor mation;thisgives N 1 .Finally,itrequeststheestimationtoitsshortcutneighb orsthentakesamedian. Forboththecachingandqueryingpurposes,therangesforbo unded-broadcastingare determinedbythenalmedianestimation.Theaccuracyofth esequentialestimationis comparedwiththeactualnumberofnodesinthenetworkinSect ion 5.4 5.2.3MapReduce-BasedCache/QuerySystem Mapandreducefunctionsarepopularparadigmsinfunctiona lprogramming languages(e.g.,Ruby,Python,andLISP).Amapfunctiontransf ormseachelement( x i ) inacollection( x 1 ,x 2 ...x n )intoadifferentkeyelement( y i ),thuscreatingacollectionof intermediateelements( y 1 ,y 2 ...y n ).Areducefunctioncomputesanaggregation( z )over thiscollection.Basedontheconceptofthemapandreducefun ctionalprogramming model,softwareframeworks(e.g.,Hadoop[ 58 ]andGoogle[ 57 ])havebeendeveloped toefcientlyparallelizecomputationsonlargedatasets. Themapfunctionusuallyworks on(key/value)pairstocreateintermediate(key/value)re sults.Reducefunctionsworkon intermediate(key/value)resultswhileaggregatinginter mediatevaluesassociatedwith thesameintermediatekeys.Theframeworkdistributesmapa ndreducetasksamong 75

PAGE 76

nodesinaclustertoenableparallelprocessing,whileuser sonlyhavetospecifythe appropriatemapandreducefunctionsassociatedwiththeir computationwithouthaving toworryaboutdetailsofdistributedparalleljobexecutio n. TheimplementationofDeetooontopofBrunetconsistsofvef unctionalmodules. TheyincludeaP2Pnetworkmodule,aMapReducecore,atreegen erationmodule,a mapmoduleandareducemodule.Figure 5-2 showsthearchitectureofMapReduce functionmodules.Whenatask(caching/querying)isassigne dthroughtheunderlying P2Pnetwork'sRemoteProcedureCall(RPC),theMapReducecorem odulerst generatesatreeusingboundedbroadcasting.Afteratreeiss uccessfullygenerated, mapfunctionsareexecutedinparallelatallthenodesinthe tree.TheMapReducecore inaninitiatingnodestartsthemap-reduceprocess.WhileMa pisprocessingitsown functionatanode,thenodewaitsfortheresponsefromitsch ildnodes.Uponreceiving resultsfromchildnodes,thenodereducesthejob,thenretu rnsthereducedresulttoits parentnode.Whenreduceiscompleted,thewholeresultispas sedtotherootnode. Notethattherootnodeinatreeistheinitiatingnodeforcac heorquery.Figure 5-3 illustratesasimpleexampleofaMapReducetree. x i isanargumentforamapfunction. z j andtheresultofmapareargumentsforareducefunction.Let amapfunctionbe f(x i ) ,aresultofreducebe z i ,andareducefunctionbe g(z j ,..,z k ,x i ) .Therootnode, x 1 executesitsownmapfunctionandgetsaresult, f(x 1 ) .Thechildnodes x 2 and x 3 pass theirreduceresults.Themapandreducefunctionsareexecu tedsimultaneouslyinthe nodesatthesamelevel.Finally, x 1 receivesreduceresultsfrom x 2 and x 3 anditreduces withthemanditsownmapresult.Thereduceresultsinleafno des( x 4 ,x 5 ,x 6 ),whichare thesameastheirmapresultsinthisexamplebecausetheydon othaveanychildnodes thatpassanyresults. Thedetailsofeachmodule'sfunctionsisdescribedinthefo llowingsections. 76

PAGE 77

5.2.3.1P2Pnetworkmodule TheP2Pnetworkmoduleisresponsibleforhandlingnewnodejo insanddepartures, connectionmanagementwithneighboringnodes,andmessage routing.Thecurrent implementationofDeetooisdevelopedontopofBrunet.Whilet heunderlyingnetwork modulefortheDeetooimplementationisBrunet,Deetoocanbe builtonmanyotherP2P platforms,suchasChord[ 3 ],CAN[ 2 ],andPastry[ 48 ].Thiscanbedonebybuilding a2-dimensionalspace,thencuttingthespacetointersecta tonepointforcacheand query.5.2.3.2MapReducecoremodule TheMapReducecoremoduleisresponsiblefordistributingm apandreduce functionsusingboundedbroadcast.WhenauserinitiatesaMa pReducetask,the requestisconveyedtotheMapReducecoremodulethroughthe underlyingP2P network'sRemoteProcedureCall(RPC)module.TheMapReducec oremodulechecks themaparguments,thereducearguments,andthebroadcastr egionarguments. Themapandreduceargumentswillbepassedtothemapandredu cefunctions, respectively.Mapargumentsincludeanobjecttobeinserte dintoanetworkincaseof cachingandanobjectandaquerytypetobepassedasmapargum entsforquerying. Theresultsfromchildnodesandtheresultofmaparepasseda sreducearguments. Thebroadcastargumentdescribesabounded-broadcastregi onthatthenodeis responsiblefor.TheMapReducecoremoduledisseminatesth etasktonodeswhich resideunderitsresponsibleregionaftermanipulatingthe broadcastregionargument appropriately.5.2.3.3Generatingatreemodule Thegeneratingtreefunctionalmodulemakesuseofboundedb roadcasttoreplicate objectsaswellastopropagatequerymessages.Withtheexist enceofshortcut connectionsinaBrunetP2Pnetwork,theboundedbroadcastbui ldsatreewhose depthisshort( logN) comparedtoanaivering-basedP2Poverlay.Thedetailed 77

PAGE 78

operationofboundedbroadcastthatbuildsamulticasttree isdescribedin[ 50 ].The rangeofboundedbroadcastingisselectedatrandom,whilet hesizeoftherange dependsontheestimatednetworksizeandthereplicationfa ctor, .Thereplication factorisauser-denedparametertothegeneratingtreefun ctionalmodule.Byadjusting thereplicationfactor,usersareabletocontrolthenumber ofreplicasinacaching networkormanagequerysuccessprobabilityinaqueryingne twork. 5.2.3.4Mappingmodule Therearetwoseparatemapfunctionsforcachingandqueryin gforthetest.For caching,themapfunctioninsertsadataobjectintothenode 'sdatalistandreturns trueifdatainsertionwassuccessful.Inthequeryingpurpo se,mapfunctionsearchesa speciedstringfromthedatalist.Themapfunctionfortheq ueryalsosupportsregular expressionsearchusingtheexisting.Netlibrary.Theresu ltofthemapfunctioniseither successorfailureifitiscalledforthecachingpurpose,wh ilethemapfunctionforthe queryingreturnsthematchingobject.Themapresultistran sferredtothenode'sreduce functionmoduleasanargument.Forthecachingandthequery ingpurposes,map functionsaredescribedasfollows: CacheMapFunction: Thepseudo-codeforacachemapfunctionisshownin Algorithm 1 .Thefunctiontakesanobjecttobeinsertedasargument.The nodewhich runsthemapfunctionaccessesitslistofobjectsandchecke siftheinsertingobject alreadyexistsinthelistornot.Theresultofcachemapfunc tionreturns true or false dependingonsuccessorfailureofinsertion. QueryMapFunction: Algorithm 2 describesthequerymapfunction.Thefunction requiresanobjecttobesearchedasanargumentanditreturn salistofmatching objects.Ifthefunctioncannotndanymatch,thequerymapf unctionreturnsanempty list. 78

PAGE 79

Algorithm1 CacheMap Require: objecto //anobjecttobeinserted Require: Noden 1: object list n.getObjects() 2: if o isnotin object list then 3: object list.put(o) 4: returntrue 5: else 6: returnfalse 7: endif Algorithm2 QueryMap Require: objecto //anobjecttobesearched Require: Noden 1: object list n.getObjects() 2: result=[] 3: forall v 2 object list do 4: if o matches v then 5: result.Add(v) 6: endif 7: endfor 8: return result 5.2.3.5Reducingmodule Inthereducefunctionalmodule,themapresultsfromthewor kingnodeandthe reduceresultsfromthechildnodesarepassedtothereducem oduleasinputs.Assume thatanodehas n childnodesinatree.Theworkingnodesendsamessagetoitsc hild nodesinthetreethatisbuiltusingboundedbroadcast.Thus ,thenodeexpects n results fromitschildnodesandoneresultfromitsmapmodule.Byredu cing n reduceresults andonemapresult,thenodetransfers n+1 reduceresultstoitsparentnodeinthetree. Inthecachingprocess,thebooleanresultswhichindicates uccessorfailureofcaching, thenumberofnodesandthetimespentintermsoftreedepthar epassedasarguments tothereducefunction.Inthequeryingprocess,theboolean resultsarereplacedbythe matchingresults.Thereducefunctionforregularexpressi onmatchconcatenatesall thereduceresultsandpassestheresultsupthetree.Bytheen dofeachprocessover thenetwork,ausercollectsinformationaboutthetotalnum berofnodesvisitedandtree 79

PAGE 80

depthinadditiontocachingorqueryresult.Asreduceisproc essedateachnodeina tree,theresultsarepropagatedbackthroughthetree.Fort hecachingandthequerying purposes,reducefunctionsaredescribedasfollows: CacheReduceFunction: Algorithm 3 explainshowacachereduceworks.When acachereduceiscalledbyanode,itcollectsalltheresults fromthenode'schildrenin atreeandtheyaretransferredtothecachereducefunctiona sarguments.Inthetest setting,thechildresultsarealistofbooleanvaluesthati ndicatethesuccessorfailure. Inaddition,theresultofmapfromthenodeispassedasaredu ceargument.Ifoneof theargumentsis NULL ,thereducefunctionreturnsonlyavalidresultfromeither map orchildresult.Thefunctioncombinesthemapresultwithth eresultsfromchildnodes, thenreturnthecombinedresult. Algorithm3 CacheReduce Require: MapResult m ,//[true,false,..,false] Require: ChildResult c //[false,true,..,true] 1: result list [] 2: if m isNULL then 3: result c 4: elseif c isNULL then 5: result m 6: else 7: result m.combine(c) 8: endif 9: return result list QueryReducefunction: Thepseudo-codeforthequeryreducefunctionisshown inAlgorithm 4 .Thisisalmostthesameasthecachereducefunction.Thedif ferenceis thattheresultfrombothchildnodeandmapisalistmatching object. 5.3ExperimentalEnvironment Inthissection,theperformanceofDeetooisconrmedviaex perimentsin Planet-Lab.Deetoonodes,eachcomposedoftwovirtualBrunet nodes,weredeployed. Thevirtualnodesformtwodifferentvirtualoverlaynetwor ks,oneforcaching,theother forquerying.Brunetframeworkmanagesconnectionsamongno desandprovidesthe 80

PAGE 81

Algorithm4 QueryReduce Require: MapResult m ,//alistofmatchingobjects Require: ChildResult c //alistofmatchingobjects 1: result list [] 2: if m isNULL then 3: result c 4: elseif c isNULL then 5: result m 6: else 7: result m.combine(c) 8: endif 9: return result list mechanismforUDPpackettransport.Also,itsupportsNATand rewalltraversals. TheDeetoosearchsystemwasimplementedonmorethan400Plan et-Labnodes.For theexperiment,100uniquestringobjectswerecachedovert henetwork.Then,the queryingprocesswasrepeated100timesforeachuniqueobje ct. Testwasperformedwithtwodifferentvaluesofreplication factor( )toobservethe effectofincreasingordecreasingthecachingorqueryingr angesize.Thereplication factorintheexperimentswassetto1.0and3.0.Notethatthe replicationfactoristhe onlyparametertoaffectahitrate,whichis e <> nodesgetbothcacheandquery. Thematchingfunctionusedregularexpressionmatchforthe entiretest.Allcaching andqueryingprocesseswereinitiatedonrandomlyselected nodesandmessageswere broadcastedwithinrandomlychosenranges. 5.4EvaluationandResults Theevaluationisfocusedon(a)accuracyofnetworksizeest imation,(b)query successprobability,(c)latencyintermsofthedepthofatr eegeneratedbybounded broadcast,and(d)communicationcost.5.4.1NetworkSizeEstimation Intheexperiment,themovingaverageofsamplesize100wasu sedforevaluation. Inotherwords,thepast1000resultswereaveragedatthetim eindicated.Themoving averageisgoodforshowingthevariationofasmallsubsetof resultsgivenavery 81

PAGE 82

largenumberofsamples.Figures 5-4 and 5-5 showhowaccuratelythenetworksize estimatorperformed.Theresultsofthenetworksizeestima tionwereslightlylargerthan theactualnetworksize.However,thedeviationwasverysma ll.Thedifferencebetween measurednetworksizeineachnodeandtheactualnetworksiz eresultedfromthe non-uniformdistributionofnodes'addresses.5.4.2QuerySuccessProbability Thequerysuccessprobabilitywasmeasured.Figure 5-6 showsthequerysuccess probabilityasafunctionofmeasuredtimewithareplicatio nfactorof1.0andFigure 5-7 showstheprobabilitywhenthereplicationfactorwassetto 3.0.Thevariationis observedineachexperiment.Thequerysuccessprobability isonlydependenton thereplicationfactorandthenetworksize.Consideringad eterministicreplication factorwhereausercanselectathisdesiredperformance,th enetworksizeistheonly inuentialfactorforthequerysuccessprobability.Eachre sultwascomparedtothe theoreticalresultthatisapproximately 1 e AsseeninFigures 5-6 and 5-7 ,thequerysuccessprobabilityisalmostconstantin time.Thenoiseintheguresresultsfromthevarianceofnet worksizeestimationsince theestimatednetworksizeatthetimeofcacheorquerydecid estherangeofbounded broadcast.Theresultswerecomparabletothetheoreticalr esults.Theconstantsuccess probabilityisdesiredsinceDeetoocanperformthesearchw ithpreferredsuccess probabilitybyadjustingbroadcastrangewithdifferentre plicationfactors.Asexpected, thelargerthereplicationfactor,thehigherthequerysucc essprobability. 5.4.3Latency Thelatencyinthetestismeasuredbycountingtreedepth.In thecalculation oflatency,thenumberofout-of-rangelinksbeforendinga nodeintherangeby greedyroutingisaddedtothetreedepth.Accordingto[ 47 ],thelatencyofbounded broadcastinagivennetworksize, n ,isboundedby O( 1 k log 2 n) ,where k isthenumberof shortcutlinks.InBrunet,eachnodemaintainsapproximatel y logn shortcutconnections. 82

PAGE 83

Thus,thetreedepthis O(logn) .Figure 5-8 and 5-9 comparetheoreticalresultswith experimentalresultswhen is1.0and3.0,respectively.Theexperimentalresults showshorterlatencybecausethenumberofshortcutconnect ionisgreaterinBrunet thanincalculation.ConsideringthatMapReduceisexecute dinparallelinatree,a shorterlatencyproducesamoredesirableresponsiveness. Theactuallatency( L ) forthequeryingismeasured.Thelatencybetweenapairofno desisnotmeasured butassumingthattheper-hoplatency( L hop )betweentwonodesisconstant,per-hop latencycanbecalculatedfromthetotallatencyandthedept hoftree( l D ). L hop = L l D Table 5-1 showsthemeasuredandcalculatedresultsoflatency,commu nicationcost, treedepth,andper-hoplatency.For =1.0 ,thelatencywillbeincreasedto 9.42(sec) (per-hoplatency communicationcost)ifaquerymessageisdeliveredsequent ially insteadofusingboundedbroadcast.Sequentialmessagerela ytakes4timesmoretime thanboundedbroadcast.Figure 5-10 showsthemeasuredlatencyofqueries. 5.4.4CommunicationCost Communicationcostisevaluatedasthenumberofnodesreach edbyacachingora queryingmessage.Figures 5-11 and 5-12 showsthecommunicationcostwithdifferent replicationfactors.Only5%ofnodesneededtobeaccessedb ythe:wsearching processtoachieveover60%ofquerysuccessprobabilityand lessthan9%ofnodes werevisitedtosatisfyover90%ofquerysuccessprobabilit y.SincethesizeofUDP packetforastringobjectcachingis384 byte andtheaveragenumberofmessages for =1.0 is20.54,approximately8 KB oftotaldataistransferredforasinglecache. Figure 5-13 illustratesthetotalbytestransferredinthenetworkfore achquery. 5.4.5Replicationvs.SuccessProbability Thereexistsatrade-offbetweenthenumberofreplicaspero bjectandquery successprobability.Thenumberofreplicasvariesfromone objecttoanothereven 83

PAGE 84

ifthegivenreplicationfactoristhesameforeachobject.T henumberofreplicasis determinedbasedonthenetworksizeestimation.Somenodesm ayoverestimateand othersmayunderestimatethesizeofthenetwork.Ifanobjec tisinsertedfromanode whoseestimationislessthantheactualnetworksize,theob jectisreplicatedmore. Thetestcountedthenumberofreplicaspereachuniqueobjec tsafterstabilization. Forthequerysuccessprobability,thenumberofsuccessful lyresolvedqueriespereach objectwascountedandaveraged.Figures 5-14 and 5-15 showthetrade-offbetween replicationandquerysuccessprobabilitywith of1.0and3.0,respectively.Iobserved thatquerysuccessprobabilityincreasedasthenumberofre plicasincreaseduntilquery successprobabilityreached100%.5.4.6LoadBalancing Let m bethenumberofobjectscached, N bethenumberofnodes,and C bethe communicationcost.Itisknownthat C= p N fromtheequations( 4–4 )and( 4–5 )in Chapter 4 .Thus,thenumberofobjectspernode, m ave ,is: m ave = m C N (5–1) =m r N (5–2) Imeasuredthenumberofobjectspernodefrom368Planet-Labn odes( N ).500 objects( m )werecachedoverthenetworkwithareplicationfactor1.Ass eeninFigures 5-16 and 5-17 ,theloadisevenlydistributed.Theaveragenumberofobjec tsinanode is24.5andthestandarddeviationis5.46.Thetheoreticale xpectationforthenumberof replicatedobjectspernodeis26.06ifthereplicationfact orissetto1.Thereasonforthe mismatchbetweenthemeasuredresultandthetheoreticalre sultcamefromtheover estimationofthenetworksize.Theaverageofestimatedsiz ewas395.6,buttheactual sizewas384.Theover-estimationresultedinthesmallernu mberofreplicatedobjects. 84

PAGE 85

5.5Conclusion Inthischapter,theDeetoosearchtechniqueisevaluatedan dtestedonPlanet-Lab toverifytheperformanceofDeetooinarealP2Pnetworkenvir onment.TheDeetoo searchmoduleisdevelopedontheexistingP2Poverlay.Thete stoftheregular expressionsearchwiththeDeetooconrmedthegeneraltype ofqueryresolving ability. ThetestresultsshowthatDeetoo'scachingandqueryingper formanceisvery closetoboththeoreticalandsimulationresults.Theperfo rmanceofDeetooonreal networksshowsthatDeetooisanattractivesolutionforuns tructuredsearchesontop ofstructuredP2Pnetworks.ThedevelopedDeetoosearchcomp onentontopofP2P substrateinthisworkisapplicabletootherexistingP2Pove rlaynetworks. 85

PAGE 86

Table5-1.Latency metric =1.0 =3.0 latency(sec) 2.292.71 depthoftree 5.06.26 per-hoplatency(sec) 0.460.43 no.messages 20.4834.38 Figure5-1.P2P(Brunet)networkoverview 86

PAGE 87

Figure5-2.MapReducefunctionmodulesforquerysystem Figure5-3.Simpleexampleofmap-reducetree 87

PAGE 88

0 2000 4000 6000 8000 10000 trial 0 200 400 600 800 1000Network size Estimated network size vs. maximum network size estimated network size maximum network size Figure5-4.Estimatednetworksize( =1.0 ) 0 2000 4000 6000 8000 10000 trial 0 200 400 600 800 1000Network size Estimated network size vs. maximum network size estimated network size maximum network size Figure5-5.Estimatednetworksize( =3.0 ) 88

PAGE 89

0 2000 4000 6000 8000 10000 trial 0.0 0.2 0.4 0.6 0.8 1.0hit rate Hit Rate plab result theory Figure5-6.Querysuccessprobability( =1.0 ) 0 2000 4000 6000 8000 10000 trial 0.0 0.2 0.4 0.6 0.8 1.0hit rate Hit Rate plab result theory Figure5-7.Querysuccessprobability( =3.0 ) 89

PAGE 90

0 2000 4000 6000 8000 10000 trial 2 3 4 5 6 7 8 9 10Tree Depth Tree Depth plab result logN Figure5-8.Latencyintermsoftreedepth( =1.0 ) 0 2000 4000 6000 8000 10000 trial 2 3 4 5 6 7 8 9 10Tree Depth Tree Depth plab result logN Figure5-9.Latencyintermsoftreedepth( =3.0 ) 90

PAGE 91

0 2000 4000 6000 8000 10000 trial 1.5 2.0 2.5 3.0 3.5 4.0 4.5Latency [sec] Latency =1 0 =3 0 0.46 log N 0.43 log3 N Figure5-10.MeasuredLatency 0 2000 4000 6000 8000 10000 trial 0 10 20 30 40 50Communication Cost Communication Cost plab result theory Figure5-11.Communicationcost( =1.0 ) 91

PAGE 92

0 2000 4000 6000 8000 10000 trial 0 10 20 30 40 50Communication Cost Communication Cost plab result theory Figure5-12.Communicationcost( =3.0 ) 0 2000 4000 6000 8000 10000 trial 0 5 10 15 20Communication Cost [KB] Communication Cost =1 0 =3 0 0.384 N 0.384n 3 N Figure5-13.Totalbytestransferredforeachquery 92

PAGE 93

5 10 15 20 25 30 35 Caching cost 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9Average Hit Rate Caching Cost vs. Hit Rate Figure5-14.Communicationcostforcachingvs.querysucce ssprobability( =1.0 ) 15 20 25 30 35 40 45 50 Caching cost 0.5 0.6 0.7 0.8 0.9 1.0 1.1Average Hit Rate Caching Cost vs. Hit Rate Figure5-15.Communicationcostforcachingvs.querysucce ssprobability( =3.0 ) 93

PAGE 94

0 5 10 15 20 25 30 node 0 10 20 30 40 50 60 70number of occurrence The number of objects per node Figure5-16.Loaddistribution 0 50 100 150 200 250 300 350 400 node 0 20 40 60 80 100number of occurrence The number of objects per node Figure5-17.Thenumberofcachedobjectspernode 94

PAGE 95

CHAPTER6 EXACTDEETOO:SEMANTIC-FREESEARCHONSTRUCTUREDPEER-TO-PEER SYSTEMS 6.1Introduction ThecoreofmostP2Psystemsisanefcientsearchalgorithm.I nChapter 4 Deetooisproposedtoprovideanefcient,scalable,self-o rganizing,andoptimalsearch algorithmintermsoftrade-offbetweencachingcostandque ryingcost.Inaddition, Deetoocanresolveanytypesofqueriessincethedataobject sarenotstructured.The addressforanewnodeisselectedatrandom.Deetoochoosesc olumns(orrows)for boundedbroadcastingatrandom,eventhoughusersdecideth enumberofcolumns (orrows)byprovidingareplicationfactor.Userscancontr olahitratebyincreasingor decreasingareplicationfactor,butusersalsohavetopayf ormorebandwidth.Deetoo canonlyachievea100%successrateforsearchbybroadcasti ngaquerymessage overtheentirenetwork,however,inthatcase,thenetworkm aybeoverloadedwith querymessagesandthenetworkisnotscalable.Duetotheran domnessofDeetoo,it doesnotguaranteeahit.Thereisalwaysachancenottoresol veaquery.Deetoois applicabletomostP2Psystemssuchasle-sharingorresourc e-discoverythatarenot strictwithrespecttothehitrate.Thoseapplicationsofte nrequiremultiplequeryresults. Eveniftherewasnomatchafteraqueryingprocess,theapplic ationssimplysend anotherquerymessageandthemessageisbroadcastedinanot herarea.However, someapplicationsrequirethehighestlevelofhitrate,ore vena100%hitrate.One exampleofsuchanapplicationisaP2Pdatabase.Toaddressth eproblemofDeetoo's inabilitytoachieve100%hits,ExactDeetooissuggestedint hischapter. TheDeetooalgorithmsucceedswithacertainprobabilityth atmeetsauser'sneeds. Ausercanachieveaconstantsuccessprobabilityregardles softhesizeofthenetwork byadjustingareplicationfactor.However,hereIpresenta waytomakeachange sothatthequeryprocessalwaysreachesasuccessfulresult withoutpayingextra communicationcost(communicationcostremainsO( p N )).Onewaytoachieve100% 95

PAGE 96

successprobabilityistoguaranteethateveryoverlappedb in(aplacewhereacache andquerycolumnoverlap)hasatleastonenodeinit.WhileDee too'sjoincostremains inverysmall,ExactDeetoorequiresslightlyhigherjoining cost.However,oncenodes arejoinedinanetwork,communicationcostbothforcaching andqueryingfollows p N andthequeryalwayssucceeds. AnodejoinalgorithminExactDeetooisimplementeddifferen tlythaninrandomized Deetoo,whiletheExactDeetoosharesDeetoo'sroutingtechn iqueandnetwork topology.ThebasicassumptionofDeetooisthateachaddres sbinisoccupiedoris empty.EachnoderandomlyselectsanewaddressinDeetoo.InEx actDeetoo,anew addressiscarefullyselectedbyalgorithm.TheExactDeetoo algorithmchoosesa newaddresssuchthateachboxmaintainstheminimumnumbero fnodes.Because eachboxisacross-sectionalareaofcachingrangeandquery ingrange,aquery alwayssucceedsbymaintainingatleastonenodeineachbox. InExactDeetoo,a binisexpandedtocontainmultiplenodes.Thebinisnowcall eda`box'.Aboxisa collectionofaddressbinsinarectangularspaceasseeninF igure 6-10 .Aboxisthe sameconceptasthecross-sectionofcolumnsandrowsinDeet oo(thearea A inFigure 4-1 ).Thenumberofboxesandthewidthandheightoftheboxesvar yaccordingtothe networksizeandthenumberofboxesarecloselyrelatedtoth ecostofjoins.Theeffect oncostisdiscussedinthefollowingsection.Themaximuman dminimumnumbersof nodesinaboxissetbytheuser.Ifthenumberofnodesinaboxr eachesthemaximum allowed,thenodetriestondanotherboxthatisnotfullint hesamecolumnorrow.If alltheboxesinthesameroworcolumnarelledwiththemaxim umnumberofnodes allowed,theboxesintherow/columnsplitintotwosub-boxe s.Ontheotherhand,ifone ormorenodesleavesaboxsuchthattheboxdoesnotmaintaint heminimumnumber ofnodes,anodeintheboxrequestsanodethatresidesinabox withmanynodesto moveintothebox.Twoadjacentcolumns/rowsaremergedwhen manyboxescontain fewernodesthantheminimum.Asthenetworkgrows,ExactDeeto omakeseachbox 96

PAGE 97

smaller.SinceExactDeetooassignsanewnode'saddresssucht hatanyboxretains appropriatenumberofnodes,users'queriesalwayssucceed .Themaincontributions ofExactDeetooare:1)ByusingExactDeetoo,queriesalwayssuc ceed.2)Thecosts forbothpublishingandsearchingremain O( p N) .3)ExactDeetooisabletoresolve anykindofquerysuchasaregularexpressionsearchsinceth edataobjectsorquery messagesarenotstructured. Inthischapter,ExactDeetooalgorithmisevaluatedthrough simulation.The metricsfortheevaluationareboxproperties(numberofbox esinthenetwork,number ofaveragenodesinabox),costfornewnodejoins,cachingan dqueryingcost,search timeintermsoftreedepth,andloadbalance. 6.2TheAlgorithm FirstthedesignofExactDeetooisdescribed.Then,inSection 6.2.1 thewaywhich anewnodejoinsanetworkisdescribed.ThebasicformofExact Deetooisthesame asDeetoo:a2-dimensionalmatrixspace.Atanypointintime, thespaceisdynamically splitamongallthenodessuchthateverynodeownsitsindivi dualzonewithintheoverall space.Thezoneissharedbyseveralnodestopreventanempty zoneaftersubsequent splittingasnetworksizegrows.Thezoneiscalleda'box'fo rtherestofthechapter. Theboxisthesameconceptofcross-sectionalregioninDeet oo.Forexample,Figure 6-1 showsa2-dimensional4-by-4space.Theboundariesofeachb oxarerepresented bycolumnnumberandrownumber.Thebox A hasaboundaryof [w = 4,2w = 4) inthe columnand [2w = 4,3w = 4) intherow,assumingthatthesizeoftheaddressspaceis B=w 2 .Thebox A contains3nodesincludingthenode n and A isassociatedwith n until A issplitormerged.ThedifferenceisthatExactDeetooalways maintainsthe minimumnumberofnodesineveryboxinordertobeabletoreso lveeverysinglequery. AsinDeetoo,eachnodehastwoaddresses,oneforthecachenet workandtheother forthequerynetwork.Thepurposeofusingtwoaddressesist ocreateanorderingon thecacheringincreasingalongthecolumnsandonthequeryr ingincreasingalong 97

PAGE 98

therows.Theaddressforagivennodeinthequeryringmustbe thetransposeofthe addressonthecachering.Nodesinthesamecolumnhaveadjac entaddressesinthe cachenetwork.Onthequerynetwork,nodesinthesamerowhav eadjacentaddresses. Adjacentnodesmakeanearconnectiontoeachother.Inthegu re,eachboxcontains atleast2nodes. NodesintheExactDeetooself-organizeintoanoverlaynetwo rkthatrepresents thisvirtualspace.Anodemaintainsitsnearandshortcutne ighborsineachring.Also anodekeepstrackoftheboxassociatedwiththatnodesothat thenodeisalwaysable toidentifytherangeofbroadcasting.Forinstance,when n insertsandataobject,the objectwillbecachedatallthethenodesbetweencolumn w = 4 andcolumn w = 2 .The broadcastingrangeforcachingisdecidedbythebox A ,andtherangeisfrom w = 4 w to (w = 2 1) w+(w 1) .Similarly,aquerymessagemustbesenttoallthenodes betweenrow w = 2 androw 3w = 4 .Therangeforaquerybroadcastistobefrom w = 2 w to (3w = 4 1) w+(w 1) .Notethateachnodeutilizesthecachingaddress,incaseof cachingandthequeryingaddress,whichistransposedformo fcachingaddressincase ofquerying.6.2.1Join Asdescribedabove,theentireaddressspaceisdividedbybox esthateach containsacertainamountofnodes.Itiscriticalthatanewl yjoiningnodendsaproper placetoachieve100%querysuccessrate.Itcannotbeallowe dthatanyboxinthe networkisempty.Thisisdonebyselectinganaddressforthe nodeinthatthenode llsaboxorsplitsaboxiftheboxisfull.Thejoinprocessta kesthefollowingsteps: rst,anewnodeselectsarandomaddress.Second,basedonthe addressassigned, thenodendsitsnearneighboronbothacachingnetworkanda queryingnetwork. Third,oneofthenearneighborsinformsaboxwhoseboundary includesthenewly assignedaddress.Theboxinformationisdescribedbythebo undariesoftheboxin termsofcolumnandrowaddresses.Thecolumnelementsofthe addressaswellasthe 98

PAGE 99

rowelementsmustbebetweentheboundaries.Fourth,ifthen umberofnodesinthe boxisnotoverthemaximumnumberofnodesallowedinabox,th eboxisselectedas thenewnode'sbox.Iftheboxisalreadyfull,thenodesendsa messagetondabox containingtheminimumnumberofnodesbyboundedbroadcast ing.Theselectionof therangefortheboundedbroadcastingisdescribedinSectio n 6.2 .Uponndinganot fullyoccupiedbox,thenewnodechangesitsboxselectionto thebox.Ifeveryboxin acolumnorarowisfullwiththemaximumnumberofnodes,then someboxhastobe split.Oncethesplitprocessiscalled,alltheboxesinthes amecolumn(orrow)willbe split.Thesplitprocesswillbediscussedinthefollowings ectionindetail.Inthesplitting process,thenewnodeidentiesaboxwhoseboundariesinclu dethenode;then,the boxisconnectedtothenewnode.Fifth,theselectedboxfrom abovestepsdecidesa newaddressinaproperpositioninthebox.Finally,anewnod ejoinsthenetworkwith theassignedaddressandmakesconnectionstothenearneigh borsandashortcut neighbor. Findingaproperpositioninaboxforanewnodeisimportants inceitisefcient ifeachboxalwaysmaintainsnodesinawaytobeina`splittab le'phase.Ifthereis onlyonenodeinabox(thiscasecanbeseenonlywhenthereiso nenodeinawhole networkoranodefailsduetothenetworkdynamics),theboxs electsadiagonal positionfromasub-boxwiththemaximumnumberofnodes.Bypl acinganewnodein adiagonalposition,theboxalwayssplittableeitherthrou ghcolumnorrow.Thecase ofthreenodesinaboxalsoselectsthesamepositionforanew nodetobalancethe positionsofthenodesineachsub-box.Inallothercases,ap ositionisselectedina sub-boxwiththeminimumnumberofnodes.Figures 6-2 through 6-5 showhowabox choosesaproperposition.Intheseexamplecases,themaxim umnumberofnodes perboxissetto5.Theboxmaintainsthenumberofnodesinany sub-box.InFigure 6-2 ,aproperpositionforanewnodemustbesub-box1whichisdia gonalfromsub-box 4.InFigure 6-3 ,eithersub-box2or3canbeselected.Whenatleast3sub-boxe sare 99

PAGE 100

occupiedbyanodeasshowninFigure 6-4 and 6-5 ,anewaddressinthesub-boxwith theminimumnodeswillbeselected.6.2.2Split Whenalltheboxesineitheracolumnorarowarelledwiththem aximumnumber ofnodes,thecolumnortherowneedstobesplit.Therststep ofsplittingistocheck iftheboxesinthecolumn(orrow)aresplittableornot.Ifth ereareatleasttwonodes intheboxandthetwonodesareinthediagonalsub-boxtoeach other,thentheboxis splittable.Ifalltheboxesaresplittable,thenodesendsa `split'messageovertheentire column(orrow).Notethatnodesareevenlydistributedover fourpositionsinaboxsince thejoinprocessplacesnewnodesinthatway.Aftersplitting ,eachboxstillincludesat leasttheminimumnumberofnodes.Finally,anewnodendsap roperpositioninthe splitbox.Figure 6-6 showsbeforeandaftersplittingboxesinarow. Theselectionofsplittingdirection(throughthecolumnor throughtherow)is determinedbycomparingthewidthofcolumnwiththewidthof rowofthebox.If w c = w r < 1 ,thentherowwillbesplit.Thecolumnwillbesplitif w c = w r > 1 .Inthecaseof w c = w r =1 ,thealgorithmselectseitheracolumnorarowtobesplit.Bys plittingthrough thewiderdirection,thealgorithmmaintainseachboxassqu areaspossible.Thebox shapeiscloselyrelatedtothetrade-offbetweenthecachin gcostandthequerying cost.Thesquarebox,whosewidthofcolumnandthatofrowist hesame,isoptimalin termsoftrade-offbetweenthecachingcostandthequerying cost.Userscancontrol theshapeofboxbygivingaprioritytosplitinacertaindire ction.Forexample,narrower widthofcolumnmakesthecachingcostlower,butonehastopa ymorequeryingcost, andviceversa.Ifthewidthsarethesame,thealgorithmsele ctsanydirectionuniformly atrandom.6.2.3Trading-offCache/QueryCosts Inthealgorithmandthesimulationsettingdescribedinthe previoussectionsfor ExactDeetoo,asymmetricaddressspace,whichis w c =w r = p B isassumed, 100

PAGE 101

where w r isthewidthofrowsforqueryingnetwork, w c isthewidthofcolumnsfor cachingnetwork,and B istotaladdressspace.Inthesymmetricspace,thenumber ofcolumnsandthenumberofrowsarethesame,andthisincurs thesameamountof communicationcostforcachingandquerying.Onecanimagin ethecaseofasymmetric cachingandqueryingcost.Forexample,thespacecanbearec tanglewith w r kw c where k issomerealnumberinsteadof1.0.Figure 6-7 illustratestheexamplecase ofanasymmetricaddressspace.Intheasymmetricmatrix,th econditionforsplitting isslightlydifferentfromthatofasymmetricmatrix.If w r w c > k ,thealgorithmsplitsa rowinhalf,anditsplitsacolumnif w r w c < k .Thesplitalgorithmselectsarowora columnrandomlyincaseof w r w c =k .Thecaseofmorecolumnsrequireslesscaching costbutmorequeryingcost,andtheexactoppositeinthecas eofmorerows.Thus, ExactDeetooprovidesmoreoptionsforthenetworksettingac cordingtothedesirable publishingandsearchingperformance.Ineithercase,Exact Deetooalwayssupports exactresponsebymaintainingatleastonenodeineachbox. 6.3SimulationResults ForthesimulationofExactDeetoo,IexpandedNetmodelerfro mtheDeetoo simulation.Fiveperformancemetricsareused:(1)Boxprope rties-thenumberofboxes andthenumberofnodesperboxasthenetworksizegrows.(2)J oincost-thenumber ofgeneratedmessagesforanewnodejoin.(3)Cachingandque ryingcost-thenumber ofmessagesbroadcastforreplicatingdataandforsearchin gdata.(4)Loadbalancethenumberofobjectspernodeandthenumberofreplicaperun iqueobject.(5)Latency -thedepthofbroadcastingtree.Formeasuringlatency,Ias sumedthatthelatency betweenanytwonodesaretheidentical. Inthesimulationmodel,theminimumnumberofnodesperboxi ssetto2andthe maximumnumberofnodesperboxissetto5.Eachboxisoccupied byatleastthe minimumnodes.Thetopologyofsimulationnetworkfollowed onedimensionalsmall worldmodelasinDeetoosimulation.Eachnodeformstwovirtu alrings,oneforthe 101

PAGE 102

cacheandtheotherforthequery.Inadditiontonearneighbo rs,eachnodemakesa connectiontoashortcutnodeaccordingtotheinverse r th powerdistribution.Exceptthe joinprocessincludingsplittingalgorithm,thenetworkst ructureandroutingalgorithm arethesameasthoseofDeetoo.WhileDeetooroutesamessage( eitheracaching messageoraqueryingmessage)overmultiplenumberofcolum nsorrowsbasedon userdenedreplicationfactor,ExactDeetooonlyneededtos electarandomnodefor astartingpointforboundedbroadcasting.Aboxassociated withthenodedecidesthe rangeofboundedbroadcastingbasedontheboundariesofthe box.Thesizeofthe addressspaceissetto32-bitwhichhas 2 32 possibleaddresses.Thenotationsused inthefollowingsectionsare: B u (box) isupperboundofthenumberofnodesinabox, B l (box) islowerboundofthenumberofnodesinabox, B u (cost) isupperboundof thecommunicationcost, B l (cost) islowerboundofthecommunicationcost, M isthe maximumnumberofnodesperbox, m istheminimumnodesinabox, K c isthecostfor acache, K q isthecostforaquery, ~ N box istheaveragenumberofnodesperbox, w is thewidthofacolumn/row,and N isthenumberofnodesinthenetwork. 6.3.1BoxProperties TheFigure 6-8 showstheactualnumberofboxesinanetworkasnetworksize growsandtheresultsarecomparedtotheupperboundandthel owerbound.Theupper boundisachievedifalltheboxescontaintheminimumnumber ofnodes.Ifalltheboxes arefullwiththemaximumnumberofnodes,thenumberofboxes reachesthelower bound.Thus, B u = N m (6–1) B l = N M (6–2) Iobservedtwophasesintheincrementofthenumberofboxes. Onephaseisa burstincrementofthenumberofboxesthatiscalled`splitt ing'phase,andtheotheris called`llingboxes'phasewherethenumberofboxesisnotc hanged.Thegure 6-9 102

PAGE 103

ampliesthetwoseparatephasesinlogscale.Whenthenumber ofboxesreaches 2 k where k isanyintegerin[0, 1 ),thenumberofboxesstaysconstantuntilalmostevery boxisfullintheentiresystem.Inthe`splitting'phasetha tisbetweentwosubsequent `llingboxes'phases,thenumberofboxesincreases.Atthet imethatthenumberof boxesreaches 2 th -power,theentirespaceissplitevenlywiththesamenumber of columnsandrowsandmakeseachboxinasquareform,Atthistim eofpoint,itis highlyprobablethateachnewnodendsaboxwiththenumbero fnodesunderthe maximumwithoutdemandingsplitting.Thejoinalgorithmof theExactDeetoomaintains `lling'phaseuntilalmosteveryboxreachesitsmaximumca pacity.The`splitting'phase startsafteralltheboxesislledwiththemaximum.Sinceane waddressisrandomly selectedattherststepofjoinalgorithm,thejoiningnode ndsafullyloadedboxwith highprobabilitiesevenifsomecolumns(orrows)arealread ysplit.The`splitting'phase continuesuntilallthecolumnandtherowarecompletelyspl itFigure 6-10 showsthe comparisonofthenumberofboxesandthenumberofboxeswith themaximumnodes. Duringthe`llingabox'phase,thenumberofboxeswiththem aximumincreaselinearly whilethenumberdecreasesinthephaseof`splitting'.Thea veragenumberofnodes perboxrepeatsapatternofincrementin`llingboxes'phas eanddecrementin`splitting' phaseasshowninFigure 6-11 6.3.2JoinCost Thenumberofboxesinanetworkandtheaveragenumberofnode sinabox determinethecostforjoins.Inthe`splitting'phase,join costincreaseslinearlysince manynodejoinsin`splitting'phaserequiresboundedbroad castingtondaboxwith minimumortosplitthecolumn.Onthecontrary,joincostisd ecreasinginthe`lling boxes'phase.In`lling'phase,manyofjoinprocessndsab oxwherethenumber ofnodesarebelowthemaximum,thusthejoiningnodedoesnot needtobounded broadcastajoinrequestmessage.Iclaimthatthejoincosti sboundedby O( p N) Thereare3possiblecasestoconfrontwhenanodetriestojoi nanetwork.Inthe 103

PAGE 104

followinganalysis,Iassumedthat w=w c =w r .Foreachcase,thejoincostis calculated: Case1: Theboxisnotfull.Inthiscase,thenodejoinswiththeminim umjoining cost.Thenodeonlyneedstocontactitsneighboringnodesto identifyaboxwhose boundariesincludethenode.Itisrequiredthatneighborsi nbothacachingnetwork andaqueryingnetworksincetheidentiedboxfromneighbor sinonenetworkcannot includethejoiningnode'saddress.Thejoiningcostforthi scaseisatmost k ,where k isthenumberofnearneighborsinbothacachingandaqueryin gnetwork.Inthe simulation,thecostforthiscaseisatmost4(2foreachnetw ork). Case2: Theboxisfullbutthereisatleastoneboxthatisnotfullina selected columnorrow.Inthiscasethenewnodesendsarequestforthe boxwithminimum nodesusingboundedbroadcastingwithintheselectedcolum norrow.Thecostfor recognizingtheboxis ~ N box w Case3: Alltheboxesinaselectedcolumnorrowarefull.Thecaserequ ires splittingalltheboxesintheselectedcolumnorrow.Thecos tsforsplittingisagain ~ N box w .Thetotalcostforthecaseisthesumofthecostsincase1,ca se2,andthecost forsplitting,whichis k+2 ~ N box w .Thus,thiscaserequiresapproximatelytwiceasthe costofcase2.Since ~ Nw=k p N ,where k issomerealnumber,thecostisboundedby O( p N) Fromtheaboveanalysis,Iconrmedthatthejoincostisboun dedby O( p N) Thephasetransitionbetween`lling'and`splitting'isob servedintheFigure 6-12 TheFigure 6-13 illustratescumulativeaverageofjoincostTheaveragecos tstays O( p N) asclaimed. 6.3.3CachingandQueryingCost Forthetestofcommunicationcostforcachingandquerying, 100stringobjects areinsertedandeachobjectisqueried.Eachinsertionandqu eryingisexecutedina randomlychosennode.Theresultingcostisaveragedfromea chtrial.IntheFigure 6-14 104

PAGE 105

andtheFigure 6-15 ,thecachingcostandthequeryingcostarecomparedtotheup per boundandthelowerbound.Theboundsarecalculatedasfollo wing: m ~ N box M (6–3) Since ~ N box = N w 2 N M w 2 N m (6–4) r N M w r N m (6–5) ~ N box r N M w ~ N box ~ N box r N m (6–6) Thecostis K c =w ~ N box m r N M K c M r N m (6–7) Sincethesymmetricspace,where w c w r ,theboundsforaqueryarethesameasthose foracache.Inotherwords,sincetheaddressspaceisdened asasquareformand thesplitoccursincolumnandrowalternatively,thenumber columnsandthenumberof rowsarealmostthesameatanycertainpointoftime.Thisres ultsinthesamepattern ofcostforbothcachingandquerying.Similartotheaboveres ults,thealternating patternisobservedaccordingtothechangeofboxphases.In `llingboxes'phase,the costincreaseslinearlywhilethecosthashighvariancein` splitting'phase. 6.3.4LoadBalancing Figure 6-16 showsthenumberofreplicaperuniqueobjectsinanetworkwi th 50,000nodes.Forthetest,500uniqueobjectswereinserted andreplicated.The numberofreplicasmustmatchthecachingcost( K c =w ~ N box ).Sincethewidthof column/rowisapproximately128forthesizeof50,000netwo rkandtheaveragenumber ofnodesperboxis3.05,theexpectedcost(replication)is3 90.4.Theaveragenumber ofreplicatedobjectsis397.14andthestandarddeviationi s64.64.Notethatthereare twoseparatedistributionssincethesizeof50,000network isin`splitting'phase.There 105

PAGE 106

existtwokindsofcolumns.Thecachingcostforthecolumnth atisalreadysplitisless thanthecostforthecolumnthatisnotyetsplit.Withlessthe n10%ofreplicationfor thisnetworksize,ExactDeetooalwayssucceedsanyquery.In caseof20000sizeof networkwhichisin`lling'phase,onlyonedistributionof replicationisobservedinsuch anetworkasshowninFigure 6-17 .Inthissizeofnetwork,theexpectedreplicationsize is294since w 69.74 and ~ N box =4.11 .Themeasuredaverageis304.60andstandard deviationis18.73. Thenumberofobjectspernodetellshowwelltheloadisdistr ibuted.Figure 6-18 displaysthedistributionofthenumberofobjectsineachno deinthe50,000sizeof network.Thenumberofobjectspernodeiscalculatedasfoll ows: ~m= K c m N (6–8) ,where ~m isthenumberofobjectspernode.Thus,theexpectednumbero fobjectsper nodeis3.90.Theaverageandstandarddeviationofnumberof objectspernode3.97 and2.14,respectively.Figure 6-19 showsthenumberofobjectspernodeinthe20,000 sizeofnetwork.Thecalculationis7.19objectspernodeand themeasuredaverageis 7.62andstandarddeviationis2.73.6.3.5Latency Latencywasmeasuredbycountingthedepthofbounded-broad castingtree.The resultisshowninFigure 6-20 TheresultswassimilartotheresultsofDeetoosince ExactDeetooutilizethesametopologyandroutingalgorithm 6.3.6QueryResult TheFigure 6-21 illustratesthenumberofnodesthatreturnsmatchingresul tfor queries.Thenumberofthenodesequalstothenumberofnodes intheboxthatvisited bybroadcastbothforcachingandquerying.Thepatternofin crementanddecrement repeatedaccordingtotheshiftingofboxphases(lling,sp litting).Notethatanysingle 106

PAGE 107

queryissuccessfullyresolvedbyatleastanode.Theresult veriedthesearchabilityof theExactDeetoo. 6.4Conclusion Inthischapter,IpresentedExactDeetoo.Themainadvantage usingExactDeetoo isthateachandeveryqueryisresolvedwithoutsacricingb andwidthusage.Exact Deetooisself-organizinginthatthesystemndsaproperpl acetojoinforanewnode. ThescalabilityofExactDeetooisvalidatedbythesimulatio nwithamillionnodes.The messageoverheadeitherforcachingorqueryingisboundedb y O( p N) .ExactDeetoo isapplicabletoanyring-basedstructuredoverlay. 107

PAGE 108

Figure6-1.Example2-dimensional4-by-4space 108

PAGE 109

Figure6-2.Onenodeinthebox Figure6-3.Twonodesinthebox Figure6-4.Threenodesinthebox Figure6-5.Fournodesinthebox 109

PAGE 110

Figure6-6.Splitboxesinarow Figure6-7.Examplesofasymmetricmatrixspace 110

PAGE 111

0 20000 40000 60000 80000 100000 number of nodes 0 10000 20000 30000 40000 50000number of boxes Number of Boxes simulation lower_bound upper_bound Figure6-8.Thenumberofboxes 1 4 16 64 256 1024 4096 16384 65536 0 10000 20000 30000 40000 50000 60000 70000 80000 90000 100000 number of boxesnumber of nodes The number of Boxes number of boxes Figure6-9.Thenumberofboxesinlogscale 111

PAGE 112

0 20000 40000 60000 80000 100000 number of nodes 0 5000 10000 15000 20000 25000 30000 35000properties Box Properties No of boxes No of Max boxes Figure6-10.Thenumberofboxesandthenumberoffullboxes 0 20000 40000 60000 80000 100000 number of nodes 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0average number of nodes per box Box Properties Figure6-11.Theaveragenumberofnodeperbox 112

PAGE 113

0 20000 40000 60000 80000 100000 Number of Nodes 0 100 200 300 400 500 600 700 800Join Cost Average Joining Cost simulation theory( N ) Figure6-12.Joincost(N=100,000) 0 20000 40000 60000 80000 100000 Number of Nodes 0 50 100 150 200 250 300 350Join Cost Average Joining Cost simulation theory( N ) Figure6-13.Joincost(N=100,000) 113

PAGE 114

0 500 1000 1500 2000 2500 3000 3500 4000 0 100000 200000 300000 400000 500000 600000 700000 800000 900000 1e+06 communication costnumber of nodes Communication Cost using Exact Deetoo cache cost lower bound upper bound a N Figure6-14.Cachingcost 0 500 1000 1500 2000 2500 3000 3500 4000 0 100000 200000 300000 400000 500000 600000 700000 800000 900000 1e+06 communication costnumber of nodes Communication Cost using Exact Deetoo query cost lower bound upper bound b N Figure6-15.Queryingcost 114

PAGE 115

250 300 350 400 450 500 550 number of replica per object 0 20 40 60 80 100 120 140 160occurrance Histogram of Replica (N = 50k) Figure6-16.Thenumberofreplicationperuniqueobject(50 knodes) 150 200 250 300 350 number of replica per object 0 50 100 150 200 250occurrance The Number of Replicas (N = 20k) Figure6-17.Thenumberofreplicationperuniqueobject(20 knodes) 115

PAGE 116

0 2 4 6 8 10 12 14 16 number of objects per node 0 5000 10000 15000 20000occurrance Histogram of The number of Ojects (N = 50k) Figure6-18.Thenumberofobjectspernode(50knodes) 2 4 6 8 10 12 14 number of objects per node 0 500 1000 1500 2000 2500 3000 3500 4000occurrance The Number of Ojects (N = 20k) Figure6-19.Thenumberofobjectspernode(20knodes) 116

PAGE 117

10 0 10 1 10 2 10 3 10 4 10 5 10 6 number of nodes 0 50 100 150 200depth Tree Depth cache query theory( log 2 N ) Figure6-20.Latency(treedepth) 0 200000 400000 600000 800000 1000000 number of nodes 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0number of hit nodes Number of responding nodes Figure6-21.Thenumberofrespondingnodes 117

PAGE 118

CHAPTER7 CONCLUSION Studyingdistributednetworkanddatastructureisofgrowin ginterestincomputer networkingresearch.TheproblemthatP2Paddressesishowto buildreliable, large-scalesystemswithoutahighcostormanagementloado nanyoneindividualor organization.ThisdissertationfocusesonP2Pdesignappro achestomakedeveloping anewP2Psystemseasy.Ipresentedthealgorithmsfordevelop ingP2Pgeneralsearch systemsandtheproblemsonecanfaceforgeneralsearchonto pofP2Poverlays. P2PapplicationscanbedevelopedbyreusingtheP2Psearchcom ponents.Iproposed solutionsforsomeoftheproblems. Inchapter 3 ,IproposedfourdifferentmethodsfornetworksizeinP2Pnet work. Themethodsestimatethenumberofnodesbasedonthenodeden sityinagivenlength ofaddressspace.Ialsosuggestedanewjoiningmethodtoimp rovetheuniformity ofnodedistribution.Eachestimationmethodsachievesvari ousperformanceand communicationcost.Ausercanselectamethodorcombinedme thodswithrespect tohis/herdesiredperformance.Icomparedeachmethodbysi mulationintermsofthe accuracyofsizeestimationandthecommunicationcost. Inchapter 4 ,IintroducedDeetoo,ascalableroutingpeer-to-peerprot ocolfor unstructurednetworkswhichprovidesefcientcachingand lookupfunctionalitywitha constantqueryhit-rate(withoutregardtoanetworksize), O( p N) replication, O( p N) querycost,and O(log 2 N) searchtime.Deetoo,allowsobjectstobeupdatedand deleted,andcanbeusedtohandlegeneralqueries.Specical ly,anyproblemthatcan bemappedontoselecting(withhighprobability)objectswh ichmatchsomequerycan berunoverDeetoo. DeetooisdeployedandtestedonPlanet-LabnodesinChapter 5 .Theimplementation onrealnetwork,suchasPlanet-Labcanbemeaningful.Therea limplementation requireswritinganAPItomakeiteasyforpeoplemakenewquery andcacheobjects. 118

PAGE 119

AnAPIprovidesagoodtoolforpeopletouseDeetooinmanyapplic ations.Deetoo's routingalgorithmisservicedontopofBrunetP2Psubstrate,t hennodeswithDeetoo functionalitydeployedonPlanet-Labnodes.Thetestresult sshowtheveryclosematch tothesimulationresultsaswellastheoreticalanalysis.By investigatingtheperformance ofDeetooontherealP2Penvironment,IassurethatDeetooisa pplicablequery algorithmontopofmanyexistingP2Poverlays. Inchapter 6 ,ExactDeetooisintroducedandevaluatedbysimulation.Exac t Deetooisdesignedtoresolveeveryquery.Thejoincost,whi chis O( p N) ,ishigherthan randomizedDeetoo.However,thecommunicationcostforcac he/queryisstill O( p N) .In thesimulation,Ifoundthatthenumberofboxandtheaverage numberofnodesperbox arethemostimportantmetricsforbothjoincostandcommuni cationcost. ExactDeetoowillbeapplicabletomanyexistingP2Poverlayst oachieve100% queryhit-rate.IbelievethatExactDeetoosuggestsanewdir ectionofP2Pdatastorage. 119

PAGE 120

REFERENCES [1] M.K.KiranNagaraja,SamiRollins,“Fromtheeditors:Peer-topeer community–lookingbeyondthelegacyofnapsterandgnutell a,”vol.7,no.3. IEEEComputerSociety,2006. [2] S.Ratnasamy,P.Francis,M.Handley,R.Karp,andS.Shenker,“ Ascalablecontent addressablenetwork,”in Proc.ofACMSIGCOMM ,2001. [3] I.Stoica,R.Morris,D.Liben-Nowell,D.R.Karger,M.F.Kaasho ek,F.Dabek, andH.Balakrishnan,“Chord:ascalablepeer-to-peerlookup protocolforinternet applications,”vol.11,no.1.ACMPress,2003,pp.17–32. [4] B.Y.Zhao,L.Huang,S.C.Rhea,J.Stribling,A.D.Joseph,andJ .D.Kubiatowicz, “Tapestry:Aglobal-scaleoverlayforrapidservicedeploy ment,”vol.22,no.1,Jan. 2004,pp.41–53. [5] G.S.Manku,M.Bawa,andP.Raghavan,“Symphony:Distributedh ashingina smallworld,”2003,pp.127–140. [6] “Gnutella,” http://www.gnutellaforums.com ,GnutellaForums,2009. [7] “Bittorrent,” http://www.bittorrent.com ,BitTorrent.Inc,,2008. [8] “Skype,” http://www.skype.com ,SkypeLimited,2010. [9] I.VesseyandG.Skinner,“Implementingberkeleysocketsins ystemV,release4,” in Proc.1990WinterUSENIXConf. Washington,DC:USENIXAssoc.,Jan.1990, pp.22–26. [10] “Apachetomcat,” http://tomcat.apache.org ,TheApacheSoftwareFoundation, 1999. [11] “Django:Thewebframeworkfortheperfectionistswithdead lines,” http://www.djangoproject.com ,DjangoSoftwareFoundation,2005. [12] “Rubyonrails,” http://www.rubyonrails.org ,RailCoreTeam,2003. [13] D.Kempe,A.Dobra,andJ.Gehrke,“Gossip-basedcomputation ofaggregate information,”in Proc.ofthe44-thAnnualIEEESymp.onFoundationsofComputer Science(FOCS'03) .Washington,DC,USA:IEEEComputerSociety,2003,p. 482. [14] M.JelasityandA.Montresor,“Epidemic-styleproactiveaggr egationinlargeoverlay networks,”in Proc.ofthe24-thInt'lConf.onDistributedComputingSystem s (ICDCS'04) .Washington,DC,USA:IEEEComputerSociety,2004,pp.102–109. [15] L.Massouli e,E.LeMerrer,A.-M.Kermarrec,andA.Ganesh,“Peercountinga nd samplinginoverlaynetworks:Randomwalkmethods,”in Proc.ofthe25-thannual 120

PAGE 121

ACMsymp.onPrinciplesofdistributedcomputing(PODC'06) .NewYork,NY, USA:ACM,2006,pp.123–132. [16] M.Bawa,H.Garcia-Molina,A.Gionis,andR.Motwani,“Estimati ngaggregateson apeer-to-peernetwork,”ComputerScienceDepartment,Stanf ordUniversity,Tech. Rep.,2003. [17] K.HorowitzandD.Malkhi,“Estimatingnetworksizefromlocal information,”vol.88, no.5.Amsterdam,TheNetherlands,TheNetherlands:Elsevier North-Holland, Inc.,2003,pp.237–243. [18] R.Mahajan,M.Castro,andA.Rowstron,“Controllingthecost ofreliabilityin peer-to-peeroverlays,”in Peer-to-PeerSystemsII ,ser.LectureNotesinComputer Science,vol.2735/2003.Berlin/Heidelberg:Springer,2003, pp.21–32. [19] E.Mane,E.Mopuru,K.Mehra,E.Mane,E.Mopuru,K.Mehra,andJ.Sriva stava, “Networksizeestimationinapeer-to-peernetwork,”Compu terScienceand Engineering,UniversityofMinnesota,Tech.Rep.,2005. [20] D.Psaltoulis,,D.Kostoulas,I.Gupta,K.Birman,andA.Demers, “Practical algorithmsforsizeestimationinlargeanddynamicgroups, ”in IEEEInt'lSymp.on 4-thNetworkComputingandApplications(NCA2005) ,2005,pp.41–48. [21] J.NonnenmacherandE.Biersack,“Optimalmulticastfeedback ,”in Proc.IEEE7-th AnnualJointConf.oftheIEEEComputerandComm.Societies(INFO COM'98) vol.3,1998,pp.964–971. [22] J.LiandD.yohLim,“Arobustaggregationtreeondistribute dhashtables,”in MIT StudentOxygen(SOW2004) ,2004. [23] J.-C.Bolot,T.Turletti,andI.Wakeman,“Scalablefeedbackc ontrolformulticast videodistributionintheinternet,”vol.24,no.4.NewYork ,NY,USA:ACM,1994, pp.58–67. [24] D.Dolev,O.Mokryn,andY.Shavitt,“Onmulticasttrees:Struc tureandsize estimation,”vol.14,no.3,Jun.2006,pp.557–567. [25] V.RamasubramanianandE.G.Sirer,“Beehive:O(1)lookupperfo rmancefor power-lawquerydistributionsinpeer-to-peeroverlays,” in Symp.onNetworked SystemsDesignandImplementation .USENIX,2004,pp.99–112. [26] C.Tang,Z.Xu,andS.Dwarkadas,“Peer-to-peerinformationr etrievalusing self-organizingsemanticoverlaynetworks,”in Proc.oftheACMSIGCOMM2003 Conf.onApplications,Technologies,Architectures,andProt ocolsforComputer Comm. ,A.Feldmann,M.Zitterbart,J.Crowcroft,andD.Wetherall, Eds.Karlsruhe, Germany:ACM,2003,pp.175–186. 121

PAGE 122

[27] E.G.S.BernardWong,AleksandrsSilvkins,“Approximatematchin gfor peer-to-peeroverlayswithcubit,”ComputingandInformat ionScience,Cornell University,Tech.Rep.,2008. [28] J.Albrecht,D.Patterson,andA.Vahdat,“Distributedresour cediscoveryon planetlabwithsword,”in WORLDS ,2004. [29] A.R.Bharambe,M.Agrawal,andS.Seshan,“Mercury:Supportingsc alable multi-attributerangequeries,”in SIGCOMM ,2004,pp.353–366. [30] M.Cai,M.Frank,J.Chen,andP.Szekely,“Maan:Amulti-attri buteaddressable networkforgridinformationservices,”in J.ofGridComputing .IEEEComputer Society,2003,p.184. [31] “Kazaa,” http://www.kazaa.com/ ,2010. [32] S.Johnstone,P.Sage,andP.Milligan,“iXChange-Aself-orga nisingsuperpeer networkmodel,”in IEEESymp.onComputersandComm. ,vol.00.Washington, DC,USA:IEEEComputerSociety,2005,pp.164–169. [33] L.Guo,S.Jiang,L.Xiao,andX.Zhang,“Exploitingcontentloca litiesforefcient searchinP2Psystems,”in Int'lSymp.onDistributedComputing .Springer,2004, pp.349–364. [34] ——,“Fastandlow-costsearchschemesbyexploitinglocalit iesinP2Pnetworks,” vol.65,no.6.Orlando,FL,USA:AcademicPress,Inc.,2005,pp.7 29–742. [35] K.Sripanidkulchai,B.M.Maggs,andH.Zhang,“Efcientconten tlocationusing interest-basedlocalityinpeer-to-peersystems,”in INFOCOM .IEEE,2003. [36] S.Jiang,L.Guo,X.Zhang,andH.Wang,“LightFlood:Minimizi ngredundant messagesandmaximizingscopeofpeer-to-peersearch,”vol .19,no.5.IEEE ComputerSociety,2008,pp.601–614. [37] L.A.Adamic,R.M.Lukose,A.R.Puniyani,andB.A.Huberman,“Searc hin power-lawnetworks,”vol.64.AmericanPhysicalSociety,2001 ,p.46135. [38] E.CohenandS.Shenker,“Replicationstrategiesinunstructu redpeer-to-peer networks,”vol.32,no.4.NewYork,NY,USA:ACM,2002,pp.177– 190. [39] Q.Lv,P.Cao,E.Cohen,K.Li,andS.Shenker,“Searchandreplicat ionin unstructuredpeer-to-peernetworks,”in Proc.ofthe16-thInt'lConf.onSupercomputing(ICS-02) .NewYork:ACMPress,2002,pp.84–95. [40] B.F.Cooper,“Quicklyroutingsearcheswithouthavingtomo vecontent,”in 4-thInt'l WorkshoponPeer-to-PeerSystems ,ser.LectureNotesinComputerScience,vol. 3640.Springer,2005,pp.163–172. 122

PAGE 123

[41] K.S.MingZhong,“Popularity-biasedrandomwalksforpeer-t o-peersearchunder thesquare-rootprinciple,”in Int'lWorkshoponPeer-to-PeerSystems ,2006. [42] N.Sarshar,P.Boykin,andV.Roychowdhury,“Percolationsear chinpowerlaw networks:Makingunstructuredpeer-to-peernetworksscal able,”in Proc.ofthe4-th IEEEint'lconf.onpeer-to-peercomputing ,2004. [43] X.Liu,Q.Huang,andY.Zhang,“Combs,needles,haystacks:Bal ancingpushand pullfordiscoveryinlarge-scalesensornetworks,”in Proc.ofthe2ndInt'lConf.on EmbeddedNetworkedSensorSystems(SenSys'04) .Baltimore,MD,USA:ACM, Nov.2004,pp.122–133. [44] M.NaorandU.Wieder,“Scalableanddynamicquorumsystems,”v ol.17,no.4, May2005,pp.311–322. [45] P.BoykinandT.W.Choi,“Netmodeler:ac++packageforanalyz ingcomplex networks.”[Online].Available: http://boykin.acis.u.edu/wiki/index.php/Netmodeler [46] J.Kleinberg,“TheSmall-WorldPhenomenon:AnAlgorithmicPerspec tive,”in Proc. ofthe32ndACMSymp.onTheoryofComputing ,2000. [47] ——,“Small-worldphenomenaandthedynamicsofinformation, ”in Advancesin NeuralInformationProcessingsystems(NIPS) .cambridge,MA:MITPress,2001, no.14. [48] A.RowstronandP.Druschel,“Pastry:Scalable,distributedo bjectlocationand routingforlarge-scalepeer-to-peersystems,”in IFIP/ACMInt.Conf.onDistributed SystemsPlatforms(Middleware) ,Heidelberg,Germany,Nov.2001,pp.329–350. [49] P.O.Boykin,J.S.A.Bridgewater,J.S.Kong,K.M.Lozev,B.A.Reza ei,andV.P. Roychowdhury,“Asymphonyconductedbybrunet,”vol.abs/0 709.4048,2007, informalpublication. [50] T.W.ChoiandP.O.Boykin,“Deetoo:Scalableunstructuredsea rchbuiltona structuredoverlay.”in 7-thInt'lWorkshoponHotTopicsinPeer-to-PeerSystems 2010. [51] “Brunet,” http://boykin.acis.u.edu/wiki/index.php/Brunet ,P.OscarBoykin,2010. [52] “Planet-lab,” http://www.planet-lab.org ,PrincetonUniversity,2007. [53] A.Ganguly,A.Agrawal,P.O.Boykin,andR.Figueiredo,“Ipoverp 2p:Enabling self-conguringvirtualipnetworksforgridcomputing,”i n InProc.of20-thInt'l ParallelandDistributedProcessingSymp.(IPDPS-2006) ,2006,pp.1–10. [54] A.Ganguly,A.Agrawal,P.O.Boykin,andR.J.Figueiredo,“Wow:Se lf-organizing wideareaoverlaynetworksofvirtualworkstations,”vol.5 ,no.2,2007,pp.151–172. 123

PAGE 124

[55] D.WolinskyandR.Figueiredo,“Simplifyingresourcesharin ginvoluntarygrid computingwiththegridappliance,”in IEEEInt'lSymp.onParallelandDistributed Processing,(IPDPS'08) ,2008,pp.1–8. [56] R.J.Figueiredo,P.O.Boykin,P.S.Juste,andD.Wolinsky,“I ntegratingoverlay andsocialnetworksforseamlessp2pnetworking,”in Proc.ofthe2008IEEE17-th WorkshoponEnablingTechnologies:InfrastructureforColl aborativeEnterprises (WETICE'08) .Washington,DC,USA:IEEEComputerSociety,2008,pp.93–98. [57] J.DeanandS.Ghemawat,“Mapreduce:Simplieddataprocessi ngonlarge clusters,”vol.51,no.1.NewYork,NY,USA:ACM,2008,pp.107– 113. [58] “Hadoop,” http://hadoop.apache.org/ ,TheApacheSoftwareFoundation,2007. 124

PAGE 125

BIOGRAPHICALSKETCH TaeWoongChoiearnedaB.E.intheelectricalengineeringdep artmentatYonsei University,Seoul,Koreain1999.Approximatelyforthreeand halfyears,heworkedas anengineeratHanaroTelecomInc.intheeldofHFC(HybridF iberCoaxial)network afterhisgraduation.In2003,heearnedaM.S.inelectrical andcomputerengineering atUniversityofFloridain2005andheiscontinuinghisacad emicexperiencetoearn hisPh.D.inElectricalandComputerEngineering.HejoinedAdva ncedComputing andInformationSystemsLabin2005.Hisresearchinterestsi ncludetheareaofP2P networksbuildingcomponentsthatcanbeputtogethertofor mnovelP2Psystems.He isworkingonanefcientnetworksizeestimationalgorithm sinthepurelydistributed networks.Heisalsoworkingonmodelingandevaluatingscal ableandefcientsearch systems.Thesearchmethodwillbeapplicabletoanytypeofs earchincludingmeta datasearch,partialmatching,regularexpressionsearch, andothermanygeneral searches. 125