![網(wǎng)絡(luò)仿真工具NS3的培訓(xùn)文檔課件_第1頁(yè)](http://file4.renrendoc.com/view/77094e62cdcbd71cfddb1e04624636f7/77094e62cdcbd71cfddb1e04624636f71.gif)
![網(wǎng)絡(luò)仿真工具NS3的培訓(xùn)文檔課件_第2頁(yè)](http://file4.renrendoc.com/view/77094e62cdcbd71cfddb1e04624636f7/77094e62cdcbd71cfddb1e04624636f72.gif)
![網(wǎng)絡(luò)仿真工具NS3的培訓(xùn)文檔課件_第3頁(yè)](http://file4.renrendoc.com/view/77094e62cdcbd71cfddb1e04624636f7/77094e62cdcbd71cfddb1e04624636f73.gif)
![網(wǎng)絡(luò)仿真工具NS3的培訓(xùn)文檔課件_第4頁(yè)](http://file4.renrendoc.com/view/77094e62cdcbd71cfddb1e04624636f7/77094e62cdcbd71cfddb1e04624636f74.gif)
![網(wǎng)絡(luò)仿真工具NS3的培訓(xùn)文檔課件_第5頁(yè)](http://file4.renrendoc.com/view/77094e62cdcbd71cfddb1e04624636f7/77094e62cdcbd71cfddb1e04624636f75.gif)
版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
ns-3TrainingComputerandCommunicationNetworkLabDepartmentofElectricalEngineeringNationalSunYat-SenUniversity5/13/2013ns-3TrainingTopicsGettingStartedns-3Whatisns-3?InstallationAFirstns-3ScriptTwotutorialexamplesAsimpleexampleforthisprojectCompletetheremainingparts2TopicsGettingStartedns-32GettingStartedns-3GettingStartedns-3Whatisns-3?ns-3isadiscrete-eventnetworksimulatorforInternetsystemsns-3allowsresearcherstostudyInternetprotocolsandlarge-scalesystemsinacontrolledenvironmentns-3isanewsimulator(notbackwards-compatiblewithns-2)ns-3isafree,opensourcesoftwareprojectorganizedaroundresearchcommunitydevelopmentandmaintenancethetargetusercommunityisnetworkingresearchersandeducators4Whatisns-3?ns-3isadiscretExtensibleSoftwareCore5ExtensibleSoftwareCore5NodeBasicsAnns-3Nodeisahuskofacomputertowhichapplications,stacks,andNICsareadded6NodeBasicsAnns-3NodeisahTracingandStatisticsTracingisastructuredformofsimulationoutputExample(fromns-2):Problem:Tracingneedsvarywidelywouldliketochangetracingoutputwithouteditingthecorewouldliketosupportmultipleoutputs7TracingandStatisticsTracingns-3HasANewTracingModelns-3solution:decoupletracesourcesfromtracesinksBenefit:Customizabletracesinks8ns-3HasANewTracingModelnsDownloadingns-39Downloadingns-39ProblemsunderWindowsCygwinorMinGWIfyoudouseCygwinorMinGWanduseLogitechproductsitcancauseCygwinorMinGWDLLstodieinmysteriouswayNotethatNSCisnotsupportedonOSXorCygwin.NetworkSimulationCradle10ProblemsunderWindowsCygwinoBuildingns-3(1/5)11#./build.pyBuildingns-3(1/5)11#./buildBuildingns-3(2/5)12#./waf-doptimizedconfigurens-3usesthewafbuildsystemBuildingns-3(2/5)12#./waf-Buildingns-3(3/5)13#./waf-ddebugconfigureBuildingns-3(3/5)13#./waf-Buildingns-3(4/5)14#./test.py-ccoreBuildingns-3(4/5)14#./test.Buildingns-3(5/5)15Buildingns-3(5/5)15RunningaScript16./waf--runhello-simulatorRunningaScript16./waf--runBuildingYourScript17#cpexamples/tutorial/first.ccscratch/myfirst.cc./wafBuildingYourScript17#cpexaBuildingYourScript18#./waf--runscratch/myfirstBuildingYourScript18#./wafAFirstns-3Script/ns-allinone-3.10/ns-3.10/examples/tutorialfirst.ccthird.ccAFirstns-3Script/ns-allinoBoilerplateThefirstlineinthefileisanemacsmodeline.
Thens-3simulatorislicensedusingtheGNUGeneralPublicLicense.
20BoilerplateThefirstlineintModuleIncludesThecodeproperstartswithanumberofincludestatements.
../../build/debug/ns321ModuleIncludesThecodeproperNs3NamespaceThenextlineinthefirst.ccscriptisanamespacedeclaration.
Logging
22Ns3NamespaceThenextlineinMainFunctionsThenextlinesofthescriptyouwillfindare,
23ns3提供的log訊息分成了以下幾個(gè)等級(jí):NS_LOG_ERROR—Logerrormessages;NS_LOG_WARN—Logwarningmessages;NS_LOG_DEBUG—Logrelativelyrare,ad-hocdebuggingmessages;NS_LOG_INFO—Loginformationalmessagesaboutprogramprogress;NS_LOG_FUNCTION—Logamessagedescribingeachfunctioncalled;NS_LOG_LOGIC–Logmessagesdescribinglogicalflowwithinafunction;NS_LOG_ALL—Logeverything.NS_LOG_UNCOND–Logtheassociatedmessageunconditionally.MainFunctionsThenextlinesoTopologyHelpersCreatethens-3Nodeobjectsthatwillrepresentthecomputersinthesimulation.
Weareconstructingapointtopointlink
24TopologyHelpersCreatethens-TopologyHelpersWewillneedtohavealistofalloftheNetDeviceobjectsthatarecreated
25TopologyHelpersWewillneedtInternetStackHelperProtocolstacksinstalledonournodes
TCP,UDP,IP,etc.Ipv4AddressHelper
maketheassociationbetweenanIPaddressandadevice26InternetStackHelperProtocolApplicationsTwospecializationsofthecorens-3classApplicationcalledUdpEchoServerApplicationUdpEchoClientApplicationUdpEchoServerHelper
27ApplicationsTwospecializationApplicationsUdpEchoClientHelper
28ApplicationsUdpEchoClientHelpeSimulatorWhatweneedtodoatthispointistoactuallyrunthesimulation.
scheduledeventsinthesimulatorat1.0seconds,2.0secondsandtwoeventsat10.0seconds
29SimulatorWhatweneedtodoatBuildingYourScriptDropyourscriptintothescratchdirectory
Nowbuildyourfirstexamplescriptusingwaf
30BuildingYourScriptDropyourBuildingYourScriptYoucannowruntheexample
31BuildingYourScriptYoucannoBuildingaWirelessNetworkTopologyAddtheWifiandthemobilitymodules
Thenetworktopologyillustrationfollows:32BuildingaWirelessNetworkToBuildingaWirelessNetworkTopologyForenablingordisablingloggingcomponentsandforchangingthenumberofdevicescreated
33BuildingaWirelessNetworkToBuildingaWirelessNetworkTopologyPartoftheWifinetwork
ConfigurethePHYandchannelhelpers
YetAnotherNetworkSimulatorM.LacageandT.R.Henderson,“YetAnotherNetworkSimulator,”WNS2ns-2:TheIPNetworkSimulator,Italy,2006./files/wns2-yans.pdf34BuildingaWirelessNetworkToBuildingaWirelessNetworkTopologyCreateachannelobjectandassociateittoourPHYlayerobjectmanager
NqosWifiMacHelperobjecttosetMACparameters
ratecontrolalgorithmAARF(AdaptiveAuto-RateFallback)algorithm35BuildingaWirelessNetworkToBuildingaWirelessNetworkTopologyTheSSIDoftheinfrastructurenetwork
Createthewifidevicesofthesestations
36BuildingaWirelessNetworkToBuildingaWirelessNetworkTopologyConfiguretheAP(accesspoint)node
SharesthesamesetofPHY-levelAttributes(andchannel)asthestations
37BuildingaWirelessNetworkToBuildingaWirelessNetworkTopologySetsomeAttributescontrollingthe“positionallocator”functionality
38Thenumberofobjectslayedoutonaline.BuildingaWirelessNetworkToBuildingaWirelessNetworkTopologyNeedtotellthemhowtomoveRandomWalk2dMobilityModelrandomdirectionrandomspeed
Rectangle(double_xMin,double_xMax,double_yMin,double_yMax)
39BuildingaWirelessNetworkToBuildingaWirelessNetworkTopologyWanttheaccesspointtoremaininafixedpositionduringthesimulation
Protocolstacks
40BuildingaWirelessNetworkToBuildingaWirelessNetworkTopologyassignIPaddressestothedeviceinterfaces
41BuildingaWirelessNetworkToBuildingaWirelessNetworkTopologyEnableinternetworkrouting
Createjustenoughtracingtocoverallthreenetworks
42BuildingaWirelessNetworkToBuildingaWirelessNetworkTopologyRunthesimulation,cleanupandthenexittheprogram
Output
43BuildingaWirelessNetworkToReadthepcapfiles
44Readthepcapfiles44Plotfigures
45Plotfigures45AnExampleofMANETReference/ns-allinone-3.10/ns-3.10/examples/wireless/wifi-hidden-terminal.ccAnExampleofMANETReferenceCodes(1/7)47Codes(1/7)47Codes(2/7)48Codes(2/7)48Codes(3/7)49Codes(3/7)49Codes(4/7)50Codes(4/7)50Codes(5/7)51Codes(5/7)51Codes(6/7)52Codes(6/7)52Codes(7/7)53Codes(7/7)53Result54Result54Needtodo……(1/3)Transmissionrangeofanodens3::RangePropagationLossModelMaxRangeNodemovingspeedns3::RandomWaypointMobilityModelSpeedPauseNodedataratens3::ConstantRateWifiManager55Needtodo……(1/3)TransmissionNeedtodo……(2/3)RTSretrylimitns3::UanMacRcRetryRateBuffersizens3::TcpSocketSndBufSizeAODVhelloperiodsns3::aodv::RoutingProtocolHelloInterval56Needtodo……(2/3)RTSretryliNeedtodo……(3/3)Uniformdistributioninasquarewith500metersns3::RandomRectanglePositionAllocator
ns3::UniformVariable57Needtodo……(3/3)UniformdistQ&A58Q&A58演講完畢,謝謝觀看!演講完畢,謝謝觀看!ns-3TrainingComputerandCommunicationNetworkLabDepartmentofElectricalEngineeringNationalSunYat-SenUniversity5/13/2013ns-3TrainingTopicsGettingStartedns-3Whatisns-3?InstallationAFirstns-3ScriptTwotutorialexamplesAsimpleexampleforthisprojectCompletetheremainingparts61TopicsGettingStartedns-32GettingStartedns-3GettingStartedns-3Whatisns-3?ns-3isadiscrete-eventnetworksimulatorforInternetsystemsns-3allowsresearcherstostudyInternetprotocolsandlarge-scalesystemsinacontrolledenvironmentns-3isanewsimulator(notbackwards-compatiblewithns-2)ns-3isafree,opensourcesoftwareprojectorganizedaroundresearchcommunitydevelopmentandmaintenancethetargetusercommunityisnetworkingresearchersandeducators63Whatisns-3?ns-3isadiscretExtensibleSoftwareCore64ExtensibleSoftwareCore5NodeBasicsAnns-3Nodeisahuskofacomputertowhichapplications,stacks,andNICsareadded65NodeBasicsAnns-3NodeisahTracingandStatisticsTracingisastructuredformofsimulationoutputExample(fromns-2):Problem:Tracingneedsvarywidelywouldliketochangetracingoutputwithouteditingthecorewouldliketosupportmultipleoutputs66TracingandStatisticsTracingns-3HasANewTracingModelns-3solution:decoupletracesourcesfromtracesinksBenefit:Customizabletracesinks67ns-3HasANewTracingModelnsDownloadingns-368Downloadingns-39ProblemsunderWindowsCygwinorMinGWIfyoudouseCygwinorMinGWanduseLogitechproductsitcancauseCygwinorMinGWDLLstodieinmysteriouswayNotethatNSCisnotsupportedonOSXorCygwin.NetworkSimulationCradle69ProblemsunderWindowsCygwinoBuildingns-3(1/5)70#./build.pyBuildingns-3(1/5)11#./buildBuildingns-3(2/5)71#./waf-doptimizedconfigurens-3usesthewafbuildsystemBuildingns-3(2/5)12#./waf-Buildingns-3(3/5)72#./waf-ddebugconfigureBuildingns-3(3/5)13#./waf-Buildingns-3(4/5)73#./test.py-ccoreBuildingns-3(4/5)14#./test.Buildingns-3(5/5)74Buildingns-3(5/5)15RunningaScript75./waf--runhello-simulatorRunningaScript16./waf--runBuildingYourScript76#cpexamples/tutorial/first.ccscratch/myfirst.cc./wafBuildingYourScript17#cpexaBuildingYourScript77#./waf--runscratch/myfirstBuildingYourScript18#./wafAFirstns-3Script/ns-allinone-3.10/ns-3.10/examples/tutorialfirst.ccthird.ccAFirstns-3Script/ns-allinoBoilerplateThefirstlineinthefileisanemacsmodeline.
Thens-3simulatorislicensedusingtheGNUGeneralPublicLicense.
79BoilerplateThefirstlineintModuleIncludesThecodeproperstartswithanumberofincludestatements.
../../build/debug/ns380ModuleIncludesThecodeproperNs3NamespaceThenextlineinthefirst.ccscriptisanamespacedeclaration.
Logging
81Ns3NamespaceThenextlineinMainFunctionsThenextlinesofthescriptyouwillfindare,
82ns3提供的log訊息分成了以下幾個(gè)等級(jí):NS_LOG_ERROR—Logerrormessages;NS_LOG_WARN—Logwarningmessages;NS_LOG_DEBUG—Logrelativelyrare,ad-hocdebuggingmessages;NS_LOG_INFO—Loginformationalmessagesaboutprogramprogress;NS_LOG_FUNCTION—Logamessagedescribingeachfunctioncalled;NS_LOG_LOGIC–Logmessagesdescribinglogicalflowwithinafunction;NS_LOG_ALL—Logeverything.NS_LOG_UNCOND–Logtheassociatedmessageunconditionally.MainFunctionsThenextlinesoTopologyHelpersCreatethens-3Nodeobjectsthatwillrepresentthecomputersinthesimulation.
Weareconstructingapointtopointlink
83TopologyHelpersCreatethens-TopologyHelpersWewillneedtohavealistofalloftheNetDeviceobjectsthatarecreated
84TopologyHelpersWewillneedtInternetStackHelperProtocolstacksinstalledonournodes
TCP,UDP,IP,etc.Ipv4AddressHelper
maketheassociationbetweenanIPaddressandadevice85InternetStackHelperProtocolApplicationsTwospecializationsofthecorens-3classApplicationcalledUdpEchoServerApplicationUdpEchoClientApplicationUdpEchoServerHelper
86ApplicationsTwospecializationApplicationsUdpEchoClientHelper
87ApplicationsUdpEchoClientHelpeSimulatorWhatweneedtodoatthispointistoactuallyrunthesimulation.
scheduledeventsinthesimulatorat1.0seconds,2.0secondsandtwoeventsat10.0seconds
88SimulatorWhatweneedtodoatBuildingYourScriptDropyourscriptintothescratchdirectory
Nowbuildyourfirstexamplescriptusingwaf
89BuildingYourScriptDropyourBuildingYourScriptYoucannowruntheexample
90BuildingYourScriptYoucannoBuildingaWirelessNetworkTopologyAddtheWifiandthemobilitymodules
Thenetworktopologyillustrationfollows:91BuildingaWirelessNetworkToBuildingaWirelessNetworkTopologyForenablingordisablingloggingcomponentsandforchangingthenumberofdevicescreated
92BuildingaWirelessNetworkToBuildingaWirelessNetworkTopologyPartoftheWifinetwork
ConfigurethePHYandchannelhelpers
YetAnotherNetworkSimulatorM.LacageandT.R.Henderson,“YetAnotherNetworkSimulator,”WNS2ns-2:TheIPNetworkSimulator,Italy,2006./files/wns2-yans.pdf93BuildingaWirelessNetworkToBuildingaWirelessNetworkTopologyCreateachannelobjectandassociateittoourPHYlayerobjectmanager
NqosWifiMacHelperobjecttosetMACparameters
ratecontrolalgorithmAARF(AdaptiveAuto-RateFallback)algorithm94BuildingaWirelessNetworkToBuildingaWirelessNetworkTopologyTheSSIDoftheinfrastructurenetwork
Createthewifidevicesofthesestations
95BuildingaWirelessNetworkToBuildingaWirelessNetworkTopologyConfiguretheAP(accesspoint)node
SharesthesamesetofPHY-levelAttributes(andchannel)asthestations
96BuildingaWirelessNetworkToBuildingaWirelessNetworkTopologySetsomeAttributescontrollingthe“positionallocator”functionality
97Thenumberofobjectslayedoutonaline.BuildingaWirelessNetworkToBuildingaWirelessNetworkTopologyNeedtotellthemhowtomoveRandomWalk2dMobilityModelrandomdirectionrandomspeed
Rectangle(double_xMin,double_xMax,double_yMin,double_yMax)
98BuildingaWirelessNetworkToBuildingaWirelessNetworkTopologyWanttheaccesspointto
溫馨提示
- 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 蘇科版數(shù)學(xué)七年級(jí)上冊(cè)4.2《一元二次方程的解法》(第6課時(shí))聽評(píng)課記錄
- 冀教版數(shù)學(xué)八年級(jí)上冊(cè)《SAS》聽評(píng)課記錄5
- 湘教版數(shù)學(xué)七年級(jí)下冊(cè)3.2.2《角的度量》聽評(píng)課記錄
- (湘教版)七年級(jí)數(shù)學(xué)下冊(cè):2.1.4《多項(xiàng)式的乘法》聽評(píng)課記錄
- 七年級(jí)道德與法治上冊(cè)第三單元 師長(zhǎng)情誼第六課師生之間第2框師生交往聽課評(píng)課記錄(新人教版)
- 人教版七年級(jí)數(shù)學(xué)上冊(cè):4.1.2《點(diǎn)、線、面、體》聽評(píng)課記錄1
- 湘教版數(shù)學(xué)七年級(jí)上冊(cè)1.4.1《有理數(shù)的加法》聽評(píng)課記錄
- 部編版八年級(jí)道德與法治上冊(cè)聽課評(píng)課記錄《9.1認(rèn)識(shí)總體國(guó)家安全觀》
- 暑假小學(xué)一年級(jí)學(xué)習(xí)計(jì)劃
- 三年級(jí)下學(xué)期班主任工作計(jì)劃
- 2025中國(guó)移動(dòng)安徽分公司春季社會(huì)招聘高頻重點(diǎn)提升(共500題)附帶答案詳解
- 七年級(jí)英語(yǔ)下學(xué)期開學(xué)考試(深圳專用)-2022-2023學(xué)年七年級(jí)英語(yǔ)下冊(cè)單元重難點(diǎn)易錯(cuò)題精練(牛津深圳版)
- 杭州市房地產(chǎn)經(jīng)紀(jì)服務(wù)合同
- 放射科護(hù)理常規(guī)
- 新時(shí)代中小學(xué)教師職業(yè)行為十項(xiàng)準(zhǔn)則
- 人教版八年級(jí)上冊(cè)英語(yǔ)1-4單元測(cè)試卷(含答案)
- 2024年大宗貿(mào)易合作共贏協(xié)議書模板
- 初中數(shù)學(xué)教學(xué)經(jīng)驗(yàn)分享
- 新聞?dòng)浾咦C600道考試題-附標(biāo)準(zhǔn)答案
- 2024年公開招聘人員報(bào)名資格審查表
- TSG ZF001-2006《安全閥安全技術(shù)監(jiān)察規(guī)程》
評(píng)論
0/150
提交評(píng)論