




已阅读5页,还剩1页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
DISTRIBUTEDSYSTEMS,EDITION5CHAPTER1SOLUTIONSFM1LASTUPDATED12OCTOBER2011228PMGEORGECOULOURIS,JEANDOLLIMOREANDTIMKINDBERGANDGORDONBLAIR2012DISTRIBUTEDSYSTEMSCONCEPTSANDDESIGNEDITION5BYGEORGECOULOURIS,JEANDOLLIMOREANDTIMKINDBERGANDGORDONBLAIRADDISONWESLEYPEARSONEDUCATION2012CHAPTER1EXERCISESOLUTIONS11WEDEFINEADISTRIBUTEDSYSTEMASONEINWHICHHARDWAREORSOFTWARECOMPONENTSLOCATEDATNETWORKEDCOMPUTERSCOMMUNICATEANDCOORDINATETHEIRACTIONSONLYBYPASSINGMESSAGESWHATARETHECONSEQUENCESOFDEFININGADISTRIBUTEDSYSTEMINTHISMANNER11ANSACONCURRENCYBNOGLOBALCLOCKCINDEPENDENTFAILURESCHAPTER1SOLUTIONSFMPAGE1WEDNESDAY,OCTOBER12,2011230PMDISTRIBUTEDSYSTEMS,EDITION5CHAPTER1SOLUTIONSFM2LASTUPDATED12OCTOBER2011228PMGEORGECOULOURIS,JEANDOLLIMORE,TIMKINDBERGANDGORDONBLAIR201212HOWMIGHTTHECLOCKSINTWOCOMPUTERSTHATARELINKEDBYALOCALNETWORKBESYNCHRONIZEDWITHOUTREFERENCETOANEXTERNALTIMESOURCEWHATFACTORSLIMITTHEACCURACYOFTHEPROCEDUREYOUHAVEDESCRIBEDHOWCOULDTHECLOCKSINALARGENUMBEROFCOMPUTERSCONNECTEDBYTHEINTERNETBESYNCHRONIZEDDISCUSSTHEACCURACYOFTHATPROCEDURE12ANSSEVERALTIMESYNCHRONIZATIONPROTOCOLSAREDESCRIBEDINSECTION103ONEOFTHESEISCRISTIANSPROTOCOLBRIEFLY,THEROUNDTRIPTIMETTOSENDAMESSAGEANDAREPLYBETWEENCOMPUTERAANDCOMPUTERBISMEASUREDBYREPEATEDTESTSTHENCOMPUTERASENDSITSCLOCKSETTINGTTOCOMPUTERBBSETSITSCLOCKTOTT/2THESETTINGCANBEREFINEDBYREPETITIONTHEPROCEDUREISSUBJECTTOINACCURACYBECAUSEOFCONTENTIONFORTHEUSEOFTHELOCALNETWORKFROMOTHERCOMPUTERSANDDELAYSINTHEPROCESSINGTHEMESSAGESINTHEOPERATINGSYSTEMSOFAANDBFORALOCALNETWORK,THEACCURACYISPROBABLYWITHIN1MSFORALARGENUMBEROFCOMPUTERS,ONECOMPUTERSHOULDBENOMINATEDTOACTASTHETIMESERVERANDITSHOULDCARRYOUTCRISTIANSPROTOCOLWITHALLOFTHEMTHEPROTOCOLCANBEINITIATEDBYEACHINTURNADDITIONALINACCURACIESARISEINTHEINTERNETBECAUSEMESSAGESAREDELAYEDASTHEYPASSTHROUGHSWITCHESINWIDERAREANETWORKSFORAWIDEAREANETWORKTHEACCURACYISPROBABLYWITHIN510MSTHESEANSWERSDONOTTAKEINTOACCOUNTTHENEEDFORFAULTTOLERANCESEECHAPTER10FORFURTHERDETAILS13CONSIDERTHEIMPLEMENTATIONSTRATEGIESFORMASSIVELYMULTIPLAYERONLINEGAMESASDISCUSSEDINSECTION122INPARTICULAR,WHATADVANTAGESDOYOUSEEINADOPTINGASINGLESERVERAPPROACHFORREPRESENTINGTHESTATEOFTHEMULTIPLAYERGAMEWHATPROBLEMSCANYOUIDENTIFYANDHOWMIGHTTHEYBERESOLVED13ANSTHEADVANTAGESOFHAVINGASINGLESERVERMAINTAINAREPRESENTATIONOFTHEGAMEARETHAT1THEREISASINGLECOPYANDHENCENONEEDTOMAINTAINCONSISTENCYOFMULTIPLECOPIESAND2CLIENTSHAVEASINGLEPLACETOGOTODISCOVERTHISSTATETHEREMAYALSOBEADVANTAGESTOHAVINGAGLOBALVIEWOFTHEENTIRESYSTEMSSTATETHEPOTENTIALPROBLEMSARETHATTHISSINGLESERVERMAYFAILANDMAYALSOBECOMEABOTTLENECKAFFECTINGTHEPERFORMANCEANDSCALABILITYOFTHEAPPROACHTOHANDLEFAILURE,ITWOULDBENECESSARYTOINTRODUCEREPLICATION,WHICHINTURNWOULDREQUIREASOLUTIONTOMAINTAININGCONSISTENCYACROSSREPLICASTHEREAREANUMBEROFSOLUTIONSTOIMPROVINGPERFORMANCEANDSCALABILITYINCLUDINGRUNNINGTHESERVERONACLUSTERARCHITECTUREASDESCRIBEDINSECTION122,ORAGAINUSINGREPLICATIONANDLOADBALANCINGWITHINTHEDISTRIBUTEDENVIRONMENTALTERNATIVELY,APEERTOPEERSOLUTIONCANBEADOPTEDTHESETECHNIQUESARECOVEREDTHROUGHOUTTHEBOOK14AUSERARRIVESATARAILWAYSTATIONTHATSHEHASNEVERVISITEDBEFORE,CARRYINGAPDATHATISCAPABLEOFWIRELESSNETWORKINGSUGGESTHOWTHEUSERCOULDBEPROVIDEDWITHINFORMATIONABOUTTHELOCALSERVICESANDAMENITIESATTHATSTATION,WITHOUTENTERINGTHESTATIONSNAMEORATTRIBUTESWHATTECHNICALCHALLENGESMUSTBEOVERCOME14ANSTHEUSERMUSTBEABLETOACQUIRETHEADDRESSOFLOCALLYRELEVANTINFORMATIONASAUTOMATICALLYASPOSSIBLEONEMETHODISFORTHELOCALWIRELESSNETWORKTOPROVIDETHEURLOFWEBPAGESABOUTTHELOCALITYOVERALOCALWIRELESSNETWORKFORTHISTOWORK1THEUSERMUSTRUNAPROGRAMONHERDEVICETHATLISTENSFORTHESEURLS,ANDWHICHGIVESTHEUSERSUFFICIENTCONTROLTHATSHEISNOTSWAMPEDBYUNWANTEDURLSOFTHEPLACESSHEPASSESTHROUGHAND2THEMEANSOFPROPAGATINGTHEURLEGINFRAREDORAN80211WIRELESSLANSHOULDHAVEAREACHTHATCORRESPONDSTOTHEPHYSICALSPREADOFTHEPLACEITSELF15DISTRIBUTEDSYSTEMSAREGOINGTHROUGHAPERIODOFSIGNIFICANTCHANGE,WHICHCANBETRACEDBACKTOANUMBEROFINFLUENTIALTRENDSCANYOUIDENTIFYWHATTHESEMIGHTBE15ANSATHEEMERGENCEOFPERVASIVENETWORKINGTECHNOLOGYBTHEEMERGENCEOFUBIQUITOUSCOMPUTINGCOUPLEDWITHTHEDESIRETOSUPPORTUSERMOBILITYINDISTRIBUTEDSYSTEMSCHAPTER1SOLUTIONSFMPAGE2WEDNESDAY,OCTOBER12,2011230PMDISTRIBUTEDSYSTEMS,EDITION5CHAPTER1SOLUTIONSFM3LASTUPDATED12OCTOBER2011228PMGEORGECOULOURIS,JEANDOLLIMORE,TIMKINDBERGANDGORDONBLAIR2012CTHEINCREASINGDEMANDFORMULTIMEDIASERVICESDTHEVIEWOFDISTRIBUTEDSYSTEMSASAUTILITY16DUETOTHEINCREASINGMATURITYOFDISTRIBUTEDSYSTEMSINFRASTRUCTURE,ORGANIZATIONSAREMOVINGTOWARDSVIEWINGDISTRIBUTEDSYSTEMSASAUTILITYINTHISMODEL,RESOURCESAREPROVIDEDBYAPPROPRIATESERVICESUPPLIERSANDEFFECTIVELYRENTEDRATHERTHANOWNEDBYTHEENDUSEREXPLAINTHISMODELWITHRESPECTTOPHYSICALRESOURCESANDSOFTWARESERVICESCANYOUGIVEEXAMPLESOFSOMECOMPANIESTHATSUPPORTSUCHSOFTWARESERVICES16ANSAPHYSICALRESOURCESSUCHASSTORAGEANDPROCESSINGCANBEMADEAVAILABLETONETWORKEDCOMPUTERSREMOVINGTHENEEDTOOWNSUCHRESOURCESONTHEIROWNBSOFTWARESERVICESCANALSOBEMADEAVAILABLEACROSSTHEGLOBALINTERNETUSINGTHISAPPROACHEXAMPLEOFCOMPANIESSUPPORTINGSUCHSOFTWARESERVICESAREWWWGOOGLECOM,WWWYAHOOCOM17ASERVERPROGRAMWRITTENINONELANGUAGEFOREXAMPLECPROVIDESTHEIMPLEMENTATIONOFABLOBOBJECTTHATISINTENDEDTOBEACCESSEDBYCLIENTSTHATMAYBEWRITTENINADIFFERENTLANGUAGEFOREXAMPLEJAVATHECLIENTANDSERVERCOMPUTERSMAYHAVEDIFFERENTHARDWARE,BUTALLOFTHEMAREATTACHEDTOANINTERNETDESCRIBETHEPROBLEMSDUETOEACHOFTHEFIVEASPECTSOFHETEROGENEITYTHATNEEDTOBESOLVEDTOMAKEITPOSSIBLEFORACLIENTOBJECTTOINVOKEAMETHODONTHESERVEROBJECT17ANSASTHECOMPUTERSAREATTACHEDTOANINTERNET,WECANASSUMETHATINTERNETPROTOCOLSDEALWITHDIFFERENCESINNETWORKSBUTTHECOMPUTERSMAYHAVEDIFFERENTHARDWARETHEREFOREWEHAVETODEALWITHDIFFERENCESOFREPRESENTATIONOFDATAITEMSINREQUESTANDREPLYMESSAGESFROMCLIENTSTOOBJECTSACOMMONSTANDARDWILLBEDEFINEDFOREACHTYPEOFDATAITEMTHATMUSTBETRANSMITTEDBETWEENTHEOBJECTANDITSCLIENTSTHECOMPUTERSMAYRUNDIFFERENTOPERATINGSYSTEMS,THEREFOREWENEEDTODEALWITHDIFFERENTOPERATIONSTOSENDANDRECEIVEMESSAGESORTOEXPRESSINVOCATIONSTHUSATTHEJAVA/CLEVELACOMMONOPERATIONWOULDBEUSEDWHICHWILLBETRANSLATEDTOTHEPARTICULAROPERATIONACCORDINGTOTHEOPERATINGSYSTEMITRUNSONWEHAVETWODIFFERENTPROGRAMMINGLANGUAGESCANDJAVA,THEYUSEDIFFERENTREPRESENTATIONSFORDATASTRUCTURESSUCHASSTRINGS,ARRAYS,RECORDSACOMMONSTANDARDWILLBEDEFINEDFOREACHTYPEOFDATASTRUCTURETHATMUSTBETRANSMITTEDBETWEENTHEOBJECTANDITSCLIENTSANDAWAYOFTRANSLATINGBETWEENTHATDATASTRUCTUREANDEACHOFTHELANGUAGESWEMAYHAVEDIFFERENTIMPLEMENTORS,EGONEFORCANDTHEOTHERFORJAVATHEYWILLNEEDTOAGREEONTHECOMMONSTANDARDSMENTIONEDABOVEANDTODOCUMENTTHEMCHAPTER1SOLUTIONSFMPAGE3WEDNESDAY,OCTOBER12,2011230PMDISTRIBUTEDSYSTEMS,EDITION5CHAPTER1SOLUTIONSFM4LASTUPDATED12OCTOBER2011228PMGEORGECOULOURIS,JEANDOLLIMORE,TIMKINDBERGANDGORDONBLAIR201218WHATISCLIENTSERVERCOMPUTINGWHICHOFTHESEROLESISANACTIVEROLE,ANDWHICHISAPASSIVEONEEXPLAINREMOTEINVOCATIONINTHISCONTEXT18ANSCLIENTSERVERCOMPUTINGREFERSTOARUNNINGPROGRAMAPROCESSONANETWORKEDCOMPUTERTHATACCEPTSREQUESTSFROMPROGRAMSRUNNINGONOTHERCOMPUTERSTOPERFORMASERVICEANDRESPONDSAPPROPRIATELYCLIENTSAREACTIVEMAKINGREQUESTSANDSERVERSAREPASSIVETHEINTERACTIONBETWEENACLIENTANDASERVER,FROMTHEPOINTWHENTHECLIENTSENDSITSREQUESTTOWHENITRECEIVESTHESERVERSRESPONSE,ISCALLEDREMOTEINVOCATION19SUPPOSETHATTHEOPERATIONSOFTHEBLOBOBJECTARESEPARATEDINTOTWOCATEGORIESPUBLICOPERATIONSTHATAREAVAILABLETOALLUSERSANDPROTECTEDOPERATIONSTHATAREAVAILABLEONLYTOCERTAINNAMEDUSERSSTATEALLOFTHEPROBLEMSINVOLVEDINENSURINGTHATONLYTHENAMEDUSERSCANUSEAPROTECTEDOPERATIONSUPPOSINGTHATACCESSTOAPROTECTEDOPERATIONPROVIDESINFORMATIONTHATSHOULDNOTBEREVEALEDTOALLUSERS,WHATFURTHERPROBLEMSARISE19ANSEACHREQUESTTOACCESSAPROTECTEDOPERATIONMUSTINCLUDETHEIDENTITYOFTHEUSERMAKINGTHEREQUESTTHEPROBLEMSAREDEFININGTHEIDENTITIESOFTHEUSERSUSINGTHESEIDENTITIESINTHELISTOFUSERSWHOAREALLOWEDTOACCESSTHEPROTECTEDOPERATIONSATTHEIMPLEMENTATIONOFTHEBLOBOBJECTANDINTHEREQUESTMESSAGESENSURINGTHATTHEIDENTITYSUPPLIEDCOMESFROMTHEUSERITPURPORTSTOBEANDNOTSOMEOTHERUSERPRETENDINGTOBETHATUSERPREVENTINGOTHERUSERSFROMREPLAYINGORTAMPERINGWITHTHEREQUESTMESSAGESOFLEGITIMATEUSERSFURTHERPROBLEMSTHEINFORMATIONRETURNEDASTHERESULTOFAPROTECTEDOPERATIONMUSTBEHIDDENFROMUNAUTHORISEDUSERSTHISMEANSTHATTHEMESSAGESCONTAININGTHEINFORMATIONMUSTBEENCRYPTEDINCASETHEYAREINTERCEPTEDBYUNAUTHORISEDUSERS110THEINFOSERVICEMANAGESAPOTENTIALLYVERYLARGESETOFRESOURCES,EACHOFWHICHCANBEACCESSEDBYUSERSTHROUGHOUTTHEINTERNETBYMEANSOFAKEYASTRINGNAMEDISCUSSANAPPROACHTOTHEDESIGNOFTHENAMESOFTHERESOURCESTHATACHIEVESTHEMINIMUMLOSSOFPERFORMANCEASTHENUMBEROFRESOURCESINTHESERVICEINCREASESSUGGESTHOWTHEINFOSERVICECANBEIMPLEMENTEDSOASTOAVOIDPERFORMANCEBOTTLENECKSWHENTHENUMBEROFUSERSBECOMESVERYLARGE110ANSALGORITHMSTHATUSEHIERARCHICSTRUCTURESSCALEBETTERTHANTHOSETHATUSELINEARSTRUCTURESTHEREFORETHESOLUTIONSHOULDSUGGESTAHIERARCHICNAMINGSCHEMEEGTHATEACHRESOURCEHASANNAMEOFTHEFORMABCETCWHERETHETIMETAKENISOLOGNWHERETHEREARENRESOURCESINTHESYSTEMTOALLOWFORLARGENUMBERSOFUSERS,THERESOURCESAREPARTITIONEDAMONGSTSEVERALSERVERS,EGNAMESSTARTINGWITHAATSERVER1,WITHBATSERVER2ANDSOFORTHTHERECOULDBEMORETHANONELEVELOFPARTITIONINGASINDNSTOAVOIDPERFORMANCEBOTTLENECKSTHEALGORITHMFORLOOKINGUPANAMEMUSTBEDECENTRALISEDTHATIS,THESAMESERVERMUSTNOTBEINVOLVEDINLOOKINGUPEVERYNAMEACENTRALISEDSOLUTIONWOULDUSEASINGLEROOTSERVERTHATHOLDSALOCATIONDATABASETHATMAPSPARTSOFTHEINFORMATIONONTOPARTICULARSERVERSSOMEREPLICATIONISREQUIREDTOAVOIDSUCHCENTRALISATIONFOREXAMPLEITHELOCATIONDATABASEMIGHTBEREPLICATEDATMULTIPLEROOTSERVERSORIITHELOCATIONDATABASEMIGHTBEREPLICATEDINEVERYSERVERINBOTHCASES,DIFFERENTCLIENTSMUSTACCESSDIFFERENTSERVERSEGLOCALONESORRANDOMLYCHAPTER1SOLUTIONSFMPAGE4WEDNESDAY,OCTOBER12,2011230PMDISTRIBUTEDSYSTEMS,EDITION5CHAPTER1SOLUTIONSFM5LASTUPDATED12OCTOBER2011228PMGEORGECOULOURIS,JEANDOLLIMORE,TIMKINDBERGANDGORDONBLAIR2012111ADISTRIBUTEDSYSTEMISDESCRIBEDASSCALABLEWHENITREMAINSEFFECTIVEWHENTHEREISASIGNIFICANTINCREASEINTHENUMBEROFRESOURCESANDTHENUMBEROFUSERSHOWEVER,THESESYSTEMSSOMETIMESFACEPERFORMANCEBOTTLENECKSHOWCANTHESEBEAVOIDED111ANSCACHINGANDREPLICATIONMAYBEUSEDTOIMPROVETHEPERFORMANCEOFTHERESOURCESTHATAREVERYHEAVILYUSEDINADISTRIBUTEDSYSTEM112ASERVERPROCESSMAINTAINSASHAREDINFORMATIONOBJECTSUCHASTHEBLOBOBJECTOFEXERCISE17GIVEARGUMENTSFORANDAGAINSTALLOWINGTHECLIENTREQUESTSTOBEEXECUTEDCONCURRENTLYBYTHESERVERINTHECASETHATTHEYAREEXECUTEDCONCURRENTLY,GIVEANEXAMPLEOFPOSSIBLEINTERFERENCETHATCANOCCURBETWEENTHEOPERATIONSOFDIFFERENTCLIENTSSUGGESTHOWSUCHINTERFERENCEMAYBEPREVENTED112ANSFORCONCURRENTEXECUTIONSMORETHROUGHPUTINTHESERVERPARTICULARLYIFTHESERVERHASTOACCESSADISKORANOTHERSERVICEAGAINSTPROBLEMSOFINTERFERENCEBETWEENCONCURRENTOPERATIONSEXAMPLECLIENTASTHREADREADSVALUEOFVARIABLEXCLIENTBSTHREADREADSVALUEOFVARIABLEXCLIENTASTHREADADDS1TOITSVALUEANDSTORESTHERESULTINXCLIENTBSTHREADSUBTRACTS1FROMITSVALUEANDSTORESTHERESULTINXRESULTXX1IMAGINETHATXISTHEBALANCEOFABANKACCOUNT,ANDCLIENTSAANDBAREIMPLEMENTINGCREDITANDDEBITTRANSACTIONS,ANDYOUCANSEEIMMEDIATELYTHATTHERESULTISINCORRECTTOOVERCOMEINTERFERENCEUSESOMEFORMOFCONCURRENCYCONTROLFOREXAMPLE,FORAJAVASERVERUSESYNCHRONIZEDOPERATIONSSUCHASCREDITANDDEBITCHAPTER1SOLUTIONSFMPAGE5WEDNESDAY,OCTOBER12,2011230PMDISTRIBUTEDSYSTEMS,EDITION5CHAPTER1SOLUTIONSFM6LASTUPDATED12OCTOBER2011228PMGEORGECOULOURIS,JEANDOLLIMORE,TIMKINDBERGANDGORDONBLAIR2012113THEANSAREFERENCEMANUALANSA1989IDENTIFIEDEIGHTFORMSOFTRANSPARENCYINADISTRIBUTEDSYSTEMWHICHARETHETWOMOSTIMPORTANTTRANSPARENCIESAMONGTHESE113ANSTHETWOMOSTIMPORTANTTRANSPARENCIESAREACCESSANDLOCATIONTRANSPARENCYTHEIRPRESENCEORABSENCEMOSTSTRONGLYAFFECTSTHEUTILIZATIONOFDISTRIBUTEDRESOURCESTHEYARESOMETIMESREFERREDTOTOGETHERASNETWORKTRANSPARENCY114ONEOFTHEMAINSTANDARDTECHNOLOGICALCOMPONENTSOFWEBISTHEHYPERTEXTTRANSFERPROTOCOLHTTP,WHICHD
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2025年互联网新零售项目小程序定制开发与全方位营销合作协议
- 2025年智能电网绿色建筑EMC合同能源管理综合服务合同
- 2025年度普速铁路客车夹胶玻璃配件定制与安装服务合同
- 2025年度茶叶深加工产品质量检测服务协议
- 2025年度新能源汽车车位租赁与共享经济合作协议
- 2025年度种子产业信息互通与品牌推广战略合作合同
- 2025年特色餐厅场地租赁合作协议书
- 红酒年份收藏市场供应链优化及品牌合作推广协议
- 2025年度环保型砂砾石开采与综合生态修复工程采购协议
- 2025年度大气污染检测仪器供应与保养协议
- 麻醉师进修汇报
- 基坑监测评审汇报
- 2025-2026年秋季学期各周国旗下讲话安排表+2025-2026学年上学期升旗仪式演讲主题安排表
- 物业公司电瓶车管理制度
- GB/T 45875-2025精细陶瓷自然烧结条件下陶瓷粉体致密性的测定
- 肺占位性病变护理查房
- 中药足浴课件
- 广告创意与用户体验-第3篇-洞察阐释
- 幼儿园一日常规安全培训
- 5G基带芯片算法验证平台:从设计到实现的关键技术与实践
- 中邮理财招聘笔试题库2025
评论
0/150
提交评论