ns3笔记

ns3博客资源

ns3仿真之两个节点之间通信加入背景流量
http://blog.csdn.net/mary19920410/article/details/72817846

NS3学习资料
http://blog.csdn.net/yanerhao/article/details/53335562

NS3 Tracing System
http://blog.csdn.net/yanerhao/article/details/53304216

Ubuntu中利用GNUPLOT画NS3产生的数据
http://blog.csdn.net/yanerhao/article/details/53215593

NS3 seventh.cc为例说明Probe
http://blog.csdn.net/yanerhao/article/details/53930373

以wifi-example-sim.cc为例说明NS3统计数据模型
http://blog.csdn.net/yanerhao/article/details/53979539

NS3命令行学习
http://blog.csdn.net/yanerhao/article/details/53436774

浅析ns3之OnOffApplication类
http://blog.csdn.net/mary19920410/article/details/71641305

NS3中,./waf –run “自定义文件夹”(脚本以及模拟场景都放在该自定义的文件夹内)
http://blog.csdn.net/xdf191/article/details/53340435

ns3中调试程序——命令行、gdb和logging系统
http://blog.csdn.net/xdf191/article/details/53400614

NS3网络仿真(8): 实时仿真
http://blog.csdn.net/lights_joy/article/details/47322513

NS3网络仿真(7): Wifi节点
http://blog.csdn.net/lights_joy/article/details/46868631

[NS3]Openflow Modle安装
http://blog.csdn.net/roger__king/article/details/9272141

NS3仿真wifi网络环境 - NS3中无线节点的通信传输范围如何设置?
http://blog.csdn.net/ztguang/article/details/71107037

浅析NS3中各个流量发送应用的异同(UdpEcho, OnOffApplication, BulkSend)
http://blog.csdn.net/xinwenfei/article/details/72599103

关于NS3中各个WifiRemoteStationManager(一)
http://blog.csdn.net/xinwenfei/article/details/70266320

全双工无线通信在ns3上的实现
http://blog.csdn.net/u013712533/article/details/60136444

NS-3上下行链路丢包仿真
http://blog.csdn.net/u014565333/article/details/53886515

NS-3 模拟FTP数据流
http://blog.csdn.net/u014565333/article/details/53419429

ns3 installation

https://www.nsnam.org/wiki/Installation

———————-9月30日 更————————————-

在使用FlowMonitor模块的时候,关于include哪个头文件的问题。

当我

#include "ns3/flow-monitor-module.h"

的时候,给我报错。
error: ‘ns3::FlowMonitorHelper::FlowMonitorHelper(const ns3::FlowMonitorHelper&)’ is private
还有../scratch/goal-topo.cc:164:84: error: within this context
Simulator::Schedule (nSamplingPeriod, &CheckThroughput, flowmon, monitor, dataset);

这里写图片描述
当我

#include "ns3/flow-monitor-helper.h"

的时候,又给我报这个错误。
这里写图片描述
不知道到底是什么鬼。。。
以上已解决。

去掉Simulator::Stop(stopTime);之后

这里写图片描述
Simulation不会停止,而且不能显示吞吐量。

把Simulator::Schedule()从CheckThroughput()函数里拿出来放到main()之后

这里写图片描述
依然不能测得吞吐量。
———————–9月24日更————————————-
今天临晨试着在ubuntu-14.04上再装一下openflow integration。最后用另外一种方式./bake安装好了openflow integration.
记住目录结构是这样的。
这里写图片描述
草!终于尼玛安装成功了。
这里写图片描述
———————–9月24日更————————————–

参考:
http://www.cnblogs.com/yibobo-blog/p/4924340.html
ns-3的API:
https://www.nsnam.org/docs/release/3.17/doxygen/
一些学习的视频:
ns3 overview
ns3share’s channel
tutorial-ns3
Building Simple Network Topologies p2

Main

