MQC Class-Based Peak Shaping


You work for a large provider in India as a senior network engineer specialized in Quality of Service. All the customers of the service provider have an Ethernet connection which is capable of delivering speeds up to 10Mbps. The ISP has diffferent subscriptions and you need to enforce that customers only get what they are paying for…time to get in shape!


  • All IP addresses have been preconfigured for you.
  • Configure router Line to shape all ICMP traffic towards router Jack to a peak rate of 256Kbps.
  • Your bursts should be based on a 20ms interval.




Class-based Peak Shaping

Video Solution:

Configuration Files

You need to register to download the GNS3 topology file. (Registration is free!)

Once you are logged in you will find the configuration files right here.

Opt In Image
Do you want your CCNA or CCNP Certificate?

The How to Master series helps you to understand complex topics like spanning-tree, VLANs, trunks, OSPF, EIGRP, BGP and more.

Written by René Molenaar - CCIE #41726

You May Also Like

About the Author: Rene Molenaar

René - CCIE #41726 is the creator of where he shares CCNA, CCNP and CCIE R&S labs. He also blogs about networking on


  1. I really liked this MQC Class Based Peak Shaping lab Rene! However, I can’t figure out why I’m seeing Shaping Active = no when I enter show policy-map interface f1/0. Below is the config I entered:

    Router: Line

    class-map ICMP
    match protocol ICMP
    policy-map SHAPE
    class ICMP
    shape peak 128000 2560 2560
    int f1/0
    ip nbar protocol-discovery
    service-policy output SHAPE

  2. Hello Renner!
    I did not understand the calculation you did to arrive at the value of 2560. Could explain to me how I do this calculation?

    1. Peak shaping means that Bc and Be are sent every interval. So, if we specify something like this:

      shape peak 128000 2560 2560

      We have specified the CIR as 128000, and we know Tc = Bc / CIR. In this case, Tc = 20 ms. However, 5120 bits can be sent every interval, which we computed to be 20 ms. With Tc of 20 ms, the shaper runs 50 times per second, so 50 * 5120 = 256000.

      Expressed another way:

      Tc = (Bc + Be) / PIR
      0.02 = (2560 + 2560) / PIR
      0.02 = 5120 / PIR
      0.02 * PIR = 5120
      PIR = 5120 / 0.02 = 256000

  3. Line#sh policy-map int

    Service-policy output: POLICY

    Class-map: ICMP (match-all)
    5203 packets, 7202932 bytes
    5 minute offered rate 0 bps, drop rate 0 bps
    Match: protocol icmp
    Traffic Shaping
    Target/Average Byte Sustain Excess Interval Increment
    Rate Limit bits/int bits/int (ms) (bytes)
    256000/128000 640 2560 2560 20 640

    Adapt Queue Packets Bytes Packets Bytes Shaping
    Active Depth Delayed Delayed Active
    – 1 33 27552 16 1984 yes

    Class-map: class-default (match-any)
    291 packets, 18616 bytes
    5 minute offered rate 0 bps, drop rate 0 bps
    Match: any

Comments are closed.