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 ...
ObjectiveThe objective of the JoBS algorithm is to provide absolute and relative (proportional) loss and delay differentiation independentlyat each node for classes of traffic. JoBS therefore provides service guarantees on a per-hop basis. The set ofperformance requirements are specified to the algorithm as a set of per-class Qualtiy of Service (QoS) constraints. As anexample, for three classes, the QoS constraints could be of the form:• Class-1 Delay ≈ 2 · Class-2 Delay,• Class-2 Loss Rate ≈ 10 −1 · Class-3 Loss Rate, or• Class-3 Delay ≤ 5 ms.Here, the first two constraints are relative constraints and the last one is an absolute constraint. The set of constraints can beany mix of relative and absolute constraints. More specifically, JoBS supports the five following types of constraints:• Relative delay constraints (RDC) specify a proportional delay differentiation between classes. As an example, fortwo classes 1 and 2, the RDC enforces a relationshipDelay of Class 2Delay of Class 1 ≈ constant .• Absolute delay constraints (ADC): An ADC on class i requires that the delays of class i satisfy a worst-case boundd i .• Relative loss constraints (RLC) specify a proportional loss differentiation between classes.• Absolute loss constraints (ALC): An ALC on class i requires that the loss rate of class i be bounded by an upperbound L i .• Absolute rate constraints (ARC): An ARC on class i means that the throughput of class i is bounded by a lowerbound µ i .JoBS does not rely on admission control or traffic policing, nor does it make any assumption on traffic arrivals. Therefore, asystem of constraints may become infeasible, and some constraints may need to be relaxed. QoS constraints are prioritized inthe following order.ALC > ADC, ARC > Relative Constraints .That is, if JoBS is unable to satisfy both absolute and relative constraints, it will give preference to the absolute constraints.MechanismsJoBS performs scheduling and buffer management in a single pass. JoBS dynamically allocates service rates to classes inorder to satisfy the delay constraints. The service rates needed for enforcing absolute delay constraints are allocated upon eachpacket arrival, while service rates derived from relative delay constraints are computed only every N packet arrivals. If nofeasible service rate allocation exists 1 , or if the packet buffer overflows, packets are dropped according to the loss constraints.The service rates are translated into packet scheduling decisions by an algorithm resembling Deficit Round Robin. That is,the scheduler tries to achieve the desired service rates by keeping track of the difference between the actual transmission ratefor each class and the desired service rate for each class. Scheduling in JoBS is work-conserving.1 For instance, if the sum of the service rates needed is greater than the output link capacity.79
7.5.2 ConfigurationRunning a JoBS simulation requires to create and configure the JoBS “link(s)”, to create and configure the Markers andDemarkers in charge of marking/demarking the traffic, to attach an application-level data source (traffic generator), and tostart the traffic generator.Initial Setupset ns [new Simulator]Queue/JoBS set drop_front_ falseQueue/JoBS set trace_hop_ trueQueue/JoBS set adc_resolution_type_ 0Queue/JoBS set shared_buffer_ 1Queue/JoBS set mean_pkt_size_ 4000Queue/Demarker set demarker_arrvs1_ 0Queue/Demarker set demarker_arrvs2_ 0Queue/Demarker set demarker_arrvs3_ 0Queue/Demarker set demarker_arrvs4_ 0Queue/Marker set marker_arrvs1_ 0Queue/Marker set marker_arrvs2_ 0Queue/Marker set marker_arrvs3_ 0Queue/Marker set marker_arrvs4_ 0set router(1) [$ns node]set router(2) [$ns node]set source [$ns node]set sink [$ns node]set bw 10000000set delay 0.001set buff 500;# preamble initialization;# use drop-tail;# enable statistic traces;# see ‘‘commands at a glance’’;# all classes share a common buffer;# we expect to receive 500-Byte pkts;# reset arrivals everywhere;# set first router;# set second router;# set source;# set traffic sink;# 10 Mbps;# 1 ms;# 500 packetsCreating the JoBS links$ns duplex-link $router(1) $router(2) $bw $delay JoBS;# Creates the JoBS link$ns_ queue-limit $router(1) $router(2) $buffset l [$ns_ get-link $router(1) $router(2)]set q [$l queue]$q init-rdcs -1 2 2 2 ;# Classes 2, 3 and 4 are bound by proportional delay differentiation with a factor of 2$q init-rlcs -1 2 2 2 ;# Classes 2, 3 and 4 are bound by proportional loss differentiation with a factor of 2$q init-alcs 0.01 -1 -1 -1 ;# Class 1 is provided with a loss rate bound of 1%$q init-adcs 0.005 -1 -1 -1 ;# Class 1 is provided with a delay bound of 5 ms$q init-arcs -1 -1 -1 500000 ;# Class 4 is provided with a minimumthroughput of 500 Kbps$q link [$l link] ;# The link is attached to the queue (required)$q trace-file jobstrace ;# Trace per-hop, per-class metrics to the file jobstrace$q sampling-period 1 ;# Reevaluate rate allocation upon each arrival$q id 1 ;# Assigns an ID of 1 to the JoBS queue$q initialize ;# Proceed with the initialization80
- Page 29 and 30: For a C++ variable to be traceable,
- Page 31 and 32: 3.5 Class TclClassThis compiled cla
- Page 33 and 34: class Packet {......static int hdrl
- Page 35 and 36: The actual arguments passed by the
- Page 37 and 38: class TclClass (Section 3.5) define
- Page 39 and 40: Chapter 4The Class SimulatorThe ove
- Page 41 and 42: 4.2.2 the heap schedulerThe heap sc
- Page 43 and 44: 4.4 Commands at a glanceSynopsis:ns
- Page 45 and 46: $ns_ dumpqCommand for dumping event
- Page 47 and 48: NODEPortClassifierAgentAgentAddrCla
- Page 49 and 50: The Node instance variable, entry_,
- Page 51 and 52: The default values for all the abov
- Page 53 and 54: The classify() method is pure virtu
- Page 55 and 56: };The class imposes no direct seman
- Page 57 and 58: flow-specific queuing disciplines a
- Page 59 and 60: 5.5 Routing Module and Classifier O
- Page 61 and 62: Module NameRtModule/BaseRtModule/Mc
- Page 63 and 64: $node neighborsThis returns the lis
- Page 65 and 66: Linkhead_enqT_queue_ deqT_ link_ tt
- Page 67 and 68: 6.2 ConnectorsConnectors, unlink cl
- Page 69 and 70: $ns_ link-lossmodel This function
- Page 71 and 72: Chapter 7Queue Management and Packe
- Page 73 and 74: }}}void Queue::resume(){Packet* p =
- Page 75 and 76: 7.3 Different types of Queue object
- Page 77 and 78: maxidle_ is the maximum amount of t
- Page 79: dst_ The destination address of pac
- Page 83 and 84: mean_pkt_size_ Used to set the expe
- Page 85 and 86: Demarker objects$q trace-file This
- Page 87 and 88: The recv() method overrides the bas
- Page 89 and 90: 9.2 ImplementationThe procedures an
- Page 91 and 92: Average sending rateTSW window leng
- Page 93 and 94: The following command adds an entry
- Page 95 and 96: $qCE configQ 0 1 10 20 0.10Note tha
- Page 97 and 98: Chapter 10AgentsAgents represent en
- Page 99 and 100: CtrMcast/EncapCtrMcast/DecapMessage
- Page 101 and 102: }bind("windowOption_", &wnd_option_
- Page 103 and 104: hdr_flags* nf = (hdr_flags*)npkt->a
- Page 105 and 106: public:ECHO_Timer(ECHO_Agent *a) :
- Page 107 and 108: 10.6.4 Using the agent through OTcl
- Page 109 and 110: State Variables are:dupacks_ Number
- Page 111 and 112: $agent attach-tbf Attaches a token
- Page 113 and 114: (void)Scheduler::instance().schedul
- 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
Objective<strong>The</strong> objective of the JoBS algorithm is to provide absolute <strong>and</strong> rel<strong>at</strong>ive (proportional) loss <strong>and</strong> delay differenti<strong>at</strong>ion independently<strong>at</strong> each node for classes of traffic. JoBS therefore provides service guarantees on a per-hop basis. <strong>The</strong> set ofperformance requirements are specified to the algorithm as a set of per-class Qualtiy of Service (QoS) co<strong>ns</strong>traints. As anexample, for three classes, the QoS co<strong>ns</strong>traints could be of the form:• Class-1 Delay ≈ 2 · Class-2 Delay,• Class-2 Loss R<strong>at</strong>e ≈ 10 −1 · Class-3 Loss R<strong>at</strong>e, or• Class-3 Delay ≤ 5 ms.Here, the first two co<strong>ns</strong>traints are rel<strong>at</strong>ive co<strong>ns</strong>traints <strong>and</strong> the last one is an absolute co<strong>ns</strong>traint. <strong>The</strong> set of co<strong>ns</strong>traints can beany mix of rel<strong>at</strong>ive <strong>and</strong> absolute co<strong>ns</strong>traints. More specifically, JoBS supports the five following types of co<strong>ns</strong>traints:• Rel<strong>at</strong>ive delay co<strong>ns</strong>traints (RDC) specify a proportional delay differenti<strong>at</strong>ion between classes. As an example, fortwo classes 1 <strong>and</strong> 2, the RDC enforces a rel<strong>at</strong>io<strong>ns</strong>hipDelay of Class 2Delay of Class 1 ≈ co<strong>ns</strong>tant .• Absolute delay co<strong>ns</strong>traints (ADC): An ADC on class i requires th<strong>at</strong> the delays of class i s<strong>at</strong>isfy a worst-case boundd i .• Rel<strong>at</strong>ive loss co<strong>ns</strong>traints (RLC) specify a proportional loss differenti<strong>at</strong>ion between classes.• Absolute loss co<strong>ns</strong>traints (ALC): An ALC on class i requires th<strong>at</strong> the loss r<strong>at</strong>e of class i be bounded by an upperbound L i .• Absolute r<strong>at</strong>e co<strong>ns</strong>traints (ARC): An ARC on class i mea<strong>ns</strong> th<strong>at</strong> the throughput of class i is bounded by a lowerbound µ i .JoBS does not rely on admission control or traffic policing, nor does it make any assumption on traffic arrivals. <strong>The</strong>refore, asystem of co<strong>ns</strong>traints may become infeasible, <strong>and</strong> some co<strong>ns</strong>traints may need to be relaxed. QoS co<strong>ns</strong>traints are prioritized inthe following order.ALC > ADC, ARC > Rel<strong>at</strong>ive Co<strong>ns</strong>traints .Th<strong>at</strong> is, if JoBS is unable to s<strong>at</strong>isfy both absolute <strong>and</strong> rel<strong>at</strong>ive co<strong>ns</strong>traints, it will give preference to the absolute co<strong>ns</strong>traints.MechanismsJoBS performs scheduling <strong>and</strong> buffer management in a single pass. JoBS dynamically alloc<strong>at</strong>es service r<strong>at</strong>es to classes inorder to s<strong>at</strong>isfy the delay co<strong>ns</strong>traints. <strong>The</strong> service r<strong>at</strong>es needed for enforcing absolute delay co<strong>ns</strong>traints are alloc<strong>at</strong>ed upon eachpacket arrival, while service r<strong>at</strong>es derived from rel<strong>at</strong>ive delay co<strong>ns</strong>traints are computed only every N packet arrivals. If nofeasible service r<strong>at</strong>e alloc<strong>at</strong>ion exists 1 , or if the packet buffer overflows, packets are dropped according to the loss co<strong>ns</strong>traints.<strong>The</strong> service r<strong>at</strong>es are tra<strong>ns</strong>l<strong>at</strong>ed into packet scheduling decisio<strong>ns</strong> by an algorithm resembling Deficit Round Robin. Th<strong>at</strong> is,the scheduler tries to achieve the desired service r<strong>at</strong>es by keeping track of the difference between the actual tra<strong>ns</strong>mission r<strong>at</strong>efor each class <strong>and</strong> the desired service r<strong>at</strong>e for each class. Scheduling in JoBS is work-co<strong>ns</strong>erving.1 For i<strong>ns</strong>tance, if the sum of the service r<strong>at</strong>es needed is gre<strong>at</strong>er than the output link capacity.79