




免费预览已结束,剩余53页可下载查看
下载本文档
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
ns-3Training,ComputerandCommunicationNetworkLabDepartmentofElectricalEngineeringNationalSunYat-SenUniversity5/13/2013,Topics,GettingStartedns-3Whatisns-3?InstallationAFirstns-3ScriptTwotutorialexamplesAsimpleexampleforthisprojectCompletetheremainingparts,2,GettingStartedns-3,Pleasereadthefollowingdocumentsns-3overview/docs/ns-3-overview.ppt/docs/ns-3-overview.pdfns-3Tutorial/docs/release/3.13/tutorial/ns-3-tutorial.pdfns-3Manual/docs/release/3.13/manual/ns-3-manual.pdf,Whatisns-3?,ns-3isadiscrete-eventnetworksimulatorforInternetsystemsns-3allowsresearcherstostudyInternetprotocolsandlarge-scalesystemsinacontrolledenvironmentns-3isanewsimulator(notbackwards-compatiblewithns-2)ns-3isafree,opensourcesoftwareprojectorganizedaroundresearchcommunitydevelopmentandmaintenancethetargetusercommunityisnetworkingresearchersandeducators,4,ExtensibleSoftwareCore,WritteninC+withoptionalPythoninterfaceextensivelydocumentedAPI(doxygen):/doxygen-release/index.html,5,NodeBasics,Anns-3Nodeisahuskofacomputertowhichapplications,stacks,andNICsareadded,6,TracingandStatistics,TracingisastructuredformofsimulationoutputExample(fromns-2):Problem:Tracingneedsvarywidelywouldliketochangetracingoutputwithouteditingthecorewouldliketosupportmultipleoutputs,7,ns-3HasANewTracingModel,ns-3solution:decoupletracesourcesfromtracesinksBenefit:Customizabletracesinks,8,Downloadingns-3,/Latestrelease:ns-3.16(2012/12/21),9,ProblemsunderWindows,CygwinorMinGWIfyoudouseCygwinorMinGWanduseLogitechproductsitcancauseCygwinorMinGWDLLstodieinmysteriouswayNotethatNSCisnotsupportedonOSXorCygwin.NetworkSimulationCradle,10,Buildingns-3(1/5),11,#./build.py,Buildingns-3(2/5),12,#./waf-doptimizedconfigurens-3usesthewafbuildsystem,Buildingns-3(3/5),13,#./waf-ddebugconfigure,Buildingns-3(4/5),14,#./test.py-ccore,Buildingns-3(5/5),15,RunningaScript,16,./waf-runhello-simulator,BuildingYourScript,17,#cpexamples/tutorial/first.ccscratch/myfirst.cc./waf,BuildingYourScript,18,#./waf-runscratch/myfirst,AFirstns-3Script,/ns-allinone-3.10/ns-3.10/examples/tutorialfirst.ccthird.cc,Boilerplate,Thefirstlineinthefileisanemacsmodeline.Thens-3simulatorislicensedusingtheGNUGeneralPublicLicense.,20,ModuleIncludes,Thecodeproperstartswithanumberofincludestatements././build/debug/ns3,21,Ns3Namespace,Thenextlineinthefirst.ccscriptisanamespacedeclaration.Logging,22,MainFunctions,Thenextlinesofthescriptyouwillfindare,23,ns3提供的log訊息分成了以下幾個等級:NS_LOG_ERRORLogerrormessages;NS_LOG_WARNLogwarningmessages;NS_LOG_DEBUGLogrelativelyrare,ad-hocdebuggingmessages;NS_LOG_INFOLoginformationalmessagesaboutprogramprogress;NS_LOG_FUNCTIONLogamessagedescribingeachfunctioncalled;NS_LOG_LOGICLogmessagesdescribinglogicalflowwithinafunction;NS_LOG_ALLLogeverything.NS_LOG_UNCONDLogtheassociatedmessageunconditionally.,TopologyHelpers,Createthens-3Nodeobjectsthatwillrepresentthecomputersinthesimulation.Weareconstructingapointtopointlink,24,TopologyHelpers,WewillneedtohavealistofalloftheNetDeviceobjectsthatarecreated,25,InternetStackHelper,ProtocolstacksinstalledonournodesTCP,UDP,IP,etc.Ipv4AddressHelpermaketheassociationbetweenanIPaddressandadevice,26,Applications,Twospecializationsofthecorens-3classApplicationcalledUdpEchoServerApplicationUdpEchoClientApplicationUdpEchoServerHelper,27,Applications,UdpEchoClientHelper,28,Simulator,Whatweneedtodoatthispointistoactuallyrunthesimulation.scheduledeventsinthesimulatorat1.0seconds,2.0secondsandtwoeventsat10.0seconds,29,BuildingYourScript,DropyourscriptintothescratchdirectoryNowbuildyourfirstexamplescriptusingwaf,30,BuildingYourScript,Youcannowruntheexample,31,BuildingaWirelessNetworkTopology,AddtheWifiandthemobilitymodulesThenetworktopologyillustrationfollows:,32,BuildingaWirelessNetworkTopology,Forenablingordisablingloggingcomponentsandforchangingthenumberofdevicescreated,33,BuildingaWirelessNetworkTopology,PartoftheWifinetworkConfigurethePHYandchannelhelpersYetAnotherNetworkSimulatorM.LacageandT.R.Henderson,“YetAnotherNetworkSimulator,”WNS2ns-2:TheIPNetworkSimulator,Italy,2006.,34,BuildingaWirelessNetworkTopology,CreateachannelobjectandassociateittoourPHYlayerobjectmanagerNqosWifiMacHelperobjecttosetMACparametersratecontrolalgorithmAARF(AdaptiveAuto-RateFallback)algorithm,35,BuildingaWirelessNetworkTopology,TheSSIDoftheinfrastructurenetworkCreatethewifidevicesofthesestations,36,BuildingaWirelessNetworkTopology,ConfiguretheAP(accesspoint)nodeSharesthesamesetofPHY-levelAttributes(andchannel)asthestations,37,BuildingaWirelessNetworkTopology,SetsomeAttributescontrollingthe“positionallocator”functionality,38,Thenumberofobjectslayedoutonaline.,BuildingaWirelessNetworkTopology,NeedtotellthemhowtomoveRandomWalk2dMobilityModelrandomdirectionrandomspeedRectangle(double_xMin,double_xMax,double_yMin,double_yMax),39,BuildingaWirelessNetworkTopology,WanttheaccesspointtoremaininafixedpositionduringthesimulationProtocolstacks,40,BuildingaWirelessNetworkTopology,assignIPaddressestothedeviceinterfaces,41,BuildingaWirelessNetworkTopology,EnableinternetworkroutingCreatejustenoughtracingtocoverallthreenetworks,42,BuildingaWirelessNetworkTopology,Runthesimulation,cleanupandthenexittheprogramOutput,43,Readthepcapfiles,44,Plotfigures,45,AnExampleofMANET,Reference/ns-allinone-3.10/ns-3.10/examples/wireless/wifi-hidden-terminal.cc,Codes(1/7),47,Codes(2/7),48,Codes(3/7),49,Codes(4/7),50,Codes(5/7),51,Codes(6/7),52,Codes(7/7),53,Result,54,Needtodo(1/3),Transmissionrangeofanodens3:RangePropagationLossModelMaxRangeNodemovingspeedns3:RandomWaypointMobilityModelSpeedPauseNodedata
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 《毫米、分米的认识》教学设计-2024-2025学年三年级上册数学人教版
- 初中分班考试试卷及答案
- 2025年全国化工自动化仪表作业证考试题库(含答案)
- 2025年高考生物试题分类汇编种群及其动态(原卷版)
- 蒸汽包安全知识培训内容课件
- 2025年陕西省中考生物试题及解析
- 2025混凝土承包的合同范本
- 2025科技创新贷款合同
- 葡萄酒知识培训教程
- 消毒管理办法题目及答案
- 矿产购销合同模板
- 湖北荆州2023年中考语文现代文阅读真题及答案
- 重庆市字水中学2024届九年级上学期期中考试数学试卷(含答案)
- 水闸现场安全检测分析报告
- 输变电工程质量通病防治手册
- 车辆定点维修服务保障方案
- 学生营养餐(中央厨房)集中配送项目计划书
- 2024年秋季新人教版九年级上册化学全册教案
- (新)精神卫生知识技能竞赛理论考试题库(含答案)
- 液碱卸车安全操作规程
- 建筑用砂石料采购 投标方案(技术方案)
评论
0/150
提交评论