ON THIS PAGE
Example: Configuring Queue Schedulers
Schedulers define the CoS properties of output queues (output queues are mapped to forwarding classes, and classifiers map traffic into forwarding classes based on IEEE 802.1p or DSCP code points). Queue scheduling works with priority group scheduling to create a two-tier hierarchical scheduler. CoS scheduling properties include the amount of interface bandwidth assigned to the queue, the priority of the queue, whether explicit congestion notification (ECN) is enabled on the queue, and the WRED packet drop profiles associated with the queue.
Configuring a CoS Scheduler
CLI Quick Configuration
To quickly configure a queue scheduler, copy the following commands, paste them in a text file, remove line breaks, change variables and details to match your network configuration, and then copy and paste the commands into the CLI at the [edit] hierarchy level:
[edit class-of-service] set schedulers be-sched transmit-rate percent 20 set schedulers be-sched shaping-rate percent 40 set schedulers be-sched buffer-size percent 20 set schedulers be-sched priority low set schedulers be-sched drop-profile-map loss-priority low protocol any drop-profile be-dp set scheduler-maps be-map forwarding-class best-effort scheduler be-sched set traffic-control-profiles be-tcp scheduler-map be-map set interfaces xe-0/0/7 forwarding-class-set lan-pg output-traffic-control-profile be-tcp
Step-by-Step Procedure
To configure a CoS scheduler:
Create scheduler (
be-sched
) with a minimum guaranteed bandwidth of 2 Gbps, a maximum bandwidth of 4 Gbps, and low priority, and map it to the drop profilebe-dp
:[edit class-of-service schedulers] user@switch# set be-sched transmit-rate percent 20 user@switch# set be-sched shaping-rate percent 40 user@switch# set be-sched buffer-size percent 20 user@switch# set be-sched priority low user@switch# set be-sched drop-profile-map loss-priority low protocol any drop-profile be-dp
Note:Because ECN is disabled by default, no ECN configuration is shown.
Configure scheduler map (
be-map
) to associate the scheduler (be-sched
) with the forwarding class (best-effort
):[edit class-of-service scheduler-maps] user@switch# set be-map forwarding-class best-effort scheduler be-sched
Associate the scheduler map
be-map
with a traffic control profile (be-tcp
):[edit class-of-service traffic-control-profiles] user@switch# set be-tcp scheduler-map be-map
Associate the traffic control profile
be-tcp
with a forwarding class set (lan-pg
) and a 10-Gigabit Ethernet interface (xe-0/0/7
):[edit class-of-service] user@switch# set interfaces xe-0/0/7 forwarding-class-set lan-pg output-traffic-control-profile be-tcp
Requirements
This example uses the following hardware and software components:
One switch (this example was tested on a Juniper Networks QFX3500 Switch)
Junos OS Release 11.1 or later for the QFX Series or Junos OS Release 14.1X53-D20 or later for the OCX Series
Overview
Scheduler parameters define the following characteristics for the queues mapped to the scheduler:
transmit-rate
—Minimum bandwidth, also known as the committed information rate (CIR). Each queue mapped to the scheduler receives a minimum of either the configured amount of absolute bandwidth or the configured percentage of bandwidth. The transmit rate also determines the amount of excess (extra) priority group bandwidth that the queue can share. Extra priority group bandwidth is allocated among the queues in the priority group in proportion to the transmit rate of each queue. You cannot configure a transmit rate for strict-high priority queues. Queues (forwarding classes) with a configured transmit rate cannot be included in a forwarding class set that has strict-high priority queues.Note:The
transmit-rate
setting works only if you also configure theguaranteed-rate
in the traffic control profile that is attached to the forwarding class set to which the queue belongs. If you do not configure theguaranteed-rate
, thetransmit-rate
does not work. The sum of all queue transmit rates in a forwarding class set should not exceed the traffic control profile guaranteed rate. If you configure transmit rates whose sum exceeds the forwarding class set guaranteed rate, the commit check fails, and the system rejects the configuration.Note:Include the preamble bytes and interframe gap bytes as well as the data bytes in your bandwidth calculations.
Note:You cannot configure a transmit rate for strict-high priority queues. Queues (forwarding classes) with a configured transmit rate cannot be included in a forwarding class set that has strict-high priority queues.
shaping-rate
—Maximum bandwidth, also known as the peak information rate (PIR). Each queue receives a maximum of the configured amount of absolute bandwidth or the configured percentage of bandwidth, even if more bandwidth is available.Note:Include the preamble bytes and interframe gap bytes as well as the data bytes in your bandwidth calculations.
priority
—One of two bandwidth priorities that queues associated with a scheduler can receive:low
—The scheduler has low priority.strict-high
—The scheduler has strict-high priority. You can configure only one queue as a strict-high priority queue. Strict-high priority allocates the scheduled bandwidth to the queue before any other queue receives bandwidth. Other queues receive the bandwidth that remains after the strict-high queue has been serviced.We recommend that you always apply a shaping rate to strict-high priority queues to prevent them from starving other queues. If you do not apply a shaping rate to limit the amount of bandwidth a strict-high priority queue can use, then the strict-high priority queue can use all of the available port bandwidth and starve other queues on the port.
drop-profile-map
—Mapping of a drop profile to a loss priority and protocol to apply WRED to the scheduler.buffer-size
—Size of the queue buffer as a percentage of the dedicated buffer space on the port, or as a proportional share of the dedicated buffer space on the port that remains after the explicitly configured queues are served.explicit-congestion-notification
—Enables ECN on a best-effort queue. ECN enables end-to-end congestion notification between two ECN-enabled endpoints on TCP/IP based networks. ECN must be enabled on both endpoints and on all of the intermediate devices between the endpoints for ECN to work properly. ECN is disabled by default.
Ingress port congestion can occur during periods of egress port congestion if an ingress port forwards traffic to more than one egress port, and at least one of those egress ports experiences congestion. If this occurs, the congested egress port can cause the ingress port to exceed its fair allocation of ingress buffer resources. When the ingress port exceeds its buffer resource allocation, frames are dropped at the ingress. Ingress port frame drop affects not only the congested egress ports, but also all of the egress ports to which the congested ingress port forwards traffic.
If a congested ingress port drops traffic that is destined for one or more uncongested egress ports, configure a weighted random early detection (WRED) drop profile and apply it to the egress queue that is causing the congestion. The drop profile prevents the congested egress queue from affecting egress queues on other ports by dropping frames at the egress instead of causing congestion at the ingress port.
Do not configure drop profiles for the fcoe and no-loss forwarding classes. FCoE and other lossless traffic queues require lossless behavior. Use priority-based flow control (PFC) to prevent frame drop on lossless priorities.
OCX Series switches do not support lossless transport or PFC. On OCX Series switches, do not map traffic to the default lossless fcoe and no-loss forwarding classes.
Scheduler maps associate schedulers with forwarding classes (queues). After defining schedulers and mapping them to queues in a scheduler map, to configure hardware queue scheduling (hierarchical port scheduling) you:
Associate a scheduler map with a traffic control profile (a traffic control profile schedules resources for a group of forwarding classes, called a forwarding class set or priority group).
Attach a forwarding class and a traffic control profile to an interface.
Example: Configuring CoS Hierarchical Port Scheduling (ETS) provides a complete example of hierarchical scheduling.
You can associate up to four user-defined scheduler maps with forwarding class sets.
This process configures the bandwidth properties and WRED characteristics that you map to forwarding classes (and thus to output queues) in a scheduler map. The traffic control profile uses the scheduler CoS properties to determine the resources that should be allocated to the individual output queues from the total resources available to the priority group.
Table 1 shows the configuration components for this example.
Component |
Settings |
---|---|
Hardware |
QFX3500 switch |
Scheduler |
Name: |
Scheduler map |
Name: |
Traffic control profile |
Name: Note:
This topic does not describe how to define a traffic control profile. |
Forwarding class set |
Name: |
Verification
To verify that the queue scheduler has been created and is mapped to the correct interfaces, perform these tasks:
- Verifying the Scheduler Configuration
- Verifying the Scheduler Map Configuration
- Verifying That the Scheduler Is Associated with the Interface
Verifying the Scheduler Configuration
Purpose
Verify that the queue scheduler be-sched
has been created with a minimum guaranteed bandwidth of 2 Gbps,
a maximum bandwidth of 4 Gbps, the priority set to low
,
and the drop profile be-dp
.
Action
Display the scheduler using the operational mode command show configuration class-of-service schedulers be-sched
:
user@switch> show configuration class-of-service schedulers be-sched transmit-rate percent 20; shaping-rate percent 40; buffer-size percent 20; priority low; drop-profile-map loss-priority low protocol any drop-profile be-dp;
Verifying the Scheduler Map Configuration
Purpose
Verify that the scheduler map be-map
has
been created and associates the forwarding class best-effort
with the scheduler be-sched
, and also that the scheduler
map is attached to the traffic control profile be-tcp
.
Action
Display the scheduler map using the operational mode
command show configuration class-of-service scheduler-maps be-map
:
user@switch> show configuration class-of-service scheduler-maps be-map forwarding-class best-effort scheduler be-sched;
Display the traffic control profile to verify that the scheduler
map be-map
is attached using the operational mode command show configuration class-of-service traffic-control-profiles be-tcp
scheduler-map
:
user@switch> show configuration class-of-service traffic-control-profiles be-tcp scheduler-map scheduler-map be-map;
This topic does not describe how to configure a traffic control profile or its allocation of port bandwidth. Using a traffic control profile to configure the port resource allocation to the priority group is necessary to implement hierarchical scheduling.
Verifying That the Scheduler Is Associated with the Interface
Purpose
Verify that the forwarding class set (lan-pg
) and the traffic control profile (be-tcp
) that are associated
with the queue scheduler are attached to the interface xe-0/0/7
.
Action
List the interface using the operational mode command show configuration class-of-service interfaces xe-0/0/7
:
user@switch> show configuration class-of-service interfaces xe-0/0/7 forwarding-class-set { lan-pg { output-traffic-control-profile be-tcp; } }