Understanding Scheduling on PTX Series Routers
This topic covers class of service packet scheduling for interfaces on PTX Series routers:
Output Queue Priorities Supported by the Junos OS CLI on PTX Series Routers
Output queues on the PTX Series interface hardware support these values for the queue priority—high, medium, low, and excess. The Junos OS supports five queue priority levels: strict-high, high, medium-high, medium-low, and low.
If a strict-high-priority queue is constantly loaded to 100 percent of traffic capacity, other queues are starved. Queue starvation can cause the interface hardware to generate interrupts.
This starvation can be alleviated by using a rate-limiter on the strict-high queues.
Scheduling Processes on PTX Series Routers
Physical interfaces on PTX Series routers support two mutually exclusive scheduling processes:
normal scheduling (default mode) — A queue’s transmit-rate is used to determine whether it is operating within the guaranteed region or in the excess region.
Within the guaranteed region (transmit-rates credits are positive), the scheduler uses the transmit rates to decide the bandwidth allocation. Queues that are at priority-level low or higher and have transmit-rate credits are serviced first by priority order and then within a priority level using packet round robin algorithm.
Within the excess region (for all queues in which transmit-rate credits are negative), CoS queues are selected based on the weighted round-robin (WRR) algorithm. If a queue does not have excess-rate configured, then its weight is set to 1.
If a queue is not configured with a transmit-rate statement (to specify the transmit rate or percentage of transmission capacity), then it will not be scheduled at priority level and only at excess level (unless priority is strict-high).
If multiple queues are in the excess region (queue priority low) and the excess-rate statement is used, then those queues are selected using the WRR algorithm.
The remainder keyword can be applied to transmit-rate as well as buffer size statements. This will cause the remaining portion of the specified resource to be assigned to the queue. The remaining resources for transmit-rate are the sum of all queues that specified a transmit-rate subtracted from the total transmit-rate available. If there are multiple queues assigned with the remainder keyword, the remainder of the resource is evenly divided amongst those queues.
There are two keywords that can be applied to the transmit-rate statement in order to limit the rate of a queue: rate-limit and exact, where rate-limit can be applied only to the strict-high queue and exact can be used for all other queues. The two keywords behave identically in that queues can transmit only up to the specified rate. All of their transmission will be scheduled at their configured priority level and they will never be scheduled at excess-priority level.
The rate-limit option of the transmit-rate configuration statement is allowed only on the strict-high queue. We recommend that you configure rate limit on strict-high queues because the other queues might not meet their guaranteed bandwidths.
Non strict-high queues can use the option exact to place a maximum transmit-rate limit on them, which is equivalent to rate-limit.
strict-priority scheduling — Queues are processed in strict-priority order. There is no concept of guaranteed region and excess region. The packet scheduler is always operating in the guaranteed region, with the exception of priority low, which is always assigned to the excess priority level. The configured transmit-rate does not affect how the queue is serviced because packets are processed in order of queue priority. Among queues that are configured low priority, if excess-rate weights are configured, they are used by the hardware to perform WRR. Queues that are mapped to the same hardware priority or that have the same configured priority other than low are serviced in a packet round-robin fashion.
The queues are serviced in strict-priority order until they have reached their transmit-rate (that is, their guaranteed rate) and then are demoted to the excess level.
The rate-limit and exact options of the transmit-rate configuration statement have no effect when strict-priority scheduling is configured.
To configure strict-priority scheduling for a physical interface on a PTX Series router, include the strict-priority-scheduler and scheduler-map map-name configuration statements in the traffic control profile you associate with an output interface.
Strict-Priority and Scheduling Processes on PTX Series Routers
Table 1 shows the different configurations available for Junos Priority Scheduler Modes, including those for Strict-Priority and Enhanced-Priority Modes. Table 1 also shows how the output queue priority values in the Junos OS map to the output queue priorities supported by physical interfaces on PTX Series routers, and the scheduling action taken. Starting in Junos OS Release 17.4, the table shows differences for normal scheduling when strict-high is not configured, and for strict-priority scheduling.
Table 1: Strict-Priority and Scheduling Processes on PTX Series Routers
Strict Priority Scheduler
Packet scheduling is strict priority round-robin while the virtual output queues are in the guaranteed region.
After the virtual output queues consume their guaranteed credits, they are demoted to excess-priority scheduling, which is weighted round-robin.
The only exception is the strict-high priority, which is always scheduled as strict-high-priority.