Configuring Tricolor Marking
Networks police traffic by limiting the input or output transmission rate of a class of traffic on the basis of user-defined criteria. Policing traffic allows you to control the maximum rate of traffic sent or received on an interface and to partition a network into multiple priority levels or classes of service. Tricolor marking (TCM) extends the functionality of class of service (CoS) traffic policing by providing three levels of drop precedence (loss priority or PLP) instead of two. With TCM, you can provision more granular service level agreements (SLAs) across the Differentiated Services (DiffServ) domain.
There are two types of TCM: single-rate and two-rate. The JUNOS software does not support single-rate tricolor marking. For T-series platforms with Enhanced II Flexible PIC Concentrators (FPCs), you can configure two-rate TCM, as defined in RFC 2698, A Two Rate Three Color Marker.
Two-rate TCM enables a "color-aware" method of traffic policing. The high, medium, and low loss priorities are mapped to the colors red, yellow, and green. The color of a packet, which is used or set by the TCM policer, corresponds to the packet's loss priority. Packets with high PLP are marked red, packets with medium PLP are marked yellow, and packets with low PLP are marked green.
Two-rate TCM polices traffic according to the color classification (loss priority) of each packet. Traffic policing is based on two rates: the committed information rate (CIR) and the peak information rate (PIR). The CIR specifies the average rate at which packets are admitted to the network. As each packet enters the network, it is counted. Packets that do not exceed the CIR are marked green, which corresponds to
lowloss priority. Packets that exceed the CIR but are below the PIR are marked yellow, which corresponds tomediumloss priority. Packets that exceed the PIR are marked red, which corresponds tohighloss priority. For more information, see How Two-Rate Tricolor Marking Works.The two-rate TCM policer provides two functions: metering and marking. The policer meters each packet and passes the packet and the metering result to the marker, as shown in Figure 6.
![]()
The meter operates in one of two modes. In the color-blind mode, the meter treats the packet stream as uncolored. Any preset loss priorities are ignored. In the color-aware mode, the meter inspects the packet's PLP field, which has been set by an upstream device as green, yellow, or red; the PLP field has already been set by a behavior aggregate (BA) or multifield (MF) classifier to low, medium, or high. The marker changes the color (PLP) of each incoming IP packet according to the results of the meter.
For information about how to use two-rate TCM with BA and MF classifiers, see Configuring the PLP for a BA Classifier and Configuring the PLP for a Multifield Classifier.
You configure TCM by defining tricolor marking policers, and three levels of packet loss priority (PLP) for classifiers, rewrite rules, random early detection (RED) drop profiles, and firewall filters. To configure TCM, you can include the following statements at the
[edit class-of-service]hierarchy level of the configuration:[edit class-of-service]tri-color;classifiers {(dscp | dscp-ipv6 | exp | ieee-802.1 | inet-precedence)classifier-name{ import (classifier-name| default); forwarding-classclass-name{ loss-priority (low | medium | high){ code-points [aliases] [6-bit-patterns]; } }}}rewrite-rules {(dscp | dscp-ipv6 | exp | ieee-802.1 | inet-precedence)rewrite-name{import (rewrite-name| default);forwarding-classclass-name{loss-priority (low | medium | high)code-point (alias|bits);}}}schedulers {scheduler-name{drop-profile-map loss-priority (any |low | medium | high) protocol anydrop-profileprofile-name;}}[edit firewall]policername{then loss-priority (low | medium | high);}three-color-policername{two-rate {(color-aware | color-blind);committed-information-ratebps;committed-burst-sizebytes;peak-information-ratebps;peak-burst-sizebytes;}}filterfilter-name{<familyfamily>{termrule-name{then {three-color-policer {two-ratepolicer-name;}}}}}This chapter discusses the following topics:
- How Two-Rate Tricolor Marking Works
- Enabling Tricolor Marking
- Configuring a Tricolor Marking Policer
- Applying a Tricolor Marking Policer to a Firewall Filter
- Applying a Tricolor Marking Policer to an Interface
- Configuring the PLP for a BA Classifier
- Configuring the PLP for a Multifield Classifier
- Configuring the PLP for a Drop-Profile Map
- Configuring the PLP for a Rewrite Rule
- Verifying Your Configuration
- Example: Configuring Tricolor Marking