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 ...
and sends it to the MH.If the COA matches that of the HA, it just removes the encapsulator it might have set up (when its mobilehost was roaminginto foreign networks) and sends the reply directly back to the MH, as the MH have now returned to its native domain.The mobilehost sends out solicitations if it doesnot hear any ads from the base-stations. Upon receiving ads, it changes itsCOA to the address of the HA/FA it has heard the ad from, and replies back to the COA with a request for registration(reg-request). Initially the MH maybe in the range of the HA and receives all pkts directly from its COA which is HA inthis case. Eventually as the MH moves out of range of its HA and into the a foreign domain of a FA, the MH’s COA changesfrom its HA to that of the FA. The HA now sets up an encapsulator and tunnels all pkts destined for MH towards the FA.The FA decapsulates the pkts and hands them over to the MH. The data from MH destined for the wired world is alwaysrouted towards its current COA. An example script for wireless mobileIP can be found at ~ns/tcl/ex/wireless-mip-test.tcl. Thesimulation consists of a MH moving between its HA and a FA. The HA and FA are each connected to a wired domain on oneside and to their wireless domains on the other. TCP flows are set up between the MH and a wired node.16.3 Lists of changes for merging code developed in older version of ns (2.1b5 orlater) into the current version (2.1b8)The CMU-wireless model developed by David Johnhson’s Monarch project was merged into ns around 1998-99 in what wasthen the ns-2.1b5 version. Since then the ns versions used by Monarch and by us here at ISI have forked quite a bit. Recentlywe ported a newer version of DSR developed by the Monarch group back into ns and in the process have created a list ofchanges that were required to be made for the merge. Hopefully this list will be helpful for those who have been working onolder versions of ns from around that time or or later, to have their stuff merged in to the current version of ns-2.1b8.The following lists of changes are required for merging the cmu version of ns (2.1b5) in to current version of 2.1b8. Eachchange is followed by a brief explanation for why the change was made.Methods for accessing pkt hdrs have changed from(hdr_sr *)p->access(off_sr)to a static access method defined for each hdr, ashdr_sr::access(p)where for class hdr_sr a static method access() is defined asinline static hdr_sr* access(const Packet* p)return (hdr_sr*)p->access(offset_);why: This change avoids using casts everywhere.As the method for accessing hdrs have changed, there is no need to explicitly bind the hdr offset values. This is now donewhile establishing tcl linkage for the individual hdr classes. so lines likebind("off_SR_", &off_sr_);bind("off_ll_", &off_ll_);bind("off_mac_", &off_mac_);bind("off_ip_", &off_ip_);should be removed.AF_ enumerations replaced by NS_AF_ as inenum ns_af_enum NS_AF_NONE, NS_AF_ILINK, NS_AF_INET ;165
why: This avoids header clashes between ns and the OS.The ip hdr (dst/src) address fields that used be integers are now defined as structures called ns_addr_t. ns_addr_t has 2members address_ and port_ that 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 extension supports 32bit addressing.The addrs_ member for hdr_sr class has a separate function for returning its value . Thus need to call hsr.addrs()instead of hsr.addrs.why: addrs_ is now a private variable which is accessed by public function addrs().All includes that had absolute paths by using were replaced by "". Thuswas changed to"cmu/dsr/dsragent.h"The tcl command "ip-addr" was changed to "addr".Other new tcl commands like "node", "port-dmux" and "trace-target" were added.why: Part of support for mobileIP and wired-cum-wireless simulations.Need to convert address in string format into int format; so useAddress::instance().str2addr(argv[2])instead ofatoi(argv[2])why: This is required for supporting hier-addressing/routing.The array packet_names[] has changed to packet_info.name()why: In order to remove a bunch of #defines for pkt types, an enumeration called packet_t now describes all packet types inns. class p_info was created that now describes an array name_ that 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.Instead of logtarget->buffer, should now call logtarget->pt_->buffer.why: This change reflects support for eventtracing. Tracing has evolved into two types, packet tracing and event tracing.Class Trace essentially supports packet tracing. However in addition to the basic tracing properties that 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.The 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 reasons in string formats.Why: Allows greater expandibility and flexibility.linkHead changed to dsrLinkHead.why: name clashed with linkHead used elsewhere in ns.166
- Page 115 and 116: * outstanding, cancel it.*/void Tcp
- Page 117 and 118: Chapter 12Packet Headers and Format
- Page 119 and 120: method is now obsolete; its usage i
- Page 121 and 122: Packethdrsize_next_bits()points to
- Page 123 and 124: the system’s memory allocator. In
- Page 125 and 126: }incr hdrlen_ $incrreturn $baseFrom
- Page 127 and 128: Chapter 13Error ModelThis chapter d
- Page 129 and 130: SimpleLink::errormodule argsSimulat
- Page 131 and 132: This is a simple example of how to
- Page 133 and 134: Higher LayersNode 1Node 2. . .Node
- Page 135 and 136: };void recv(Packet* p, Handler*);vi
- Page 137 and 138: and the frame type. It then passes
- Page 139 and 140: $ll_ set delay_ $delay$ll_ set band
- Page 141 and 142: 14.10 Commands at a glanceThe follo
- Page 143 and 144: 15.2.1 Default Hierarchical Setting
- Page 145 and 146: Chapter 16Mobile Networking in nsTh
- Page 147 and 148: entry_addrdemuxIP addressdefaulttar
- Page 149 and 150: 16.1.2 Creating Node movementsThe m
- Page 151 and 152: set netif $netif_($t)set mac $mac_(
- Page 153 and 154: the hardware address of a packet’
- Page 155 and 156: destined to itself to the port dmux
- Page 157 and 158: switch(ch->ptype()) {case PT_MAC:br
- Page 159 and 160: 16.1.7 Revised format for wireless
- Page 161 and 162: Packet info at "Application level"
- Page 163 and 164: The main problem facing the wired-c
- Page 165: target_target_encapsulatorreg_agent
- Page 169 and 170: This command is used to create a Go
- Page 171 and 172: Chapter 17Satellite Networking in n
- Page 173 and 174: in counter-rotating planes (where t
- Page 175 and 176: • Position/Sat/Geo A geostationar
- Page 177 and 178: $ns add-isl $ltype $node1 $node2 $b
- Page 179 and 180: $satrouteobject_ compute_routeswher
- Page 181 and 182: This will add an error model to the
- Page 183 and 184: lh_firstnameobj‘‘name’’ is
- Page 185 and 186: from routing agentto Node->entrySat
- 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
<strong>and</strong> sends it to the MH.If the COA m<strong>at</strong>ches th<strong>at</strong> of the HA, it just removes the encapsul<strong>at</strong>or it might have set up (when its mobilehost was roaminginto foreign networks) <strong>and</strong> sends the reply directly back to the MH, as the MH have now returned to its n<strong>at</strong>ive domain.<strong>The</strong> mobilehost sends out solicit<strong>at</strong>io<strong>ns</strong> if it doesnot hear any ads from the base-st<strong>at</strong>io<strong>ns</strong>. Upon receiving ads, it changes itsCOA to the address of the HA/FA it has heard the ad from, <strong>and</strong> replies back to the COA with a request for registr<strong>at</strong>ion(reg-request). Initially the MH maybe in the range of the HA <strong>and</strong> receives all pkts directly from its COA which is HA inthis case. Eventually as the MH moves out of range of its HA <strong>and</strong> into the a foreign domain of a FA, the MH’s COA changesfrom its HA to th<strong>at</strong> of the FA. <strong>The</strong> HA now sets up an encapsul<strong>at</strong>or <strong>and</strong> tunnels all pkts destined for MH towards the FA.<strong>The</strong> FA decapsul<strong>at</strong>es the pkts <strong>and</strong> h<strong>and</strong>s them over to the MH. <strong>The</strong> d<strong>at</strong>a from MH destined for the wired world is alwaysrouted towards its current COA. An example script for wireless mobileIP can be found <strong>at</strong> ~<strong>ns</strong>/tcl/ex/wireless-mip-test.tcl. <strong>The</strong>simul<strong>at</strong>ion co<strong>ns</strong>ists of a MH moving between its HA <strong>and</strong> a FA. <strong>The</strong> HA <strong>and</strong> FA are each connected to a wired domain on oneside <strong>and</strong> to their wireless domai<strong>ns</strong> on the other. TCP flows are set up between the MH <strong>and</strong> a wired node.16.3 Lists of changes for merging code developed in older version of <strong>ns</strong> (2.1b5 orl<strong>at</strong>er) into the current version (2.1b8)<strong>The</strong> CMU-wireless model developed by David Johnhson’s Monarch project was merged into <strong>ns</strong> around 1998-99 in wh<strong>at</strong> wasthen the <strong>ns</strong>-2.1b5 version. Since then the <strong>ns</strong> versio<strong>ns</strong> used by Monarch <strong>and</strong> by us here <strong>at</strong> ISI have forked quite a bit. Recentlywe ported a newer version of DSR developed by the Monarch group back into <strong>ns</strong> <strong>and</strong> in the process have cre<strong>at</strong>ed a list ofchanges th<strong>at</strong> were required to be made for the merge. Hopefully this list will be helpful for those who have been working onolder versio<strong>ns</strong> of <strong>ns</strong> from around th<strong>at</strong> time or or l<strong>at</strong>er, to have their stuff merged in to the current version of <strong>ns</strong>-2.1b8.<strong>The</strong> following lists of changes are required for merging the cmu version of <strong>ns</strong> (2.1b5) in to current version of 2.1b8. Eachchange is followed by a brief explan<strong>at</strong>ion for why the change was made.Methods for accessing pkt hdrs have changed from(hdr_sr *)p->access(off_sr)to a st<strong>at</strong>ic access method defined for each hdr, ashdr_sr::access(p)where for class hdr_sr a st<strong>at</strong>ic method access() is defined asinline st<strong>at</strong>ic hdr_sr* access(co<strong>ns</strong>t Packet* p)return (hdr_sr*)p->access(offset_);why: This change avoids using casts everywhere.As the method for accessing hdrs have changed, there is no need to explicitly bind the hdr offset values. This is now donewhile establishing tcl linkage for the individual hdr classes. so lines likebind("off_SR_", &off_sr_);bind("off_ll_", &off_ll_);bind("off_mac_", &off_mac_);bind("off_ip_", &off_ip_);should be removed.AF_ enumer<strong>at</strong>io<strong>ns</strong> replaced by NS_AF_ as inenum <strong>ns</strong>_af_enum NS_AF_NONE, NS_AF_ILINK, NS_AF_INET ;165