12.07.2015 Views

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 ...

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

One addition is the Class Trace/S<strong>at</strong>/Error, which traces any packets th<strong>at</strong> are errored by an error model. <strong>The</strong> errortrace logs packets dropped due to errors as follows, for example:e 1.2404 12 13 cbr 210 ------- 0 12.0 13.0 0 0 -0.00 10.20 -0.00 -10.00It may happen th<strong>at</strong> a s<strong>at</strong>ellite node gener<strong>at</strong>es a packet th<strong>at</strong> it cannot forward (such as in s<strong>at</strong>-mixed.tcl). This will show up as adrop in the tracefile with a destin<strong>at</strong>ion field set to -2, <strong>and</strong> the coordin<strong>at</strong>es set to -999.00:d 848.0000 14 -2 cbr 210 ------- 1 14.0 15.0 6 21 0.00 10.00 -999.00 -999.00This indic<strong>at</strong>es th<strong>at</strong> node 14, in trying to send a packet to node 15, could not find an available route.To enable tracing of all s<strong>at</strong>ellite links in the simul<strong>at</strong>or, use the following comm<strong>and</strong>s before i<strong>ns</strong>tanti<strong>at</strong>ing nodes <strong>and</strong> links:set f [open out.tr w]$<strong>ns</strong> trace-all $f<strong>The</strong>n use the following line after all node <strong>and</strong> link cre<strong>at</strong>ion (<strong>and</strong> all error model i<strong>ns</strong>ertion, if any) to enable tracing of alls<strong>at</strong>ellite links:$<strong>ns</strong> trace-all-s<strong>at</strong>links $fSpecifically, this will put tracing around the link layer queues in all s<strong>at</strong>ellite links, <strong>and</strong> will put a receive trace between themac <strong>and</strong> the link layer for received packets. To enable tracing only on a specific link on a specific node, one may use thecomm<strong>and</strong>:$node trace-inlink-queue $f $i$node trace-outlink-queue $f $iwhere i is the index of the interface to be traced.<strong>The</strong> implement<strong>at</strong>io<strong>ns</strong> of the s<strong>at</strong>ellite trace objects can be found in ~<strong>ns</strong>/tcl/lib/<strong>ns</strong>-s<strong>at</strong>.tcl <strong>and</strong> ~<strong>ns</strong>/s<strong>at</strong>trace.{cc,h}.17.2.6 Error models<strong>ns</strong> error models are described in Chapter 13. <strong>The</strong>se error models can be set to cause packets to be errored according to variousprobability distributio<strong>ns</strong>. <strong>The</strong>se error models are simple <strong>and</strong> don’t necessarily correspond to wh<strong>at</strong> would be experienced onan actual s<strong>at</strong>ellite channel (particularly a LEO channel). Users are free to define more sophistic<strong>at</strong>ed error models th<strong>at</strong> moreclosely m<strong>at</strong>ch a particular s<strong>at</strong>ellite environment.<strong>The</strong> following code provides an example of how to add an error model to a link:set em_ [new ErrorModel]$em_ unit pkt$em_ set r<strong>at</strong>e_ 0.02$em_ ranvar [new R<strong>and</strong>omVariable/Uniform]$node interface-errormodel $em_179

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!