Policing
VPP implements several policer types, that don’t always conform to the related RFCs 3 4 5. Only policers implemented in VPP will be presented, along with the differences they have compared to RFCs.
1 rate 2 color (1r2c)
This is the most straightforward policer. There is no RFC describing it, however we can found its description in many documentation 1 2 .
A 1r2c policer is great to classify incoming packets into two categories: conforming packets (said green), and violating ones (said red).
Parameters
To set-up such a policer, only two parameters are needed:
- Committed Information Rate (CIR)
Given in bytes per second, this parameter is the average throughput allowed by the policer.
It sets the limit between conforming arriving packets (those making the traffic fall below the CIR), and violating arriving packets (those making the traffic exceed the CIR).
- Committed Burst Size (CBS)
It represents the size (in bytes) of a token bucket used to allow some burstiness from the incoming traffic.
The committed token bucket (C) is filling up at CIR tokens (bytes) per second, up to CBS tokens. All overflowing tokens are lost.
Color-Blind algorithm
Color-Aware algorithm
In online documentation, there is no trace of a color-aware 1r2c policer. However, VPP implementation allows such a thing.
1 rate 3 color (1r3c) RFC 2697 3
As for the 1 rate 2 color (1r2c) policer, only one rate parameters is required to setup a 1r3c policer. However, such a policer adds another kind of packet category: exceeding ones (said yellow).
Parameters
To set-up such a policer, three parameters are needed:
- Committed Information Rate (CIR)
As in the 1 rate 2 color (1r2c) policer.
- Committed Burst Size (CBS)
As in the 1 rate 2 color (1r2c) policer.
- Excess Burst Size (EBS)
It represents the size (in bytes) of a second token bucket used to allow an additional burstiness from the incoming traffic, when traffic as been below the CIR for some time.
The committed token bucket (C) is filling up at CIR tokens (bytes) per second, up to CBS tokens. When C is full, tokens are overflowing into the excess token bucket (E), up to EBS tokens. Only overflowing tokens from E are lost.
Color-Blind algorithm
Color-Aware algorithm
Notes
In the RFC 2697 3 describing the 1r3c policer, conforming (green) packets only consume tokens from the token bucket C. Whereas, in VPP, they also consume tokens from E.
One way to stick to the RFC is then to set the EBS parameter to be superior to CBS, so that EBS - CBS corresponds to the EBS from the RFC.
However, VPP does not enforce setting EBS > CBS, which could result in undesired behavior.
2 rate 3 color (2r3c) RFC 2698 4
Instead of setting the limit between yellow and red packets in terms of bursts, as it is done by 1 rate 3 color (1r3c) RFC 2697 policers, two rate policers introduce another rate parameter to discriminate between those two kinds of packets.
Parameters
To set-up such a policer, four parameters are needed:
- Committed Information Rate (CIR)
As in the 1 rate 2 color (1r2c) policer.
- Committed Burst Size (CBS)
As in the 1 rate 2 color (1r2c) policer.
- Peak Information Rate (PIR)
Given in bytes per second, this parameter is the average throughput allowed by the policer when there is a peak in traffic.
It sets a second limit between exceeding arriving packets (those making the traffic fall below the PIR, but above CIR), and violating arriving packets (those making the traffic exceed the PIR).
- Peak Burst Size (PBS)
It represents the size (in bytes) of a second token bucket used to allow an additional peak traffic.
The committed token bucket (C) is filling up at CIR tokens (bytes) per second, up to CBS tokens. In the meantime, the peak token bucket (P) is filling up at PIR tokens per second, up to PBS. All overflowing tokens from C and P are lost.
Color-Blind algorithm
Color-Aware algorithm
Notes
To have a working policer, the condition PIR >= CIR needs to hold. Indeed, since we assume that peak traffic should have a greater rate than committed ones.
2 rate 3 color (2r3c) RFC 4115 5
The 2r3c-RFC4115 is an allowed choice by VPP. However, there is currently no implementation of such a policer. Hence, the only two rate policer VPP implements is the 2 rate 3 color (2r3c) RFC 2698 policer.
References: