Omnet下使用Inet官方demo说明

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

INETFrameworkforOMNEST/OMNeT++AGuidedTourContentsIntroductionLaunchingtheARPTestsimulationTheGUIatthefirstglanceLet'srunthesimulation!Over?Youcanrestartit!OK,butwhatarethoseflashinglinkcolors?Whatisinsidethehostsandrouters?StepstowardsexploringARPARPbeginsTheARPRequestpacketThependingqueueTheARPcacheTransmissionoverEthernetARPReplyProcessingtheARPReplyTheclient'sSYNgetstotheserverFollowingARPfromthedocumentationConclusionIntroductionThepurposeofthistutorialistogetyoufamiliarwiththeINETframework,asimulationmodelsuiteforTCP/IPandInternet-relatedprotocols,writtenfortheOMNeT++/OMNESTsimulationenvironment.ThistutorialisbasedontheARPTestexamplesimulation.Totryit,youneedabinary(executable)versionofthissimulation.TheeasiestistodownloadandinstalltheWindowsdemoforINET.Alternatively(orifyourplatformisLinuxorsomeotherOS),youmaydownloadandcompiletheOMNeT++andINETsourcepackages.LaunchingtheARPTestsimulationWhenyoustarttheINETdemopackage(ifyouinstalledtheWindowsdemo,you'llfindtheINETdemoontheStartMenu;ifyoucompiledINETyourself,findandrunExamples/rundemo[.bat]),you'llseeawindowlikethis:ClickthebuttonwhichsaysARPTestontheleft--adescriptionofthemodelshouldappearinthemainwindow.ClickthelargeLaunchbuttononthebottom,andtheARPsimulationmodelshouldstart.TheGUIatthefirstglanceThepictureyouseewilllooklikethis.ThewindowinthebackisthemainOMNeT++/OMNESTwindow,closingitwillexittheprogram.Thelargetextwindowontherightsidedisplayslogmessagesfromthesimulationmodel(outputfromevstatementsintheC++codewillwritethere),andtheleft-handdisplaysthemodelobjectsinafoldabletreeform.There'sa3-linestatusbaratthetop(we'lllookatitlater),andatoolbartoaccessfrequentlyusedfunctionsoftheGUI.Thefrontwindowdisplaysthesimulationmodel.Ifyouhappentoaccidentallycloseit,youcanopenitagainbyclickingtheInspectnetworktoolbaricon.Let'srunthesimulation!ClickontheRunbuttononthemainwindow'stoolbar,orhitF5.Firstyoushouldseemessageslabelledautoconfbeingexchangedbythenodes,aspartoftheEthernetmodelautoconfigurationprocess:Then,atabout1mssimulationtime,autoconfigfinishes,andsimulatingthenetworkoperationbegins.Inthemodelscenario,theclientcomputer(laptopicon)opensaTCPconnectiontotheserver(servericon)at1s,andstartssendingalargedatastream.Theserverwilljustechothedatasentbytheclient.SincetheunderlyingnetworkisEthernet,beforebeingabletosendtheTCPSYNpackettheclienthastoperformanARPrequesttolearntheMACaddressforthedefaultrouter.Aftersomemoremessaging,theTCPconnectionwillbeestablishedanddatatransferbegins.We'llexplorethesehappeningsinthenetworklater,butfornowjustsitbackandwatchthesimulation.Youcanmaketheanimationfasterorslowerbyadjustingtheslideratthetopofthenetworkwindow.YoucanstopthesimulationbyclickingtheredSTOPtrafficsignicon(orbyhittingF8),andresumeit(RuniconorF5).TheFasticonor(F6)willturnoffmessageanimationandupdatethegraphicsonlyevery10eventsorso(theexactnumbercanbeconfiguredintheSimulationOptionsdialog,Optionsmenu,accessiblefromviathetoolbaraswell).TheExpressiconprovidesthehighestspeed:itturnsoffallGUIfunctionswhilethesimulationisrunning,evenwritingtothelogisturnedoff.Expressmodeupdatesthedisplayevery1000eventsorso(alsoconfigurableinSimulationOptions).InExpressmodeyoucanonlystopthesimulationbyclickingtheBigRedSTOPButton(seebelow).SimulationspeedinExpressmodemaysignificantlydependonthestateoftheautoupdateinspectorscheckbox.Youcanreadthespeedofthesimulationonthe3rdlineofthemainwindowstatusbar.Ev/sectellsyouhowmanyeventsyourCPUcrunchesinasecond--thisdependsonthestrengthofyourhardware,ontheamountprocessing(C++code)tobedoneforanaverageevent(refertothehandleMessage(cMessage*)functionsinthemodelsource),andontherunmode(Normal,FastorExpress).ItisnotunusualfortheExpressmodetobe100-200timesfasterthanFastmode.Theothertworeadingsonthatstatusbararesimsec/sec(howmanysimulatedsecondsthemodelprogressesinonerealsecond)andev/simsec(howmanyeventsyourmodelcontainspersimulatedsecond).Thesimsec/secvalueisusefulforestimatinghowlongyoursimulationwilltake.Ev/simsecisindependentofwhetheryouuseNormal,FastorExpressmode,anditonlydependsonthenatureandsizeofyourmodel(ATMcell-levelsimulationswillhaveafewmagnitudeshigherev/simsecvaluesthancallcentersimulations.)Over?Youcanrestartit!WhileinExpessmode,you'llprobablygetthefollowingdialogafterawhile:Nomoreeventsisonewayasimulationcanterminatenormally(i.e.notwithanerror).Itmeansthatthere'snothingmoretosimulate--inoursimulationthisoccurswhentheclienthassuccessfullyclosedtheTCPconnectionandfinisheditsoperation,andthere'renomorepacketsunderwayandnotimersrunninganywhereinthewholemodel.OthersimulationsmayendwiththeSimulationtimelimitreached--simulationstoppedmessagewhichmeansthatthesimulationtimeconfiguredinomnetpp.inihasbeenreached.(Forcompleteness:otherpossibilitiesincludeCPUtimelimitreached,andSimulationstoppedwithendSimulation()meaningthatsomecomponentinthemodelcalledtheendSimulation()C++function--forexamplewhenitdetectsthatdesiredstatisticalaccuracyhasbeenreached).InbothcasesyoucanrestartthesimulationusingtheRebuildnetworkcommandontheSimulatemenu.Infact,youcandothat

1 / 28
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功