# Odom Qos: single rate, three color policing - condition for exceeding

Member Posts: 37 ■■□□□□□□□□
Hi everyone,

I'm reading "The QoS Book" by Odom and I don't really feel comfortable with how he describes the condition for a packet to exceed in single rate, three color policer.

a short quote from the book (p. 363, top of the page, list item 2):
If the packet does not conform, and the nuber of bytes in the packet is less or equal to (<=) the number of tokens in the Be Bucket, the packet exceeds. CB policing removes tokens from the Be Bucket equal to the number of bytes in the packet, and performs the action for packets that exceed the contract.

My common sense says that if a packet does not conform (not enough tokens in Bc Bucket), I take tokens from both the Bc and Be buckets together and if there is more tokens than the number of bytes in the packet, then the packet exceeds. In such case tokens would be first removed from the Bc Bucket and the excess tokens from the Be Bucket.

To contrast the two methods:

say Bc = 150 and Be = 100, two packets of 110 B each arrive at the same time (the time gap between the packets is neglectable)
according to the book:
1st packet conforms, leaving 40 tokens in the Bc Bucket, 100 in Be Bucket
2nd packet violates, since there is not enough tokens in either bucket
my understanding:
1st packet conforms, leaving 40 tokens in the Bc Bucket, 100 in Be Bucket
2nd packet exceeds, leaving 0 tokens in the Bc Bucket, 30 in Be Bucket

The book is consistent about this explanation, it is used several times in different points through the chapter. On the other hand I have found resources online that support my understanding.

Can you please shed some light into this matter? Thanks!

• Member Posts: 567
See this: http://www.ietf.org/rfc/rfc2697.txt
Item number 3 is what you are looking at in regards to your question. I learned early on not to try and make sense of QoS...just go with it...j/k.
• Member Posts: 37 ■■□□□□□□□□
Lol, is there really an RFC on just the three color policer? Thanks for posting the link!

After some more research I figured that my way of understanding would behave like a shaper with excess burst rate (in the way of spending tokens), where the bucket size is Bc+Be tokens. I just have to take it as it is and try not to think too much about it I guess.

Anyways, I'm taking the Qos exam next week, possibly on Friday this week. Hope to knock it out.
• Member Posts: 4,024
mkomon wrote: »
Hi everyone,

My common sense says that if a packet does not conform (not enough tokens in Bc Bucket), I take tokens from both the Bc and Be buckets together and if there is more tokens than the number of bytes in the packet, then the packet exceeds. In such case tokens would be first removed from the Bc Bucket and the excess tokens from the Be Bucket.

It's actually not that difficult.

Can the traffic be classified as conforming? Then it comes out of the conform bucket

Can the traffic be classified as exceeding? Then it comes out of the exceed bucket.

Given how arcane the rest of QoS is, boiling it down to something this simple can make you do a double take and think 'that's not right...'