




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡介
Chapter4-4routingandIProutingroutingandIProuting2/51Chapter4:NetworkLayer4.1Introduction4.2Virtualcircuitanddatagramnetworks4.3What’sinsidearouter4.4IP:InternetProtocolDatagramformatIPv4addressingICMPIPv64.5RoutingalgorithmsLinkstateDistanceVectorHierarchicalrouting4.6RoutingintheInternetRIPOSPFBGP4.7BroadcastandmulticastroutingroutingandIProuting3/51LogicalStructureofInternetAdhocinterconnectionofnetworksNoparticulartopologyVastlydifferentrouter&linkcapacitiesSendpacketsfromsourcetodestinationbyhoppingthroughnetworksRouterconnectonenetworktoanotherDifferentpathstodestinationmayexisthosthostrouterrouterrouterrouterrouterrouterroutingandIProuting4/51GettingtoaDestinationHowdoyougetdrivingdirections?IntersectionsroutersRoadslinks/networksRoadschangeslowlyroutingandIProuting5/51Whatisrouting?R3ABCR1R2R4DEFR5R5FR3ER3DNextHopDestinationDDroutingandIProuting6/51Whatisrouting?R3ABCR1R2R4DEFR5R5FR3ER3DNextHopDestinationDDDD163241DataOptions(ifany)DestinationAddressSourceAddressHeaderChecksumProtocolTTLFragmentOffsetFlagsFragmentIDTotalPacketLengthT.ServiceHLenVer20bytesroutingandIProuting7/51Whatisrouting?ABCR1R2R3R4DEFR5routingandIProuting8/51BridgeroutingandIProuting9/511230111valueinarrivingpacket’sheaderroutingalgorithmlocalforwardingtableheadervalueoutputlink01000101011110013221Interplaybetweenrouting,forwardingroutingandIProuting10/51uyxwvz2213112535Graph: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)}GraphabstractionRemark:GraphabstractionisusefulinothernetworkcontextsExample:P2P,whereNissetofpeersandEissetofTCPconnectionsroutingandIProuting11/51Graphabstraction: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?Routingalgorithm:algorithmthatfindsleast-costpathroutingandIProuting12/51RoutingAlgorithmclassificationGlobalordecentralizedinformation?Global:allroutershavecompletetopology,linkcostinfo“l(fā)inkstate”algorithmsDecentralized:
routerknowsphysically-connectedneighbors,linkcoststoneighborsiterativeprocessofcomputation,exchangeofinfowithneighbors“distancevector”algorithmsStaticordynamic?Static:
routeschangeslowlyovertimeDynamic:
routeschangemorequicklyperiodicupdateinresponsetolinkcostchangesroutingandIProuting13/51Chapter4:NetworkLayer4.1Introduction4.2Virtualcircuitanddatagramnetworks4.3What’sinsidearouter4.4IP:InternetProtocolDatagramformatIPv4addressingICMPIPv64.5RoutingalgorithmsLinkstateDistanceVectorHierarchicalrouting4.6RoutingintheInternetRIPOSPFBGP4.7BroadcastandmulticastroutingroutingandIProuting14/51ALink-StateRoutingAlgorithmDijkstra’salgorithmnettopology,linkcostsknowntoallnodesplishedvia“l(fā)inkstatebroadcast”allnodeshavesameinfocomputesleastcostpathsfromonenode(‘source”)toallothernodesgivesforwardingtableforthatnodeiterative:afterkiterations,knowleastcostpathtokdest.’sNotation:c(x,y):linkcostfromnodextoy;=∞ifnotdirectneighborsD(v):currentvalueofcostofpathfromsourcetodest.vp(v):predecessornodealongpathfromsourcetovN':setofnodeswhoseleastcostpathdefinitivelyknownroutingandIProuting15/51Dijsktra’sAlgorithm1Initialization:
2N'={u}3forallnodesv4ifvadjacenttou5thenD(v)=c(u,v)6elseD(v)=∞
78Loop
9findwnotinN'suchthatD(w)isaminimum10addwtoN'
11updateD(v)forallvadjacenttowandnotinN':12D(v)=min(D(v),D(w)+c(w,v))13/*newcosttoviseitheroldcosttovorknown14shortestpathcosttowpluscostfromwtov*/15untilallnodesinN'
routingandIProuting16/51Dijkstra’salgorithm:exampleStep012345N'uuxuxyuxyvuxyvwuxyvwzD(v),p(v)2,u2,u2,uD(w),p(w)5,u4,x3,y3,yD(x),p(x)1,uD(y),p(y)∞2,xD(z),p(z)∞∞4,y4,y4,yuyxwvz2213112535routingandIProuting17/51Dijkstra’salgorithm:example(2)uyxwvzResultingshortest-pathtreefromu:vxywz(u,v)(u,x)(u,x)(u,x)(u,x)destinationlinkResultingforwardingtableinu:routingandIProuting18/51Dijkstra’salgorithm,discussionAlgorithmcomplexity:nnodeseachiteration:needtocheckallnodes,w,notinNn(n+1)/2comparisons:O(n2)moreefficientimplementationspossible:O(nlogn)Oscillationspossible:e.g.,linkcost=amountofcarriedtrafficADCB11+ee0e1100ADCB2+e0001+e1ADCB02+e1+e100ADCB2+e0e01+e1initially…puterouting…pute…puteroutingandIProuting19/51Dijkstra’salgorithm:example(2)uyxwvzResultingshortest-pathtreefromu:vxywz(u,v)(u,x)(u,x)(u,x)(u,x)destinationlinkResultingforwardingtableinu:routingandIProuting20/51Dijkstra’sAlgorithm:ConceptNodeSetsDoneAlreadyhaveleastcostpathtoitHorizon:Reachablein1hopfromnodeinDoneUnseen:CannotreachdirectlyfromnodeinDoneLabeld(v)=pathcostFromstovPathKeeptrackoflastlinkinpathAEFCDB23631123SourceNodeDoneHorizonUnseen0253
CurrentPathCostsroutingandIProuting21/51Dijkstra’sAlgorithm:InitiallyNonodesdoneSourceinhorizonAEFCDB23631123SourceNodeDoneHorizonUnseen0
CurrentPathCostsroutingandIProuting22/51Dijkstra’sAlgorithm:Initiallyd(v)tonodeAshowninredOnlyconsiderlinksfromdonenodesAEFCDB23631123SourceNodeDoneHorizonUnseen0263
CurrentPathCostsroutingandIProuting23/51Dijkstra’sAlgorithmSelectnodevinhorizonwithminimumd(v)AddlinkusedtoaddnodetoshortestpathtreeUpdated(v)informationAEFCDB23631123SourceNodeDoneHorizonUnseen023
CurrentPathCosts65routingandIProuting24/51Dijkstra’sAlgorithmRepeat…AC23631123SourceNodeDoneHorizonUnseen0253
CurrentPathCostsFBDEroutingandIProuting25/51Dijkstra’sAlgorithmUpdated(v)valuesCancauseadditionofnewnodestohorizon2631123SourceNodeDoneHorizonUnseen0243
6CurrentPathCostsAC3DBEFroutingandIProuting26/51Dijkstra’sAlgorithmFinaltreeshowningreen2631123SourceNode024356AC3DBEFroutingandIProuting27/51Chapter4:NetworkLayer4.1Introduction4.2Virtualcircuitanddatagramnetworks4.3What’sinsidearouter4.4IP:InternetProtocolDatagramformatIPv4addressingICMPIPv64.5RoutingalgorithmsLinkstateDistanceVectorHierarchicalrouting4.6RoutingintheInternetRIPOSPFBGP4.7BroadcastandmulticastroutingroutingandIProuting28/51DistanceVectorAlgorithmBellman-FordEquation(dynamicprogramming)Definedx(y):=costofleast-costpathfromxtoyThendx(y)=min{c(x,v)+dv(y)}whereministakenoverallneighborsvofxvroutingandIProuting29/51Bellman-Fordexampleuyxwvz2213112535Clearly,dv(z)=5,dx(z)=3,dw(z)=3du(z)=min{c(u,v)+dv(z),c(u,x)+dx(z),c(u,w)+dw(z)}=min{2+5,1+3,5+3}=4Nodethatachievesminimumisnexthopinshortestpath?forwardingtableB-Fequationsays:routingandIProuting30/51DistanceVectorAlgorithmDx(y)=estimateofleastcostfromxtoyNodexknowscosttoeachneighborv:c(x,v)NodexmaintainsdistancevectorDx=[Dx(y):y?N]Nodexalsomaintainsitsneighbors’distancevectorsForeachneighborv,xmaintains
Dv=[Dv(y):y?N]routingandIProuting31/51Distancevectoralgorithm(4)Basicidea:
Fromtime-to-time,eachnodesendsitsowndistancevectorestimatetoneighborsAsynchronousWhenanodexreceivesnewDVestimatefromneighbor,itupdatesitsownDVusingB-Fequation:Dx(y)←minv{c(x,v)+Dv(y)}foreachnodey?NUnderminor,naturalconditions,theestimateDx(y)convergetotheactualleastcost
dx(y)routingandIProuting32/51DistanceVectorAlgorithm(5)Iterative,asynchronous:eachlocaliterationcausedby:locallinkcostchangeDVupdatemessagefromneighborDistributed:eachnodenotifiesneighborsonlywhenitsDVchangesneighborsthennotifytheirneighborsifnecessarywaitfor(changeinlocallinkcostormsgfromneighbor)puteestimatesifDVtoanydesthaschanged,notifyneighborsEachnode:routingandIProuting33/51xyzxyz027∞∞∞∞∞∞fromcosttofromfromxyzxyz0fromcosttoxyzxyz∞∞∞∞∞costtoxyzxyz∞∞∞710costto∞201∞∞∞201710timexz127ynodextablenodeytablenodeztableDx(y)=min{c(x,y)+Dy(y),c(x,z)+Dz(y)}
=min{2+0,7+1}=2Dx(z)=min{c(x,y)+
Dy(z),c(x,z)+Dz(z)}=min{2+1,7+0}=332routingandIProuting34/51xyzxyz027∞∞∞∞∞∞fromcosttofromfromxyzxyz023fromcosttoxyzxyz023fromcosttoxyzxyz∞∞∞∞∞costtoxyzxyz027fromcosttoxyzxyz023fromcosttoxyzxyz023fromcosttoxyzxyz027fromcosttoxyzxyz∞∞∞710costto∞201∞∞∞201710201710201310201310201310201310timexz127ynodextablenodeytablenodeztableDx(y)=min{c(x,y)+Dy(y),c(x,z)+Dz(y)}
=min{2+0,7+1}=2Dx(z)=min{c(x,y)+
Dy(z),c(x,z)+Dz(z)}=min{2+1,7+0}=3routingandIProuting35/51DistanceVector:linkcostchangesLinkcostchanges:nodedetectslocallinkcostchangeupdatesroutinginfo,recalculates
distancevectorifDVchanges,notifyneighbors“goodnewstravelsfast”xz1450y1Attimet0,ydetectsthelink-costchange,updatesitsDV,andinformsitsneighbors.Attimet1,zreceivestheupdatefromyandupdatesitstable.ItcomputesanewleastcosttoxandsendsitsneighborsitsDV.Attimet2,yreceivesz’supdateandupdatesitsdistancetable.y’sleastcostsdonotchangeandhenceydoesnotsendanymessagetoz.routingandIProuting36/51DistanceVector:linkcostchangesLinkcostchanges:goodnewstravelsfastbadnewstravelsslow-“counttoinfinity”problem!44iterationsbeforealgorithmstabilizes:seetextPoisonedreverse:
IfZroutesthroughYtogettoX:ZtellsYits(Z’s)distancetoXisinfinite(soYwon’troutetoXviaZ)willthiscompletelysolvecounttoinfinityproblem?xz1450y60routingandIProuting37/51ComparisonofLSandDValgorithmsMessagecomplexityLS:withnnodes,Elinks,O(nE)msgssentDV:exchangebetweenneighborsonlyconvergencetimevariesSpeedofConvergenceLS:O(n2)algorithmrequiresO(nE)msgsmayhaveoscillationsDV:convergencetimevariesmayberoutingloopscount-to-infinityproblemRobustness:whathappensifroutermalfunctions?LS:
nodecanadvertiseincorrectlinkcosteachnodecomputesonlyitsowntableDV:DVnodecanadvertiseincorrectpathcosteachnode’stableusedbyotherserrorpropagatethrunetworkroutingandIProuting38/51Chapter4:NetworkLayer4.1Introduction4.2Virtualcircuitanddatagramnetworks4.3What’sinsidearouter4.4IP:InternetProtocolDatagramformatIPv4addressingICMPIPv64.5RoutingalgorithmsLinkstateDistanceVectorHierarchicalrouting4.6RoutingintheInternetRIPOSPFBGP4.7BroadcastandmulticastroutingroutingandIProuting39/51HierarchicalRoutingscale:with200milliondestinations:can’tstorealldest’sinroutingtables!routingtableexchangewouldswamplinks!
administrativeautonomyinternet=networkofnetworkseachnetworkadminmaywanttocontrolroutinginitsownnetworkOurroutingstudythusfar-idealizationallroutersidenticalnetwork“flat”…nottrueinpracticeroutingandIProuting40/51HierarchicalRoutingaggregateroutersintoregions,
“autonomoussystems”(AS)routersinsameASrunsameroutingprotocol“intra-AS”routingprotocolroutersindifferentAScanrundifferentintra-ASroutingprotocolGatewayrouterDirectlinktorouterinanotherASroutingandIProuting41/513b1d3a1c2aAS3AS1AS21a2c2b1bIntra-ASRoutingalgorithmInter-ASRoutingalgorithmForwardingtable3cInterconnectedASesforwardingtableconfiguredbybothintra-andinter-ASroutingalgorithmintra-ASsetsentriesforinternaldestsinter-AS&intra-AssetsentriesforexternaldestsroutingandIProuting42/513b1d3a1c2aAS3AS1AS21a2c2b1b3cInter-AStaskssupposerouterinAS1receivesdatagramdestinedoutsideofAS1:routershouldforwardpackettogatewayrouter,butwhichone?AS1must:learnwhichdestsarereachablethroughAS2,whichthroughAS3propagatethisreachabilityinfotoallroutersinAS1Jobofinter-ASrouting!routingandIProuting43/51Example:Settingforwardingtableinrouter1dsupposeAS1learns(viainter-ASprotocol)thatsubnetxreachableviaAS3(gateway1c)butnotviaAS2.inter-ASprotocolpropagatesreachabilityinfotoallinternalrouters.router1ddeterminesfromintra-ASroutinginfothatitsinterfaceIisontheleastcostpathto1c.installsforwardingtableentry(x,I)3b1d3a1c2aAS3AS1AS21a2c2b1b3cx…routingandIProuting44/51Example:ChoosingamongmultipleASesnowsupposeAS1learnsfrominter-ASprotocolthatsubnetxisreachablefromAS3andfromAS2.toconfigureforwardingtable,router1dmustdeterminetowardswhichgatewayitshouldforwardpacketsfordestx.thisisalsojobofinter-ASroutingprotocol!3b1d3a1c2aAS3AS1AS21a2c2b1b3cx……routingandIProuting45/51Learnfrominter-ASprotocolthatsubnetxisreachableviamultiplegatewaysUseroutinginfofromintra-ASprotocoltodeterminecostsofleast-costpathstoeachofthegatewaysHotpotatorouting:ChoosethegatewaythathasthesmallestleastcostDeterminefromforwardingtabletheinterfaceIthatleadstoleast-costgateway.Enter(x,I)inforwardingtableExample:ChoosingamongmultipleASesnowsupposeAS1learnsfrominter-ASprotocolthatsubnetxisreachablefromAS3andfromAS2.toconfigureforwardingtable,router1dmustdete
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 中國古代工程技術(shù)知到課后答案智慧樹章節(jié)測試答案2025年春廣東工業(yè)大學(xué)
- 8《動(dòng)物的一生》教學(xué)設(shè)計(jì)-2023-2024學(xué)年科學(xué)三年級下冊教科版
- Module8Sports lifeUnit 3Language in use教學(xué)設(shè)計(jì)-2024-2025學(xué)年外研版英語九年級上冊
- 機(jī)械CADCAM-中望CAD項(xiàng)目教程 項(xiàng)目二 平面圖形的繪制電子教案
- 高承重180kg電動(dòng)升降桅桿產(chǎn)品技術(shù)說明書
- 網(wǎng)球與在線平臺企業(yè)制定與實(shí)施新質(zhì)生產(chǎn)力戰(zhàn)略研究報(bào)告
- 電子競技賽事直播與轉(zhuǎn)播平臺行業(yè)跨境出海戰(zhàn)略研究報(bào)告
- 消泡體系行業(yè)跨境出海戰(zhàn)略研究報(bào)告
- 智能藥物輸注系統(tǒng)行業(yè)跨境出海戰(zhàn)略研究報(bào)告
- 生物質(zhì)炭化土壤改良劑企業(yè)制定與實(shí)施新質(zhì)生產(chǎn)力戰(zhàn)略研究報(bào)告
- 公園保潔服務(wù)投標(biāo)方案
- 隨州市公共租賃住房租賃資格申請表
- 10J113-1內(nèi)隔墻-輕質(zhì)條板(一)
- 蘇科版八年級數(shù)學(xué)上冊講練專題訓(xùn)練勾股定理30道經(jīng)典壓軸題型(原卷版+解析)
- 2024年廣東省初中學(xué)業(yè)水平考試中考英語試卷(真題+答案解析)
- 第一課 中望3D-界面環(huán)境講解
- 小學(xué)數(shù)學(xué)人教版五年級下冊 3長方體和正方體應(yīng)用題20道
- DZ/T 0462.3-2023 礦產(chǎn)資源“三率”指標(biāo)要求 第3部分:鐵、錳、鉻、釩、鈦(正式版)
- 2024年昆明巫家壩建設(shè)發(fā)展有限責(zé)任公司招聘筆試沖刺題(帶答案解析)
- 2024年洛陽職業(yè)技術(shù)學(xué)院單招職業(yè)適應(yīng)性測試題庫帶答案
- 上海市崇明縣鄉(xiāng)鎮(zhèn)地圖矢量可編輯課件行政區(qū)劃邊界高清(上海市)
評論
0/150
提交評論