Traffic Shaping and Policing Lab Examples

*Taken from my GNS3 Lab

SHAPING

R1#sh policy-map
 Policy Map SHAPE_500
 Class DATA
 Traffic Shaping
 Peak Rate Traffic Shaping
 CIR 500000 (bps) Max. Buffers Limit 1000 (Packets)
 Class VOICE
 Traffic Shaping
 Average Rate Traffic Shaping
 CIR 500000 (bps) Max. Buffers Limit 1000 (Packets)

SYNTAX

class-map match-any DATA
 match protocol http
 match protocol secure-http
 match protocol ftp
class-map match-any VOICE
 match protocol rtp
!
!
policy-map SHAPE_500
 class DATA
 shape peak 500000
 class VOICE
 shape average 500000

Adding queuing with nesting.

class-map match-any DATA
 match protocol http
 match protocol secure-http
 match protocol ftp
class-map match-any VOICE
 match protocol rtp
class-map match-all ALL_TRAFFIC
 match class-map DATA
 match class-map VOICE
 match class-map class-default
!
!
policy-map PRIORITY
 class DATA
 bandwidth 50
 class VOICE
 priority 300
 class class-default
 fair-queue
policy-map SHAPE_500
 class ALL_TRAFFIC
 shape average 500000
 service-policy PRIORITY
R1#sh policy-map
 Policy Map PRIORITY
 Class DATA
 Bandwidth 50 (kbps) Max Threshold 64 (packets)
 Class VOICE
 Strict Priority
 Bandwidth 300 (kbps) Burst 7500 (Bytes)
 Class class-default
 Flow based Fair Queueing
 Bandwidth 0 (kbps) Max Threshold 64 (packets)
Policy Map SHAPE_500
 Class ALL_TRAFFIC
 Traffic Shaping
 Average Rate Traffic Shaping
 CIR 500000 (bps) Max. Buffers Limit 1000 (Packets)
 service-policy PRIORITY

POLICING

class-map match-any GARBAGE
match protocol edonkey
match protocol kazaa2
match protocol napster
match protocol winmx
policy-map GARBAGE_SMACKDOWN
class-map GARBAGE
police 56000 conform-action transmit exceed-action drop
policy-map GARBAGE_SMACKDOWN
class-map GARBAGE
police 150000 conform-action transmit exceed-action set-pre-transmit 0 violate-action drop
show policy-map
You should see a Bc and a Be indicating a dual bucket model

CIR/32 = Bc (32 = default value – 32 intervals)

Advertisements