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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

SimpleLink::errormodule argsSimul<strong>at</strong>or::lossmodel 〈em〉 〈src〉 〈dst〉When an error model is given as a parameter, it i<strong>ns</strong>erts the error module intothe simple link, right after the queue module, <strong>and</strong> set the drop-target of the errormodel to be the drop trace object of the simple link. Note th<strong>at</strong> this requiresthe following configur<strong>at</strong>ion order: <strong>ns</strong> namtrace-all followed by link configur<strong>at</strong>io<strong>ns</strong>,followed by error model i<strong>ns</strong>ertion. When no argument is given, itretur<strong>ns</strong> the current error model in the link, if there’s any. This method is definedin <strong>ns</strong>/tcl/lib/<strong>ns</strong>-link.tclCall SimpleLink::errormodule to i<strong>ns</strong>ert the given error module into the simplelink (src, dst). It’s simply a wrapper for the above method. This method is definedin <strong>ns</strong>/tcl/lib/<strong>ns</strong>-lib.tcl.• I<strong>ns</strong>ert an error module in a SimpleLink AFTER the queue but BEFORE the delay link. This is provided by the followingtwo methods:SimpleLink::i<strong>ns</strong>ert-linkloss args This method’s behavior is identical to th<strong>at</strong> ofSimpleLink::errormodule, except th<strong>at</strong> it i<strong>ns</strong>erts an error moduleimmedi<strong>at</strong>ely after the queue object. It’s defined in <strong>ns</strong>/tcl/lib/<strong>ns</strong>-link.tclSimul<strong>at</strong>or::link-lossmodel 〈em〉 〈src〉 〈dst〉 This is a wrapper for SimpleLink::i<strong>ns</strong>ert-linkloss. It’s definedin <strong>ns</strong>/tcl/lib/<strong>ns</strong>-lib.tcl<strong>The</strong> nam traces gener<strong>at</strong>ed by error models i<strong>ns</strong>erted using these two methods do not require special tre<strong>at</strong>ment <strong>and</strong> canbe visualized using an older version of nam.• I<strong>ns</strong>ert an error module in a Link AFTER the delay link module. This can be done by Link::i<strong>ns</strong>tall-error.Currently this API doesn’t produce any trace. It only serves as a placeholder for possible future exte<strong>ns</strong>io<strong>ns</strong>.To add an error model over wireless networks, each node can i<strong>ns</strong>ert a given st<strong>at</strong>istical error model either over outgoing orincoming wireless channels. Precisely, the i<strong>ns</strong>tanci<strong>at</strong>ed error model would be stuck between mac <strong>and</strong> netif modules depictedin Figure 16.2. For the outgoing link, the error module would be pointed by downtarget_ of the above mac module while forthe incoming link it would be linked by uptaget_ pointer of the below netif module. And in each case the target_ of the errormodule points to either the netif or the mac respectively. <strong>The</strong> difference of placing over the two different loc<strong>at</strong>io<strong>ns</strong> is th<strong>at</strong> theoutgoing causes all the receivers to receive the packet suffering the same degree of errors since the error is determined beforewireless channel module copies the packet. On the other h<strong>and</strong>, the incoming error module lets each receiver get the packetcorrupted with different degree of error since the error is independently computed in each error module.<strong>The</strong> i<strong>ns</strong>ertion into the wireless protocol stack can be done by calling node-config comm<strong>and</strong> explained in Section ?? with thetwo optio<strong>ns</strong> IncomingErrrProc <strong>and</strong> OutgoingErrProc. We can use these two optio<strong>ns</strong> <strong>at</strong> the same time or each one separ<strong>at</strong>ely.<strong>The</strong> argument of the two option is the name of the global procedure which cre<strong>at</strong>es an error model object, feeds it withnecessary initial values appropri<strong>at</strong>e for the new error module, <strong>and</strong> finally retur<strong>ns</strong> the object pointer. <strong>The</strong> following shows asimple TCL example script to add an error module into the wireless protocol stack.$<strong>ns</strong> node-config -IncomingErrProc UniformErr -OutgoingErrProc UniformErrproc UniformErrset err [new ErrorModel]$err unit packetreturn $err13.3 Multi-st<strong>at</strong>e error modelContributed by Jianping Pan (jpan@bbcr.uw<strong>at</strong>erloo.ca).128

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

Saved successfully!

Ooh no, something went wrong!