欢迎来到麦多课文档分享! | 帮助中心 海量文档,免费浏览,给你所需,享你所想!
麦多课文档分享
全部分类
  • 标准规范>
  • 教学课件>
  • 考试资料>
  • 办公文档>
  • 学术论文>
  • 行业资料>
  • 易语言源码>
  • ImageVerifierCode 换一换
    首页 麦多课文档分享 > 资源分类 > PPT文档下载
    分享到微信 分享到微博 分享到QQ空间

    Introduction to Mobility Network Simulator 2 (NS-2).ppt

    • 资源ID:376685       资源大小:61KB        全文页数:25页
    • 资源格式: PPT        下载积分:2000积分
    快捷下载 游客一键下载
    账号登录下载
    微信登录下载
    二维码
    微信扫一扫登录
    下载资源需要2000积分(如需开发票,请勿充值!)
    邮箱/手机:
    温馨提示:
    如需开发票,请勿充值!快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。
    如需开发票,请勿充值!如填写123,账号就是123,密码也是123。
    支付方式: 支付宝扫码支付    微信扫码支付   
    验证码:   换一换

    加入VIP,交流精品资源
     
    账号:
    密码:
    验证码:   换一换
      忘记密码?
        
    友情提示
    2、PDF文件下载后,可能会被浏览器默认打开,此种情况可以点击浏览器菜单,保存网页到桌面,就可以正常下载了。
    3、本站不支持迅雷下载,请使用电脑自带的IE浏览器,或者360浏览器、谷歌浏览器下载即可。
    4、本站资源下载后的文档和图纸-无水印,预览文档经过压缩,下载后原文更清晰。
    5、试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。

    Introduction to Mobility Network Simulator 2 (NS-2).ppt

    1、Introduction to Mobility & Network Simulator 2 (NS-2),Mahmood Hasanlou m_hasanlouce.sharif.edu,Department of Computer Engineering Sharif University of Technology,Sharif university of Technology,2/23,Outline,Random Walk Mobility Model Random Waypoint Mobility Model Network Simulator Mobile Networking

    2、 in ns Simulation Scenario Home Work 2,Sharif university of Technology,3/23,Random Walk Mobility Model,Since many entities in nature move in extremely unpredictable ways, the Random Walk Mobility Model was developed to mimic this erratic movement In this mobility model, an MN moves from its current

    3、location to a new location by randomly choosing a direction and speed in which to travel The new speed and direction are both chosen from pre-defined ranges, speedmin; speedmax and 0;2p respectively,Sharif university of Technology,4/23,Random Walk Mobility Model,Each movement in the Random Walk Mobi

    4、lity Model occurs in either a constant time interval t or a constant distance traveled d, at the end of which a new direction and speed are calculated If an MN which moves according to this model reaches a simulation boundary, it “bounces” off the simulation border with an angle determined by the in

    5、coming direction The MN then continues along this new path,Sharif university of Technology,5/23,Outline,Random Walk Mobility Model Random Waypoint Mobility Model Network Simulator Mobile Networking in ns Simulation Scenario Home Work 2,Sharif university of Technology,6/23,Random Waypoint Mobility Mo

    6、del (RWPM),The Random Waypoint Mobility Model includes pause times between changes in direction and/or speed An MN begins by staying in one location for a certain period of time (i.e., a pause time) Once this time expires, the MN chooses a random destination in the simulation area and a speed that i

    7、s uniformly distributed between minspeed, maxspeed,Sharif university of Technology,7/23,Random Waypoint Mobility Model (RWPM),The MN then travels toward the newly chosen destination at the selected speed Upon arrival, the MN pauses for a specified time period before starting the process again We not

    8、e that the movement pattern of an MN using the Random Waypoint Mobility Model is similar to the Random Walk Mobility Model if pause time is zero and minspeed, maxspeed = speedmin, speedmax,Sharif university of Technology,8/23,Outline,Random Walk Mobility Model Random Waypoint Mobility Model Network

    9、Simulator Mobile Networking in ns Simulation Scenario Home Work 2,Sharif university of Technology,9/23,Network Simulator (NS),ns is an object oriented simulator, written in C+, with an OTcl interpreter as a frontend The simulator supports a class hierarchy in C+ (also called the compiled hierarchy i

    10、n this document), and a similar class hierarchy within the OTcl interpreter (also called the interpreted hierarchy in this document) The two hierarchies are closely related to each other; from the users perspective, there is a one-to-one correspondence between a class in the interpreted hierarchy an

    11、d one in the compiled hierarchy The root of this hierarchy is the class TclObject,Sharif university of Technology,10/23,Network Simulator (NS),Users create new simulator objects through the interpreter; these objects are instantiated within the interpreter, and are closely mirrored by a correspondin

    12、g object in the compiled hierarchy The interpreted class hierarchy is automatically established through methods defined in the class TclClass user instantiated objects are mirrored through methods defined in the class TclObject,Sharif university of Technology,11/23,Why two languages?,ns uses two lan

    13、guages because simulator has two different kinds of things it needs to do On one hand, detailed simulations of protocols requires a systems programming language which can efficiently manipulate bytes, packet headers, and implement algorithms that run over large data sets For these tasks run-time spe

    14、ed is important and turn-aroundtime (run simulation, find bug, fix bug, recompile, re-run) is less important,Sharif university of Technology,12/23,Why two languages?,On the other hand, a large part of network research involves slightly varying parameters or configurations, or quickly exploring a num

    15、ber of scenarios In these cases, iteration time (change the model and re-run) is more important Since configuration runs once (at the beginning of the simulation), run-time of this part of the task is less important,Sharif university of Technology,13/23,Why two languages?,ns meets both of these need

    16、s with two languages, C+ and OTcl C+ is fast to run but slower to change, making it suitable for detailed protocol implementation OTcl runs much slower but can be changed very quickly (and interactively), making it ideal for simulation configuration,Sharif university of Technology,14/23,Which langua

    17、ge for what?,Having two languages raises the question of which language should be used for what purpose Our basic advice is to use OTcl: for configuration, setup, and “one-time” stuff if you can do what you want by manipulating existing C+ objects and use C+:if you are doing anything that requires p

    18、rocessing each packet of a flowif you have to change the behavior of an existing C+ class in ways that werent anticipated,Sharif university of Technology,15/23,Outline,Random Walk Mobility Model Random Waypoint Mobility Model Network Simulator Mobile Networking in ns Simulation Scenario Home Work 2,

    19、Sharif university of Technology,16/23,Mobile Networking in ns,The functions and procedures described in this subsection can be found in ns/mobilenode.cc,h, ns/tcl/lib/ns-mobilenode.tcl, ns/tcl/mobility/dsdv.tcl, ns/tcl/mobility/dsr.tcl, ns/tcl/mobility/tora.tcl Example scripts can be found in ns/tcl

    20、/ex/wireless-test.tcl and ns/tcl/ex/wireless.tcl,Sharif university of Technology,17/23,Outline,Random Walk Mobility Model Random Waypoint Mobility Model Network Simulator Mobile Networking in ns Simulation Scenario Home Work 2,Sharif university of Technology,18/23,Simulation Scenario,We start by pre

    21、senting simple script that run single TCP connection over 3-nodes over an area of size 500m over 400m The location process is as follow : The initial locations of nodes 0, 1 and 2 are respectively (5,5), (490,285) and (150,240) At time 10, node 0 starts moving towards point (250,250) at a speed of 3

    22、m/s At time 15, node 1 starts moving towards point (45,285) at a speed of 5m/s At time 20, node 0 starts moving towards point (480,300) at a speed of 5m/s Node 2 is still throughout the simulation The simulation lasts 150s. At time 10 a TCP connection is initiated between node 0 and node 1,Sharif un

    23、iversity of Technology,19/23,Writing the TCL script,We begin by specifying some basic parameters for the simulation : set val(chan) Channel/WirelessChannel set val(prop) Propagation/TwoRayGround set val(netif) Phy/WirelessPhy set val(mac) Mac/802_11 set val(ifq) Queue/DropTail/PriQueue set val(ll) L

    24、L set val(ant) Antenna/OmniAntenna set val(ifqlen) 50 ;# max packet in ifq set val(x) 800;# X dimension of the topography set val(y) 800;# Y dimension of the topography set val(nn) 30 ;# number of nodes set val(rp) DSDV set val(stop) 150 ;# simulation time These parameters are used in configuring of

    25、 the nodes,Sharif university of Technology,20/23,Configures of a mobile node,$ns_ node-config -adhocRouting $val(rp) -llType $val(ll) -macType $val(mac) -ifqType $val(ifq) -ifqLen $val(ifqlen) -antType $val(ant) -propType val(prop) -phyType $val(netif) -channelType val(chan) -topoInstance $topo -age

    26、ntTrace ON -routerTrace ON -macTrace OFF -MovementTrace ON For set $i 0 $i $val(nn) incr $i set node_($i) $ns node ,Sharif university of Technology,21/23,Initial location and movement of nodes,The initial location of node 0 given as follows : $node_(0) set X_ 5.0 $node_(0) set Y_ 5.0 $node_(0) set Z

    27、_ 5.0 A linear movement of a node is generated by specifying the time in which it start, the x and y values of the target point and the speed: $ns at 15.0 “$node_(1) setdest 45.0 285.0 5.0”,Sharif university of Technology,22/23,Ending the simulation,We need to create the initial node position for na

    28、m using For set $i 0 $i $val(nn) incr $i $ns initial_node_pos $node_($i) 30 We tell nodes when the simulation ends with : For set $i 0 $i $val(nn) incr $i $ns at $val(stop) “node_($i) reset” ,Sharif university of Technology,23/23,Outline,Random Walk Mobility Model Random Waypoint Mobility Model Netw

    29、ork Simulator Mobile Networking in ns Simulation Scenario Home Work 2,Sharif university of Technology,24/23,Home Work 2,You must look at the mobile node source code and determine which of the mobility models support in it ? You simulate a scenario and obtain its result with mobility model that exist

    30、 Then you must change that mobility model to another You simulate your scenario again with this new mobility model and compare the result of this by previous results Scenario is the same scenario of the HW1,Sharif university of Technology,25/23,Refrence,A collaboration between researchers at UC Berkeley, LBL, USC/ISI, and Xerox PARC, “The NS Manual”, 2005 Lecture Notes 2003-2004 Univ. de Los andes, Merida, Venezuela, and ESSI, “NS simulator for beginners” Tracy Camp, Jeff Boleng, Vanessa Davies, “A Survey of Mobility Models for Ad Hoc Network Research” , 2002,


    注意事项

    本文(Introduction to Mobility Network Simulator 2 (NS-2).ppt)为本站会员(eventdump275)主动上传,麦多课文档分享仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知麦多课文档分享(点击联系客服),我们立即给予删除!




    关于我们 - 网站声明 - 网站地图 - 资源地图 - 友情链接 - 网站客服 - 联系我们

    copyright@ 2008-2019 麦多课文库(www.mydoc123.com)网站版权所有
    备案/许可证编号:苏ICP备17064731号-1 

    收起
    展开