您好,欢迎访问三七文档
当前位置:首页 > 商业/管理/HR > 信息化管理 > 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
本文标题:Omnet下使用Inet官方demo说明
链接地址:https://www.777doc.com/doc-4844210 .html