[Cisco] How to limit a rate on interface ?

The command ‘rate-limit’ is interface configuration command. It is used to setup a committed access rate (CAR) and distributed CAR (DCAR) policies. To remove the rate limit from the configuration, as you know, use the no form of this command.


rate-limit {input | output} [dscp dscp-value] [access-group [rate-limit] acl-index]
bps burst-normal burst-max conform-action conform-action exceed-action
exceed-action

no rate-limit {input | output} [dscp dscp-value] [access-group [rate-limit]
acl-index] bps burst-normal burst-max conform-action conform-action exceed-action
exceed-action

input Applies this CAR traffic policy to packets received on this input interface.
output Applies this CAR traffic policy to packets sent on this output interface .
dscp (Optional) Allows the rate limit to be applied to any packet matching a specified differentiated services code point (DSCP).
access-group (Optional) Applies this CAR traffic policy to the specified access list.
rate-limit (Optional) The access list is a rate-limit access list.
bps Average rate, in bits per second (bps). The value must be in increments of 8 kbps.
burst-normal Normal burst size, in bytes. The minimum value is bps divided by 2000.
burst-max Excess burst size, in bytes.
conform-action Action to take on packets that conform to the specified rate limit. Specify one of the following keywords .
exceed-action Action to take on packets that exceed the specified rate limit. Specify one of the following keywords .


o  CAR and DCAR can only be used with IP traffic. Non-IP traffic is not rate limited.
o  CAR and DCAR can be configured on an interface or subinterface. However, CAR and DCAR are not supported on the Fast EtherChannel, tunnel, or PRI interfaces, nor on any interface that does not support Cisco Express Forwarding (CEF).
o  CEF must be enabled on the interface before you configure CAR or DCAR.


Policing Traffic with CAR

 

CAR embodies a rate-limiting feature for policing traffic. When policing traffic with CAR, Cisco recommends the following values for the normal and extended burst parameters:

Burst-normal = configured rate * 1/8 * 1.5 seconds (1/8 for convert bit to byte)
Burst-max = Burst-normal * 2

 

Examples 1.

FTP traffic is sent with an MPLS experimental field of 5 if it conforms to the second rate policy. If the FTP traffic exceeds the rate policy, it is dropped. See the following commands in the example:

rate-limit input access-group 122 10000000 1875000 3750000 confirm-action
mpls-exp 5 exceed-action drop

access-list 122 permit tcp any any eq ftp

 

Examples 2.

 

Below example is shown two access lists are created to classify the web and FTP traffic so that they can be handled separately by the CAR feature:

interface Serial 0/1
Description T3 to MR
rate-limit
input access-group 111 10000000 1875000 3750000 conform-action drop
rate-limit
input access-group 122 8000000 1500000 3000000 conform-action drop
rate-limit
input access-group 133 20000000 3750000 7500000 conform-action drop

access-list 111 permit tcp any any eq www
access-list 122 permit tcp and any eq ftp


Reference; http://www.cisco.com/en/US/customer/docs/ios/12_2/qos/command/reference/qrfcmd8.html

 

Leave a Reply