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.

why: This avoids header clashes between <strong>ns</strong> <strong>and</strong> the OS.<strong>The</strong> ip hdr (dst/src) address fields th<strong>at</strong> used be integers are now defined as structures called <strong>ns</strong>_addr_t. <strong>ns</strong>_addr_t has 2members address_ <strong>and</strong> port_ th<strong>at</strong> are both defined as int. Hence lines likeiph->src() should change toiph->saddr() & iph->sport();Also lines likedst_ = (IP_BROADCAST « 8) | RT_PORTshould be replaced bydst_.addr_ = IP_BROADCAST;dst_.port_ = RT_PORT;Why: This exte<strong>ns</strong>ion supports 32bit addressing.<strong>The</strong> addrs_ member for hdr_sr class has a separ<strong>at</strong>e function for returning its value . Thus need to call hsr.addrs()i<strong>ns</strong>tead of hsr.addrs.why: addrs_ is now a priv<strong>at</strong>e variable which is accessed by public function addrs().All includes th<strong>at</strong> had absolute p<strong>at</strong>hs by using were replaced by "". Thuswas changed to"cmu/dsr/dsragent.h"<strong>The</strong> tcl comm<strong>and</strong> "ip-addr" was changed to "addr".Other new tcl comm<strong>and</strong>s like "node", "port-dmux" <strong>and</strong> "trace-target" were added.why: Part of support for mobileIP <strong>and</strong> wired-cum-wireless simul<strong>at</strong>io<strong>ns</strong>.Need to convert address in string form<strong>at</strong> into int form<strong>at</strong>; so useAddress::i<strong>ns</strong>tance().str2addr(argv[2])i<strong>ns</strong>tead of<strong>at</strong>oi(argv[2])why: This is required for supporting hier-addressing/routing.<strong>The</strong> array packet_names[] has changed to packet_info.name()why: In order to remove a bunch of #defines for pkt types, an enumer<strong>at</strong>ion called packet_t now describes all packet types in<strong>ns</strong>. class p_info was cre<strong>at</strong>ed th<strong>at</strong> now describes an array name_ th<strong>at</strong> has replaced packet_names array used previously.Have to explicitly set direction of new pkts to DOWN before sending them down to the LL.why: A variable direction_ in hdr_cmn is now used. This is used in the lower layers like LL, mac, phy etc to determine thedirection of the pkt flow. All incoming pkts are marked as UP by channel, which should be remarked as DOWN by agentsbefore sending them out into the network again.I<strong>ns</strong>tead of logtarget->buffer, should now call logtarget->pt_->buffer.why: This change reflects support for eventtracing. Tracing has evolved into two types, packet tracing <strong>and</strong> event tracing.Class Trace essentially supports packet tracing. However in addition to the basic tracing properties th<strong>at</strong> it derives from aBaseTrace class, pkt-tracing also requires to inherit some of the Connector class properties as well. Hence pt_, a basetraceobject represents the pure tracing functionalities required for a trace object.<strong>The</strong> parameter used to describe the reason a pkt was dropped used to be an integer. This was changed to char*. Henceneeded to define different pkt-drop reaso<strong>ns</strong> in string form<strong>at</strong>s.Why: Allows gre<strong>at</strong>er exp<strong>and</strong>ibility <strong>and</strong> flexibility.linkHead changed to dsrLinkHead.why: name clashed with linkHead used elsewhere in <strong>ns</strong>.166

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

Saved successfully!

Ooh no, something went wrong!