Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 10

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.

Policing protects a network from being overrun by traffic

Policing can mark down traffic( QOS) or discard traffic.

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

The shaper just grabs the next packet, decrements


the Bc values by the number of bits in the packet, and keeps doing that until the Bc
value is consumed. At that point, shaping waits until the Tc has expired, when
shaping gets to send another Bc worth of bits.

This would be a poor choice for delay sensitive traffic.

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.

The token bucket example

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.

With BE ( excess burst)

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.

FECN, is set by a frame relay switch if the congestion is happening.


BECN, is set in response to the FECN to send back to the source host.

Foresight messages are separate, nondata signalling frames , sends messages toward
the device that needs to slow down.

When the Shaper receives a BECN or Foresight message, it slows down by 25


percent of the maximum rate. In order to slow down, CB Shaping actually simply
decreases Bc and Be by 25%,

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,

Shaping can be applied to the physical interface, a subinterface, or VC

CB Shaping can be applied per subinterface, but not per-VC on multipoint


Subinterfaces
The shaping queues exist separately from the interface software queues

Single rate Traffic policing

Conforming—Packet is inside the contract


Exceeding—Packet is using up a excess burst capability
Violating—Packet is totally outside the contract

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 Bc bucket is full it over flows into Be bucket.

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.

Dual rate traffic policing:

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

Tuning Shaping for Voice Using LLQ and a Small Tc


Notice how the second polcy map references the first policy map.
policy-map queue-voip
class voip-rtp
priority 32
class class-default
fair-queue
!
!
policy-map shape-all
class class-default
shape average 96000 960
service-policy queue-voip
shape peak instead of shape average command turns on dual streams ( both Bc and
Be get tokens Per Tc)

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

Shaping_rate = configured_rate (kbps) (1 + Be(bits)/Bc(bits))

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

Single rate multi policers


policy-map police-web
class match-web
police cir 80000 bc 10000 be 5000 conform-action transmit exceed-action transmit
violate-action drop
class class-default
police cir 16000 bc 2000 be 1000 conform-action transmit exceed-action
transmit violate-action set-dscp-transmit 0

Dual rate Policer

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

police cir percent 25 bc 500 ms pir percent 50 be 500 ms

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.

Assuming 1544k this would give a Cir 386kbps with a Bc of 192Kbps


And a pir of 772kbps with a Be of 386kbps.

If you don’t config a Bc the defaults of Tc 0.25 sec’s ( 250ms) .


so Bc = Cir (in bytes) / 4 .

Again the same for the Be but based of the PIR

MQC based FRTS

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.

Restrictions for MQC-Based Frame Relay Traffic Shaping


You must create a default class for the service policy as specified with the class class-
default command to configure FRTS using MQC on a Frame Relay PVC. The default
class will have all the FRTS parameters applied to it

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.

The following MQC traffic-shaping commands are supported by the MQC-Based


Frame Relay Traffic Shaping feature:
• shape {average | peak}
• shape adaptive
• shape fecn-adapt
• shape max-buffers

To configure a Frame Relay interface to reflect received forward explicit congestion


notification (FECN) bits as backward explicit congestion notification (BECN) bits in
Q.922 "Test Response" messages, use the shape fecn-adapt command in policy-map
class configuration mode. To configure the Frame Relay interface not to reflect FECN
as BECN, use the no form of this command.

You might also like