ns2无线仿真中常用命令列表
以下是无线仿真中会使用到得一个命令列表:
$ns_ node-config -addressingType <usually flat or hierarchical used for
wireless topologies>
-adhocRouting <adhoc rotuing protocol like DSDV, DSR,
TORA, AODV etc>
-llType <LinkLayer>
-macType <MAC type like Mac/802_11>
-propType <Propagation model like
Propagation/TwoRayGround>
-ifqType <interface queue type like
Queue/DropTail/PriQueue>
-ifqLen <interface queue length like 50>
-phyType <network inteface type like
Phy/WirelessPhy>
-antType <antenna type like Antenna/OmniAntenna>
-channelType <Channel type like Channel/WirelessChannel>
-topoInstance <the topography instance>
-wiredRouting <turning wired routing ON or OFF>
-mobileIP <setting the flag for mobileIP ON or OFF>
-energyModel <EnergyModel type>
-initialEnergy <specified in Joules>
-rxPower <specified in W>
-txPower <specified in W>
-agentTrace <tracing at agent level turned ON or OFF>
-routerTrace <tracing at router level turned ON or OFF>
-macTrace <tracing at mac level turned ON or OFF>
-movementTrace <mobilenode movement logging turned
ON or OFF>
这个命令代表性的用来配置一个移动节点。要获得更多的关于此命令的说明(新节点APIs部分)可以看在ns注释和档中章节标题为“Restructuring ns node and new Node APIs”的部分。
$ns_ node <optional:hier address>
如在节点配置命令里展示的那样节点配置完成后,这个命令被用来创建一个移动节点。在分级地址正在使用的情况下,节点的分级地址也需要通过。
$node log-movement
这个命令过去用于增强移动节点移动的logging,现在已被
$ns_node-config -movementTrace <ON or OFF>替代.
$create-god <num_nodes>
这个命令被用来创建一个GOD实例。移动节点的数目作为论点被传递,这个论点被GOD用来创建一个存储拓扑连通性信息的矩阵。
$topo load_flatgrid <X> <Y> <optional:res>
它初始化地形目标的栅格。<X> and <Y>是拓扑的x-y坐标并用来依大小排列栅格。栅格resolution可以作为<res>被传递。1的默认值常被使用。
$topo load_demfile <file-descrptor>
为了调用DEMFile目标进入地形。
$ns_ namtrace-all-wireless <namtrace> <X> <Y>
为了使传递节点运动在nam中可被观察,这个命令用来初始化namtrace檔。namtrace档描述符,无线拓扑的X,Y坐标轴通过这个命令作为参数被传送。
$ns_ nam-end-wireless <stop-time>
这个命令通过使用<stop-time>用来告诉nam仿真停止时间。
$ns_ initial_node_pos <node> <size>
这个命令定义了节点在nam中的初始位置。<size>表明了在nam中节点的大小。这个功能必须在移动模型被定义后被调用。
$mobilenode random-motion <0 or 1>
随机运动被用来开始移动节点的随机运动,在这种情况下,随机目的地被分配给节点。0为停止随机运动,1为开始随机运动。
$mobilenode setdest <X> <Y> <s>
这个命令为建立一个移动节点的目的地。移动节点开始以<s> m/s的速度,向给定了<X>and <Y>的目的地移动。
$mobilenode reset
此命令用来重新设置节点中所有目标。
内部程序:
下面是无线网络得内部程序行表:
$mobilenode base-station <BSnode-hier-addr>
它被用作无线与有线通信场景。这里移动节点由该域的基站节点信息提供。既然无线与有线通信场景代表性的使用分级地址,所以地址也是分级的。
$mobilenode log-target <target-object>
<target-object>通常来说是一个追踪目标,用来记录移动节点运动和它们的能量使用(如果能量模式被提供的话)
$mobilenode topography <topoinstance>
这个命令用一个句柄向地形目标提供节点。
$mobilenode addif
一个移动节点可以有不只一个网络接口。这个命令用来为向节点的一个网络接口传送句柄。
$mobilenode namattach <namtracefd>
这个命令用来把namtrace档描述符配属给移动节点。所有节点的nam traces被写进这个namtrace文件。
$mobilenode radius <r>
半径<r>指明了节点的范围。所有落进以该节点为中心,半径为<r>的圆内的移动节点被认做为邻居。这个信息代表性的由gridkeeper使用。
$mobilenode start
这个命令用来开始移动节点的运动。