资源描述:
《计算机网络第四章作业.doc》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、第四章P450-22:Considerthefollowingnetwork.Withtheindicatedlinkcosts,useDijkstra’sshortest-pathalgorithmtocomputetheshortestpathfromxtoallnetworknodes.Showhowthealgorithmworksbycomputingatable.zxyVwtus126681483425914AnswerProblem22StepN’D(s),p(s)D(t),p(t)D(u),p(u)D(v),p(v)D(w),p(w)D(y),p(y)D(z),p(z)0x∞∞
2、∞8,x6,x6,x∞1xw∞∞14,w8,x6,x∞2xwy∞15,y14,w7,y18,y3xwyv∞11,v10,v18,y4xwyvu14,u11,v18,y5xwyvut12,t16,t6xwyvuts16,t7xwyvutszytzxvswuRoutingTable:DESCOSTNESTHOPx0y6yw6wv7yt11yu10yz16ys12yP451-25:Considerthenetworkfragmentshownbelow.xhasonlytwoattachedneighbors,wandy.whasaminimum-costpathtodestinationuof5,
3、andyhasaminimum-costpathtouof6.Thecompletepathsfromwandytou(andbetweenwandy)arenotshown.Alllinkcostsinthenetworkhavestrictlypositiveintegervalues.a.Givex’sdistancevectorfordestinationsw,y,andu.b.Givealink-costchangeforeitherc(x,w)orc(x,y)suchthatxwillinformitsneighborsofanewminimum-costpathtouasares
4、ultofexecutingthedistance-vectoralgorithm.c.Givealink-costchangeforeitherc(x,w)orc(x,y)suchthatxwillnotinformitsneighborsofanewminimum-costpathtouasaresultofexecutingthedistance-vectoralgorithm.wxy25AnswerProblem25a.Dx(y)=5,Dx(w)=2,Dx(u)=7b.Firstconsiderwhathappensifc(x,y)changes.Ifc(x,y)becomeslarg
5、erorsmaller(aslongasc(x,y)>0),theleastcostpathfromxtouwillstillhavecostatleast7.Thusachangeinc(x,y)willnotcausextoinformitsneighborsofanychanges.Nowconsiderifc(x,w)changes.Ifc(x,w)=e£1,thentheleast-costpathtoucontinuestopassthroughwanditscostchangesto5+e;xwillinformitsneighborsofthisnewcost.Ifc(x,w)
6、=d>6,thentheleastcostpathnowpassesthroughyandhascost11;againxwillinformitsneighborsofthisnewcost.c.Anychangeinlinkcostc(x,y)willnotcausextoinformitsneighborsofanewminimum-costpathtou.