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 ...

nmlab.korea.ac.kr
from nmlab.korea.ac.kr More from this publisher
12.07.2015 Views

9.2.3 PolicyClass Policy and its sub-classes (see dsPolicy.{cc, h}) define the policies used by edge routers to mark incomingpackets. A policy is established between a source and destination node. All flows matching that source-destination pair aretreated as a single traffic aggregate. Policy for each different traffic aggregate has an associated policer type, meter type, andinitial code point. The meter type specifies the method for measuring the state variables needed by the policer. For example,the TSW Tagger is a meter that measures the average traffic rate, using a specified time window.When a packet arrives at an edge router, it is examined to determine to which aggregate it belongs. The meter specified bythe corresponding policy is invoked to update all state variables. The policer is invoked to determine how to mark the packetdepending on the aggregate’s state variables: the specified initial code point or a downgraded code point. Then the packet isenqueued accordingly.Currently, six different policy models are defined:1. Time Sliding Window with 2 Color Marking (TSW2CMPolicer): uses a CIR and two drop precedences. The lowerprecedence is used probabilistically when the CIR is exceeded.2. Time Sliding Window with 3 Color Marking (TSW3CMPolicer): uses a CIR, a PIR, and three drop precedences. Themedium drop precedence is used probabilistically when the CIR is exceeded and the lowest drop precedence is usedprobabilistic ally when the PIR is exceeded.3. Token Bucket (tokenBucketPolicer): uses a CIR and a CBS and two drop precedences. An arriving packet is markedwith the lower precedence if and only if it is larger than the token bucket.4. Single Rate Three Color Marker (srTCMPolicer): uses a CIR, CBS, and an EBS to choose from three drop precedences.5. Two Rate Three Color Marker (trTCMPolicer): uses a CIR, CBS, PIR, and a PBS to choose from three drop precedences.6. NullPolicer: does not downgrade any packetsThe policies above are defined as a sub-classes of dsPolicy. The specific meter and policer are implemented in functionsapplyMeter and applyPolicer, which are defined as virtual functions in class dsPolicy. User specified policy canbe added in the similar way. Please refer to NullPolicy as the simplest example.All policies are stored in the policy table in class PolicyClassifier. This table is an array that includes fields for thesource and destination nodes, a policer type, a meter type, an initial code point, and various state information as shown below:The rates CIR and PIR are specified in bits per second:CIR: committed information ratePIR: peak information rateThe buckets CBS, EBS, and PBS are specified in bytes:CBS: committed burst sizeEBS: excess burst sizePBS: peak burst sizeC bucket: current size of the committed bucketE bucket: current size of the excess bucketP bucket: current size of the peak bucketArrival time of last packet89

Average sending rateTSW window lengthClass PolicyClassifier also contains a Policer Table to store the mappings from a policy type and initial code pointpair to its associated downgraded code point(s).9.3 ConfigurationThe number of physical and virtual queues can be configured as:$dsredq set numQueues_ 1$dsredq setNumPrec 2Variable numQueues_ in class dsREDQueue specifies the number of physical queues. It has a default value as 4 definedin ~ns/tcl/lib/ns-default.tcl and can be changed as shown in the example above. Variable setNumPrec sets the number ofvirtual queues within one physical queue.RED parameters can be configured for each virtual queue as follows:$dsredq configQ 0 1 10 20 0.10The mean packet size (in bytes) is also needed for the average RED queue length calculation.$dsredq meanPktSize 1500The variant of MRED used to calculate queue sizes can be configured.$dsredq setMREDMode RIO-C 0The above command sets the MRED mode of physical queue 0 to RIO-C. If the second argument was not included, all queueswould be set to RIO-C which is the default.The various MRED modes supported in DiffServ module are:RIO-C (RIO Coupled): The probability of dropping an out-of-profile packet is based on the weighted average lengths of allvirtual queues; while the probability of dropping an in-profile packet is based solely on the weighted average length ofits virtual queue.RIO-D (RIO De-coupled): Similar to RIO-C; except the probability of dropping an out-of-profile packet is based on thesize of its virtual queue.WRED (Weighted RED): All probabilities are based on a single queue length.DROP: Same as a drop tail queue with queue limit set by RED minimum threshold: when the queue size reaches theminimum threshold, all packets are dropped regardless of marking.The following command adds an entry to the PHB Table and maps code point 11 to physical queue 0 and virtual queue 1.$dsredq addPHBEntry 11 0 190

