网络实验计算机网络l_第1页
网络实验计算机网络l_第2页
网络实验计算机网络l_第3页
网络实验计算机网络l_第4页
网络实验计算机网络l_第5页
已阅读5页,还剩48页未读 继续免费阅读

下载本文档

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

文档简介

ComputerNetworks

Lecture11JingXu(徐晶)Dept.ofElectronicsandInformationEng.HuazhongUniversityofScienceandTechnologyJuly.2012ProbleminChapter4:ThereIsMoreThanOneNetwork-2-ReviewIPmechanismsdealingwithheterogeneitydefineabest-effortservicemodelandprovideunreliabledatagramsdeliveryacommonpacketformat,andfragmentation/reassemblymechanismtoworkovernetworkswithdifferentMTUsaglobaladdressspaceforidentifyingallhosts,andARPmechanismtoworkovernetworkswithdifferentphysicaladdressingschemesIPmechanismsdealingwithscalehierarchicalaggregationinaddress,IPaddressesarepartitionedintonetworkandhostcomponents-3--4-Lecture9Chapter4.PacketSwitchingProblem:ThereIsMoreThanOneNetwork4.1SimpleInternetworking(IP)4.2Routing4.2.1NetworkasaGraph4.2.2DistanceVector(RIP)4.2.3LinkState(OSPF)4.2.4Metrics4.2.5RoutingforMobileHosts4.3GlobalInternet4.4Multicast4.5MultiprotocolLabelSwitching(MPLS)4.6Summary-5-ForwardingandRoutingDataInDataOutControlPlaneDataPlaneQueueingRoutingRoutingMessagesRouteLookupForwardingTableRoutingTableRoutingMessagesRoutingtableandforwardingtableRoutingtableisbuiltupbytheroutingalgorithmsasaprecursortobuildingtheforwardingtablecontainsmappingsfromnetworknumberstonexthopsForwardingtableisusedwhenapacketisbeingforwardedandsomustcontainenoughinformationtoaccomplishtheforwardingfunctioncontainsthemappingfromanetworknumbertoanoutgoinginterfaceandsomeMACinformation,suchastheEthernetaddressofthenexthop-6-Routinginthissectionweareconsideringtheproblemofroutinginthecontextofsmalltomidsizednetworks,notforanetworkthesizeoftheInternet.RoutinginthissectionDoesthissolutionscale?NOdesignedfornetworksoffairlymodestsize—fewerthanahundrednodestheprotocolsdescribedinthissectionarecollectivelyknownasintradomainroutingprotocols,orinteriorgatewayprotocols(IGPs)-7--8-Lecture94.2Routing4.2.1NetworkasaGraphNetworkasagraphRoutingprotocols4.2.2DistanceVector(RIP)4.2.3LinkState(OSPF)4.2.4Metrics4.2.5RoutingforMobileHosts-9-4.2.1NetworkasaGraphAnetworkcanberepresentedbyagraphnode:routeredge:linkedgecost:cost,delay,…Routingisessentiallyaproblemofgraphtheorytofindoutthelower-costpathbetweenanytwonodes-10-uyxwvz2213112535Graph:G=(N,E)N=setofrouters={u,v,w,x,y,z}E=setoflinks={(u,v),(u,x),(v,x),(v,w),(x,w),(x,y),(w,y),(w,z),(y,z)}Graphabstraction-11-Graphabstraction:costsuyxwvz2213112535c(x,x’)=costoflink(x,x’)-e.g.,c(w,z)=5costcouldalwaysbe1,orinverselyrelatedtobandwidth,orinverselyrelatedtocongestionCostofpath(x1,x2,x3,…,xp)=c(x1,x2)+c(x2,x3)+…+c(xp-1,xp)Question:What’stheleast-costpathbetweenuandz?Solution:Routingalgorithm,findingleast-costpath-12-ShortestPathGeneralizedistancetoweightedsettingDigraphG=(V,E)withweightfunctionW:ER(assigningrealvaluestoedges)Weightofpathp=v2…vkisShortestpath=apathoftheminimumweightApplicationsstatic/dynamicnetworkroutingrobotmotionplanningmap/routegenerationintraffic-13-Shortest-PathProblems Shortest-PathproblemsSingle-source(single-destination).Findashortestpathfromagivensource(vertexs)toeachofthevertices.Single-pair.Giventwovertices,findashortestpathbetweenthem.Solutiontosingle-sourceproblemsolvesthisproblemefficiently,too.All-pairs.Findshortest-pathsforeverypairofvertices.Dynamicprogrammingalgorithm.-14-Shortest-PathProblems Shortest-PathProblemsingraphtheoryBi-direction,weightedwithrealnumberMoregeneralcasesTwoalgorithmsDijkstra'sAlgorithmExchangeinformationgloballyBellman-FordAlgorithmExchangeinformationamongpairsInfact,thepracticalalgorithmsdeployedinnetworkingismuchmoresimply-15-Lecture94.2Routing4.2.1NetworkasaGraphNetworkasagraphRoutingprotocols4.2.2DistanceVector(RIP)4.2.3LinkState(OSPF)4.2.4Metrics4.2.5RoutingforMobileHosts-16-RoutingProtocolRunsamongroutersbasedonaroutingalgorithmChallenges:distributed,dynamic,...ConsistsoftwopartstopologyinformationdisseminationroutecomputationTypesdistancevectorlinkstatepathvector-17-TopologyInformationDisseminationHowtoobtaintopologyinformationwhenanodestartsuporaddsalinktoothernode,itadvertisesitsconnectivityinformationanodeknowsfailureofitsneighbornodeoralinkbycontinualprobingwithcontrolpacketbeingawareofthatithasnotreceivedperiodictopologyinformationforseveralcycles-18-TopologyInformationDisseminationWhentodisseminatetopologyinformationperiodicdistributionfrequencyamountofinformationtriggeredupdatecausedbychangesoftopologyandroutes,e.g.,node/linkfailure,routeschanges-19-Lecture94.2Routing4.2.1NetworkasaGraph4.2.2DistanceVector(RIP)DistancevectorroutingRIPProtocol4.2.3LinkState(OSPF)4.2.4Metrics4.2.5RoutingforMobileHosts-20-Distance-VectorRoutingBasicideaAnodeconstructsavectorofdistances(costs)toallothernodesThendistributesthevectortoitsimmediateneighborsAndcomputesitsshortestpathstoallothernodesaccordingtothedistancevectorsreceivedEventuallygetscompleteroutingtableafterrecursivedistancevectorexchangesandcomputations-21-Distance-VectorRoutingStep1:anodeinitiallysetsacostof1toitsimmediateneighbors,and∞toallothernodesinitsdistancevectorStep2:thenodesendsitsdistancevectortoitsimmediateneighborsStep3:basedonreceiveddistancevectorfromitsimmediateneighborY,thenodeXcomputesnewdistancetoeachnode(e.g.Z)indicatedinY’svectorbyaddingitsdistancetoY(i.e.1)toY’sdistancetothatnode(e.g.Z)comparesthisnewdistancewithitsownone:ifshorter,replacesitsownoneandrecordsNextHopisY-22-Distance-VectorRouting:ExampleInitialdistancevectors A:(0,1,1,∞,1,1,∞) B:(1,0,1,∞,∞,∞,∞) C:(1,1,0,1,∞,∞,∞) E:(1,∞,∞,∞,0,∞,∞) F:(1,∞,∞,∞,∞,0,1)dst.costNextHopB1BC1CD∞-E1EF1FG∞-InitialroutingtableatnodeADistanceVector–LocalViewDestCostNextHopB1BC1CD–E1EF1FG–23DestCostNextHopA1AC1CD–E–F–G–DestCostNextHopA1AB1BD1DE–F–G–DestCostNextHopA–B–C1CE–F–G1GDestCostNextHopA1AB–C–D–F–G–DestCostNextHopA1AB–C–D–E–G1GDestCostNextHopA–B–C–D1DE–F1FDistanceVector–1stUpdateDestCostNextHopB1BC1CD2CE1EF1FG2F24DestCostNextHopA1AC1CD2CE2AF2AG–DestCostNextHopA1AB1BD1DE2AF2AG2GDestCostNextHopA2CB2CC1CE–F2GG1GDestCostNextHopA1AB2AC2AD–F2AG–DestCostNextHopA1AB2AC2AD2GE2EG1GDestCostNextHopA2FB–C2DD1DE–F1FDistanceVector–2ndUpdateDestCostNextHopB1BC1CD2CE1EF1FG2F25DestCostNextHopA1AC1CD2CE2AF2AG3CDestCostNextHopA1AB1BD1DE2AF2AG2GDestCostNextHopA2CB2CC1CE3CF2GG1GDestCostNextHopA1AB2AC2AD3AF2AG3ADestCostNextHopA1AB2AC2AD2GE2EG1GDestCostNextHopA2FB3DC2DD1DE3FF1F-26-Example(contd.)dst.costNextHopB1BC1CD2CE1EF1FG2FFinalroutingtableatnodeAdst.costNextHopB1BC1CD∞-E1EF1FG∞-InitialroutingtableatnodeA-27-PracticalissuesHowtodistributetheroutingupdates?Solution1:PeriodicupdateEachnodeautomaticallysendsanupdatemessageineveryperiodevenifnothinghaschanged.Thisservestolettheothernodesknowthatthisnodeisstillrunning.Italsomakessurethattheykeepgettinginformationthattheymayneediftheircurrentroutesbecomeunviable.Thefrequency:secondstominutes.-28-PracticalissuesHowtodistributetheroutingupdates?Solution2:TriggeredupdateThemechanismhappenswheneveranodereceivesanupdatefromoneofitsneighborsWheneveranode’sroutingtablechanges,itsendsanupdatetoitsneighborsThismayleadtoachangeintheirtables,causingthemtosendanupdatetotheirneighbors.AadvertisesadistanceofinftytoEandupdatesitsneighborsCadvertisesadistanceof2toEviaABadvertisesadistanceof3toEviaCAupdatesitstableandadvertisesadistanceof4viaBCupdatesitstableandadvertisesadistanceof5viaA…Count-to-InfinityProblem29SolutionsforCount-to-InfinityProblemSolA:UseamaximumhopcountinsteadofinfinitySolB:SplitHorizonDonotsendupdatesontheneighborthatprovidedtheinfoforaparticularroute.E.g.:BdoesnotsendanupdateforEtoA,sinceitlearnedaboutEfromASolC:SplitHorizonwithPoisonReverseBadvertisesarouteofcostinfinitytoEtoensurethatBdoesnotuseBtogettoESolutionsdonotalwaysworkforloopswithmorethan3nodes30-31-Lecture94.2Routing4.2.1NetworkasaGraph4.2.2DistanceVector(RIP)DistancevectorroutingRIPProtocol4.2.3LinkState(OSPF)4.2.4Metrics4.2.5RoutingforMobileHosts-32-RoutingInformationProtocol(RIP)Anroutingprotocolbuiltondistance-vectoralgorithmdistancevectoralgorithmincludedinBSD-UNIXDistributionin1982distancemetric:#ofhops(max=15hops)Arouteradvertisesthecostsofreachingnetworksratherthantheonesofreachingotherrouters-33-RIPMessageFormat-34-FeaturesofRIPVersion:1,and2Supportsmultipleprotocolfamilies(notjustIP)Topologyinformationdisseminationevery30secondswheneveranupdatefromanotherroutercausesaroutertochangeitsroutingtableCosts(metrics)associatedwithlinksalllinkcostsequal1validdistancesare1through15,with16denotinginfinity-35-Lecture94.2Routing4.2.1NetworkasaGraph4.2.2DistanceVector(RIP)4.2.3LinkState(OSPF)ReliablefloodingRoutecalculationOSPFprotocol4.2.4Metrics4.2.5RoutingforMobileHosts-36-Link-StateRoutingBasicideaeverynodeknowshowtoreachitsdirectlyconnectedneighbors(linkstate),andadvertisesthisknowledgetoeveryothernodes,soeverynodecanobtainacompletemapofthenetworktobuilditsroutingtableReliesontwomechanismsreliablefloodingoflinkstatescalculationofroutesbasedonthecollectionofalltheaccumulatedlinkstates-37-FloodingFlooding:advertisedmessagesreachallthenodesReliableFloodingLinkstatemessageLink-statepacket,LSPtheIDofthenodethatcreatedthelinkstatemessagealistof<AdjacentNode,Cost>pairsinwhichthecostisassociatedwiththelinktothatadjacentnodeasequencenumberatimetoliveforthismessageHowtomakethelinkstatefloodingreliableusingacknowledgementsandretransmissionsbysequencenumbernotsendingthemessageback-38-ReliableFlooding(contd.)Newlinkstatesmessagesfloodedasquicklyaspossible,andoldonesremovedasquicklyaspossiblebytheusageofsequencenumberandTTLlongsequencenumberper-hopdecrementofTTLMinimizethetotalamountoflinkstatemessagesfloodedaroundthenetworkperiodicgenerationwithlongtimertriggeredondemand-39--40-TriggerofLinkStateFloodingSimilartoRIP,newlinkstatemessageisgeneratedwhenaperiodictimeexpires,orchangeoftopologyoccursDetectionoftopologychangenewnode/link:byitsadvertisementoflinkstatemessagefailureofnode/linkbylink-layerprotocolperiodic“hello”messageexchange-41-Lecture94.2Routing4.2.1NetworkasaGraph4.2.2DistanceVector(RIP)4.2.3LinkState(OSPF)ReliablefloodingRoutecalculationOSPFprotocol4.2.4Metrics4.2.5RoutingforMobileHosts-42-RouteCalculationBasedonDijkstraalgorithmNotation s:thenodeexecutingthealgorithm N:thesetofallnodesinthenetwork l(i,j):costassociatedwiththelinkbetweennodesi,j∈N M:thesetofnodescurrentlyincorporatedbythealgorithm C(n):thecostofthepathfromstonodenM={s}foreachninN-{s} C(n)=l(s,n)while(M≠N) findoutwsuchthatC(w)istheminimumforallnodesw∈(N-M) M=M∪{w} foreachn∈(N-M) C(n)=MIN(C(n),C(w)+l(w,n))-43-RealizationofDijkstraAlgorithm:

