9.2.3 Policy

Class Policy and its sub-classes (see dsPolicy.{cc, h}) define the policies used by edge routers to mark incoming packets. A policy is established between a source and destination node. All flows matching that source-destination pair are treated as a single traffic aggregate. Policy for each different traffic aggregate has an associated policer type, meter type, and initial code point. The meter type specifies the method for measuring the state variables needed by the policer. For example, the TSW Tagger is a meter that measures the average traffic rate, using a specified time window.

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:

  1. Time Sliding Window with 2 Color Marking (TSW2CMPolicer): uses a CIR and two drop precedences. The lower precedence is used probabilistically when the CIR is exceeded.
  2. Time Sliding Window with 3 Color Marking (TSW3CMPolicer): uses a CIR, a PIR, and three drop precedences. The medium drop precedence is used probabilistically when the CIR is exceeded and the lowest drop precedence is used probabilistic ally when the PIR is exceeded.
  3. Token Bucket (tokenBucketPolicer): uses a CIR and a CBS and two drop precedences. An arriving packet is marked with the lower precedence if and only if it is larger than the token bucket.
  4. Single Rate Three Color Marker (srTCMPolicer): uses a CIR, CBS, and an EBS to choose from three drop precedences.
  5. Two Rate Three Color Marker (trTCMPolicer): uses a CIR, CBS, PIR, and a PBS to choose from three drop precedences.
  6. NullPolicer: does not downgrade any packets

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 2011-11-05