9.2.3 PolicyClass Policy <strong>and</strong> its sub-classes (see dsPolicy.{cc, h}) define the policies used by edge routers to mark incomingpackets. A policy is established between a source <strong>and</strong> destin<strong>at</strong>ion node. All flows m<strong>at</strong>ching th<strong>at</strong> source-destin<strong>at</strong>ion pair aretre<strong>at</strong>ed as a single traffic aggreg<strong>at</strong>e. Policy for each different traffic aggreg<strong>at</strong>e has an associ<strong>at</strong>ed policer type, meter type, <strong>and</strong>initial code point. <strong>The</strong> meter type specifies the method for measuring the st<strong>at</strong>e variables needed by the policer. For example,the TSW Tagger is a meter th<strong>at</strong> measures the average traffic r<strong>at</strong>e, using a specified time window.When a packet arrives <strong>at</strong> an edge router, it is examined to determine to which aggreg<strong>at</strong>e it belongs. <strong>The</strong> meter specified bythe corresponding policy is invoked to upd<strong>at</strong>e all st<strong>at</strong>e variables. <strong>The</strong> policer is invoked to determine how to mark the packetdepending on the aggreg<strong>at</strong>e’s st<strong>at</strong>e variables: the specified initial code point or a downgraded code point. <strong>The</strong>n the packet isenqueued accordingly.Currently, six different policy models are defined:1. Time Sliding Window with 2 Color Marking (TSW2CMPolicer): uses a CIR <strong>and</strong> two drop precedences. <strong>The</strong> lowerprecedence is used probabilistically when the CIR is exceeded.2. Time Sliding Window with 3 Color Marking (TSW3CMPolicer): uses a CIR, a PIR, <strong>and</strong> three drop precedences. <strong>The</strong>medium drop precedence is used probabilistically when the CIR is exceeded <strong>and</strong> the lowest drop precedence is usedprobabilistic ally when the PIR is exceeded.3. Token Bucket (tokenBucketPolicer): uses a CIR <strong>and</strong> a CBS <strong>and</strong> two drop precedences. An arriving packet is markedwith the lower precedence if <strong>and</strong> only if it is larger than the token bucket.4. Single R<strong>at</strong>e Three Color Marker (srTCMPolicer): uses a CIR, CBS, <strong>and</strong> an EBS to choose from three drop precedences.5. Two R<strong>at</strong>e Three Color Marker (trTCMPolicer): uses a CIR, CBS, PIR, <strong>and</strong> a PBS to choose from three drop precedences.6. NullPolicer: does not downgrade any packets<strong>The</strong> policies above are defined as a sub-classes of dsPolicy. <strong>The</strong> specific meter <strong>and</strong> policer are implemented in functio<strong>ns</strong>applyMeter <strong>and</strong> applyPolicer, which are defined as virtual functio<strong>ns</strong> in class dsPolicy. User specified policy canbe added in the similar way. Please refer to NullPolicy as the simplest example.All policies are stored in the policy table in class PolicyClassifier. This table is an array th<strong>at</strong> includes fields for thesource <strong>and</strong> destin<strong>at</strong>ion nodes, a policer type, a meter type, an initial code point, <strong>and</strong> various st<strong>at</strong>e inform<strong>at</strong>ion as shown below:<strong>The</strong> r<strong>at</strong>es CIR <strong>and</strong> PIR are specified in bits per second:CIR: committed inform<strong>at</strong>ion r<strong>at</strong>ePIR: peak inform<strong>at</strong>ion r<strong>at</strong>e<strong>The</strong> buckets CBS, EBS, <strong>and</strong> PBS are specified in bytes:CBS: committed burst sizeEBS: excess burst sizePBS: peak burst sizeC bucket: current size of the committed bucketE bucket: current size of the excess bucketP bucket: current size of the peak bucketArrival time of last packet89

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

Saved successfully!

Ooh no, something went wrong!