百度空间 | 百度首页 
 
文章列表
 
您正在查看 "Ns2 Related" 分类下的文章

2009-02-06 22:42
类别:Ns2 Related | 评论(2) | 浏览()
 
2008-12-18 18:49
刚为一起研究的本科生作了一张ppt,讲述数据包在NS2无线节点(MobileNode)协议栈中的流动情况.

四张: 发送,转发,接收,ns2文档中未提到的无线网络各trace对象所在的位置.



ppt可以在这里下载

还有一本电子版的NS2与网络模拟可以在这里下载,尽管写的实在是...
类别:Ns2 Related | 评论(0) | 浏览()
 
2008-11-25 20:05

Linux.com

Everything Linux and Open Source

ns-2 network simulator: Free, yes; friendly, no

July 18, 2006 (8:00:00 AM) - 2 years, 4 months ago

By: Nauman Afzal

The open source network simulation tool ns-2 is an invaluable tool for researchers working on wired or wireless networks. I came across ns-2 while working on my thesis. I needed a network simulator, and since my college lacked the brand-name heavyweights, I had to look for an alternative that was free but could do the job. While ns-2 is free, it's also pretty unfriendly.

ns-2 is a variant of the REAL network simulator. Over the past few years it has been evolving, and it is still far from complete. Several organizations have been involved in its development, including DARPA, Xerox, UCB, and Sun Microsystems. The objective has been to make a network simulation tool to study and analyze new ideas in detail before implementation.

The software has been designed to work on Linux, but it can be made to run on Windows XP by using the Cygwin tool. For the current version ns-2.29, Fedora Core 2 is recommended, although ns-2 may work on Red Hat 9 or even FC4. Though there are no stringent hardware requirements, using a fast PC will result in less wasted time when you're running large simulations.

Installing ns-2 shouldn't be difficult for anyone familiar with unzipping source code, which can be downloaded for free from the ns-2 Web site. ns-2 runs from the command line; there is little GUI or drag-and-drop functionality.

The simulator structure uses two languages: OTcl scripting on the front end, and C++ on the back end. You use OTcl scripting to make a simulation scenario, which may include network components like nodes, routers, and link bandwidth. When using Windows-based simulators like Opnet and OMNeT, making a simulation scenario is as easy as dragging and dropping the required network components onto a workspace. In order to make a simulation scenario with ns-2, however, one has to learn OTcl in some detail, and that means the learning curve to use ns-2 can be quite steep.

Then, on the back end, there is C++. If, for instance, you are making a Mobile IP-based simulation, you have to enable the relevant Mobile IP C++ files in the OTcl code. The OTcl code links to the C++ files, so when the OTcl code runs, it calls the relevant C++ code to execute a particular task.

Results of the simulations are shown in a tabular form in what ns-2 calls trace files. One line in a trace file is produced for each data packet that travels from the initiating node to the terminating node. Since the trace files record every parameter of a data packet, including its size, start time, type, time to live, starting node, and ending node, ns-2 generates huge trace files. For example, in a Mobile IP simulation run of 120 seconds involving two nodes, the relevant trace file generated takes up a hefty 100MB. Run on a Pentium III client, the simulation could take more than 45 minutes to finish.

Filtering out required data from the trace files presents another issue. The data in trace files is in tabular form, with each column separated by a white space. You need to employ a programming language to filter out the required data. I have found that Perl or awk can handle the white space issue well.

ns-2 comes bundled with Xgraph to plot the data on a graph for analysis. You can also use a spreadsheet to make relevant plots and curves.

Though ns-2 provides limited ability to view the animations after the simulation, its sister program Network Animator (NAM) makes it possible. NAM also can record the animation in the form of graphics as the simulation progresses. These graphics can then be converted to GIF or AVI format for later viewing. NAM also provides options for adjusting the step size of the animation in milliseconds, zooming in and out, and pausing the animation.

In addition to being a research tool, ns-2 is also an excellent educational tool. The built-in tutorials provide an in-depth understanding of networks, their different protocols, and layer functions. For research, you will have to tinker with the C++ files that work in the background, and that can be mind-boggling at times. However, user support via mailing lists is excellent. Posted questions are usually answered in 24 hours, and that is one of the reasons why I chose ns-2 instead of OMNeT.

