# MATLAB-NS3
Co-simulate MATLAB with NS-3 network simulator, combining the powers of MATLAB and NS-3. Describe the scenario in MATLAB, run simulation from MATLAB, capture the results and visualize them in MATLAB.
Optionally use the MATLAB PHY and Channel models, instead of the statistical models of NS-3.
This co-simulation code currently:
* Supports modeling WLAN network and 802.11p based V2X scenarios.
* See the documentation for the list of supported classes.
* Works with NS3.29 version (see the GitHub branch for NS3.26 version support)
* Works on Linux. Can get it working on Windows, if the NS3 library port is available to Windows.
* For high-fidelity WLAN PHY and Channel modeling, MATLAB WLAN Toolbox is recommended. Included example usage for 802.11a.
* For proper visualization of the included examples, display should be of Full-HD (1920x1080) resolution.
## Example scenarios
Following example scenarios are included in this repository:
1. WLAN Infrastructure Example
2. Truck Platooning Example with V2X
3. Manhattan Grid Hazard Warning Example with V2X
See the included documentation in 'doc' folder, for more details.
## Folders in the repository
* doc - Documentation about the co-simulation and included examples
* mlCode/mlWrappers - MATLAB wrappers over NS3
* mlCode/mlWiFiPhyChannel - Sample MALTAB code using MATLAB WLAN Toolbox Phy and Channel modeling
* native/mexBindings - Mex bindings over native C++ classes of NS3
* native/mlPhy - Additional C++ classes for NS3 to invoke MATLAB WLAN Toolbox Phy and Channel models
* scenarios - Contains example scenarios written in MATLAB that utilize the MATLAB-NS3 co-simulation
* videos - Recorded videos, expaining the demo scenarios
## Setting up the co-simulation environment
Follow these steps to setup this co-simulation:
1. Download the source code (or download and extract the zip file). This gives out MATLAB-NS3 folder.
1. Download NS-3.29 from https://www.nsnam.org/release/ns-allinone-3.29.tar.bz2.
* Untar and place NS-3 source folder 'ns-allinone-3.29\' inside the MATLAB-NS3 folder
* Execute ‘NS3-build.sh’ to build all the necessary NS3 libraries using the following command
`$sh NS3-build.sh`
**Note:** *It is strongly recommended that you add LD_LIBRARY_PATH export to the shell startup script so that it is set automatically at startup.*
1. Add path to 'LD_LIBRARY_PATH' in the startup script
* If you use bash shell, add this line at the end of ~/.bashrc file:
`export LD_LIBRARY_PATH=<MATLAB-NS3 BASE FOLDER>/ns-allinone-3.29/ns-3.29/build/lib:$LD_LIBRARY_PATH`
* If you use csh / tcsh, add the following line at the end of ~/.cshrc file:
`setenv LD_LIBRARY_PATH<MATLAB-NS3 BASE FOLDER>/ns-allinone-3.29/ns-3.29/build/lib:$LD_LIBRARY_PATH`
**Note:** *You have to launch new terminal (shell) or restart the PC to get the environment with updated LD_LIBRARY_PATH.*
1. Launch MATLAB from the new terminal. Go to the folder MATLAB-NS3.
1. Run ‘buildMex.m’ to build Mex-binaries in the MATLAB Command Window.
`>>MATLAB-NS3/native/mexBindings/buildMex`
**Note:** *You may ignore warnings about GCC compiler version, thrown by MATLAB MEX. It works on Debian 8 (GCC version 4.9.x) and Debian 9 (GCC version 6.3.x). Should work with other GCC versions also.*
## Running the example scenarios
All examples are placed under ‘scenarios’ folder. Following steps are applicable to run any of the examples in this folder.
1. Go to any example folder, such as: MATLAB-NS3/scenarios/truckPlatooning/
2. Run ‘scenario.m’ script of any example. It might take around 2-3 minutes to complete. During this time the terminal will remain busy.
**Note:** *Running the simulation scenario will clear all the variables, close all the figures and unload all the functions in the current workspace.*
`>>scenario.m`
3. To visualize the results of the simulation, run the MATLAB script in the ‘visualizer’ folder of the same example.
`>>topologyVisualizer.m`
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
该资源内项目源码是个人的课程设计,代码都测试ok,都是运行成功后才上传资源,答辩评审平均分达到96分,放心下载使用! ## 项目备注 1、该资源内项目代码都经过测试运行成功,功能ok的情况下才上传的,请放心下载使用! 2、本项目适合计算机相关专业(如计科、人工智能、通信工程、自动化、电子信息等)的在校学生、老师或者企业员工下载学习,也适合小白学习进阶,当然也可作为毕设项目、课程设计、作业、项目初期立项演示等。 3、如果基础还行,也可在此代码基础上进行修改,以实现其他功能,也可用于毕设、课设、作业等。 下载后请首先打开README.md文件(如有),仅供学习参考, 切勿用于商业用途。 该资源内项目源码是个人的课程设计,代码都测试ok,都是运行成功后才上传资源,答辩评审平均分达到96分,放心下载使用! ## 项目备注 1、该资源内项目代码都经过测试运行成功,功能ok的情况下才上传的,请放心下载使用! 2、本项目适合计算机相关专业(如计科、人工智能、通信工程、自动化、电子信息等)的在校学生、老师或者企业员工下载学习,也适合小白学习进阶,当然也可作为毕设项目、课程设计、作业、项目初期立项演示等。 3、如果基础还行,也可在此代码基础上进行修改,以实现其他功能,也可用于毕设、课设、作业等。 下载后请首先打开README.md文件(如有),仅供学习参考, 切勿用于商业用途。
资源推荐
资源详情
资源评论
收起资源包目录
毕业设计&课设-MATLAB与NS3协同仿真.zip (177个子文件)
ml-wifi-phy.cc 11KB
ml-wifi-channel.cc 8KB
ml-wifi-helper.cc 5KB
mexMatlabWifiChannelHelper.cpp 14KB
mexNode.cpp 12KB
mexWaveHelper.cpp 11KB
mexIpv4Address.cpp 11KB
mexNodeContainer.cpp 11KB
mexNetDevice.cpp 11KB
mexConfig.cpp 10KB
mexYansWifiChannelHelper.cpp 9KB
mexWifiHelper.cpp 9KB
mexInetSocketAddress.cpp 8KB
mexMobilityHelper.cpp 8KB
mexApplicationContainer.cpp 7KB
mexSimulator.cpp 7KB
mexNqosWaveMacHelper.cpp 6KB
mexEventId.cpp 6KB
mexQosWaveMacHelper.cpp 6KB
mexUdpClientHelper.cpp 6KB
mexNetDeviceContainer.cpp 6KB
mexUdpEchoClientHelper.cpp 6KB
mexPacketSocketAddress.cpp 6KB
mexOnOffHelper.cpp 6KB
mexSsid.cpp 6KB
mexIpv4AddressHelper.cpp 6KB
mexInternetStackHelper.cpp 6KB
mexWifiMacHelper.cpp 6KB
mexIpv4InterfaceContainer.cpp 5KB
mexUdpServerHelper.cpp 5KB
mexWifi80211pHelper.cpp 5KB
mexSocketInterface.cpp 5KB
mexAddress.cpp 5KB
mexPacketSinkHelper.cpp 5KB
mexUdpEchoServerHelper.cpp 5KB
mexNs3State.cpp 4KB
mexTimeValue.cpp 4KB
mexIpv4GlobalRoutingHelper.cpp 4KB
mexConstantAccelerationMobilityModel.cpp 4KB
mexMatlabWifiPhyHelper.cpp 4KB
mexConstantVelocityMobilityModel.cpp 4KB
mexYansWifiPhyHelper.cpp 4KB
mexPacketSocketHelper.cpp 4KB
mexMobilityModel.cpp 3KB
mexDataRateValue.cpp 3KB
mexAddressValue.cpp 3KB
mexSsidValue.cpp 3KB
mexUintegerValue.cpp 3KB
mexStringValue.cpp 3KB
mexBooleanValue.cpp 3KB
mexDoubleValue.cpp 3KB
mexRngSeedManager.cpp 3KB
mexYansWavePhyHelper.cpp 3KB
mexConstantPositionMobilityModel.cpp 3KB
mexEmptyAttributeValue.cpp 2KB
mexMatlabWifiChannel.cpp 2KB
mexYansWifiChannel.cpp 2KB
mexNodeList.cpp 2KB
mexWifiPhyHelper.cpp 2KB
mexAttributeDumper.cpp 769B
deinitNs3Interface.cpp 407B
initNs3Interface.cpp 405B
ml-wifi-helper.h 8KB
ml-wifi-phy.h 5KB
ml-wifi-channel.h 5KB
mexNs3State.h 3KB
Example-WLANInfrastructure.html 273KB
GettingStarted.html 186KB
Example-ManhattanGridHazardWarning.html 88KB
Example-TruckPlatooning.html 72KB
ns3_supported_class_list.html 10KB
mobilityIntelligence.m 20KB
scenarioSetup.m 17KB
scenarioSetup.m 16KB
vehicularRoute.m 15KB
visualizerTraces.m 14KB
topologyVisualizer.m 13KB
topologyVisualizer.m 13KB
scenario.m 12KB
WSMPTraffic.m 12KB
scenario.m 11KB
mobilityIntelligence.m 10KB
manhattanTopology.m 10KB
scenario.m 10KB
visualizerTraces.m 10KB
WSMPTraffic.m 9KB
street.m 9KB
vehicularMobility.m 8KB
nodeListInfo.m 6KB
vehicularMobility.m 6KB
nodeListInfo.m 5KB
hazard.m 5KB
WSTCallback.m 5KB
WaveHelper.m 4KB
Ipv4Address.m 4KB
buildMex.m 3KB
MatlabWifiChannelHelper.m 3KB
Node.m 3KB
YansWifiChannelHelper.m 3KB
NodeContainer.m 3KB
共 177 条
- 1
- 2
资源评论
毕业小助手
- 粉丝: 2751
- 资源: 5583
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 项目采用YOLO V4算法模型进行目标检测,使用Deep SORT目标跟踪算法 .zip
- 针对实时视频流和静态图像实现的对象检测和跟踪算法 .zip
- 部署 yolox 算法使用 deepstream.zip
- 基于webmagic、springboot和mybatis的MagicToe Java爬虫设计源码
- 通过实时流协议 (RTSP) 使用 Yolo、OpenCV 和 Python 进行深度学习的对象检测.zip
- 基于Python和HTML的tb商品列表查询分析设计源码
- 基于国民技术RT-THREAD的MULTInstrument多功能电子测量仪器设计源码
- 基于Java技术的网络报修平台后端设计源码
- 基于Python的美食杰中华菜系数据挖掘与分析设计源码
- 基于Java与JavaScript混合技术的吉森摄影项目设计源码
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功