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 ...
Part IVRouting249
Chapter 29Unicast RoutingThis section describes the structure of unicast routing in ns. We begin by describing the interface to the user (Section 29.1),through methods in the class Simulator and the class RouteLogic. We then describe configuration mechanismsfor specialized routing (Section 29.2) such as asymmetric routing, or equal cost multipath routing The next section describesthe the configuration mechanisms for individual routing strategies and protocols (Section 29.3). We conclude with a comprehensivelook at the internal architecture (Section 29.4) of routing in ns.The procedures and functions described in this chapter can be found in ~ns/tcl/lib/ns-route.tcl, ~ns/tcl/rtglib/route-proto.tcl,~ns/tcl/mcast/McastProto.tcl, and ~ns/rtProtoDV.{cc, h}.29.1 The Interface to the Simulation Operator (The API)The user level simulation script requires one command: to specify the unicast routing strategy or protocols for the simulation.A routing strategy is a general mechanism by which ns will compute routes for the simulation. There are four routing strategiesin ns: Static, Session, Dynamic and Manual. Conversely, a routing protocol is a realization of a specific algorithm. Currently,Static and Session routing use the Dijkstra’s all-pairs SPF algorithm []; one type of dynamic routing strategy is currentlyimplemented: the Distributed Bellman-Ford algorithm []. In ns, we blur the distinction between strategy and protocol forstatic and session routing, considering them simply as protocols 1 .rtproto{} is the instance procedure in the class Simulator that specifies the unicast routing protocol to be used inthe simulation. It takes multiple arguments, the first of which is mandatory; this first argument identifies the routing protocolto be used. Subsequent arguments specify the nodes that will run the instance of this protocol. The default is to run thesame routing protocol on all the nodes in the topology. As an example, the following commands illustrate the use of thertproto{} command.$ns rtproto Static;# Enable static route strategy for the simulation$ns rtproto Session;# Enable session routing for this simulation$ns rtproto DV $n1 $n2 $n3 ;# Run DV agents on nodes $n1, $n2, and $n3$ns rtproto LS $n1 $n2;# Run link state routing on specified nodesIf a simulation script does not specify any rtproto{} command, then ns will run Static routing on all the nodes in thetopology.1 The consideration is that static and session routing strategies/protocols are implemented as agents derived from the class Agent/rtProto similarto how the different dynamic routing protocols are implemented; hence the blurred distinctions.250
- 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
- Page 213 and 214: Chapter 23Changes made to the IEEE
- Page 215 and 216: Part IIISupport214
- Page 217 and 218: endenddocument pargvcPrint out argc
- Page 219 and 220: 24.4.2 Memory Conservation TipsSome
- Page 221 and 222: Chapter 25Mathematical SupportThe s
- Page 223 and 224: set run [lindex $argv 0]}if {$run <
- Page 225 and 226: }$sizeRNG next-substream# print the
- Page 227 and 228: protected:RNG* rng_;};Classes deriv
- Page 229 and 230: ns-random is implemented in ~ns/mis
- Page 231 and 232: Chapter 26Trace and Monitoring Supp
- Page 233 and 234: The monitor-queue function is const
- Page 235 and 236: also used to accumulate packet drop
- Page 237 and 238: }name,th->size(),flags,iph->flowid(
- Page 239 and 240: PT_TORA,PT_DSR,PT_AODV,// insert ne
- Page 241 and 242: The QueueMonitor class is not deriv
- Page 243 and 244: $ns_ trace-all This is the command
- Page 245 and 246: Chapter 27Test Suite SupportThe ns
- Page 247 and 248: ... ...}$ns_ at $opt(stop).1 "$self
- Page 249: Example: To enable debugging in Que
- Page 253 and 254: Asymmetric Routing Asymmetric routi
- Page 255 and 256: class RouteLogic This class defines
- Page 257 and 258: — The procedure init-all{} is a g
- Page 259 and 260: Global Actions Once the detailed ac
- Page 261 and 262: This dumps next hop information in
- Page 263 and 264: $ns mrtproto ST;# specify shared tr
- Page 265 and 266: Dense Mode The Dense Mode protocol
- Page 267 and 268: and unique label (id). Thus, “inc
- Page 269 and 270: add-iif{ifid link},add-oif{link if}
- Page 271 and 272: CtrMcastComp is the centralised mul
- Page 273 and 274: $ns_ mrtproto This command specifi
- Page 275 and 276: Chapter 31Network DynamicsThis chap
- Page 277 and 278: v 0.8123 link-up 3 5v 0.8123 link-u
- Page 279 and 280: The first argument is the time at w
- Page 281 and 282: $ns_ rtmodel This command defines
- Page 283 and 284: $ns set-address-format hierarchical
- Page 285 and 286: 32.4 Hierarchical Routing with Sess
- Page 287 and 288: Chapter 33UDP Agents33.1 UDP Agents
- Page 289 and 290: Chapter 34TCP AgentsThis section de
- Page 291 and 292: set ns [new Simulator]set node1 [$n
- Page 293 and 294: 34.2.1 The Base TCP SinkThe base TC
- Page 295 and 296: Agent/TCP/FullTcp set dupseg_fix_ t
- Page 297 and 298: 34.5 Tracing TCP DynamicsThe behavi
- Page 299 and 300: Chapter 35SCTP AgentsThis chapter d
Part IVRouting249