- 1、本文档共133页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
柯志亨老师ns2
Network Simulation and AnalysisUsing NS2;Methods for network research;Why Simulation;Simulation -- Advantage;Simulation -- Disadvantage;Outline1 ;Outline2;Outline3;Outline4;Outline5;Outline6;What is NS-2;Ns functionalities;“Ns” Components;NS Architecture;The simulation procedure;User’s view of NS2;Architecture view of NS2;NS2 Installation;完成安裝後, 並重新啟動cygwin視窗,就會如上圖所示,產生一個home 目錄
並且把一些設定檔案放到home目錄下;NS2 installation;export NS_HOME=`pwd`/ns-allinone-2.27
export PATH=$NS_HOME/tcl8.4.5/unix:$NS_HOME/tk8.4.5/unix:$NS_HOME/bin:$PATH
export LD_LIBRARY_PATH=$NS_HOME/tcl8.4.5/unix:$NS_HOME/tk8.4.5/unix:\
$NS_HOME/otcl-1.8:$NS_HOME/lib:$LD_LIBRARY_PATH
export TCL_LIBRARY=$NS_HOME/tcl8.4.5/library;測試你安裝的ns2
1.如上圖所示
2. $cd ns-allinone-2.28/ns-2.28
$./validate;How to insert a new module into your NS2?;set ns_ [new Simulator]
$ns_ node-config -addressType hierarchical
AddrParams set domain_num_ 2
lappend cluster_num 1 1
AddrParams set cluster_num_ $cluster_num
lappend eilastlevel 1 2
AddrParams set nodes_num_ $eilastlevel
set tracefd [open noah.tr w]
$ns_ trace-all $tracefd
set topo [new Topography]
$topo load_flatgrid 100 100
set god_ [create-god 2]
set W(0) [$ns_ node 0.0.0]
set chan_ [new Channel/WirelessChannel]
$ns_ node-config -adhocRouting NOAH \
-llType LL \
-macType Mac/802_11 \
-ifqType Queue/DropTail/PriQueue \
-ifqLen 50 \
-antType Antenna/OmniAntenna \
-propType Propagation/TwoRayGround \
-phyType Phy/WirelessPhy \
-channel $chan_ \
-topoInstance $topo \
-wiredRouting ON\
-agentTrace OFF \
-routerTrace OFF \
-macTrace OFF
set BA [$ns_ node 1.0.0]
$ns_ node-config -wiredRouting OFF
set MH(0) [$ns_ node 1.0.1]
$MH(0) random-motion 0
$MH(0) set base-station [AddrParams addr2id [$BA node-addr]]
;IEEE 802.11e for the ns-2 simulator;modify the original C++ code;nsB
文档评论(0)