@Beta
public interface Policer
For example a policer specifying only a single token bucket, it will model a simple drop policer or a marker policer. For the former, the traffic in profile is green or red if it is out-of-profile. The latter envisages green or yellow traffic. Currently there is no RFC for this kind of policer but some vendors implement this model.
RFC 2697 can be modelled creating a policer with a collection of two token buckets: [0] CIR + CBS; [1] CIR + EBS. In this way, it is possible to create a policer single rate three color marker.
RFC 2698 and P4 meter are modelled in the same way but different attributes for the token buckets: [0] PIR + PBS; [2] CIR + CBS. In this way, we can create a policer two rate three color marker.
How these policers will be implemented depends on the specific technology used in the device. For an OF device, the single rate two color marker it could be implemented with a simple meter with a drop band.
Following abstraction has been designed to cover several types of policing that have been specified during the years. However, this does not assure that used technology will support all possible scenarios. For example, OF limitations are well known in this field and implementations are even worse.
Modifier and Type | Interface and Description |
---|---|
static interface |
Policer.Builder
A policer builder.
|
static class |
Policer.Unit
Unit of traffic used by this policer.
|
Modifier and Type | Method and Description |
---|---|
ApplicationId |
applicationId()
The id of the application which created this policer.
|
String |
description()
Brief description of this policer.
|
DeviceId |
deviceId()
The device of this policer, where policing
is applied.
|
boolean |
isColorAware()
Indicates if this policer is aware of the marking indication
in the ethernet frames.
|
long |
life()
The lifetime in seconds of this policer.
|
PolicerId |
policerId()
The id of this policer.
|
long |
processedBytes()
Stats which reports how many bytes have been
processed so far.
|
long |
processedPackets()
Stats which reports how many packets have been
processed so far.
|
long |
referenceCount()
Returns how many are referencing this policer.
|
Collection<TokenBucket> |
tokenBuckets()
The token buckets used within this policer.
|
Policer.Unit |
unit()
The unit used within this policer.
|
DeviceId deviceId()
ApplicationId applicationId()
long referenceCount()
long processedPackets()
long processedBytes()
PolicerId policerId()
boolean isColorAware()
long life()
Policer.Unit unit()
Collection<TokenBucket> tokenBuckets()
String description()