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 ...
21.2.2 XCP RouterThe XCP router consists of a wrapper class that holds virtual queues for XCP, TCP and OTHER traffic flows. OTHER flowmaybe anything other than XCP and TCP. In the current implementation, the XCP queue is a drop-tail queue while those forTCP and OTHER use RED.These underlying queues are bundled in a wrapper class XCPWrapQ that provides necessary interface to the XCP router.The XCP/TCP/OTHER queues are serviced in a Weighted Round-Robin manner. Each queue has a weight that determinesthe percentage of the service it receives. The current queue weights of 0.5 each for the XCP and TCP allows equal servicebetween the two. The third queue reserved for OTHER flows has not been used as yet and has a weight of 0.0.OTCL Class Queue/XCP has a flag named tcp_xcp_on_ which is set to a default value of 0. This should be set to 1 for thosesimulations that use both XCP and TCP flows. This flag is used to split the link capacity of the router between the XCP andTCP queues in simulations that use both flow types. This is supposed to be a temporary fix and should go away once thedynamic queue weights come into effect. A caveat for the tcp_xcp flag is that it is set as an OTcl class variable and not perinstance variable. This might cause some problems in topologies that uses mix of intermittent xcp and tcp flows for whichsome router would require to support both TCP and XCP and some wouldn’t.Every packet received by the wrapper queue class is first marked or assigned a code point depending on the type of the packet.Packets, for the current TCP implementation, are marked for XCP, TCP/TCP-ACK and OTHER packets. This code point isused to enque packets in the right queue. The wrapper class is implemented in xcp.cc,h.21.2.3 XCP queueThe XCP queue is responsible for sending back feedback in every packet header which is used by the sender to control rate ofsending data packets into the network. XCP uses two control algorithms, the congestion controller and the fairness controllerthat are executed once every estimation control interval, Te.In ns the estimation_timer is used to maintain this interval which is based on the average rtt values of the (xcp) flows seenthrough the router. However there may be better ways of defining this interval. The outstanding queue in the router is measuredat a separate interval Tq, for which a queue_timer is used. Finally an rtt_timer is used to measure certain parameters in therouter like packet drops, queue size, utilization etc for a given interval Tr, that may either be set by user from tcl scripts or itmay use the highest rtt value seen for all flows in the router.The rtt_timer interval value, Tr maybe set from tcl using the following API:$queue queue-sample-everyrtt $rtt_valuewhere $queue is a handle to the xcp router and $rtt_value is the interval for which xcp queue parameters like packet drop ,queue size etc shall be measured. See example script under ~ns/tcl/ex/xcp/parking_lot_topo/parking_lot_topo.tcl for use ofthis API.On packet arrival the total input traffic seen at the XCP queue is incremented by the size of the packet received. The sum ofinversed throughput and sum of rtt by throughput is incremented as well. Values for throughput and rtt are read from the xcpheader as set by the TCP source. Each value is normalised by the packet size.On the event of the estimation timer going off, average rtt of all flows is estimated using the above two sums as followsavg_rtt = sum_rtt_by_throughput/ sum_inv_throughputThe aggregate feedback is calculated based on the available bandwidth capacity of the router, arriving traffic bandwidth and203
the persistent queue length in the router. Further detailed explanation of calculations used by the XCP router algorithm canbe found in XCP specification available from XCP’s website at http://www.isi.edu/isi-xcp/docs/draft-falk-xcp-spec-00.txtEach packet carries the current throughput value of the flow and a throughput adjustment or the delta_throughput in itsheader. The XCP router based on the feedback values it calculates in the estimation control timeout, calculates a per-packetthroughput adjustment feedback for every packet. Positive feedback is applied equally per-flow while negative feedback ismade proportional to each flow’s capacity. Also a downsream router can change the delta_throughput value in a packet’sheader only if the feedback value calculated is less than that in the header (written by an less congested upstream router). Theimplementation of XCP queue in ns may be found in xcpq.{cc,h}.21.3 XCP example scriptLet’s walk through a simple xcp script that is similar to ~ns/tcl/ex/xcp/xcp_test.tcl The example uses a small dumbbelltopology having 3 xcp sources running over a bottleneck link.The topology is setup using the node and link creation APIs. The bottleneck is a duplex link that has a xcp router in bothdirections. For details on creating nodes, links etc in ns see Marc Greis’ NS tutorial at http://www.isi.edu/nsnam/ns/tutorial.The bottleneck link having a XCP queue is created as follows:set R0 [$ns node] ;# create Bottleneck between nodes R0 and R1set R1 [$ns node]$ns duplex-link $R0 $R1 Mb ms XCPThe side links connecting source nodes to the bottleneck link have XCP queues as well. The API queue-limit allowsusers to set the buffer size in the queue.The xcp source and sink is created as follows (very similar to tcp):set xcp [new Agent/TCP/Reno/XCP]$ns attach-agent $src_node $xcpset xcp_sink [new Agent/TCPSink/XCPSink]$ns attach-agent $rcvr_node $xcp_sink$ns connect $xcp $xcp_sink......There is a tcl class GeneralSender used in the example script that sets up xcp agents in the source nodes and then connectsthem to the xcp receiver in the destination node. An FTP source is used in all the 3 sources.Note that once the topology is set up the link bandwidth information needs to be propagated to the xcp queue as this is usedby the xcp router for feedback calculation. So for every xcp queue use the following tcl command:$xcp_queue set-link-capacity Next we need to trace variables in thexcp router and xcp sources. The GeneralSender class procedure trace-xcp sets up tracing for xcp sources using variabletracingin ns.204
- 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 and 166: target_target_encapsulatorreg_agent
- Page 167 and 168: why: This avoids header clashes bet
- 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: 21.2 Implementation of XCP in NSIn
- 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
- Page 217 and 218: endenddocument pargvcPrint out argc
- Page 219 and 220: 24.4.2 Memory Conservation TipsSome
- Page 221 and 222: Chapter 25Mathematical SupportThe s
- Page 223 and 224: set run [lindex $argv 0]}if {$run <
- Page 225 and 226: }$sizeRNG next-substream# print the
- Page 227 and 228: protected:RNG* rng_;};Classes deriv
- Page 229 and 230: ns-random is implemented in ~ns/mis
- Page 231 and 232: Chapter 26Trace and Monitoring Supp
- Page 233 and 234: The monitor-queue function is const
- Page 235 and 236: also used to accumulate packet drop
- Page 237 and 238: }name,th->size(),flags,iph->flowid(
- Page 239 and 240: PT_TORA,PT_DSR,PT_AODV,// insert ne
- Page 241 and 242: The QueueMonitor class is not deriv
- Page 243 and 244: $ns_ trace-all This is the command
- Page 245 and 246: Chapter 27Test Suite SupportThe ns
- Page 247 and 248: ... ...}$ns_ at $opt(stop).1 "$self
- Page 249 and 250: Example: To enable debugging in Que
- Page 251 and 252: Chapter 29Unicast RoutingThis secti
- Page 253 and 254: Asymmetric Routing Asymmetric routi
the persistent queue length in the router. Further detailed explan<strong>at</strong>ion of calcul<strong>at</strong>io<strong>ns</strong> used by the XCP router algorithm canbe found in XCP specific<strong>at</strong>ion available from XCP’s website <strong>at</strong> http://www.isi.edu/isi-xcp/docs/draft-falk-xcp-spec-00.txtEach packet carries the current throughput value of the flow <strong>and</strong> a throughput adjustment or the delta_throughput in itsheader. <strong>The</strong> XCP router based on the feedback values it calcul<strong>at</strong>es in the estim<strong>at</strong>ion control timeout, calcul<strong>at</strong>es a per-packetthroughput adjustment feedback for every packet. Positive feedback is applied equally per-flow while neg<strong>at</strong>ive feedback ismade proportional to each flow’s capacity. Also a dow<strong>ns</strong>ream router can change the delta_throughput value in a packet’sheader only if the feedback value calcul<strong>at</strong>ed is less than th<strong>at</strong> in the header (written by an less congested upstream router). <strong>The</strong>implement<strong>at</strong>ion of XCP queue in <strong>ns</strong> may be found in xcpq.{cc,h}.21.3 XCP example scriptLet’s walk through a simple xcp script th<strong>at</strong> is similar to ~<strong>ns</strong>/tcl/ex/xcp/xcp_test.tcl <strong>The</strong> example uses a small dumbbelltopology having 3 xcp sources running over a bottleneck link.<strong>The</strong> topology is setup using the node <strong>and</strong> link cre<strong>at</strong>ion APIs. <strong>The</strong> bottleneck is a duplex link th<strong>at</strong> has a xcp router in bothdirectio<strong>ns</strong>. For details on cre<strong>at</strong>ing nodes, links etc in <strong>ns</strong> see Marc Greis’ NS tutorial <strong>at</strong> http://www.isi.edu/<strong>ns</strong>nam/<strong>ns</strong>/tutorial.<strong>The</strong> bottleneck link having a XCP queue is cre<strong>at</strong>ed as follows:set R0 [$<strong>ns</strong> node] ;# cre<strong>at</strong>e Bottleneck between nodes R0 <strong>and</strong> R1set R1 [$<strong>ns</strong> node]$<strong>ns</strong> duplex-link $R0 $R1 Mb ms XCP<strong>The</strong> side links connecting source nodes to the bottleneck link have XCP queues as well. <strong>The</strong> API queue-limit allowsusers to set the buffer size in the queue.<strong>The</strong> xcp source <strong>and</strong> sink is cre<strong>at</strong>ed as follows (very similar to tcp):set xcp [new Agent/TCP/Reno/XCP]$<strong>ns</strong> <strong>at</strong>tach-agent $src_node $xcpset xcp_sink [new Agent/TCPSink/XCPSink]$<strong>ns</strong> <strong>at</strong>tach-agent $rcvr_node $xcp_sink$<strong>ns</strong> connect $xcp $xcp_sink......<strong>The</strong>re is a tcl class GeneralSender used in the example script th<strong>at</strong> sets up xcp agents in the source nodes <strong>and</strong> then connectsthem to the xcp receiver in the destin<strong>at</strong>ion node. An FTP source is used in all the 3 sources.Note th<strong>at</strong> once the topology is set up the link b<strong>and</strong>width inform<strong>at</strong>ion needs to be propag<strong>at</strong>ed to the xcp queue as this is usedby the xcp router for feedback calcul<strong>at</strong>ion. So for every xcp queue use the following tcl comm<strong>and</strong>:$xcp_queue set-link-capacity Next we need to trace variables in thexcp router <strong>and</strong> xcp sources. <strong>The</strong> GeneralSender class procedure trace-xcp sets up tracing for xcp sources using variabletracingin <strong>ns</strong>.204