Professional Documents
Culture Documents
Search …
Lesson Contents
Course Contents
1. Configuration CCNP ENCOR 350-401
2. Conclusion
Unit 1: Switching
Unit 2: Routing
In a previous lesson I explained how we can use shaping to enforce lower bitrates. In this
Unit 3: Wireless
lesson, I will explain how to configure shaping. This is the topology we will use:
Unit 4: Multicast
Unit 6: Services
6.1 NTP
6.2 NAT/PAT
QoS Classification
QoS Marking
Introduction to Shaping
Above we have two routers connected to each other with a serial and FastEthernet link. Shaping Configuration
We’ll use both interfaces to play with shaping. The computers are used for iPerf which is Introduction to Policing
a great application to test the maximum achievable bandwidth. The computer on the left Policing Configuration
side is our client, on the right side we have the server. Right now we are using the serial Unit 7: Network Assurance
Unit 8: Security
interfaces thanks to the following static routes:
Unit 9: Automation
R2#
1. Configuration
https://networklessons.com/cisco/ccnp-encor-350-401/traffic-shaping-on-cisco-ios 1/12
9/20/22, 12:21 PM Traffic Shaping on Cisco IOS
24:22
We will start with some low bandwidth settings. Let’s set the clock rate of the serial
interface to 128 Kbps:
SERVER# iperf -s
------------------------------------------------------------
------------------------------------------------------------
That’s all we have to do on the server side, it will listen on the default port with a window
size of 85.3 Kbyte. Here’s what we will do on the client side:
------------------------------------------------------------
------------------------------------------------------------
[ 10] local 192.168.1.1 port 44350 connected with 192.168.2.2 port 5001
The “-P” parameter tells the client to establish eight connections. I’m using multiple
connections so we get a nice average bandwidth. Here’s what you will see on the server:
https://networklessons.com/cisco/ccnp-encor-350-401/traffic-shaping-on-cisco-ios 2/12
9/20/22, 12:21 PM Traffic Shaping on Cisco IOS
Server#
Above you see the individual connections and the [SUM] is the combined throughput of
all connections. 121 Kbps comes pretty close to the clock rate of 128 Kbps which we
configured.
Let’s configure shaping to limit the throughput of Iperf. This is done with the MQC
(Modular Quality of Service) framework which makes the configuration very simple. First
we need to configure an access-list which matches our traffic:
The access-list above will match all traffic from 192.168.1.1 to 192.168.2.2. Now we need
to create a class-map:
R1(config)#class-map IPERF
The class map is called IPERF and matches our access-list. Now we can configure a policy-
map:
R1(config)#policy-map SHAPE_AVERAGE
R1(config-pmap)#class IPERF
R1(config-pmap-c)#shape ?
In the policy-map we select the class-map, above you can see the options for shaping.
We’ll start with a simple example:
R1(config-pmap-c)#shape average ?
https://networklessons.com/cisco/ccnp-encor-350-401/traffic-shaping-on-cisco-ios 3/12
9/20/22, 12:21 PM Traffic Shaping on Cisco IOS
We will go for shape average where we have to specify the target bit rate. Let’s go for 64
Kbps (64000 bps):
algorithm will fi
When you configure the target bit rate, there’s an option to specify the bits per interval.
Cisco IOS recommends you not to configure this manually so for now, we’ll stick to
configuring the bit rate. This means Cisco IOS will automatically calculate the Bc and Tc:
That’s all there is to it. Now we can activate our policy-map on the interface:
SERVER#
Great, that’s close to 64 Kbps. Here’s what it looks like on our router:
https://networklessons.com/cisco/ccnp-encor-350-401/traffic-shaping-on-cisco-ios 4/12
9/20/22, 12:21 PM Traffic Shaping on Cisco IOS
Serial0/0/0
Queueing
Match: any
Above you can see that we have matched packets on our policy-map. Cisco IOS decided
to use 256 bits for the Bc value.
The example above is of a Cisco 2800 router running IOS 15.1 which only
shows you the calculated Bc value. Older Cisco IOS versions show a lot more
detailed information, including the calculated Tc value.
How did it come up with this value? The Tc can be calculated like this:
Tc = Bc / CIR
Let’s look at some more examples, I’ll also explain how to change the Be and Tc values.
Let’s set the clock rate to 256 Kbps and shape to 128 Kbps:
R1(config)#policy-map SHAPE_AVERAGE
R1(config-pmap)#class IPERF
https://networklessons.com/cisco/ccnp-encor-350-401/traffic-shaping-on-cisco-ios 5/12
9/20/22, 12:21 PM Traffic Shaping on Cisco IOS
Serial0/0/0
Queueing
SERVER#
Seems our shaper is working fine, we get close to 128 Kbps. Let’s bump up the clock rate
again:
R1(config)#policy-map SHAPE_AVERAGE
R1(config-pmap)#class IPERF
https://networklessons.com/cisco/ccnp-encor-350-401/traffic-shaping-on-cisco-ios 6/12
9/20/22, 12:21 PM Traffic Shaping on Cisco IOS
Serial0/0/0
Queueing
Once again, Cisco IOS sets the Bc value so we end up with a Tc value of 4 ms. Let’s try
iPerf again:
SERVER#
What about faster interfaces? Let’s try something with our FastEthernet interfaces
between R1 and R2. Let’s change the static route so that R1 and R2 don’t use the serial
links anymore:
Let’s see what kind of throughput we get without any shaper configured:
SERVER#
The output above is what we would expect from a 100 Mbit link. Let’s shape this to 1
Mbit:
https://networklessons.com/cisco/ccnp-encor-350-401/traffic-shaping-on-cisco-ios 7/12
9/20/22, 12:21 PM Traffic Shaping on Cisco IOS
R1(config)#policy-map SHAPE_AVERAGE
R1(config-pmap)#class IPERF
R1(config-pmap-c)#shape average 1m
Instead of specifying the shape value in bits, you can also use “k” or “m” to specify Kbps
or Mbps. Let’s activate it:
FastEthernet0/0
0 packets, 0 bytes
Queueing
The most recent Cisco IOS versions always prefer a Tc of 4 ms and will
calculate the Bc value accordingly. On older Cisco IOS versions it’s possible
that you see higher Bc values with a Tc of 125 ms.
SERVER#
Great, our traffic is now shaped to 955 Kbps which is close enough to 1 Mbps.
So far we used the default Bc and Tc values that the router calculated for us. What if we
have a requirement where we have to configure one of these values manually?
We can’t configure the Tc directly but we can change the Bc. Let’s say that we have a
requirement where we have to set the Tc to 10 ms. How do we approach this?
Bc = Tc * CIR
R1(config)#policy-map SHAPE_AVERAGE
R1(config-pmap)#class IPERF
R1(config-pmap-c)#shape average 1m ?
algorithm will fi
First we set the targetted bit rate and then we set the Bc value:
FastEthernet0/0
Queueing
That’s all there is to it. Let’s try one more example, let’s say we want a Tc of 125 ms:
R1(config)#policy-map SHAPE_AVERAGE
R1(config-pmap)#class IPERF
https://networklessons.com/cisco/ccnp-encor-350-401/traffic-shaping-on-cisco-ios 9/12
9/20/22, 12:21 PM Traffic Shaping on Cisco IOS
FastEthernet0/0
Queueing
That’s it, you have now seen how to configure shaping and how to influence the Tc by
setting different Bc values.
2. Conclusion
Thanks to the MQC, configuring shaping on Cisco IOS routers is pretty straightforward.
You have now learned how to configure shaping and also how to influence the Tc by
setting the correct Bc value.
In the next lesson, I will explain how “peak” shaping works which works a bit different
compared to “average” shaping.
Configurations
Want to take a look for yourself? Here you will find the final configuration of each device.
R1
hostname R1
ip cef
interface FastEthernet0/0
interface FastEthernet0/1
interface Serial0/0/0
end
R2
https://networklessons.com/cisco/ccnp-encor-350-401/traffic-shaping-on-cisco-ios 10/12
9/20/22, 12:21 PM Traffic Shaping on Cisco IOS
hostname R2
ip cef
interface FastEthernet0/0
interface FastEthernet0/1
interface Serial0/0/0
end
I hope you enjoyed this lesson, if you have any questions feel free to leave a comment
below.
« Previous Lesson
Introduction to Shaping
Next Lesson
Introduction to Policing »
Tags: IOS, Shaping
Forum Replies
johnfrades
wuchester
mangatoea
Thanks Rene!
Also nice to know that newer ios versions adopt the Tc value as 4ms now, i.s.o 125ms before.
That makes it good for all in regards to voice and video or latency sensitive traffic!
ReneMolenaar
https://networklessons.com/cisco/ccnp-encor-350-401/traffic-shaping-on-cisco-ios 11/12
9/20/22, 12:21 PM Traffic Shaping on Cisco IOS
Hi Edwin,
That’s good to hear! I agree that 125 ms was a bit too much. Decreasing the Tc could increase the CPU load, I haven’t really tested this but it might be
something to keep in mind…next time I’m messing around with shaping I’ll see what the impact is
Rene
jonstatic1982
I work with Carrier Ethernet circuits that have policed Committed Burst Size variables. If I understand this correctly, I should be to shape the traffic using
shape average (CIR) (CBSx8) (EBS) x 8. According to MEF, a good rule of thumb for CBS is 8x mtu. We typically have an EBS of 0. Would it be appropriate to
divide the CBS by two use that value for CBS and EBS or is another strategy more better?
51 more replies! Ask a question or join the discussion by visiting our Community Forum
https://networklessons.com/cisco/ccnp-encor-350-401/traffic-shaping-on-cisco-ios 12/12