Class BandwidthProfile


  • @Beta
    public final class BandwidthProfile
    extends Object
    Implementation of a generic bandwidth profile (marker/policer).
    • Method Detail

      • name

        public String name()
        Obtains the name of this bandwidth profile.
        Returns:
        the bandwidth profile name
      • cir

        public Bandwidth cir()
        Obtains the committed information rate (CIR) of this bandwidth profile.
        Returns:
        the CIR of the bandwidth profile
      • pir

        public Bandwidth pir()
        Obtains the peak information rate (PIR) of this bandwidth profile. If this profile does not have a PIR, null is returned.
        Returns:
        the PIR of the profile; null if the profile does not have a PIR
      • cbs

        public Integer cbs()
        Obtains the committed burst size (CBS) of this bandwidth profile. The CBS is measured in bytes. If this profile does not have a CBS, null is returned.
        Returns:
        the CBS of the profile (bytes); null if the profile does not have a CBS
      • pbs

        public Integer pbs()
        Obtains the peak burst size (PBS) of this bandwidth profile. The PBS is measured in bytes. If this profile does not have a PBS, null is returned.
        Returns:
        the PBS of the bandwidth profile (bytes); null if the profile does not have a PBS
      • ebs

        public Integer ebs()
        Obtains the excess burst size (EBS) of this bandwidth profile. The EBS is measured in bytes. If this profile does not have an EBS, null is returned.
        Returns:
        the EBS of the bandwidth profile (bytes); null if the profile does not have an EBS
      • greenAction

        public BandwidthProfileAction greenAction()
        Obtains the action to be taken for traffic marked as green. Green color marking is applied to traffic that conforms to the CIR/CBS.
        Returns:
        the action to be taken for traffic marked as green
      • yellowAction

        public BandwidthProfileAction yellowAction()
        Obtains the action to be taken for traffic marked as yellow. Yellow color marking is applied to traffic that does not conform to the CIR/CBS but conforms to one of:
        • EBS (srTCM type)
        • PIR/PBS (trTCM type)
        If this profile does has neither EBS or PIR/PBS, null is returned.
        Returns:
        the action to be taken for traffic marked as yellow; null if neither EBS nor PIR/PBS are defined
      • redAction

        public BandwidthProfileAction redAction()
        Obtains the action to be taken for traffic marked as red. Red color marking is applied to traffic that does not conform to one of the following:
        • CIR/CBS (sr2CM type)
        • EBS (srTCM type)
        • PIR/PBS (trTCM type)
        Returns:
        the action to be taken for traffic marked as red
      • colorAware

        public boolean colorAware()
        Obtains the color-aware mode of the bandwidth profile.
        Returns:
        true if the bandwidth profile is color-aware; false otherwise
      • type

        public org.onosproject.net.behaviour.BandwidthProfile.Type type()
        Obtains the bandwidth profile type depending on the profile parameters.
        • When PIR is defined, the profile corresponds to a Two Rate Three Color Marker (trTCM)
        • When EBS is defined, the profile corresponds to a Single Rate Three Color Marker (srTCM)
        • When neither PIR nor EBS are defined, the profile corresponds to a Single Rate Two Color Marker/Policer (sr2CM)
        Returns:
        the bandwidth profile type
      • fromMeter

        public static BandwidthProfile fromMeter​(Meter meter)
        Creates a bandwidth profile based on the parameters of a Meter. NOTE: The dropPrecedence in the Meter is interpreted as the DSCP class to set on the packet
        Parameters:
        meter - the Meter to be used for creating the bandwidth profile
        Returns:
        the bandwidth profile created
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object