ebook img

Peer-to-Peer Computing: Building Supercomputers with Web Technologies PDF

277 Pages·2007·4.568 MB·English
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Peer-to-Peer Computing: Building Supercomputers with Web Technologies

P1:OTE/SPH P2:OTE SVNY285-Loo October25,2006 20:48 Computer Communications and Networks i P1:OTE/SPH P2:OTE SVNY285-Loo October25,2006 20:48 TheComputerCommunicationsandNetworksseriesisarangeoftextbooks,monographs andhandbooks.Itsetsouttoprovidestudents,researchersandnon-specialistsalikewith asuregroundingincurrentknowledge,togetherwithcomprehensibleaccesstothelatest developmentsincomputercommunicationsandnetworking. Emphasisisplacedonclearandexplanatorystylesthatsupportatutorialapproach,sothat eventhemostcomplexoftopicsispresentedinalucidandintelligiblemanner. Alsointhisseries: AnInformationSecurityHandbook JohnM.D.Hunter 1-85233-180-1 MultimediaInternetBroadcasting:Quality,TechnologyandInterface AndySloaneandDaveLawrence(eds.) 1-85233-283-2 UMTS:Origins,ArchitectureandtheStandard PierreLescuyer(TranslationEditor:FrankBott) 1-85233-676-5 DesigningSoftwarefortheMobileContext:APractitioner’sGuide RomanLongoria 1-85233-785-0 OSSforTelecomNetworks KundanMisra 1-85233-808-3 TheQuintessentialPIC®Microcontroller2ndedition SidKatzen 1-85233-942-X FromP2PtoWebServicesandGrids:PeersinaClient/ServerWorld IanJ.Taylor 1-85233-869-5 IntelligentSpaces:TheApplicationofPervasiveICT AlanSteventonandSteveWright(eds) 1-84628-002-8 UbiquitousandPervasiveCommerce GeorgeRoussos(ed.) 1-84628-035-4 InformationAssurance:SecurityintheInformationEnvironment2ndedition AndrewBlythandGeraldL.Kovacich 1-84628-266-7 ii P1:OTE/SPH P2:OTE SVNY285-Loo October25,2006 20:48 Alfred Wai-Sing Loo Peer-to-Peer Computing Building Supercomputers with Web Technologies iii P1:OTE/SPH P2:OTE SVNY285-Loo October25,2006 20:48 AlfredWai-SingLoo,BSc,MSc,PhD,MBCS,MIMA,CEng,CSci,CMath,CITP DepartmentofComputingandDecisionSciences,LingnanUniversity, TuenMun,HongKong SeriesEditor ProfessorA.J.Sammes,BSc,MPhil,PhD,FBCS,CEng. CISMGroup,CranfieldUniversity,RMCS,Shrivenham,SwindonSN68LA, UK BritishLibraryCataloguinginPublicationData AcataloguerecordforthisbookisavailablefromtheBritishLibrary LibraryofCongressControlNumber:2006925862 ComputerCommunicationsandNetworksISSN1617-7975 ISBN-10:1-84628-381-7 Printedonacid-freepaper ISBN-13:978-1-84628-381-9 ©AlfredWai-SingLoo2007 Apartfromanyfairdealingforthepurposesofresearchorprivatestudy,orcriticismorreview,as permittedundertheCopyright,DesignsandPatentsAct1988,thispublicationmayonlybereproduced, storedortransmitted,inanyformorbyanymeans,withthepriorpermissioninwritingofthepublishers, orinthecaseofreprographicreproductioninaccordancewiththetermsoflicencesissuedbythe CopyrightLicensingAgency.Enquiriesconcerningreproductionoutsidethosetermsshouldbesentto thepublishers. Theuseofregisterednames,trademarks,etc.inthispublicationdoesnotimply,evenintheabsenceof aspecificstatement,thatsuchnamesareexemptfromtherelevantlawsandregulationsandtherefore freeforgeneraluse. Thepublishermakesnorepresentation,expressorimplied,withregardtotheaccuracyoftheinfor- mationcontainedinthisbookandcannotacceptanylegalresponsibilityorliabilityforanyerrorsor omissionsthatmaybemade. 9 8 7 6 5 4 3 2 1 springer.com iv P1:OTE/SPH P2:OTE SVNY285-Loo October25,2006 20:48 v Tomywife,Rebecca,forherloveandsupport P1:OTE/SPH P2:OTE SVNY285-Loo October25,2006 20:48 Contents 1 OverviewofPeer-to-PeerSystem.............................................. 1 1.1 Introduction..................................................................... 1 1.2 BatchModes.................................................................... 1 1.3 On-LineModes................................................................. 3 1.4 Client-Server.................................................................... 5 1.5 Peer-to-PeerSystems.......................................................... 6 2 File-SharingPeer-to-PeerSystem.............................................. 9 2.1 Introduction..................................................................... 9 2.2 FamousNapsterModel....................................................... 9 2.3 Gnutella.......................................................................... 10 2.4 BitTorrent........................................................................ 13 2.5 CommonFeatures.............................................................. 17 2.6 LegalChallenges............................................................... 17 3 TheNeedforMorePowerfulComputers.................................... 18 3.1 Introduction..................................................................... 18 3.2 ProblemsofParallelComputers............................................. 19 3.3 CPUPowerSharingExamples.............................................. 20 3.4 NeedforParallelAlgorithms................................................ 22 3.5 MetricsinParallelSystems.................................................. 23 3.6 Summary......................................................................... 27 4 ProblemsandSolutions........................................................... 28 4.1 Problems......................................................................... 28 4.2 DesirableCharacteristicsofP2PSystems................................. 29 4.3 EnablingTechnologies........................................................ 30 4.4 OverviewofOurSolution.................................................... 31 4.5 Comparison..................................................................... 32 4.6 Impact............................................................................ 33 vii P1:OTE/SPH P2:OTE SVNY285-Loo October25,2006 20:48 viii Contents 5 WebServerandRelatedTechnologies...................................... 34 5.1 Introduction................................................................. 34 5.2 WebServers................................................................ 34 5.3 ApacheTomcat............................................................ 35 5.4 StartingtheTomcatServer............................................... 40 5.5 BetterDevelopmentEnvironment...................................... 43 5.6 Directories.................................................................. 46 5.7 MappingBetweenURLandServlet................................... 50 5.8 SelectionofWebServers................................................ 53 6 IntroductiontoServlets......................................................... 56 6.1 Introduction................................................................. 56 6.2 Servlets...................................................................... 56 6.3 ServletLifecycle........................................................... 57 6.4 ServletCollaboration..................................................... 58 6.5 BasicStructureofServlet................................................ 59 6.6 SendingandReceivingInformation................................... 60 6.7 TestingyourFirstServlet................................................ 62 6.8 TestingSecondServlet(WithouthtmlFile).......................... 64 6.9 FurtherTests................................................................ 66 6.10 CompilingtheServlet.................................................... 66 7 JavaNetworkProgramming................................................... 67 7.1 Introduction................................................................. 67 7.2 URLConnection........................................................... 67 7.3 SocketCommunication................................................... 69 7.4 Datagram.................................................................... 79 7.5 Differences................................................................. 90 8 TestingandEnhancementsofServlets...................................... 91 8.1 Introduction................................................................. 91 8.2 DebuggingTechniques................................................... 91 8.3 GlobalParameters......................................................... 95 8.4 Synchronization........................................................... 101 8.5 TipstoSpeedupTesting................................................. 103 8.6 Troubleshooting........................................................... 104 9 PowerServer:Model1.......................................................... 106 9.1 Introduction................................................................. 106 9.2 ModelWithoutWebServer—Model1................................ 107 9.3 FirstTest.................................................................... 130 9.4 SecondTest................................................................. 131 9.5 Troubleshooting........................................................... 132 9.6 FurtherTests................................................................ 133 P1:OTE/SPH P2:OTE SVNY285-Loo October25,2006 20:48 Contents ix 10 PowerServer:Model2.......................................................... 134 10.1 Introduction................................................................. 134 10.2 PowerServerwithWebServer—Model2............................ 135 10.3 ServerSidePrograms..................................................... 139 10.4 Phase1Testing—invokeServerProgram............................. 141 10.5 Phase2Testing............................................................ 143 11 PowerServer:Model3.......................................................... 147 11.1 Introduction................................................................. 147 11.2 PowerServer—Model3.................................................. 147 11.3 ServerProgramofModel3.............................................. 148 11.4 ClientProgramofModel3.............................................. 151 11.5 divide.javaModule........................................................ 158 11.6 share2.java.................................................................. 158 11.7 Testing....................................................................... 158 11.8 ComparisonwithModel1............................................... 163 12 PowerServer:Model4.......................................................... 165 12.1 Introduction................................................................. 165 12.2 PowerServerwithWebServer—Model4............................ 165 12.3 ServerSideProgram...................................................... 166 12.4 TestingtheinvokeServer2Program.................................... 169 12.5 TestingtheSystem........................................................ 172 13 PowerServer:Model5.......................................................... 175 13.1 Introduction................................................................. 175 13.2 PowerServer—Model5.................................................. 175 13.3 ServerSideProgram...................................................... 176 13.4 ClientSideProgram...................................................... 176 13.5 Testing....................................................................... 182 13.6 ComparisonwithModel4............................................... 186 13.7 FurtherTests................................................................ 187 13.8 OtherImprovements...................................................... 187 14 WirelessP2PSystem............................................................. 188 14.1 Introduction................................................................. 188 14.2 IEEE802Standards....................................................... 189 14.3 Bluetooth.................................................................... 189 14.4 WirelessLAN.............................................................. 190 14.5 WirelessRouters........................................................... 190 14.6 Internet-EnabledDevices................................................ 190 14.7 ProblemsofMobilePhones............................................. 191 14.8 ExtendingthePowerofMobilePhones............................... 192 14.9 WirelessP2PSystemswithMobilePhones.......................... 193 P1:OTE/SPH P2:OTE SVNY285-Loo October25,2006 20:48 x Contents 15 ImplementationofWirelessP2PSystems.................................. 196 15.1 Introduction................................................................. 196 15.2 Client—MobilePhone.................................................... 196 15.3 Tier1ServerProgram—phoneServlet.java........................... 196 15.4 Tier-2ServerSideProgram.............................................. 201 15.5 ToolsforMobilePhoneDevelopment................................. 201 15.6 TestingtheWirelessP2P................................................. 201 15.7 ExperimentswithMoreSub-tasks..................................... 204 15.8 Conclusions................................................................. 207 16 ComputerArchitecture......................................................... 209 16.1 Introduction................................................................. 209 16.2 ClassificationofComputerArchitectures............................. 209 16.3 Granularity.................................................................. 213 16.4 GeneralorSpeciallyDesignedProcessors............................ 215 16.5 ProcessorNetworks....................................................... 215 16.6 SharedMemoryConnection............................................. 224 16.7 Summary.................................................................... 224 17 DistributedandParallelAlgorithms........................................ 227 17.1 Introduction................................................................. 227 17.2 OverviewofSerialSorting.............................................. 228 17.3 CharacteristicsofSortingAlgorithms................................. 234 17.4 ParallelSortingAlgorithmsforMIMDwith SharedMemory............................................................ 234 17.5 ParallelSortingAlgorithmsforMIMDwith DistributedMemory...................................................... 238 17.6 Conclusions................................................................. 238 18 InfrastructureandFutureDevelopment................................... 240 18.1 Infrastructure............................................................... 240 18.2 Incentives................................................................... 241 18.3 Maintenance................................................................ 242 18.4 FutureP2PDevelopment................................................ 244 18.5 ProblemsofData-SharingP2PSystem................................ 245 18.6 EfficientParallelAlgorithms............................................ 246 18.7 Re-VisitingSpeedUp..................................................... 246 18.8 Applications................................................................ 247 18.9 FurtherImprovements.................................................... 247 AppendixA:Data-SharingP2PAlgorithm.................................... 248 AppendixB:UsefullWebsites...................................................... 260 Bibliography............................................................................ 262 Index..................................................................................... 267 P1:OTE/SPH P2:OTE/SPH QC:FCH/UKS T1:FCH SVNY285-Loo October18,2006 7:7 1 Overview of Peer-to-Peer System 1.1 Introduction Peer-to-peer(P2P)computingisthesharingofresourcesbetweencomputers.Such resourcesincludeprocessingpower,knowledge,diskstorageandinformationfrom distributeddatabases(Kamath,2001).Inthelastseveralyears,abouthalfabillion dollarshavebeeninvestedincompaniesdevelopingP2Psystems. Thiskindofinterestisduetothesuccessofseveralhigh-profileandwell-known P2PapplicationssuchastheNapsterandOxfordanti-cancerprojects(Loo,2003). Theconceptofsharingresourcesisnotcompletelynew.Indeed,P2Psystemsare anaturalevolutioninsystemarchitecture.Itisworthwhiletohaveabrieflookat thisevolution. 1.2 Batch Modes Mainframecomputerswereimportanttoolsforlargeenterprises.Intheolddays, therewasonlyonecomputerinoneorganizationasthemachineswereprohibitively expensive. They required special rooms with air-conditioning. The operation of thesecomputers(Fig.1.1)isdescribednext. End users used to write down input data on special forms. These forms were passed to the data entry section periodically (e.g., once a day or once a month dependingonthenatureoftheprocess).Dataentryoperatorstypedthedatawith specialmachines,whichconvertedthedataintopunchcard,magnetictapeand/or magneticdisk.Suchinputmediumswerepassedtocomputerroom.Acomputer operator then fed the data into computer. The computer processed the data and printed the reports. Such reports were sent back to the users together with their inputforms. Obviously, this ‘batch processing’ mode of operation suffers from several problems: 1. Inputdataformsarecollectedperiodicallyasabatch.Itisnotuncommonthat users need to wait for a few days to get their computer reports. Such kinds of 1

See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.