Priority Scheduling Overview
The Junos OS supports multiple levels of transmission
priority, which in order of increasing priority are low
, medium-low
, medium-high
, and high
, and strict-high
. This allows the software to service
higher-priority queues before lower-priority queues.
Priority scheduling determines the order in which an output
interface transmits traffic from its queues, thus ensuring that queues
containing important traffic are provided better access to the outgoing
interface. Junos OS accomplishes priority scheduling by examining
the assigned priority of each individual queue and whether each individual
queue is within its defined bandwidth profile. Junos OS determines
whether an individual queue is within its bandwidth profile by comparing,
at regular intervals, the amount of data transmitted by the queue
against the amount of bandwidth allocated to it by the configured
scheduler transmission rate (transmit-rate
) defined at the [edit class-of-service schedulers scheduler-name]
hierarchy level. When the transmitted amount is less than
the allocated amount, the queue is considered to be in profile. A queue is out of profile when its transmitted
amount is larger than its allocated amount.
The queues for a given output physical interface (or output logical interface if per-unit scheduling is enabled on that interface) are divided into sets based on their priority. Any such set contains queues of the same priority.
Junos OS traverses the sets in descending order of priority. If at least one of the queues in the set has a packet to transmit, the software selects that set. A queue from the set is selected based on the weighted round robin (WRR) algorithm, which operates within the set.
The Junos OS performs priority queuing using the following steps:
The software locates all high-priority queues that are currently in profile. These queues are serviced first in a weighted round-robin fashion.
The software locates all medium-high priority queues that are currently in profile. These queues are serviced second in a weighted round-robin fashion.
The software locates all medium-low priority queues that are currently in profile. These queues are serviced third in a weighted round-robin fashion.
The software locates all low-priority queues that are currently in profile. These queues are serviced fourth in a weighted round-robin fashion.
The software locates all high-priority queues that are currently out of profile and are not rate limited. The weighted round-robin algorithm is applied to these queues for servicing.
The software locates all medium-high priority queues that are currently out of profile and are not rate limited. The weighted round-robin algorithm is applied to these queues for servicing.
The software locates all medium-low priority queues that are currently out of profile and are not rate limited. The weighted round-robin algorithm is applied to these queues for servicing.
The software locates all low-priority queues that are currently out of profile and are also not rate limited. These queues are serviced last in a weighted round-robin manner.
Strict-High Priority Configuration Overview
You can configure one queue per interface to have strict-high
priority, which works the same as high
priority, but
provides unlimited transmission bandwidth. As long as the queue with strict-high
priority has traffic to send, it receives precedence
over all other queues, except queues with high
priority.
Queues with strict-high
and high
priority take
turns transmitting packets until the strict-high
queue
is empty, the high
priority queues are empty, or the high
priority queues run out of bandwidth credit. Only when
these conditions are met can lower priority queues send traffic.
When you configure a queue to have strict-high
priority,
you do not need to include the transmit-rate
statement
in the queue configuration at the [edit class-of-service schedulers scheduler-name]
hierarchy level because the transmission
rate of a strict-high
priority queue is not limited by
the WRR configuration. If you do configure a transmission rate on
a strict-high
priority queue, it does not affect the WRR
operation. The transmission rate does, however, affect the calculation
of the delay buffer and also serves as a placeholder in the output
of commands such as the show interface queue
command.
strict-high
priority queues might starve low
priority queues, and under certain circumstances might limit high
priority queues. The high
priority allows you
to protect traffic classes from being starved by traffic in a strict-high
queue. For example, a network-control queue might
require a small bandwidth allocation (say, 5 percent). You can
assign high
priority to this queue to prevent it from being
underserved.
A queue with strict-high
priority supersedes bandwidth
guarantees for queues with lower priority; therefore, we recommend
that you use the strict-high
priority to ensure proper
ordering of special traffic, such as voice traffic. You can preserve
bandwidth guarantees for queues with lower priority by allocating
to the queue with strict-high
priority only the amount
of bandwidth that it generally requires by applying the rate-limit
option to the strict-high
queue’s transmission rate.
For example, consider the following allocation of transmission bandwidth:
Q0 BE—20 percent, low priority
Q1 EF—30 percent, strict-high priority
Q2 AF—40 percent, low priority
Q3 NC—10 percent, low priority
This bandwidth allocation assumes that, in general, the EF forwarding
class requires only 30 percent of an interface’s transmission
bandwidth. However, if short bursts of traffic are received on the
EF forwarding class, and the rate-limit
option is not applied,
100 percent of the bandwidth is given to the EF forwarding class
because of the strict-high
setting.