From: Dillon Yang (gzdillon@hotmail.com)
Date: Fri Apr 01 2005 - 08:45:21 GMT-3
Hi, Jongsoo:
For a complex police, cisco do not allow something:
<quote>
R2(config-if)#service-policy in multi-map
'set' command is not supported in a 2nd level policymap
</quote>
So, how about this type police?
<example>
if ?udp_packet?
then
if ?voice?
then { set ip precedence 5; police it}
else { set ip pre 3; set ip next }
else
if ?tcppacket?
then
if ?telnetpacket?
then { set ip prece 5; police it }
else
if ?wwwpacket?
then {set ip next}
else drop
</example>
TIA
dillon
----- Original Message -----
From: "Jongsoo kim" <bstrt2002@gmail.com>
To: <ccielab@groupstudy.com>
Sent: Friday, April 01, 2005 10:25 AM
Subject: Traffic shape and Police #1 : The difference
> Guys
>
> I always have some difficulty to explain the difference between 1)
> traffic shaping and 2) police. After reading many "complicated"
> documents, I believe I can explain perhaps easier.
>
> Here we go.
>
> I) Shaper
>
> Shaper has a queue and a token bucket while police has only token
> bucket. First, shaper put arriving packets into a queue after
> classification.
> The key is to understand how traffic shaper transmits packets out of
> the queue by using token bucket algorithm. Shaper transmits a certain
> amount of packets out of queue every time interval( Tc). This amount
> is determined by token bucket that consists of Bc and Be with
> following rules.
> 1) If the amount( bits) of packets in queue is less than Bc, then all
> the packets are transmitted and the left-over bits are stored in Be
> for burst.
> 2) If the amount of packet bits in queue is more than Bc, then shaper
> checks the availability of stored bits in Be. If available, shaper
> transmits the amount of packet bits out of queue equal to Bc +
> availble Be.
> Therefore, in case of "shape average" command under policy-map, Be is
> always zero so that shaper can't burst.
>
> Bucket Bc is filled by tokens with the shaping rate. The time
> interval( Tc) is the duration that bucket Bc is 100% full.
>
> Complexity can be added if this queue configed as custom and priority queue.
> By default, FRTS uses Fifo ( tail-drop) while GTS uses fair-queue.
> I believe shaper under class map uses fifo( tail-drop) by defaut.
>
> That's it for Traffic shaping.
>
> II) Police
>
> Now, if you understand traffic shaping, police is a lot easier.
> Many docuement says a simple way to explain policing is that there is
> no queue in police while traffic shaper has a queue. But what does it
> mean by no queue? Basically, policer transmits or drops traffic
> immediately after examing every arriving packet against available
> bytes in Bc and Be. Depeding on the availability of Bc and Be, proper
> actions such as conform, exceed, violate is chosen. "Conform action"
> is taken when token bytes is available in Bc( burst-normal), exceed
> action when token bytes are only available in Be and violate action
> when no token bytes in Bc and Be are available. Whenever conform or
> exceed action takes places for a packet, the byte amount of the packet
> is taken out from Bc or Be depending on type of actions. Bc is
> constanty filled by token bytes at police rate, if Bc is 100% full,
> then Be is filled and if Be is 100% full, then token byte is
> discarded.
> As you may see, time interval Tc that is very important for traffic
> shaping is meaningless in police because transmit or drop decision in
> police is made per packet arrival while traffic shaper usually has
> only transmit decision, which occurs per time interval (Tc)
>
>
> Here is my reference.
>
> http://www.cisco.com/univercd/cc/td/doc/product/software/ios122/122cgcr/fqos_c/fqcprt4/qcfpolsh.htm
> http://www.cisco.com/warp/public/125/token_fchart.html
>
> < quote>
> Note that the token bucket mechanism used for traffic shaping has both
> a token bucket and a data buffer, or queue; if it did not have a data
> buffer, it would be a policer. For traffic shaping, packets that
> arrive that cannot be sent immediately are delayed in the data buffer.
> < quote>
>
> Regards
>
> Jongsoo
>
> _______________________________________________________________________
> Subscription information may be found at:
> http://www.groupstudy.com/list/CCIELab.html
This archive was generated by hypermail 2.1.4 : Tue May 03 2005 - 07:54:51 GMT-3