![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
ns2
文章平均质量分 66
天使之梦魇
这个作者很懒,什么都没留下…
展开
-
NS2安装
[1] Windows + Cygwin +[1] Windows + Cygwin + NS2 (好,先把这个安装成功才能进行下面的工作)http://140.116.72.80/~smallko/ns2/setup_en.htm (英文)http://140.116.72.80/~smallko/ns2/setup.htm (中文)[2] LEACH protocol inst转载 2014-02-28 22:34:51 · 736 阅读 · 0 评论 -
NS2之 glibc detected 事出有因
今天自己在ns2中添加协议过程,出现段错误,想用gdb调试,上网google下,发现只需加入-g参数就可以了,学长提醒我,直接在./configure --enable-debug就可以在不直接修改Makefile的情况下进行调试支持,其实相当于这一步将-g加入了Makefile,但是还有错误,是“warning as error”,解决方法是,把 -Werror参数去掉,因为这个参数是提醒编转载 2013-10-14 10:57:43 · 1036 阅读 · 0 评论 -
NS2进阶实例 8---RandomNumber Generation(NS2中随机数产生)
NS2进阶实例 8---RandomNumber Generation(NS2中随机数产生) 2011-06-19 16:09:00| 分类:NS2学习 |举报|字号 订阅网络仿真中有很多场景是需要随机数作为输入或控制时刻的,为此我参考了柯老师资料,学习了NS2中产生随机数的方法,并且给出我的TCL代码,方便大家学习,也方便自己以后查询,可以拿来即用!转载 2014-02-28 21:58:55 · 866 阅读 · 0 评论 -
OTcl与C++,NS2是如何识别并调用执行协议的
经过一段时间的代码阅读和资料查阅,在这里我想试着讲明一个困扰大多数NS2 Beginner的问题:Otcl和C++的交互,我们写的新协议(假若有的话)是如何被NS2执行的。就简单的从我们现有的来自长庚大学的802.16的补丁说起。移植完16的补丁我们的NS2就可以执行MAC层协议为“Mac/802_16“的tcl脚本代码。但是这个补丁(wimax_v2.03)里面的代码全都是用C++编写的底层转载 2014-02-28 22:29:08 · 462 阅读 · 0 评论 -
NS2画图gnuplot介绍
论文仿真的时候,结果需要通过图标来显示,可以使用最新的4.4版本来画图,将画图过程的设置写在一个文件中,保存在binary目录中,命名为:*.dat。具体的画图的命令的设置,可以在gnuplot中使用help命令来查看,查看参数的设置和你想要的效果。下面就举一个例子:set term emf //保存为emf格式,这样图才是矢量图,放大和缩小后不会失真set output "*转载 2014-02-28 22:39:05 · 1073 阅读 · 0 评论 -
ns2代码里面怎么得到其它节点的位置?
在node.h里面找到了static Node* get_node_by_address(nsaddr_t);MobileNode* pN=(MobileNode*)node->get_node_by_address(hdrcmn->prev_hop_); coutprev_hop_ if(pN) cout转载 2014-02-28 22:08:48 · 2867 阅读 · 1 评论 -
NS2节点通信半径修改
ns/tcl/lib/ns-default.tcl 里有设置默认值的,传输距离250米更改发射功率,或者接收阀值均能改变通信距离,计算公式在mobile/tworayground.cc里 ns-default.tcl 中的代码如下:Phy/WirelessPhy set CSThresh_ 1.559e-11 //this sensoring radiusPhy/Wi转载 2014-02-28 22:26:43 · 830 阅读 · 0 评论 -
NS2之移动节点
#include #include #include "connector.h" #include "delay.h" #include "packet.h" #include "random.h" #include "trace.h" #include "address.h" #include "arp.h" #include "topography.h" #in转载 2014-02-28 22:37:57 · 1514 阅读 · 0 评论 -
Ubuntu 12.04 +ns-allinone-2.34 安装教程
环境:一、下载ns-allinone-2.34。原版本下载:点此下载。二、安装X Windows的开发包和g++编译器在终端输入如下命令:如果还是没有成功安装的话,可以先安装这些软件包。sudo apt-get install build-essentialsudo apt-get install tcl8.4 tcl8.4-dev tk8.4 tk8.4-dev转载 2013-10-09 14:37:36 · 2133 阅读 · 0 评论 -
ns2传输损耗模型
在ns2的传输损耗模型中,节点位置、天线参数配置、传输路径模型都会影响到传输情况$ns node-config -adhocRouting $opt(adhocRouting) \ -llType $opt(ll) \ -macType $opt(mac) \ -channel $ch转载 2014-02-28 22:06:20 · 781 阅读 · 0 评论 -
NS2之移动节点邻居节点发现
//You can use the following methods to discover neighbors: //1. Use Hello Packets for *neighbor* discovery. //2. Use Communication range for neighbour discovery. //3. Use Nodes Positions for *neigh转载 2014-02-28 22:35:59 · 1137 阅读 · 0 评论 -
利用NS2的产生随机数机制来实现对链路的动态设置(连接建立时间,延迟)
set ns [new Simulator]set nf [open ex3out.nam w]$ns namtrace-all $nf set tf [open ex3out.tr w]$ns trace-all $tfset windowVsTime [open win w]set param [open parameters w]#Define a 'f转载 2014-02-28 22:44:22 · 1155 阅读 · 0 评论 -
ns2_相关资料大全
1、NS与网络模拟电子版 http://www.baisi.net/viewthread. ... %26amp%3Btypeid%3D22、NS软件包在Windows XP下的详细安装过程(多图,lynn友情提供) http://www.baisi.net/viewthread. ... %26amp%3Btypeid%3D23、一款强大的代码阅读器source insight转载 2014-02-28 11:55:27 · 945 阅读 · 0 评论 -
如何在ns2里产生随机数字
使用方法set r1 [new RandomVariable/Pareto]$r1 set avg_ 10.0$r1 set shape_ 1.2 puts stdout "[$r1 value ]"通过value就可以得到随机数。然后是要修改随机seed种子,就要在tcl开始预定义部分加入set val(seed) 0.0下面是一些随机分布的设定:1、均匀分布Ra转载 2014-02-28 22:14:26 · 1144 阅读 · 0 评论