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 ...
unique packet identifier. Each new packet created in the simulation is assigned a new, unique identifier.26.5 Packet TypesEach packet contains a packet type field used by Trace::format to print out the type of packet encountered. The type fieldis defined in the TraceHeader class, and is considered to be part of the trace support; it is not interpreted elsewhere in thesimulator. Initialization of the type field in packets is performed by the Agent::allocpkt(void) method. The type field isset to integer values associated with the definition passed to the Agent constructor (Section 10.6.3). The currently-supporteddefinitions, their values, and their associated symblic names are as follows (defined in ~ns/packet.h):enum packet_t {PT_TCP,PT_UDP,PT_CBR,PT_AUDIO,PT_VIDEO,PT_ACK,PT_START,PT_STOP,PT_PRUNE,PT_GRAFT,PT_GRAFTACK,PT_JOIN,PT_ASSERT,PT_MESSAGE,PT_RTCP,PT_RTP,PT_RTPROTO_DV,PT_CtrMcast_Encap,PT_CtrMcast_Decap,PT_SRM,/* simple signalling messages */PT_REQUEST,PT_ACCEPT,PT_CONFIRM,PT_TEARDOWN,PT_LIVE,// packet from live networkPT_REJECT,PT_TELNET,// not needed: telnet use TCPPT_FTP,PT_PARETO,PT_EXP,PT_INVAL,PT_HTTP,/* new encapsulator */PT_ENCAPSULATED,PT_MFTP,/* CMU/Monarch’s extnsions */PT_ARP,PT_MAC,237
PT_TORA,PT_DSR,PT_AODV,// insert new packet types herePT_NTYPE // This MUST be the LAST one};The constructor of class p_info glues these constants with their string values:p_info() {name_[PT_TCP]= "tcp";name_[PT_UDP]= "udp";name_[PT_CBR]= "cbr";name_[PT_AUDIO]= "audio";...name_[PT_NTYPE]= "undefined";}See also section 12.2.2 for more details.26.6 Queue MonitoringQueue monitoring refers to the capability of tracking the dynamics of packets at a queue (or other object). A queue monitortracks packet arrival/departure/drop statistics, and may optionally compute averages of these values. Monitoring may beapplied to all packets (aggregate statistics), or per-flow statistics (using a Flow Monitor).Several classes are used in supporting queue monitoring. When a packet arrives at a link where queue monitoring is enabled, itgenerally passes through a SnoopQueue object when it arrives and leaves (or is dropped). These objects contain a referenceto a QueueMonitor object.A QueueMonitor is defined as follows (~ns/queue-monitor.cc):class QueueMonitor : public TclObject {public:QueueMonitor() : bytesInt_(NULL), pktsInt_(NULL), delaySamp_(NULL),size_(0), pkts_(0),parrivals_(0), barrivals_(0),pdepartures_(0), bdepartures_(0),pdrops_(0), bdrops_(0),srcId_(0), dstId_(0), channel_(0) {bind("size_", &size_);bind("pkts_", &pkts_);bind("parrivals_", &parrivals_);bind("barrivals_", &barrivals_);bind("pdepartures_", &pdepartures_);bind("bdepartures_", &bdepartures_);238
- 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
- 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: }name,th->size(),flags,iph->flowid(
- 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 and 250: Example: To enable debugging in Que
- Page 251 and 252: Chapter 29Unicast RoutingThis secti
- 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
PT_TORA,PT_DSR,PT_AODV,// i<strong>ns</strong>ert new packet types herePT_NTYPE // This MUST be the LAST one};<strong>The</strong> co<strong>ns</strong>tructor of class p_info glues these co<strong>ns</strong>tants with their string values:p_info() {name_[PT_TCP]= "tcp";name_[PT_UDP]= "udp";name_[PT_CBR]= "cbr";name_[PT_AUDIO]= "audio";...name_[PT_NTYPE]= "undefined";}See also section 12.2.2 for more details.26.6 Queue MonitoringQueue monitoring refers to the capability of tracking the dynamics of packets <strong>at</strong> a queue (or other object). A queue monitortracks packet arrival/departure/drop st<strong>at</strong>istics, <strong>and</strong> may optionally compute averages of these values. Monitoring may beapplied to all packets (aggreg<strong>at</strong>e st<strong>at</strong>istics), or per-flow st<strong>at</strong>istics (using a Flow Monitor).Several classes are used in supporting queue monitoring. When a packet arrives <strong>at</strong> a link where queue monitoring is enabled, itgenerally passes through a SnoopQueue object when it arrives <strong>and</strong> leaves (or is dropped). <strong>The</strong>se objects contain a referenceto a QueueMonitor object.A QueueMonitor is defined as follows (~<strong>ns</strong>/queue-monitor.cc):class QueueMonitor : public TclObject {public:QueueMonitor() : bytesInt_(NULL), pktsInt_(NULL), delaySamp_(NULL),size_(0), pkts_(0),parrivals_(0), barrivals_(0),pdepartures_(0), bdepartures_(0),pdrops_(0), bdrops_(0),srcId_(0), dstId_(0), channel_(0) {bind("size_", &size_);bind("pkts_", &pkts_);bind("parrivals_", &parrivals_);bind("barrivals_", &barrivals_);bind("pdepartures_", &pdepartures_);bind("bdepartures_", &bdepartures_);238