计算机网络复习-计算机网课件ch2p2p_第1页
计算机网络复习-计算机网课件ch2p2p_第2页
计算机网络复习-计算机网课件ch2p2p_第3页
计算机网络复习-计算机网课件ch2p2p_第4页
计算机网络复习-计算机网课件ch2p2p_第5页
已阅读5页,还剩70页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

Peer-to-Peer(P2P)networksandapplicationsClient/ServerWellpowerful,serverisadataClientsrequestfromVerysuccessfulWWW(HTTP),Webservices,

Server

Client/ServerScalabilityishardtoPresentsasinglepointofRequiresUnusedresourcesatthenetworkP2PsystemstrytoaddresstheseWhatis“P2Pisaclassofapplicationsthattakeadvantageofresources–storage,cycles,content,humanpresence–availableattheedgesoftheInternet.Itis“AdistributednetworkVariousdefinitionsseemtoagreesharingofdirectcommunicationbetweenequalsnocentralizedP2PAllnodesarebothclientsandserversProvideandAnynodecaninitiateNodesareNocentralizeddata

“Theultimateformofdemocracyonthe“Theultimatethreattocopy-rightprotectionontheInternet”

P2P&BecauseaccessingthesedecentralizedresourcesmeansoperatinginanenvironmentofunstableandunpredictableIPaddresses,P2PnodesmustoperateoutsidetheDNSsystemandhavesignificant,ortotalautonomyfromcentralservers”(此时不需要域名,直接通过**ComparedwithClient-serverFile学生

学生

学生学生

学生学生

学生

学生ComparedwithClient-serverFile与传统的客户端-服务器方式相学生学生 ? 学生学生P2PFile学生学生学生学生学生学生学生学学生学生学生 学5 P2P 学5 率作理统率作理统P2PFileDistributionP2PScalabilityofP2PArchitectureP2PBitTorrentSearchingforInformationinaP2PCommunityCentralizedIndex集中式管理QueryFloodingHierarchicalOverlayCaseStudy:P2PInternetTelephonywithPeer-to-PeerContentPopularfilesharingP2PNapster,Gnutella,Kazaa,LargescalesharingofUserAmakesfiles(music,video,etc.)ontheircomputeravailabletoothersUserBconnectstothenetwork,searchesforfilesanddownloadsfilesdirectlyfromuserAIssuesofcopyrightFileDistribution:Server-ClientvsQuestion:HowmuchtimetodistributefilefromoneservertoNpeers?

us:serveruploadsizesizeuNNetworkabundantdi:peeriF F Network(withabundantbandwidth)serversequentiallysendsNcopies:NF/usclientitakesF/ditimetodownloadTimetodistributeFtoNclientsusingclient/server

=dcs=max{NF/us,F/min(di)iincreaseslinearlyini(forlargeF F Network(withabundantbandwidth)servermustsendonecopy:F/ustimetoclientitakesF/ditoNFbitsmustbedownloaded(aggregate)fastestpossibleuploadrate:us+ddP2P=max{F/us,F/min(di)i,NF/(us+ui)Server-clientvs.P2P:3Client-21005NMinimumDistributionClientuploadrate=3Client-21005NMinimumDistributionFiledistribution:Efficientcontentdistributionsystemusingfileswarming.Usuallydoesnotperformallthefunctionsofatypicalp2psystem,likesearching.CacheLogicestimated(around2003orso)thatBitTorrentTrafficaccountsforroughly35%ofalltrafficontheInternet.BitTorrent比特型例子BT原理普通的HTTP/FTP下载使用TCP/IP协议,BitTorrent协议是构于TCP/IP协议之上的一个P2P文件传输协议BitTorrent协议本身也包含了很多具体的内容协议和扩展协议,并不断扩充中BitTorrent比特根据BitTorrent协议,文件发布者会根据要发布的文件生成提一个.torrent文件,即种子文件,也简称为“种子”Tracker:收集下载者信息的服务器,并将此信息提供给其载者,使下载者们相互连接起来,传输数做种:发布者提供下载任务的全部内容的行为;下载者下载完后继续提供给他人下载的行为BitTorrent比特.torrent文件就是被下载文件的“索引Filedistribution:P2Pfiletracker:tracksparticipatingin

torrent:groupofpeersexchangingchunksofafileobtainof

filedividedinto256KBpeerjoininghasnochunks,butwillaccumulatethemoverregisterswithtrackertogetlistofconnectstosubsetofpeerswhiledownloading,peeruploadschunkstopeersmaycomeandoncepeerhasentirefile,itmay(selfishly)leave(altruistically)BT:FileToshareafileorgroupoffiles,apeerfirsta.torrentfile,asmallfilethatmetadataaboutthefilestobeshared,Informationaboutthetracker,thecomputercoordinatesthefilePeersfirstobtaina.torrentfile,andthenconnecttothespecifiedtracker,whichtellsthemfromwhichotherpeerstodownloadthepiecesofthefile.OverallAWebA

CC

BB

OverallAWebA

CC

BB

OverallAWebA

CC

BB

OverallWeb

CCBABA

OverallWeb

CCBABA

OverallWeb

CCBABA

BT:The.torrentTheURLofthePieces<hash1,hash2,…,hashPieceNameoftheLengthoftheBT:TheIPaddress,port,peerStateinformation(CompletedorReturnsarandomlistofBT:Pullingatanygiventime,differentpeershavesubsetsoffileperiodically,apeer(Alice)askseachneighborlistofchunksthattheyAlicesendsrequestsforhermissingBT:PiecesandSub-Apieceisbrokenintosub-pieces...typically16KBinsizeUntilapieceisassembled,onlydownloadthesub-piecesofthatpieceonlyThispolicyletspiecesassembleBT:WhentransferringdataoverTCP,alwayshaveseveralrequestspendingatonce,toavoidadelaybetweenpiecesbeingsent.Atanypointintime,somenumber,typically5,arerequestedsimultaneously.Everytimeapieceorasub-piecearrives,arequestissentBT:PieceTheorderinwhichpiecesareselectedbydifferentpeersiscriticalforgoodperformanceIfaninefficientpolicyisused,thenpeersmayendupinasituationwhereeachhasallidenticalsetofeasilyavailablepieces,andnoneofthemissingones.Iftheoriginalseedisprematurelytakendown,thenthefilecannotbecompletelydownloaded!Whatare“goodpolicies?”BT:ChunkStrictFirstRarestGeneralRandomFirstSpecialcase,attheEndgameSpecialRarestPieceDeterminethepiecesthataremostrareamongyourpeers,anddownloadthosefirst.ThisensuresthatthemostcommonlyavailablepiecesarelefttilltheendtoBT:SendingAlicesendschunkstofourneighborssendingherchunksatthehighestre-evaluatetop4every10every30secs:randomlyselectanotherpeer,startssendingchunksnewlychosenpeermayjointop“optimisticallyunchoke…障碍Chokingisatemporaryrefusaltoupload.ItisoneofBitTorrent’smostpowerfulideatodealwithfreeriders(thosewhoonlydownloadbutneverTodiscovercurrentlyunusedconnectionsarethantheonesbeingToprovideminimalservicetonewWithhigheruploadrate,canfindbettertradingpartners&getfileWithhigheruploadrate,canfindbettertradingpartners&getfilefaster!Alice“optimisticallyunchokes” esoneofBob’stop-fourproviders;Bob esoneofAlice’stop-fourUpload-OnlyOncedownloadiscomplete,apeerhasnodownloadratestouseforcomparisonnorhasanyneedtousethem.Thequestionis,whichnodestouploadto?Policy:Uploadtothosewiththebestuploadrate.Thisensuresthatpiecesgetreplicatedfaster,andnewseedersarecreatedfast下面 软件界搜索BT资以狗狗影视为搜索BT资以狗狗影视为P2PFileDistributionP2PScalabilityofP2PArchitectureP2PBitTorrentSearchingforInformationinaP2PCommunityCentralizedIndex集中式管理QueryFloodingHierarchicalOverlayCaseStudy:P2PInternetTelephonywithP2P:searchingforIndexinP2Psystem:mapsinformationtopeerlocation(location=IPaddress&portnumber).Filesharing(ege-Indexdynamicallytracksthelocationsoffilesthatpeersshare.PeersneedtoindexwhattheyPeerssearchindextodeterminewherefilescanbefound

InstantIndexmapsusernamestolocations.WhenuserstartsIMapplication,itneedstoinformindexofitsPeerssearchindextodetermineIPaddressofuser.Unstructured(queryStructured(DistributedHashCentralizedoriginal“Napster”whenpeerconnects,informscentralIP Alicequeriesfor“Hey Alicerequestsfilefrom

directory111

3Centralized filetransferisdecentralized,filetransferisdecentralized,butlocatingcontentishighly Lowper-nodeLimitedbandwidthShortlocationHighsuccessFaultSinglepointof

LimitedPossiblycopyright

Napster:howdoesitApplication-level,client-serverprotocoloverpoint-pointFourConnecttoNapsterUploadyourlistoffiles(push)toGive tosearchthefulllistSelect“best”ofcorrectanswers.Filelistis

searchatUserpingshoststhathavedata.Looksforbesttransferrate.

UserretrievesQueryfullynocentralusedbyEachpeerindexesthefilesitmakesavailableforsharing(andnootherfiles)

overlaynetwork:edgebetweenpeerXandYifthere’saTCPallactivepeersedgesformoverlayedge:virtualphysical)givenpeertypicallyconnectedwith<10overlayneighborsGnutella:QueryFileQuerymessagesentoverexistingTCPpeersQuerysentover

Gnutella:PeerjoiningpeerAlicemustfindanotherpeerinGnutellanetwork:uselistofcandidatepeersAlicesequentiallyattemptsTCPconnectionswithcandidatepeersuntilconnectionsetupwithBobFlooding:AlicesendsPingmessagetoBob;BobforwardsPingmessagetohisoverlayneighbors(whothenforwardtotheirneighbors….)peersreceivingPingmessagerespondtoAlicewithPongmessageAlicereceivesmanyPongmessages,andcanthensetupadditionalTCPconnectionsSearchingbyIfyoudon’thavethefileyouwant,query7ofyourIftheydon’thaveit,theycontact7oftheirneighbors,foramaximumhopcountof10.Requestsareflooded,thereisnotreeNoloopingbutpacketsmaybereceivedtwice.Reversepathfool.*TTL=

TTL=TTL=TTL=YGnutellaLimitedper-nodeFaultHighbandwidthLongtimetolocateNoguaranteeonsuccessPossiblyunbalanced

Hierarchicalbetweencentralizedindex,queryfloodingeachpeeriseitherasupernodeorassignedtoasupernodeTCPconnectionbetweenpeeranditssupernode.TCPconnectionssomepairsofsuperSupernodetracksinits

ordinarypeerg

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论