From: SIMON HART (simon.hart@btinternet.com)
Date: Fri Jul 01 2005 - 10:13:33 GMT-3
Hi Gladston,
CB Policing without violate action is valid. Your
configs below, however, do not make a great deal of
sense. I shall try and explain.
Police cir 64000 bc 8000 be 1000
Now this statement dictates that we can transmit
conforming bits at a rate of 64000 bits (8000bytes)
every second. So our Tc is 1 second. The statement
also suggests that during any Tc interval of 1 second
we can send an additional 8000 bits (1000bytes), if
the be bucket has not been used up.
Now in order to explore this further we need to make
some assumptions. Firstly lets assume that the
packets offered are 1000bytes (8000 bits).
Therefore for each Tc we can transmit 64000/8000 = 8
packets that conform.
We need to determine the actions for conforming and
non-conforming traffic
so in your config:
conform-action transmit
exceed-action drop
violate-action drop
Example 1
Now look at what happens as packets are offered
At Tc0
Bc = 8 packets
Be = 1 packet
At Tc1 (end of first period)
Offered packets 9
In contract first 8 packets - transmit
Remaining 1 packet - try and use Be
Decrement Be by 1 token
Take action on Be - in this case drop, therefore
packet is dropped.
At Tc2
Offered packets 10
In contract first 8 packets - transmit
Remaining 2 packets - try and use Be
Be = 0
therefore take Violate action - which is drop
remaining packets
At Tc3
Offered packets 5
In contract first 5 packets - transmit
Because Bc has not been fully used (3 tokens spare)
We can now add 1 token to Be
At Tc4
Offered packets 10
In contract first 8 packets - transmit
Remaining 2 packets - try and use Be
Decrement Be by 1 token
Take exceed action on Be - in this case drop,
therefore packet is dropped.
1 packet now violates - take violate action -
therefore drop this packet.
Hopefully from the above example you can see that Be
is not really being used for any purpose. This is
because the Be action is the same as the violate
action, and hence any non-conforming packets will be
dropped.
Example 2
Now see what happens when we remove the violate action
on the previous example.
At Tc0
Bc = 8 packets
Be = 1 packet
At Tc1 (end of first period)
Offered packets 9
In contract first 8 packets - transmit
Remaining 1 packet - try and use Be
Decrement Be by 1 token
Take action on Be - in this case drop, therefore
packet is dropped.
At Tc2
Offered packets 10
In contract first 8 packets - transmit
Remaining 2 packets - try and use Be
Be = 0
No violate action - however therefore take Be action -
drop packets
At Tc3
Offered packets 5
In contract first 5 packets - transmit
Because Bc has not been fully used (3 tokens spare)
We can now add 1 token to Be
At Tc4
Offered packets 10
In contract first 8 packets - transmit
Remaining 2 packets - try and use Be
Decrement Be by 1 token
Take exceed action on Be - in this case drop,
therefore packet is dropped.
No violate action, therefore take exceed action -
which is drop the remaining packet.
Example 3
This time we have no violate action and the exceed
action is set-dscp to af13
exceed-action set-dscp-transmit af13
At Tc0
Bc = 8 packets
Be = 1 packet
At Tc1 (end of first period)
Offered packets 9
In contract first 8 packets - transmit
Remaining 1 packet - try and use Be
Decrement Be by 1 token
Take action on Be - transmit with dscp of af13
At Tc2
Offered packets 10
In contract first 8 packets - transmit
Remaining 2 packets - try and use Be
Be = 0
No violate action - however therefore take Be action -
transmit with dscp of af13
At Tc3
Offered packets 5
In contract first 5 packets - transmit
Because Bc has not been fully used (3 tokens spare)
We can now add 1 token to Be
At Tc4
Offered packets 10
In contract first 8 packets - transmit
Remaining 2 packets - try and use Be
Decrement Be by 1 token
Take exceed action on Be - set dscp of af13
No violate action, therefore take exceed action -
which is transmit with dscp of af13
In this example it should be clear that the class is
no longer policed as all traffic is transmitted,
however the out of contract traffic (everything above
cir) will be marked as af13.
Example 4
One final example to round this off.
We shall use an exceed action that sets dscp and a
violate action that drops packets
exceed-action set-dscp-transmit af13
violate-action drop
At Tc0
Bc = 8 packets
Be = 1 packet
At Tc1 (end of first period)
Offered packets 9
In contract first 8 packets - transmit
Remaining 1 packet - try and use Be
Decrement Be by 1 token
Take action on Be - transmit with dscp of af13
At Tc2
Offered packets 10
In contract first 8 packets - transmit
Remaining 2 packets - try and use Be
Be = 0
Violate action - Drop the remaining 2 packets
At Tc3
Offered packets 5
In contract first 5 packets - transmit
Because Bc has not been fully used (3 tokens spare)
We can now add 1 token to Be
At Tc4
Offered packets 10
In contract first 8 packets - transmit
Remaining 2 packets - try and use Be
Decrement Be by 1 token
Take exceed action on Be - set the dscp of af13
No violate action, therefore take exceed action -
which is to drop the remaining packet
This last example shows that the Be is being used
effectively. That is we can transmit a small burst of
traffic if the Be token bucket is full (but perhaps
mark it down). And any packets above Be are going to
be dropped.
Sorry for the rather longwinded mail, but I am not
sure how to describe the various options any more
succinctly. I think once you have read this through a
couple of times it will become a little more
intuitive.
Thanks
simon
--- gladston@br.ibm.com wrote:
> Hi,
>
> When configuring violate action on CB Police, I
> understand Wendell explanation that "CB policing
> uses a simpler algorithm than CAR when a Be value
> has been configured". (pag. 348, DQoS)
>
> Now, when violate action is not configured, does the
> algorithm is changed?
> Or CB just checks Be and if there is not enough
> tokens the packet are transmitted or if there isn't
> the packet is discarded?
> (no Dc and Da as in CAR)
> Or, are once posted here, CB with Be withouth the
> keyword violate is not valid, although IOS takes the
> command?
>
> Rack2R5(config)# policy-map Police
> Rack2R5(config-pmap)# class Police
> Rack2R5(config-pmap-c)# police cir 64000 bc 8000
> be 1000
> Rack2R5(config-pmap-c-police)# conform-action
> transmit
> Rack2R5(config-pmap-c-police)# exceed-action
> drop
> Rack2R5(config-pmap-c-police)# violate-action
> drop
>
> Rack2R5#sh policy-map interface ser 0/0
>
> Serial0/0
>
> Service-policy input: Police
>
> Class-map: Police (match-all)
> 71423 packets, 22027792 bytes
> 5 minute offered rate 53000 bps, drop rate
> 7000 bps
> Match: access-group 104
> police:
> cir 64000 bps, bc 8000 bytes, be 1000
> bytes
> conformed 68579 packets, 20396020 bytes;
> actions:
> transmit
> exceeded 2672 packets, 1532012 bytes;
> actions:
> drop
> violated 172 packets, 99760 bytes; actions:
> drop
> conformed 46000 bps, exceed 1000 bps,
> violate 5000 bps
>
>
> Rack2R5(config)# policy-map Police
> Rack2R5(config-pmap)# class Police
> Rack2R5(config-pmap-c)# police cir 64000 bc 8000
> be 1000
> Rack2R5(config-pmap-c-police)# conform-action
> transmit
> Rack2R5(config-pmap-c-police)# exceed-action
> drop
> Rack2R5(config-pmap-c-police)#no violate-action
> drop
>
> policy-map Polic
> class Police
> police cir 64000 bc 8000 be 1000
> conform-action transmit
> exceed-action drop
>
>
> Rack2R5#sh policy-map interface ser 0/0
>
> Serial0/0
>
> Service-policy input: Police
>
> Class-map: Police (match-all)
> 73504 packets, 22676038 bytes
> 5 minute offered rate 48000 bps, drop rate
> 8264000 bps
> Match: access-group 104
> police:
> cir 64000 bps, bc 8000 bytes
> conformed 70517 packets, 20963166 bytes;
> actions:
> transmit
> exceeded 2747 packets, 1573672 bytes;
> actions:
> drop
> conformed 42000 bps, exceed 6000 bps
>
>
This archive was generated by hypermail 2.1.4 : Sun Sep 04 2005 - 17:00:29 GMT-3