Policing, or rate limiting, is an important component of firewall filters that lets you control the amount of traffic that enters an interface on Juniper Networks EX Series Ethernet Switches.
This topic describes:
A single firewall filter configured with a policer permits only traffic within a specified set of rate limits to provide protection from denial-of-service (DoS) attacks. Traffic that exceeds the rate limits specified by the policer is either discarded immediately or is marked as lower priority than traffic that is within the rate limits. The switch discards the lower-priority traffic if traffic becomes congested.
A policer applies two types of rate limits on traffic:
Policing uses an algorithm to enforce a limit on average bandwidth while allowing bursts up to a specified maximum value. You can define specific classes of traffic on an interface and apply a set of rate limits to each class. After you name and configure a policer, it is stored as a template. You can then use a policer in a firewall filter configuration.
Each policer that you configure includes an implicit counter that counts the number of packets that exceed the rate limits that are specified for the policer. To get filter-specific or term-specific packets counts, you must configure a different policer for each filter or term that performs policing.
Switches support three types of policers:
Policer actions are implicit or explicit and vary by policer type. The term implicit means that Junos OS assigns a loss-priority value automatically; explicit means that you configure the action. Table 1 lists policer actions.
Table 1: Policer Actions
Policer | Marking | Implicit Action | Configurable Action |
|---|---|---|---|
Single-rate two-color | Green (Conforming) | Assign low loss priority | None |
Red (Nonconforming) | None | Assign low or high loss priority, assign a forwarding class, or discard | |
Single-rate three-color | Green (Conforming) | Assign low loss None priority | None |
Red (Above the EBS) | Assign high loss priority | Discard | |
Two-rate three-color | Green (Conforming) | Assign low loss priority | None |
Red (Above the PIR and PBS) | Assign high loss priority | Discard |
You can configure policers at the queue level, logical interface level, or Layer 2 (MAC) level. Only a single policer is applied to a packet at the egress queue, and the search for policers occurs in this order:
Tricolor marking (TCM) policers are not bound by a green-yellow-red coloring convention. Packets are marked with low or high PLP bit configurations based on color, so both three-color policer types extend the functionality of class-of-service (CoS) traffic policing by providing three levels of drop precedence (loss priority) instead of the two normally available in policers. Both single-rate and two-rate three-color policer types can operate in two modes:
We recommend you use the naming convention policernumber-TCMnumber-colortype when configuring three-color policers and policernumber when configuring two-color policers. TCM stands for tricolor marking. Because policers can be numerous and must be applied correctly to work, a simple naming convention makes it easier to apply the policers properly.
For example, if the first policer you configure is a single-rate, color-aware, three-color policer, name it srTCM1-ca. If the second policer you configure is a two-rate, color-blind, three-color policer, name it trTCM2-cb.