When a packet arrives at an edge router, it is examined to determine to which aggregate it belongs. The meter specified by the corresponding policy is invoked to update all state variables. The policer is invoked to determine how to mark the packet depending on the aggregate's state variables: the specified initial code point or a downgraded code point. Then the packet is enqueued accordingly.
Currently, six different policy models are defined:
The policies above are defined as a sub-classes of dsPolicy. The specific meter and policer are implemented in functions applyMeter and applyPolicer, which are defined as virtual functions in class dsPolicy. User specified policy can be added in the similar way. Please refer to NullPolicy as the simplest example.
All policies are stored in the policy table in class PolicyClassifier. This table is an array that includes fields for the source and destination nodes, a policer type, a meter type, an initial code point, and various state information as shown below:
The rates CIR and PIR are specified in bits per second:
CIR: committed information rate
PIR: peak information rate
The buckets CBS, EBS, and PBS are specified in bytes:
CBS: committed burst size
EBS: excess burst size
PBS: peak burst size
C bucket: current size of the committed bucket
E bucket: current size of the excess bucket
P bucket: current size of the peak bucket
Arrival time of last packet
Average sending rate
TSW window length
Class PolicyClassifier also contains a Policer Table to store the mappings from a policy type and initial code point pair to its associated downgraded code point(s).
Tom Henderson 2014-12-17