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.

class Link This class supports the primitives: up <strong>and</strong> down, <strong>and</strong> up? to set <strong>and</strong> query st<strong>at</strong>us_. <strong>The</strong>se primitives arei<strong>ns</strong>tance procedures of the class.<strong>The</strong> i<strong>ns</strong>tance procedures up{} <strong>and</strong> down{} set st<strong>at</strong>us_ to 1 <strong>and</strong> 0 respectively.In addition, when the link fails, down{} will reset all connectors th<strong>at</strong> make up the link. Each connector, including allqueues <strong>and</strong> the delay object will flush <strong>and</strong> drop any packets th<strong>at</strong> it currently stores. This emul<strong>at</strong>es the packet drop dueto link failure.Both procedures then write trace entries to each file h<strong>and</strong>le in the list, dynT_.<strong>The</strong> i<strong>ns</strong>tance procedure up?{} retur<strong>ns</strong> the current value of st<strong>at</strong>us_.In addition, the class contai<strong>ns</strong> the i<strong>ns</strong>tance procedure all-connectors{}. This procedure takes an oper<strong>at</strong>ion as argument,<strong>and</strong> applies the oper<strong>at</strong>ion uniformly to all of the class i<strong>ns</strong>tance variables th<strong>at</strong> are h<strong>and</strong>les for TclObjects.class SimpleLink <strong>The</strong> class supports two i<strong>ns</strong>tance procedures dynamic{} <strong>and</strong> trace-dynamics{}. We havealready described the l<strong>at</strong>ter procedure when describing the trace{} procedure in the class rtModel.<strong>The</strong> i<strong>ns</strong>tance procedure dynamic{} i<strong>ns</strong>erts a DynamicLink object (Section 6.2) <strong>at</strong> the head of the queue. It points the downtargetof the object to the drop target of the link, drpT_, if the object is defined, or to the nullAgent_ in the simul<strong>at</strong>or. Italso signals each connector in the link th<strong>at</strong> the link is now dynamic.Most connectors ignore this signal to be become dynamic; the exception is DelayLink object. This object will normallyschedule each packet it receives for reception by the destin<strong>at</strong>ion node <strong>at</strong> the appropri<strong>at</strong>e time. When the link is dynamic,the object will queue each packet internally; it schedules only one event for the next packet th<strong>at</strong> will be delivered, i<strong>ns</strong>tead ofone event per packet normally. If the link fails, the route model will signal a reset, <strong>at</strong> which point, the shadow object willexecute its reset i<strong>ns</strong>tproc-like, <strong>and</strong> flush all packets in its internal queue. Additional details about the DelayLink can be foundin another chapter (Chapter 8).31.4 Deficencies in the Current Network Dynamics API<strong>The</strong>re are a number of deficencies in the current API th<strong>at</strong> should be changed in the next iter<strong>at</strong>ion:1. <strong>The</strong>re is no way to specify a cluster of nodes or links th<strong>at</strong> behave in lock-step dynamic synchrony.2. Node failure should be dealt with as its own mechanism, r<strong>at</strong>her than a second grade citizen of link failure. This showsup in a number of situ<strong>at</strong>io<strong>ns</strong>, such as:(a) <strong>The</strong> method of emul<strong>at</strong>ing node failure as the failure of the incident links is broken. Ideally, node failure shouldcause all agents incident on the node to be reset.(b) <strong>The</strong>re is no tracing associ<strong>at</strong>ed with node failure.3. If two distinct route models are applied to two separ<strong>at</strong>e links incident on a common node, <strong>and</strong> the two links experiencea topology change <strong>at</strong> the same i<strong>ns</strong>tant, then the node will be notified more than once.31.5 Comm<strong>and</strong>s <strong>at</strong> a glanceFollowing is a list of comm<strong>and</strong>s used to simul<strong>at</strong>e dynamic scenarios in <strong>ns</strong>:279

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

Saved successfully!

Ooh no, something went wrong!