# 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`
没有合适的资源?快使用搜索试试~ 我知道了~
MATLAB and NS3 co-simulation.zip
共178个文件
m:99个
cpp:59个
html:5个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 118 浏览量
2023-07-19
19:58:22
上传
评论
收藏 47.82MB ZIP 举报
温馨提示
MATLAB and NS3 co-simulation.zip
资源推荐
资源详情
资源评论
收起资源包目录
MATLAB and NS3 co-simulation.zip (178个子文件)
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
LICENSE 18KB
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
共 178 条
- 1
- 2
资源评论
AbelZ_01
- 粉丝: 896
- 资源: 5441
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 基于Golang实现的加权pagerank算法实现.zip
- 基于Java实现的pagerank算法.zip
- 基于C++实现的pagerank算法.zip
- 基于Python实现的pagerank算法.zip
- java面试题-leetcode题解之第14题最长公共前缀.zip
- java面试题-leetcode题解之第28题找出字符串中第一个匹配项的下标.zip
- java面试题-leetcode题解之第31题下一个排列.zip
- java面试题-leetcode题解之第6题Z字形变换.zip
- java面试题-leetcode题解之第8题字符串转换整数atoi.zip
- java面试题-leetcode题解之第13题罗马数字转整数.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功