The ns Manual (formerly ns Notes and Documentation)1 - NM Lab at ...
The ns Manual (formerly ns Notes and Documentation)1 - NM Lab at ... The ns Manual (formerly ns Notes and Documentation)1 - NM Lab at ...
a starting position. The information regarding number of hops between the nodes is fed to the central object "GOD" (XXXbut why/where is this information used??-answer awaited from CMU.) Next each node is a speed and a direction to move to.The generator for creating node movement files are to be found under ~ns/indep-utils/cmu-scen-gen/setdest/ directory. Compilethe files under setdest to create an executable. run setdest with arguments in the following way:./setdest -n -p -s -t -x -y > /Note that the index used for nodes now start from 0 instead of 1 as was in the original CMU version, to match with ns’stradition of assigning node indices from 0.Generating traffic pattern filesThe examples for traffic patterns may be found in ~ns/tcl/mobility/scene/cbr-50-{10-4-512, 20-4-512}.The traffic generator is located under ~ns/indep-utils/cmu-scen-gen/ and are called cbrgen.tcl and tcpgen.tcl. They may beused for generating CBR and TCP connections respectively.To create CBR connecions, runns cbrgen.tcl [-type cbr|tcp] [-nn nodes] [-seed seed][-mc connections] [-rate rate]To create TCP connections, runns tcpgen.tcl [-nn nodes] [-seed seed]You will need to pipe the outputs from above to a cbr-* or a tcp-* file.16.2 Extensions made to CMU’s wireless modelAs mentioned earlier, the original CMU wireless model allows simulation of wireless LANs and ad-hoc networks. Howeverin order to use the wireless model for simulations using both wired and wireless nodes we had to add certain extensions tocmu model. We call this wired-cum-wireless feature. Also SUN’s MobileIP (implemented for wired nodes) was integratedinto the wireless model allowing mobileIP to run over wireless mobilenodes. The following two subsections describe thesetwo extensions to the wireless model in ns.16.2.1 wired-cum-wireless scenariosThe mobilenodes described so far mainly supports simulation of multi-hop ad-hoc networks or wireless LANs. But what ifwe need to simulate a topology of multiple wireless LANs connected through wired nodes, or may need to run mobileIP ontop of these wireless nodes? The extensions made to the CMU wireless model allows us to do that.161
The main problem facing the wired-cum-wireless scenario was the issue of routing. In ns, routing information is generatedbased on the connectivity of the topology, i.e how nodes are connected to one another through Links. Mobilenodes on theother hand have no concept of links. They route packets among themselves, within the wireless topology, using their routingprotocol. so how would packets be exchanged between these two types of nodes?So a node called BaseStationNode is created which plays the role of a gateway for the wired and wireless domains.The BaseStationNode is essentially a hybrid between a Hierarchical node 1 (HierNode) and a MobileNode. Thebasestation node is responsible for delivering packets into and out of the wireless domain. In order to achieve this we needHierarchical routing.Each wireless domain along with its base-station would have an unique domain address assigned to them. All packets destinedto a wireless node would reach the base-station attached to the domain of that wireless node, who would eventually hand thepacket over to the destination (mobilenode). And mobilenodes route packets, destined to outside their (wireless) domain, totheir base-station node. The base-station knows how to forward these packets towards the (wired) destination. The schematicof a BaseStationNode is shown in Figure 16.3.The mobilenodes in wired-cum-wireless scenario are required to support hierarchical addressing/routing. Thus the MobileNodelooks exactly like the BaseStationNode. The SRNode, however, simply needs to have its own hier-address since it doesnot require any address demuxes and thus is not required to support hier routing 2 .The DSDV agent on having to forward a packet checks to see if the destination is outside its (wireless) subnet. If so, it triesto forward the packet to its base-station node. In case no route to base-station is found the packet is dropped. Otherwisethe packet is forwarded to the next_hop towards the base-station. Which is then routed towards the wired network by basestation’sclassifiers.The DSR agent, on receiving a pkt destined outside its subnet, sends out a route-query for its base-station in case the route tobase-station is not known. The data pkt is temporarily cached while it waits to hear route replies from base-station. On gettinga reply the packet is provided with routing information in its header and send away towards the base-station. The base-stationaddress demuxes routes it correctly toward the wired network.The example script for a wired-cum-wireless simulation can be found at ~ns/tcl/ex/wired-cum-wireless-sim.tcl. The methodsfor wired-cum-wireless implementations are defined in ~ns/tcl/lib/ns-bsnode.tcl, ~ns/tcl/mobility/{com.tcl,dsr.tcl, dsdv.tcl},~ns/dsdv/dsdv.{cc,h} and ~ns/dsr/dsragent.{cc,h}.16.2.2 MobileIPThe wired-cum-wireless extensions for the wireless model paved the path for supporting wireless MobileIP in ns. SunMicrosystem’s (Charlie Perkins et al) MobileIP model was based on ns’s wired model (consisting of Node’s and Link’s)and thus didnot use CMU’s mobility model.Here we briefly describe the wireless MobileIP implementation. We hope that Sun would provide the detailed version of thedocumentation in the future.The mobileIP scenario consists of Home-Agents(HA) and Foreign-Agents(FA) and have Mobile-Hosts(MH) moving betweentheir HA and FAs. The HA and FA are essentially base-station nodes we have described earlier. While MHs arebasically the mobileNodes described in section 16.1.1. The methods and procedures for MobileIP extensions are described in~ns/mip.{cc,h}, ~ns/mip-reg.cc, ~ns/tcl/lib/ns-mip.tcl and ~ns/tcl/lib/ns-wireless-mip.tcl.The HA and FA nodes are defined as MobileNode/MIPBS having a registering agent (regagent_) that sends beacon out to1 Refer to Chapter 32 for details on hierarchical routing and internals of HierNode.2 In order to do away with all these different variations of the definition of a node, we are planning to revise the node architecture that would allow a moreflexible and modularised construction of a node without the necessity of having to define and be limited to certain Class definitions only.162
- Page 111 and 112: $agent attach-tbf Attaches a token
- Page 113 and 114: (void)Scheduler::instance().schedul
- Page 115 and 116: * outstanding, cancel it.*/void Tcp
- Page 117 and 118: Chapter 12Packet Headers and Format
- Page 119 and 120: method is now obsolete; its usage i
- Page 121 and 122: Packethdrsize_next_bits()points to
- Page 123 and 124: the system’s memory allocator. In
- Page 125 and 126: }incr hdrlen_ $incrreturn $baseFrom
- Page 127 and 128: Chapter 13Error ModelThis chapter d
- Page 129 and 130: SimpleLink::errormodule argsSimulat
- Page 131 and 132: This is a simple example of how to
- Page 133 and 134: Higher LayersNode 1Node 2. . .Node
- Page 135 and 136: };void recv(Packet* p, Handler*);vi
- Page 137 and 138: and the frame type. It then passes
- Page 139 and 140: $ll_ set delay_ $delay$ll_ set band
- Page 141 and 142: 14.10 Commands at a glanceThe follo
- Page 143 and 144: 15.2.1 Default Hierarchical Setting
- Page 145 and 146: Chapter 16Mobile Networking in nsTh
- Page 147 and 148: entry_addrdemuxIP addressdefaulttar
- Page 149 and 150: 16.1.2 Creating Node movementsThe m
- Page 151 and 152: set netif $netif_($t)set mac $mac_(
- Page 153 and 154: the hardware address of a packet’
- Page 155 and 156: destined to itself to the port dmux
- Page 157 and 158: switch(ch->ptype()) {case PT_MAC:br
- Page 159 and 160: 16.1.7 Revised format for wireless
- Page 161: Packet info at "Application level"
- Page 165 and 166: target_target_encapsulatorreg_agent
- Page 167 and 168: why: This avoids header clashes bet
- Page 169 and 170: This command is used to create a Go
- Page 171 and 172: Chapter 17Satellite Networking in n
- Page 173 and 174: in counter-rotating planes (where t
- Page 175 and 176: • Position/Sat/Geo A geostationar
- Page 177 and 178: $ns add-isl $ltype $node1 $node2 $b
- Page 179 and 180: $satrouteobject_ compute_routeswher
- Page 181 and 182: This will add an error model to the
- Page 183 and 184: lh_firstnameobj‘‘name’’ is
- Page 185 and 186: from routing agentto Node->entrySat
- Page 187 and 188: $satnode add-isl This method c
- Page 189 and 190: set prop [new Propagation/FreeSpace
- Page 191 and 192: 18.3.2 Using shadowing modelBefore
- Page 193 and 194: Chapter 19Energy Model in nsEnergy
- Page 195 and 196: Chapter 20Directed DiffusionThe dir
- Page 197 and 198: However if we have a large and dens
- Page 199 and 200: yr application in the ns context. T
- Page 201 and 202: value of opt(pre-stop) is usually t
- Page 203 and 204: 21.2 Implementation of XCP in NSIn
- Page 205 and 206: the persistent queue length in the
- Page 207 and 208: Thruput2 0.054024 60000residue_pos_
- Page 209 and 210: Chapter 22DelayBox: Per-Flow Delay
- Page 211 and 212: $ns attach-agent $n_sink $sink# mak
a starting position. <strong>The</strong> inform<strong>at</strong>ion regarding number of hops between the nodes is fed to the central object "GOD" (XXXbut why/where is this inform<strong>at</strong>ion used??-a<strong>ns</strong>wer awaited from CMU.) Next each node is a speed <strong>and</strong> a direction to move to.<strong>The</strong> gener<strong>at</strong>or for cre<strong>at</strong>ing node movement files are to be found under ~<strong>ns</strong>/indep-utils/cmu-scen-gen/setdest/ directory. Compilethe files under setdest to cre<strong>at</strong>e an executable. run setdest with arguments in the following way:./setdest -n -p -s -t -x -y > /Note th<strong>at</strong> the index used for nodes now start from 0 i<strong>ns</strong>tead of 1 as was in the original CMU version, to m<strong>at</strong>ch with <strong>ns</strong>’stradition of assigning node indices from 0.Gener<strong>at</strong>ing traffic p<strong>at</strong>tern files<strong>The</strong> examples for traffic p<strong>at</strong>ter<strong>ns</strong> may be found in ~<strong>ns</strong>/tcl/mobility/scene/cbr-50-{10-4-512, 20-4-512}.<strong>The</strong> traffic gener<strong>at</strong>or is loc<strong>at</strong>ed under ~<strong>ns</strong>/indep-utils/cmu-scen-gen/ <strong>and</strong> are called cbrgen.tcl <strong>and</strong> tcpgen.tcl. <strong>The</strong>y may beused for gener<strong>at</strong>ing CBR <strong>and</strong> TCP connectio<strong>ns</strong> respectively.To cre<strong>at</strong>e CBR connecio<strong>ns</strong>, run<strong>ns</strong> cbrgen.tcl [-type cbr|tcp] [-nn nodes] [-seed seed][-mc connectio<strong>ns</strong>] [-r<strong>at</strong>e r<strong>at</strong>e]To cre<strong>at</strong>e TCP connectio<strong>ns</strong>, run<strong>ns</strong> tcpgen.tcl [-nn nodes] [-seed seed]You will need to pipe the outputs from above to a cbr-* or a tcp-* file.16.2 Exte<strong>ns</strong>io<strong>ns</strong> made to CMU’s wireless modelAs mentioned earlier, the original CMU wireless model allows simul<strong>at</strong>ion of wireless LANs <strong>and</strong> ad-hoc networks. Howeverin order to use the wireless model for simul<strong>at</strong>io<strong>ns</strong> using both wired <strong>and</strong> wireless nodes we had to add certain exte<strong>ns</strong>io<strong>ns</strong> tocmu model. We call this wired-cum-wireless fe<strong>at</strong>ure. Also SUN’s MobileIP (implemented for wired nodes) was integr<strong>at</strong>edinto the wireless model allowing mobileIP to run over wireless mobilenodes. <strong>The</strong> following two subsectio<strong>ns</strong> describe thesetwo exte<strong>ns</strong>io<strong>ns</strong> to the wireless model in <strong>ns</strong>.16.2.1 wired-cum-wireless scenarios<strong>The</strong> mobilenodes described so far mainly supports simul<strong>at</strong>ion of multi-hop ad-hoc networks or wireless LANs. But wh<strong>at</strong> ifwe need to simul<strong>at</strong>e a topology of multiple wireless LANs connected through wired nodes, or may need to run mobileIP ontop of these wireless nodes? <strong>The</strong> exte<strong>ns</strong>io<strong>ns</strong> made to the CMU wireless model allows us to do th<strong>at</strong>.161