I advise anyone planning to try ns-2 to have patience and be ready for a lot of experimentation and tinkering.

Read in the original layout at: http://www.linux.com/feature/55614
类别:Ns2 Related | 评论(0) | 浏览()
 
2008-11-23 12:25
列出NS2中当前某一类别模型下的所有子模型名称
I creat this tcl file for listing models in NS2.

List.tcl

proc showAgent {arg1 arg2} {

   foreach cl [$arg1 info subclass] {

   set head |-

   for {set i 2} {$i <= $arg2} {incr i 1} {

      append head -

   }   append head $cl

   puts $head

   if {[$cl info subclass]!=""} {

      showAgent $cl [expr $arg2 + 1]

}

   }

}

set name [lindex $argv 0]

puts $name

showAgent $name 1

USAGE:
./ns List.tcl module_name
module_name: Agent, Application, Queue, Mac, Trace, Object, TclObject...

Example:
./ns List.tcl Mac

Mac
|-Mac/802_15_4
|-Mac/Sat
|--Mac/Sat/UnslottedAloha
|-Mac/Simple
|-Mac/SMAC
|-Mac/Tdma
|-Mac/802_3
|-Mac/802_11Ext
|-Mac/802_11
./ns List.tcl Queue
Queue
|-Queue/XCP
|-Queue/GK
|-Queue/REM
|-Queue/Vq
|-Queue/PI
|-Queue/dsRED
|--Queue/dsRED/core
|--Queue/dsRED/edge
|-Queue/Demarker
|-Queue/Marker
|-Queue/JoBS
|-Queue/CBQ
|--Queue/CBQ/WRR
|-Queue/SRR
|-Queue/DRR
|-Queue/FQ
|-Queue/SFQ
|-Queue/RED
|--Queue/RED/Pushback
|--Queue/RED/PD
|--Queue/RED/RIO
|---Queue/RED/RIO/Semantic
|--Queue/RED/Semantic
|-Queue/SimpleIntServ
|-Queue/DropTail
|--Queue/DropTail/XCPQ
|--Queue/DropTail/PriQueue


Contact Information

Email: fangvv@gmail.com

Website: http://sites.google.com/site/fangvv

类别:Ns2 Related | 评论(0) | 浏览()
 
2008-11-20 17:27

使用Source Insight分析NS2代码

Source Insight

