Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 11

Implementing Traffic Shaping

QoS Traffic Policing and Shaping

© 2012 Cisco and/or its affiliates. All rights reserved. SPCORE v1.01—6-1
Objective
• Describe class-based shaping
• Explain a Single-Level Shaping Configuration
• Explain a Hierarchical Shaping Configuration
• Describe the show command used to Monitoring Class-Based
Shaping operations

© 2012 Cisco and/or its affiliates. All rights reserved. SPCORE v1.01—6-2
Class-Based Traffic Shaping
Access
Aggregation
IP Edge
Core
Residential

Mobile Users

Business

Customer Outbound Traffic Shaping Traffic Shaping Toward Customer

• Class-based shaping is used to rate-limit packets.


• Class-based shaping delays exceeding packets rather than
dropping them.
• Class-based shaping has no marking capabilities.

© 2012 Cisco and/or its affiliates. All rights reserved. SPCORE v1.01—6-3
Shaping to Average Rate
• Shaping to the average rate
- Forwarding at the configured average rate
- Allowed bursting up to Be when there are extra tokens available
- Most common method
- Supported on Cisco IOS XR, Cisco IOS, and Cisco IOS XE routers
• Shaping to the peak rate
- Forwarding at the peak rate of up to Bc + Be at every Tc
- Rarely used
- Not supported on Cisco IOS XR Software

© 2012 Cisco and/or its affiliates. All rights reserved. SPCORE v1.01—6-4
Single-Level Shaping
Gig0/0/0/1
Access and
Customer A Aggregation

Shaping Traffic to Customer A

ipv6 access-list CustomerA-v6-ACL


10 permit ipv6 any 2001:1:101::/48
!
ipv4 access-list CustomerA-v4-ACL
10 permit ipv4 any 192.168.101.0/24
!
class-map match-any CustomerA
match access-group ipv4 CustomerA-v4-ACL
match access-group ipv6 CustomerA-v6-ACL
!
Average rate defined in b/s, kb/s, mb/s, gb/s, or percent.
policy-map egress
Layer 2 encapsulation is considered.
class CustomerA
shape average 1 mbps 20 ms
! Excess burst configured in bytes, KB, MB, GB, milli-or
interface GigabitEthernet0/0/0/1 micro-seconds. Only configurable in IOS XR Software.
service-policy output egress

© 2012 Cisco and/or its affiliates. All rights reserved. SPCORE v1.01—6-5
Hierarchical Traffic Shaping
Parent: Shaping, Child: CBWFQ

Customer
A Gig0/0/0/1 shape-all Shape to 5 mb/s
Access and
aggregation
Customer Child-
Cust-A Cust-B Level
B shape-all Policy
CBWFQ
50% 20%

policy-map child-cbwfq
class Cust-A Child-Level CBWFQ
bandwidth percent 50
class Cust-B
bandwidth percent 20 Parent-Level Shaper
!
policy-map shape-all
class class-default Parent Level: class-default
shape average 5 mbps Child policy applies CBWFQ.
service-policy child-cbwfq
!
Child class exceeds its rate
interface GigabitEthernet0/0/0/1
service-policy output shape-all if there is no congestion.

© 2012 Cisco and/or its affiliates. All rights reserved. SPCORE v1.01—6-6
Hierarchical Traffic Shaping
Parent: Shaping, Child: Shaping

Customer
A Gig0/0/0/1 shape-all Shape to 5 mb/s
Access and
aggregation
Customer Child-
Cust-A Cust-B Level
B shape-all Policy
Shapers
50% 20%

policy-map child-shaper
class CustomerA Child-Level shaper
shape average percent 50
class CustomerB
shape average percent 20
Parent-Level shaper
!
policy-map shape-all
class Customers Parent-Level Custom Class
service-policy child-shaper
shape average 5 mbps 20 ms
! Child class never
interface GigabitEthernet0/0/0/1 exceeds its rate.
service-policy output shape-all

© 2012 Cisco and/or its affiliates. All rights reserved. SPCORE v1.01—6-7
Hierarchical Traffic Shaping and Policing on Parent
or Child Level
policy-map police-all
class Customers Parent-Level
police rate 10 mbps policer
service-policy child-shaper
! Child-Level
policy-map child-shaper shaper
class Customer
shape average percent 10
!
interface GigabitEthernet0/0/0/1
service-policy output police-all

policy-map shape-all Parent-Level


class Customers shaper
shape average 5 mbps
service-policy child-policer
!
policy-map child-policer Child-Level
class Customer policer
police rate percent 10
!
interface GigabitEthernet0/0/0/1
service-policy output shape-all

© 2012 Cisco and/or its affiliates. All rights reserved. SPCORE v1.01—6-8
Monitoring Traffic Shaping
RP/0/RSP0/CPU0:PE# show policy-map interface gigabitEthernet 0/0/0/2
GigabitEthernet0/0/0/2 output: egress

Class Customer
Classification statistics (packets/bytes) (rate - kbps)
Matched : 200/283600 0
Transmitted : 200/283600 0
Total Dropped : 0/0 0
Queueing statistics
Queue ID : 266 Tail Drop Counter
High watermark (Unknown)
Inst-queue-len (packets) : 0
Avg-queue-len (Unknown)
Traffic Within the Shaped Rate
Taildropped(packets/bytes) : 3/3785
Queue(conform) : 42/59556 0
Queue(exceed) : 158/224044 0
RED random drops(packets/bytes) : 0/0
Traffic Above the Shaped Rate
Class class-default
Classification statistics (packets/bytes) (rate - kbps)
Matched : 58/5484 0
Transmitted : 58/5484 0
<output truncated>

© 2012 Cisco and/or its affiliates. All rights reserved. SPCORE v1.01—6-9
Summary
• Traffic shaping is typically deployed on CE devices on the links toward
the SP and on the PE devices, on the links toward the customers
• The shape average command in policy-map class configuration mode
is used to shape traffic to the indicated average bit rate
• Class-based shaping can be used in combination with class-based
weighted fair queuing (CBWFQ)
• The show policy-map interface command displays all service policies
that are applied to the interface

© 2012 Cisco and/or its affiliates. All rights reserved. SPCORE v1.01—6-10
© 2012 Cisco and/or its affiliates. All rights reserved. SPCORE v1.01—6-11

You might also like