Professional Documents
Culture Documents
CCIE Chapter 14 QOS Shaping and Policing
CCIE Chapter 14 QOS Shaping and Policing
Resources:
http://www.cisco.com/en/US/docs/ios/12_2t/12_2t13/feature/guide/frqosmqc.html
IP Telephony Self-Study Cisco QOS Exam Certification Guide, Second Edition
CCIE Routing and Switching Exam Certification Guide Third Edition
Most shaping and policing happens between network or network types, network to
internet, Ethernet to frame relay, corporate network to carrier network.
Shaping just slows the rate of sending packets so that the traffic contract is
not exceeded. Policing discards some packets so that the traffic contract is not
exceeded.
If a service provider policies traffic then you should shape traffic at the same rate.
Shaping only makes sense when the physical clock rate of a transmission medium
exceeds a traffic contract.
to shape the traffic to match CIR (64 kbps), the router just has to send traffic on the
link half of the time. If a period of time, the router sends traffic only half of the
time, at 128 kbps (because that’s the only rate it can actually send traffic), the average
over that time is 64 kbps. The concept is that simple!
Bc = .125 seconds * 64000 bits/second = 8000 bits
Cisco recommends that when you have delay-sensitive traffic, configure Bc such
that Tc is 10 ms or less. This can give a very small Bc and fragmentation of a packet
might be needed to transmit data within a given Tc.
Excluding BE
A bucket has tokens in that that allow 1 bit to be sent for every token. The Token
bucket is the size of the BC.
The bucket is filled to capacity (BC value) at the start of every TC.
For every bit sent tokens are removed.
The bucket is now the size of BC + BE at the start of every TC a BC worth Is added.
This means if there are TC’s where not all the tokens are spent the bucket starts to fill
up past the value of BC ( into the BE range). All these tokens can then be spent within
1 TC if needed.
Foresight messages are separate, nondata signalling frames , sends messages toward
the device that needs to slow down.
The rate grows again after 16 consecutive intervals occur without a BECN or
Foresight congestion message. The shaping rate grows by 1/16 of the maximum
rate(BC +BE) during each Tc,
Policing fills a bucket with tokens every time a packet arrives, the longer time
between packets the more tokens that are added ( this scale is linear). The amount of
tokens can be calculated by the following:
When you want the policer to support both a committed burst (Bc) and an excess
burst (Be), the policer uses two token buckets.
If the number of bytes in the packet is less than or equal to (<=) the number of tokens
in the Bc Bucket, the packet conforms. Removes packet from Bc bucket
If the packet does not conform, and the number of bytes in the packet is less than or
equal to (<=) the number of tokens in the Be Bucket, the packet exceeds. Removes
tokens from the Be Bucket equal to the number of bytes in the packet
If the packet neither conforms nor exceeds, it violates the traffic contract, no tokens
taken from any bucket.
Has two buckets both are refiled the same way as single rate. One bucket for CIR
(bc) another for PIR (peak info rate) (Be) . this means that the PIR bucket is going to
get more tokens each packet arrival because the Be will be higher then the Bc.
So packet arrives, if it can be sent from the Bc bucket tokens are taken from the Bc
bucket. The same amount of tokens are also taken from the Be bucket! Packet
conforms.
If packet is larger then tokens in Bc but less the Be then packet is exceed. Tokens are
taken from the Be bucket.
If greater then both packet is violate and no tokens are taken from the buckets.
policer is configured to mark multiple fields for packets that fall into a single policing
category, the policer is said to be a multi-action policer.
CB Shaping calculates a value for Bc and Be if the shape command does not include
a value. From those values, CB Shaping calculates the Tc. At lower shaping rates
(less than 320 kbps), CB Shaping assumes a Bc of 8000 bits, and calculates Tc based
on the formula Tc = Bc/CIR, with some rounding as necessary. At 320 kbps, the
calculated Tc would be 25 ms, or .025 seconds.
CB Shaping instead uses a default Tc of .025 seconds, and calculates Bc based on the
same formula, Bc = Tc * CIR. For instance, at 640 kbps, Bc = .025 * 640 kbps =
16,000 bits.
You can explicitly set the Bc and Be values in addition to the shaping rate. As a
result, you will have supplied two of the three variables in the Tc = Bc/CIR formula
This config will force a Tc of 50ms
policy-map shape-non-voip
class voip-rtp
class class-default
shape average 64000 3200
the shape peak 64000 command actually shapes packets at a rate higher than 64 kbps.
To calculate the actual rate, you would use the following
For instance, in this example, the actual shaping rate would be 128 kbps:
64 (1 + 8000/8000) = 128 ( remember on link below 320kbps a Bc of 8000 is
assumed).
Adaptive Shaping
policy-map shape-all
class class-default
shape average 96000 9600
shape adaptive 32000!
This config will reduce the shape average down by 25% to a minimum of 32Kbps if a
Becn is received.
Shaping by Percent
policy-map percent-test
class class-default
shape average percent 50 125 ms
interface Serial0/1
bandwidth 128
service-policy output percent-test
this example will make a shaper using 64Kbps with a Tc of 125ms so the Bc will be
8000bps.
Policing
all IOS shapers use bits as the unit when setting Bc and Be; policers use bytes as
the unit.
Single rate
policy-map police-all
class class-default
police cir 96000 bc 12000 be 6000 conform-action transmit exceed-action set-dscp- transmit 0 violate-action drop
if you wanted to perform dual-rate policing, with a CIR of 96 kbps and a PIR of 128
kbps, you would simply use a command like police cir 96000 pir 128000
Multi-action Policing
R3(config)#policy-map testpol1
R3(config-pmap)#class class-default
R3(config-pmap-c)#police 128000 256000
R3(config-pmap-c-police)#conform-action transmit
R3(config-pmap-c-police)#exceed-action transmit
R3(config-pmap-c-police)#violate-action set-dscp-transmit 0
R3(config-pmap-c-police)#violate-action set-frde-transmit
Policing by percentage
assuming a 128k link this would give you a cir of 32Kbps with a Bc of 16000bps
and a pir of 64k with a Be of 32000 bps.
The FECN bit can be set to 1 to indicate that congestion was experienced in the
direction of the frame transmission, so it informs the destination that congestion has
occurred. BECN means Backwards Explicit Congestion Notification. The BECN bit
can be set to 1 to indicate that congestion was experienced in the network in the
direction opposite of the frame transmission, so it informs the sender that congestion
has occurred.
If FRTS and fragmentation are applied to a PVC using MQC, the interface queue will
change to dual FIFO queueing. The two queues will consist of a high-priority queue
to carry Voice over IP (VoIP) and certain control packets, and a low-priority queue to
carry all other packets.
the MQC-Based Frame Relay Traffic Shaping feature is used to configure FRTS, the
shaping rate that was configured in the parent policy map using MQC will be used as
the total available bandwidth for the child policy map, if CBWFQ is configured. If
both the shape average and shape adaptive commands are used for traffic-shaping,
the available bandwidth will be based on the parameters specified by the shape
adaptive command
Configuring traffic shaping using MQC and configuring traffic shaping using
traditional FRTS commands are mutually exclusive. Traffic shaping cannot be
configured on the same interface using both methods.