ForwardSearchEachroutermaintainstwolists,i.e.,TentativeandConfirmedEachlistcontainsasetofentriesintheformof(Destination,Cost,NextHop)FinalConfirmedlististheexpectedresult–routingtableatthisrouterStepsatanode(seenextpage)InitializetheConfirmedwiththeentry(Myself,0,-)SelectthelinkstatelistofnodeNextthatisjustaddedtotheConfirmedFor(eachNeighborofNext) theCosttothisNeighbor=thecostfrommyselftoNext+thecostfromNexttoNeighbor -IfNeighborisonneithertheConfirmednortheTentative,thenadd(Neighbor,Cost,NextHop)totheTentative,whereNextHopisthedirectionIgotoreachNext -IfNeighborisontheTentative,andtheCostislessthanthecurrentlylistedcostforNeighbor,thenreplacethecurrententrywith(Neighbor,Cost,NextHop),whereNextHopisthedirectionIgotoreachNextIftheTentativeisempty,stop;otherwise,picktheentryfromtheTentativewiththelowestcost,moveittotheConfirmed,andreturntostep2-45-ExampleofForwardSearchStep1234567Confirmed(D,0,-)(D,0,-)(D,0,-)(C,2,C)(D,0,-)(C,2,C)(D,0,-)(C,2,C)(B,5,C)(D,0,-)(C,2,C)(B,5,C)(D,0,-)(C,2,C)(B,5,C)(A,10,C)Tentative(B,11,B)(C,2,C)(B,11,B)(B,5,C)(A,12,C)(A,12,C)(A,10,C)RouterD-46-CommentsonLink-StateRoutingMeritsstabilizedquicklydoesnotgeneratemuchtrafficrespondsrapidlytotopologychangesDemeritstheamountoflinkstateinformationDifferencebetweenthelink-stateandthedistance-vectoralgorithmslink-state:eachnodetellsallothernodeonlythestateofitsdirectlyconnectedlinksdistance-vector:eachnodetellsitsdirectlyconnectednodesbuteverythingithaslearnedaboutdistances-47-Lecture94.2Routing4.2.1NetworkasaGraph4.2.2DistanceVector(RIP)4.2.3LinkState(OSPF)ReliablefloodingRoutecalculationOSPFprotocol4.2.4Metrics4.2.5RoutingforMobileHosts-48-OSPF(OpenShortestPathFirst)“open”:publiclyavailableusesLinkStatealgorithmLSpacketdisseminationtopologymapateachnoderoutecomputationusingDijkstra’salgorithmOSPFadvertisementcarriesoneentryp

温馨提示

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

最新文档

评论

0/150

提交评论