Wednesday, July 31, 2013

Set QoS CAR for All IP traffic on Cisco

What is CAR ? Please refer to QoS | CAR, CIR, MIR, EIR, PIR, CDR for glossary.
CAR is used to limit traffic that can enter or exit an interface.

CAR is part of Classification on QoS implementation.
How to set CAR and apply?

#### Set CAR rate policies for 1 Mbps or 1024 Kbps

rate-limit input 1024000 128000 128000 conform-action transmit exceed-action drop
rate-limit output 1024000 128000 128000 conform-action transmit exceed-action drop

#### Set CAR rate policies for 4 Mbps or 4096 Kbps

rate-limit input 4096000 512000 512000 conform-action transmit exceed-action drop
rate-limit output 4096000 512000 512000 conform-action transmit exceed-action drop

So what is 128000 or 512000 in rate policies above?

1. input/output is direction traffic incoming or outgoing
2. 1024000/4096000 is rate traffic in bits per seconds
3. first 128000/512000 is normal burst in bytes, large traffic burst for normal condition
4. second 128000/512000 is maximum burst in bytes, exceed burst between normal and maximum is possible
5. transmit is traffic that falls under rate (2) will always conform
6. drop is traffic that over rate (2) will drop

After set CAR rate policies, what next?

#### Apply CAR to interface

IOS(config-if)#
interface FastEthernet1/0
 description To-Router
 ip address 192.168.100.1 255.255.255.0
 rate-limit input 1024000 128000 128000 conform-action transmit exceed-action drop
 rate-limit output 1024000 128000 128000 conform-action transmit exceed-action drop

#### Verify CAR

IOS#show interfaces FastEthernet1/0 rate-limit
FastEthernet1/0 To-Router
  Input
    matches: all traffic
      params:  1024000 bps, 128000 limit, 128000 extended limit
      conformed 3 packets, 282 bytes; action: transmit
      exceeded 0 packets, 0 bytes; action: drop
      last packet: 2352ms ago, current burst: 0 bytes
      last cleared 00:00:23 ago, conformed 0 bps, exceeded 0 bps
  Output
    matches: all traffic
      params:  1024000 bps, 128000 limit, 128000 extended limit
      conformed 3 packets, 282 bytes; action: transmit
      exceeded 0 packets, 0 bytes; action: drop
      last packet: 2156ms ago, current burst: 0 bytes
      last cleared 00:00:23 ago, conformed 0 bps, exceeded 0 bps

2 comments:

Unknown said...

Hey Hermawan Widiyanto,

I have been reading your article for quite a long time. You have a good insight about networking technology.

Keep sharing the good posts.

Best Regards,
Silvester Norman
Change MAC Address

Hermawan Widiyanto said...

Hi Silverster Norman,

Thank you for your reading :-)
I will keep sharing with the best I ever know.

BR,