Interface Policer

  • All Known Implementing Classes:
    DefaultPolicer

    @Beta
    public interface Policer
    Generic abstraction for a policer which can mark and/or discard ingress traffic. Each policer is made up of an identifier and a set of attributes which defines the type of 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.

    • Method Detail

      • deviceId

        DeviceId deviceId()
        The device of this policer, where policing is applied.
        Returns:
        the device id
      • applicationId

        ApplicationId applicationId()
        The id of the application which created this policer.
        Returns:
        the identifier of the application
      • referenceCount

        long referenceCount()
        Returns how many are referencing this policer. Availability of this information depends on the technology used for the implementation of this policer.
        Returns:
        the reference count
      • processedPackets

        long processedPackets()
        Stats which reports how many packets have been processed so far. Availability of this information depends on the technology used for the implementation of this policer.
        Returns:
        the processed packets
      • processedBytes

        long processedBytes()
        Stats which reports how many bytes have been processed so far. Availability of this information depends on the technology used for the implementation of this policer.
        Returns:
        the processed bytes
      • policerId

        PolicerId policerId()
        The id of this policer.
        Returns:
        the policer id
      • isColorAware

        boolean isColorAware()
        Indicates if this policer is aware of the marking indication in the ethernet frames. TODO Understand for the future how it is implemented by the vendors
        Returns:
        true if this policer is color aware.
      • life

        long life()
        The lifetime in seconds of this policer. Availability of this information depends on the technology used for the implementation of this policer.
        Returns:
        number of seconds
      • unit

        Policer.Unit unit()
        The unit used within this policer.
        Returns:
        the unit
      • tokenBuckets

        java.util.Collection<TokenBucket> tokenBuckets()
        The token buckets used within this policer.
        Returns:
        the list of the token buckets
      • description

        java.lang.String description()
        Brief description of this policer.
        Returns:
        human readable description