(http://www.sourceinsight.com)

Introduction: http://www.sourceinsight.com/prodinfo.html

Trial Version: http://www.sourceinsight.com/eval.html

User Manual: http://www.sourceinsight.com/docsv3.html

Adding support for .cc file:

1.         Click “Options” Menu --> “Document Options” Dialog

2.         In “Document Options” Dialog:

Select "C++ Source File" in "Document Type" Droplist --> Add “;*.cc” in “File filter”

--> Click “Close” Button

Adding support for .tcl file:

1.         Download tcl language file from: http://www.sourceinsight.com/public/languages/TCL.CLF

2.         Click “Options” Menu --> “Preferences” Dialog --> “Languages” Tab

3.         In “Languages” Tab:

Click “import” Button --> Select “TCL.CLF” to import the tcl language file --> Select “TCL” in “Language” --> Click “Doc Types…” Button in “Languages” Tab --> “Document Options” Dialog

4.         In “Document Options” Dialog:

Click “Add Type…” Button --> Type “tcl” as Document Type Name --> Type “*.tcl” in “File filter” --> Select “TCL” in “Language” Droplist --> Select "Include when adding to projects" Checkbox --> Click “Close” Button

Import NS2 Source code

1.         Click "Project" Menu --> New Project --> Type “NS2” as the project name --> Click “OK” Button --> Click “OK” Button in “New Project Setting” Dialog --> “Add and Remove Project Files” Dialog

2.         In “Add and Remove Project Files” Dialog:

Select the NS2 source code file folder --> Click “Add All” Button --> Select “Recursively add lower sub-directories” --> Click “OK” Button --> Click “OK” for importing source code --> Click “Close” Button in “Add and Remove Project Files” Dialog

That’s ok! Enjoy it! For how to use Source Insight, please refer to its User Manual.

PS. You can also try the open source “Source Navigator” http://sourcenav.sourceforge.net/ and “Source Navigator NG” http://sourcenav.berlios.de/ .

Contact Information

Email: fangvv@gmail.com

Website: http://sites.google.com/site/fangvv

类别:Ns2 Related | 评论(0) | 浏览()
 
2008-11-17 17:49

使用NOAH (NO Ad-Hoc Routing Agent) 无线网络静态路由

Wireless Static Routing With NOAH (NO Ad-Hoc Routing Agent)

参考资料: http://icapeople.epfl.ch/widmer/uwb/ns-2/noah/

目前NS2官方版本中的DSDVDSRAODVTORA等路由协议均使用路由封包广播的方式来建立节点间的路由路径.相比而言,NOAH是一个可以由NS2使用者自己来设置路由路径的Routing Agent模块,路由表项均可由使用者在模拟script中指定.

[安装方法]

以下步骤在NS2.31版本上完成,当前路径为~/ns-2.31.

1.         Makefile.in檔的OBJ_CC段中,增加

noah/noah.o \

2.         Makefile.in檔的NS_TCL_LIB段中,增加

tcl/mobility/noah.tcl \

3.         建立一个新目录noah,下载noah.h noah.cc到这个目录下

4.         下载noah.tcltcl/mobility/目录下

5.         tcl/lib/ns-lib.tcl档的相关部分进行修改

source ../mobility/dsdv.tcl

source ../mobility/dsr.tcl

source ../mobility/com.tcl

#增加如下内容

source ../mobility/noah.tcl

           DSDV {

                  set ragent [$self create-dsdv-agent $node]

           }

           DSR {

                  $self at 0.0 "$node start-dsr"

           }

           AODV {

                  set ragent [$self create-aodv-agent $node]

           }

           TORA {

                  Simulator set IMEPFlag_ ON

                  set ragent [$self create-tora-agent $node]

           }

            #增加如下内容

           NOAH {

                   set ragent [$self create-noah-agent $node]

           }

Simulator instproc create-tora-agent { node } {

    set ragent [new Agent/TORA [$node id]]

       $node set ragent_ $ragent

       return $ragent

}

#增加如下函数

Simulator instproc create-noah-agent { node } {

    # Create a noah routing agent for this node

    set ragent [new Agent/NOAH]

   ## setup address (supports hier-addr) for noah agent

    ## and mobilenode

    set addr [$node node-addr]

    $ragent addr $addr

    $ragent node $node

    if [Simulator set mobile_ip_] {

        $ragent port-dmux [$node demux]

    }

    $node addr $addr

    $node set ragent_ $ragent

    return $ragent

}

6.         在终端执行如下命令,重新生成Makefile,清理并生成新的支持NOAH模块的NS2

./configure

make clean

make

[使用方法]

1.         在模拟script,设置Routing AgentNOAH.

……

set val(rp)             NOAH

……

$ns_ node-config -adhocRouting $val(rp) \

……

2.         仿真脚本中的路由表项设定规则为:

[$node_(N) set ragent_] routing C dest1 to-dest1-next dest2 to-dest2-next …

其中N为节点id (N=0,1,2…), C为路由表项数目, destx是目标节点, to-destx-next是从当前节点N到达destx所要经由的下一跳节点id.

示例:

[$node_(0) set ragent_] routing 2 3 1 4 2

表示节点0的路由表中有2:到达节点3的下一跳节点为节点1,到达节点4的下一跳节点为节点2.

注意1: 路由表项数目(C)要等于实际所使用的数目,如示例中使用2.

注意2: 若为一个目标节点指定多个下一跳节点,NOAH只选择最先设定的下一跳节点作为实际的下一跳节点.[$node_(0) set ragent_] routing 2 3 1 3 2中节点0到达目标节点3的下一跳节点为节点1.

注意3: 路由路径手动设定时,必须将下一跳节点选择为当前节点通信半径范围内的某个节点,否则无法建立连通的路由路径.

Contact Information

Email: fangvv@gmail.com

Website: http://sites.google.com/site/fangvv

繁体中文版: http://140.116.72.80(台湾省 成功大学)/~smallko/ns2/noah_st.htm

类别:Ns2 Related | 评论(0) | 浏览()
 
2008-11-16 18:35

NS2中无ARP的无线网络模拟

Wireless Simulation in NS2 without ARP

参考数据: ARP协议分析 http://sec.chinabyte.com/484/8578484.shtml

ARP(Address Resolution Protocol,地址解析协议) 是属于数据链路层的协议,用于将网络节点的网络地址(IP地址)转化为硬件地址(MAC地址).以太网中的数据帧通过硬件地址而非网络地址来确定接口.但是,当前的某些非使用TCP/IP协议的无锡网络(如无限传感器网络, Wireless Sensor Network),节点可能只具有简单的节点标识,不存在MAC地址和IP地址之间的相互映像.因此,在节点大规模部署的无线网络系统的仿真中,节点ARP封包的广播也会导致对网络性能评测的影响.

[方法]

以下步骤在NS2.31版本上完成,其它版本可相应参考.

1.         修改mac/mac.cc

//static int MacIndex = 0; 不使用该变量生成MAC地址index_

Mac::Mac() :

       BiConnector(), abstract_(0), netif_(0), tap_(0), ll_(0), channel_(0), callback_(0),

       hRes_(this), hSend_(this), state_(MAC_IDLE), pktRx_(0), pktTx_(0)

{

       //index_ = MacIndex++; 不使用该方法生成MAC地址index_

       bind ("index_", &index_); //index_变量和tcl空间中的index_变量绑定

       bind_bw("bandwidth_", &bandwidth_);

       bind_time("delay_", &delay_);

       bind_bool("abstract_", &abstract_);

}

2.         修改tcl/lib/ns-default.tcl

#

# Wireless simulation support

#

Mac set debug_ false

Mac set index_ -1 ; #tcl空间的index_变量赋初始值

ARPTable set debug_ false

ARPTable set avoidReordering_ false ; #not used

God set debug_ false

3.         修改tcl/lib/ns-mobilenode.tcl

       set nullAgent_ [$ns set nullAgent_]

       set netif $netif_($t)

       set mac $mac_($t)

# IP地址id_直接赋予MAC地址index_

$mac set index_ [$self set id_]

       set ifq $ifq_($t)

       set ll $ll_($t)

4.         修改mac/arp.cc中的arpresolve函数

int

ARPTable::arpresolve(nsaddr_t dst, Packet *p, LL *ll)

{

       ARPEntry *llinfo ;

      

       assert(initialized());

// 根据上文的修改,每个节点的id_index_相同

// 在传输时只需要将封包中的下一跳MAC地址设为网络地址ch->next_hop_即可

// 下一跳节点的网络地址ch->next_hop_在节点的路由层时已经确定,这里直接使用

hdr_cmn *ch = HDR_CMN(p);

       mac_->hdr_dst((char*) HDR_MAC(p), ch->next_hop_);

       return 0;

}

5.         重新编译NS2,在仿真Script中将MAC Trace选项打开,观察仿真结果.



Contact Information

Email: fangvv@gmail.com

Website: http://sites.google.com/site/fangvv

繁体中文版: http://140.116.72.80(台湾省 成功大学)/~smallko/ns2/arp.htm

类别:Ns2 Related | 评论(0) | 浏览()
 
2008-10-27 22:02



<<NS2与网络模拟>>书中148页介绍threshold工具时,只提到了控制NS2无线节点的信号传输范围,实际上载波侦听范围同样也需要设置,设置阈值同样可以使用threshold工具,但需要同时写入以下两个语句:

Phy/WirelessPhy set RXThresh_ XXXXXX
Phy/WirelessPhy set CSThresh_ YYYYYY

需要注意的是,在NS2里默认设置载波侦听范围(550m)是信号传输范围(250m)的2.2倍,如果自己设置的话最好也按照2.2倍来计算设置,比如说30m-->66m等等.

如何选择最好的设置倍数,请参考:Tuning the Carrier Sensing Range of IEEE 802.11 MAC
类别:Ns2 Related | 评论(0) | 浏览()
 
2008-05-12 17:57
http://www.ece.rice.edu/~jpr/ns/docs/802_11.html

了解NS2中802.11 MAC的工作流程
类别:Ns2 Related | 评论(8) | 浏览()
 
2008-05-09 13:13
http://www.wns2.org/

SCOPE

ns, the free open-source network simulator, is the de-facto standard for research over a wide variety of networking areas. ns version 2 is widely used across both academia and industry as a way of designing, testing and evaluating new and existing protocols and architectures, and has also proven a very useful tool for teaching purposes. ns version 3 is under active development.

The Workshop on ns-2 (WNS2) is a two-day event held in conjunction with VALUETOOLS 2008, the Third International Conference on Performance Evaluation Methodologies and Tools (http://www.valuetools.org/), during the week of 20-24 October 2008 in Athens, Greece. WNS2 2008 follows the success of the first WNS2 workshop in 2006. A tutorial day on Thursday 23 October is followed by presentation of reviewed papers on Friday 24 October 2008.

The main goals of this second WNS2 workshop are to bring together networking researchers from both academia and industry, to discuss recent advances, to identify future directions in network simulation, and to foster interdisciplinary collaborative research in this area. The workshop aims to emphasise the future evolution of ns-2, now that ns-3 is under active development, and its extension in novel research areas and networking technologies and scenarios.

TOPICS

This workshop focuses on the ns simulator in itself, and in improving simulation. We seek original contributions that go beyond the use of ns-2 "as is" for networking scenarios, and which try to make ns do something new and different. Topics of interest for the Workshop include, but are not limited to:

Structural developments/enhancements to the NS-2 simulator itself:

  • Presentation/evaluation of new features/architectures under development for ns-3.
  • Dynamic management of libraries / ns-Modules.
  • Large-scale network simulation and model-based simulation approaches.
  • Development of parallel and distributed versions of ns. Use of virtualization with ns.
  • Integration of simulation and emulation.
  • Post-processing tools, including GUIs for statistical analysis and visualization of simulation results.

Simulator use and validation of simulation accuracy:

  • Validation of ns behaviour with experimentation and real data from implementations.
  • Comparative studies of ns and other network simulation tools, both commercial and freely available.
  • Environments and methodologies: the best practices, third-party code, helper scripts, and frameworks that serious users of ns recommend to get things done

New simulation models and features:

  • Wireless channel modelling.
  • Frameworks for cross-layer support.
  • Mobile and wireless networks, 3G/4G networks, WLANs, WPANs, WiMAX, Mesh networks...
  • Delay-tolerant networking.
  • Congestion-control and transport-layer issues in long-fat networks.
  • Mobility: network mobility (NEMO), physical node mobility (e.g., group mobility models).
  • Sensor and actuator networks (wireless, underwater, underground).
  • Peer-to-peer systems.
  • Network coding: data dissemination, encoding/decoding suites.
  • Grid computing.

Important Dates

Full Papers due:
Notification of Acceptance:
Camera-ready Manuscripts due:
Conference Dates:
May 25, 2008
July 1, 2008
August 1, 2008
October 24, 2008

CFP

第二届了,第一届的论文在这里.
类别:Ns2 Related | 评论(0) | 浏览()
 
2008-05-09 09:41
http://code.google.com/soc/2008
The ns-3 Project (ideas)

如果有时间参加这种开发活动还是比较有意义的,我觉得比做野鸡项目好:)

注:野鸡项目:我用来指代一般的小公司为了节省成本而将工程项目外包给学校实验室做的,或者是开公司的叫兽们使用廉价劳动力来做他公司事情的,一无理论创新研究价值二无开源发布之可能三可能无商业价值的,做了之后除了多会了三五个API对自己并无实际提高且容易造成博士没文章而延期的这种项目.
类别:Ns2 Related | 评论(0) | 浏览()
 
2008-04-23 13:24
http://blog.sina.com.cn/s/blog_3c680f8101008rty.html

推荐一下,我个人不做分簇协议,不过安装确实很重要,很多同学包括老师研究WSN就是从LEACH协议开始的.
类别:Ns2 Related | 评论(0) | 浏览()
 
2008-04-14 18:20
http://www.mannasim.dcc.ufmg.br/index.htm

看了一下,如果你要在LEACH上做一些改动,这个版本应该不错,本身集成了LEACH协议.

另外,网络结构是三层的: 普通节点,簇头,网络接入点,总的来看比较适合用于分簇结构的WSN网络模拟.

脚本可视化生成功能早在05-06年我就带本科毕业设计做过了,只是做得不好因此没有像Jtrana那样开源了.

其他的看上去没有太大的亮点.

ps:
因为我曾经做过很长时间的模拟器相关的工作,就国内而言,并不适合做这样的工作.第一是不专心,有搞钱的项目人心就飞走不干了,项目持续性差,做不了NS2那么多年的持之以恒;第二是国人不喜欢开源,有的时候是太烂不敢开源,因此不开源带来的封闭性和不可维护性可想而知.当然,国外也不见得有多好,但比国内要好.国内有个著名的模拟器SkyEye,挺不错的.
另外,做了那么多模拟器,真正被用的有几个?说白了,很多人就是拿来凑凑数据发发文章,有一个通用的就够了.不信可以调查一下用NRLsim做文章的有几个?多数的EEer使用Matlab,多数的CSer使用NS2和Glomosim,还有手编的. 大多数模拟器还是针对不同场景不同应用不同项目做的,比如我在做的NS2,Matlab联合仿真,少了EE和CS的人一起做,绝对不知何其所云!这样的东西realease出来不会是通用的,只会是少部分人关注.
最要命的是最后一点,就是做模拟器的,找工作时可能会比较麻烦,试问你能找到什么工作?
当然了,做这样的事情绝对是可以申请除NSFC以外的一些大项目的,只是说白了,对科学的意义和对自身的意义实在是微乎其微,我觉得.
类别:Ns2 Related | 评论(2) | 浏览()
 
2008-04-10 09:04
有朋友问我一些NS2无线模拟的问题,难度不大,我想提问的原因有三:1.实践少;2.懒得搜;3.答案快. 因为我面临的主要问题是推公式写文章以求早点毕业,所以没有太多的精力去仔细回答,实在是抱歉.推荐几个网站,先自己学习学习吧,谁都是从ABC学起的.

柯博士的网站:http://140.116.72.80(台湾省 成功大学)/~smallko/ns2/ns2.htm, 内容覆盖很全了,适合去找具体的模型实现.

一些博士们的心得体会和经验,你的问题说不定就能得到解决:

http://www.cs.binghamton.edu/~kliu/research/ns2code/index.html
http://web.syr.edu/~dchen02/FAQ.txt
http://www.winlab.rutgers.edu/~zhibinwu/html/network_simulator_2.html

想学会做Adhoc路由的先学简单的NOAH静态路由:
http://icapeople.epfl.ch/widmer/uwb/ns-2/noah/

http://www.crhc.uiuc.edu/wireless/实验室推出的课程,实验室的教授也是很有名的,不但因为其无线多信道通信做的好,而且因为其在Infocom上的扫盲课程:Tutorial on Mobile Ad Hoc Networks: Routing, MAC and Transport Issues 。
http://www.crhc.uiuc.edu/wireless/assignments/simulations/


最后,有什么问题,完全可以按照关键字来查找Google嘛,推荐用英文版的Google,中文版的任何搜索引擎在学术搜索上都不行.学会自己找答案,这是研究生学习的一个基本要求吧.当然也可以去搜索NS2的邮件列表和在上面提问.

本博客NS2相关文章
类别:Ns2 Related | 评论(3) | 浏览()
 
2008-02-23 13:07
http://netlab.cse.yzu.edu.tw/ns2/html/topology/topology.htm
类别:Ns2 Related | 评论(0) | 浏览()
 
     
 
 
文章分类
 
     
 
文章存档
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
     
 
最新文章评论
   

非常感谢!
 

do not know or understand articles totally But one thing, you are competent a...
 
 

Thanks
 

TKS
 
     


©2009 Baidu