Peak Traffic Shaping on Cisco IOS

Cisco IOS routers support two types of shaping:

  • shape average
  • shape peak

In my first lesson I explained the basics of shaping and I demonstrated how to configure shape average. This time we will take a look at peak shaping which is often misunderstood and confusing for many networking students.

Cisco IOS routers support two types of shaping: shape average shape peak In my first lesson I explained the basics of shaping and I demonstrated how to configure shape average. This time we will take a look at peak shaping which is often misunderstood and confusing for many networking students.


 

Shape Average

Here’s a quick recap of how shape average works:

shape token bucket bc be

We have a bucket and it can contain Bc and Be tokens. At the beginning of the Tc we will only fill the token bucket with the Bc but because it’s larger we can “save” tokens up to the Be level. The advantage of having a bigger bucket is that we can save tokens when we have periods of time where we send less bits than the configured shaping rate.

After a period of inactivity, we can send our Bc and Be tokens which allows us to burst for a short time. When we use a bucket that has Bc and Be, this is what our traffic pattern will look like:

shaping bc be explained

Above you can see that we start with a period where we are able to spend Bc and Be tokens, the next interval only the Bc tokens are renewed so we are only able to spend those. After awhile a period of inactivity allows us to fill our bucket again.

Shape Peak

Peak shaping uses the Be in a completely different way. We still have a token bucket that stores Bc + Be but will fill our token bucket with Bc and Be tokens each Tc and unused tokens will be discarded.

Here’s what our traffic pattern will look like:

Shaping Peak Visualized

Each Tc our Bc and Be tokens are renewed so we are able to spend them. A period of inactivity doesn’t mean anything.

Now you might be wondering why do we use this and what’s the point of it?

Depending on your traffic contract, an ISP might give you a CIR and PIR (Peak Information Rate). The rate is the guaranteed bandwidth that they offer you, the PIR is the maximum non-guaranteed rate that you could get when there is no congestion on the network. When there is congestion, this traffic might be dropped. ISPs typically use policing to enforce these traffic contracts.

The idea behind peak shaping is that we can configure shaping and take the CIR and PIR of the ISP into account.

When we send a lot of traffic, we will be spending the Bc and Be tokens each Tc and we are shaping up to the PIR. When there isn’t as much traffic to shape, we only spend Bc tokens and that’s when we are shaping up to the CIR.

Let’s look at an configuration example which will help to clarify things.

Configuration

I will use the following topology to demonstrate peak shaping:

shape peak topology iperf

Above we have two computers and two routers. The computers will be used to generate traffic with iPerf, I’ll configure peak shaping on R1. Let’s do a quick test with iPerf, time to start the server:

We're Sorry, Full Content Access is for Members Only...

If you like to keep on reading, Become a Member Now! Here is why:

  • Learn any CCNA, CCNP and CCIE R&S Topic. Explained As Simple As Possible.
  • Try for Just $1. The Best Dollar You've Ever Spent on Your Cisco Career!
  • Full Access to our 660 Lessons. More Lessons Added Every Week!
  • Content created by Rene Molenaar (CCIE #41726)

503 Sign Ups in the last 30 days

satisfaction-guaranteed
100% Satisfaction Guaranteed!
You may cancel your monthly membership at any time.
No Questions Asked!

Tags:


Forum Replies

  1. Please help me out to implement QoS over ADSL link. I want to prioritize my voice traffic and assign 15% of BW.
    Please check the config of my usual WAN link not sure what would be on ADSL.

    class-map match-any Client-Signal-Class
     match precedence 3
     match ip dscp af31
     match ip dscp cs3
    class-map match-any Client-VOIP-Class
     match precedence 5
     match ip dscp ef
    !
    policy-map 50Mb-VOIP-PMAP
     class Client-VOIP-Class
      priority percent 10
     class Client-Signal-Class
      bandwidth percent 5
     class class-default
      fair-queue
    policy-map 50Mb-VOIP
     class class-default
      s
    ... Continue reading in our forum

  2. Hello Prashant,

    Both policing and shaping have a common goal: to “rate-limit” exceeding traffic.

    How they do it is different though. A shaper will “buffer” the traffic while a policer “drops” the traffic.

    A practical example could be an ISP router that is connected to multiple customer routers. Let’s say that the routers are connected with GigabitEthernet links but the customers are only paying for a 100/100 Mbit connection.

    The ISP will then use a policer to drop all incoming traffic that exceeds 100 Mbit.

    On the customer end, you probably don’t want your traf

    ... Continue reading in our forum

  3. Hello Jose

    Yes indeed this can be the case. You must coordinate with the ISP so that your shaping policy on the edge of your network doesn’t send more traffic than the ISP is configured to handle especially if the ISP implements a more strict policy than your edge router. Otherwise, as you describe in your post, traffic can and will be dropped by the ISP.

    I hope this has been helpful!

    Laz

  4. Thank you Laz!
    Sorry I have another question; I’m confused about what is the value I should use for BC, what exactly has to be in consideration to decide this value? In some documentation I found BC=(CIR/8)*1,5 but I guess that it can’t be a static rule, I think it should be diferent for UDP voice than TCP for example. Could you help me to clear this doubt?

  5. Hello Jose

    There’s no single answer to your question. You are correct in that the Bc that you will use will depend on the traffic that you want to shape. As mentioned in the lesson, Bc depends upon the Tc and upon the actual Committed Information Rate or the required shaped speed of the link, like so:

    Bc = Tc * CIR

    And Tc will depend on the kind of traffic that will be shaped. If you’re shaping voice, Tc should be around 10 ms. So Bc = 10 ms * CIR. Now if your CIR is very large like 5Mbps, then Bc will be 50 kilobits, but if your CIR is relatively small li

    ... Continue reading in our forum

53 more replies! Ask a question or join the discussion by visiting our Community Forum