——————7月8日更新———————————–
我拿着这个bug在网上半天找不到答案,突然找到一个Google Group里面的回答,发现跟我之前装ns3的方式不一样。于是在之前ns3的兄弟目录装了一个他们说的那种版本的ns3.
http://mailman.isi.edu/pipermail/ns-bugs/2015-February/011975.html
并按照这里面的内容改了一下几个文件(其实就是在一个.cc文件里面include了某个头文件,而在另一个文件.h里取消了include那个头文件,然后改了一下wscript)。
这里写图片描述
编译这两千个.cc文件也是不简单给ubuntu的2.2G内存用完了,结果还碰到一个g++编译器的问题,得用swap,于是在本来就不多的硬盘上给了1G用作swap,sudo dd if=/dev/zero of=/swapfile bs=64M count=16sudo mkswap /swapfile
sudo swapon /swapfile
。编译完成之后删除sudo swapoff /swapfile
sudo rm /swapfile
。其实就是在『bindings/ns3module.cc』这个文件编译的时候超级吃内存(感觉得要2G),这种文件编译完了立马内存就释放了。
http://skypacer210.github.io/2014/12/26/building-ns-3-on-ubuntu/
这里写图片描述
这里写图片描述
OK,在这种下载ns3的方式下,编译成功了。
这里写图片描述
————————-我是分割线——————————–
最近准备建一些混杂的拓扑(有WIFI,有点对点,有CSMA以太网),但是OpenNet这个库是刚出来的,有一些小bug,不太好用,于是跟Gilani交流后,他说ns-3可以做,于是我上网找了一些视频开始学习。
看视频里面的代码的一个示例:tutorial4.cc
这里写图片描述
这里是要建立的拓扑:
这里写图片描述
实际上每个节点(由NodeDeviceContainer建立的)是按照创建顺序然后依次排入一个NodeList中,用来为没个节点建立数字索引。
这里写图片描述
每个网卡(API里面叫NetDevice,比如回环网卡LoopbackNetDevice, 点对点网卡PointToPointNetDevice等)

这里写图片描述
一个物理的网络设备可以有安装多个网卡
这里写图片描述

————————–9月1日————————-
现在要监控网络流量,测速。要用到ns3/flow-monitor-helper.h
但是网上看到的例子
https://groups.google.com/forum/#!topic/ns-3-users/9_X3qWt3dBI里面碰到一个issue。
这里写图片描述
然后发现可以这样解决。

For ns-3.15 or later, you should be doing instead:
onOffHelper.SetAttribute (“OnTime”, StringValue
(“ns3::ConstantRandomVariable[Constant=20]”));
This was an API change from ns-3.14 to ns-3.15.

https://groups.google.com/forum/#!topic/ns-3-users/iG9Y3KBx29U

————-9月18日 更————————–

设置NS_LOG环境变量

原来得在命令行里设置环境变量,那些NS_LOG_INFO()才会生效。

$ export NS_LOG=GoalTopoScript=info

其中GoalTopoScript这个值是在我的那个goal-topo.cc文件开头定义的。
这里写图片描述

// 用于命令行操作 `$ export NS_LOG=GoalTopoScript=info`
NS_LOG_COMPONENT_DEFINE ("GoalTopoScript");

设置好NS_LOG环境变量之后,再运行,就可以看到NS_LOG_INFO()的消息了。
这里写图片描述

————————9月20日 更—————————–
『./ns3/log-macros-enabled.h:156:11: error: ‘g_log’ was not declared in this scope』
当我运行

$ ./waf --run wifi-wired-bridging

的时候,他给我报这个错。
这里写图片描述
查了下google groups里面说的,
https://groups.google.com/forum/#!topic/ns-3-users/i9HijXJADKU
原来是没有在using namespace ns3int main()之间加

NS_LOG_COMPONENT_DEFINE ("wifiWiredBridgingScript");

加上之后,果然编译成功了。
这里写图片描述
然后查看一下.pcap抓包文件。

$ tcpdump -tt -nn -r wifi-wired-bridging-0-2.pcap |grep -E "192.168.0.6|192.168.0.2"
#或者 grep -e "192.168.0.6" -e "192.168.0.2"

这里写图片描述

  • 7
    点赞
  • 72
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值