网络仿真工具NS3的培训教学课件

上传人:沈*** 文档编号:241740866 上传时间:2024-07-20 格式:PPT 页数:59 大小:3.48MB
返回 下载 相关 举报
网络仿真工具NS3的培训教学课件_第1页
第1页 / 共59页
网络仿真工具NS3的培训教学课件_第2页
第2页 / 共59页
网络仿真工具NS3的培训教学课件_第3页
第3页 / 共59页
点击查看更多>>
资源描述
ns-3 TrainingComputerandCommunicationNetworkLabDepartmentofElectricalEngineeringNationalSunYat-SenUniversity5/13/2019TopicspGettingStartedns-3nWhatisns-3?nInstallationpAFirstns-3ScriptnTwotutorialexamplespAsimpleexampleforthisprojectnCompletetheremainingparts2Getting Started ns-3Pleasereadthefollowingdocumentsns-3overviewnsnam.org/docs/ns-3-overview.pptnsnam.org/docs/ns-3-overview.pdfns-3Tutorialnsnam.org/docs/release/3.13/tutorial/ns-3-tutorial.pdfns-3Manualnsnam.org/docs/release/3.13/manual/ns-3-manual.pdfWhat is ns-3?pns-3isadiscrete-eventnetworksimulatorforInternetsystemsnns-3allowsresearcherstostudyInternetprotocolsandlarge-scalesystemsinacontrolledenvironmentnns-3isanewsimulator(notbackwards-compatiblewithns-2)pns-3isafree,opensourcesoftwareprojectorganizedaroundresearchcommunitydevelopmentandmaintenancenthetargetusercommunityisnetworkingresearchersandeducators4Extensible Software CorepWritteninC+withoptionalPythoninterfacenextensivelydocumentedAPI(doxygen):nnsnam.org/doxygen-release/index.html5Node BasicspAnns-3Nodeisahuskofacomputertowhichapplications,stacks,andNICsareadded6Tracing and StatisticspTracingisastructuredformofsimulationoutputpExample(fromns-2):pProblem:Tracingneedsvarywidelynwouldliketochangetracingoutputwithouteditingthecorenwouldliketosupportmultipleoutputs7ns-3 Has A New Tracing Modelpns-3solution:decoupletracesourcesfromtracesinkspBenefit:Customizabletracesinks8Downloading ns-3pnsnam.org/nLatestrelease:ns-3.16(2019/12/21)9Problems under WindowspCygwinorMinGWpIfyoudouseCygwinorMinGWanduseLogitechproductsnitcancauseCygwinorMinGWDLLstodieinmysteriouswaypNotethatNSCisnotsupportedonOSXorCygwin.nNetworkSimulationCradle10Building ns-3(1/5)p#./build.py11Building ns-3(2/5)p#./waf-doptimizedconfigurenns-3usesthewafbuildsystem12Building ns-3(3/5)p#./waf-ddebugconfigure13Building ns-3(4/5)p#./test.py-ccore14Building ns-3(5/5)15Running a Scriptp./waf-runhello-simulator16Building Your Scriptp#cpexamples/tutorial/firstscratch/myfirstp./waf17Building Your Scriptp#./waf-runscratch/myfirst18A First ns-3 Script/ns-allinone-3.10/ns-3.10/examples/tutorialfirstthirdBoilerplatepThefirstlineinthefileisanemacsmodeline.npThens-3simulatorislicensedusingtheGNUGeneralPublicLicense.n20Module IncludespThecodeproperstartswithanumberofincludestatements.np././build/debug/ns321Ns3 NamespacepThenextlineinthefirstscriptisanamespacedeclaration.npLoggingn22Main FunctionspThenextlinesofthescriptyouwillfindare,nnns3提供的log訊息分成了以下幾個等級:1.NS_LOG_ERRORLogerrormessages;2.NS_LOG_WARNLogwarningmessages;3.NS_LOG_DEBUGLogrelativelyrare,ad-hocdebuggingmessages;4.NS_LOG_INFOLoginformationalmessagesaboutprogramprogress;5.NS_LOG_FUNCTIONLogamessagedescribingeachfunctioncalled;6.NS_LOG_LOGICLogmessagesdescribinglogicalflowwithinafunction;7.NS_LOG_ALLLogeverything.8.NS_LOG_UNCONDLogtheassociatedmessageunconditionally.23Topology HelperspCreatethens-3Nodeobjectsthatwillrepresentthecomputersinthesimulation.npWeareconstructingapointtopointlinkn24Topology HelperspWewillneedtohavealistofalloftheNetDeviceobjectsthatarecreatedn25Internet Stack HelperpProtocolstacksinstalledonournodesnpTCP,UDP,IP,etc.pIpv4AddressHelpernnpmaketheassociationbetweenanIPaddressandadevice26ApplicationspTwospecializationsofthecorens-3classApplicationcallednUdpEchoServerApplicationnUdpEchoClientApplicationpUdpEchoServerHelpern27ApplicationspUdpEchoClientHelpern28SimulatorpWhatweneedtodoatthispointistoactuallyrunthesimulation.npscheduledeventsinthesimulatorat1.0seconds,2.0secondsandtwoeventsat10.0secondsn29Building Your ScriptpDropyourscriptintothescratchdirectorynpNowbuildyourfirstexamplescriptusingwafnn30Building Your ScriptpYoucannowruntheexamplenn31Building a Wireless Network TopologypAddtheWifiandthemobilitymodulesnpThenetworktopologyillustrationfollows:32Building a Wireless Network TopologypForenablingordisablingloggingcomponentsandforchangingthenumberofdevicescreatedn33Building a Wireless Network TopologypPartoftheWifinetworknpConfigurethePHYandchannelhelpersnnYetAnotherNetworkSimulatorpM.LacageandT.R.Henderson,“YetAnotherNetworkSimulator,”WNS2ns-2:TheIPNetworkSimulator,Italy,2019.pcutebugs/files/wns2-yans.pdf34Building a Wireless Network TopologypCreateachannelobjectandassociateittoourPHYlayerobjectmanagernpNqosWifiMacHelperobjecttosetMACparametersnnratecontrolalgorithmpAARF(AdaptiveAuto-RateFallback)algorithm35Building a Wireless Network TopologypTheSSIDoftheinfrastructurenetworknpCreatethewifidevicesofthesestationsn36Building a Wireless Network TopologypConfiguretheAP(accesspoint)nodenpSharesthesamesetofPHY-levelAttributes(andchannel)asthestationsn37Building a Wireless Network TopologypSetsomeAttributescontrollingthe“positionallocator”functionalitynThenumberofobjectslayedoutonaline.38Building a Wireless Network TopologypNeedtotellthemhowtomovenRandomWalk2dMobilityModelprandomdirectionprandomspeednpRectangle(double_xMin,double_xMax,double_yMin,double_yMax)n39Building a Wireless Network TopologypWanttheaccesspointtoremaininafixedpositionduringthesimulationnpProtocolstacksn40Building a Wireless Network TopologypassignIPaddressestothedeviceinterfacesn41Building a Wireless Network TopologypEnableinternetworkroutingnnpCreatejustenoughtracingtocoverallthreenetworksnn42Building a Wireless Network TopologypRunthesimulation,cleanupandthenexittheprogramnpOutputn43Read the pcap filespp44Plot figurespp45An Example of MANETReference/ns-allinone-3.10/ns-3.10/examples/wireless/wifi-hidden-terminalCodes(1/7)47Codes(2/7)48Codes(3/7)49Codes(4/7)50Codes(5/7)51Codes(6/7)52Codes(7/7)53Result54Need to do(1/3)pTransmissionrangeofanodenns3:RangePropagationLossModelpMaxRangepNodemovingspeednns3:RandomWaypointMobilityModelpSpeedpPausepNodedataratenns3:ConstantRateWifiManager55Need to do(2/3)pRTSretrylimitnns3:UanMacRcpRetryRatepBuffersizenns3:TcpSocketpSndBufSizepAODVhelloperiodsnns3:aodv:RoutingProtocolpHelloInterval56Need to do(3/3)pUniformdistributioninasquarewith500metersnns3:RandomRectanglePositionAllocatorppns3:UniformVariable57Q&A58xiexie!xiexie!谢谢!谢谢!
展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 管理文书 > 施工组织


copyright@ 2023-2025  zhuangpeitu.com 装配图网版权所有   联系电话:18123376007

备案号:ICP2024067431-1 川公网安备51140202000466号


本站为文档C2C交易模式,即用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。装配图网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知装配图网,我们立即给予删除!