ON THIS PAGE
Example: Configuring Class-of-Service Schedulers on a Security Device
This example shows how to configure CoS schedulers on a device.
Requirements
Before you begin, determine the buffer size allocation method to use. See Scheduler Buffer Size Overview.
Overview
An individual device interface has multiple queues assigned to store packets temporarily before transmission. To determine the order in which to service the queues, the device uses a round-robin scheduling method based on priority and the queue's weighted round-robin (WRR) credits. Junos OS schedulers allow you to define the priority, bandwidth, delay buffer size, rate control status, and RED drop profiles to be applied to a particular queue for packet transmission.
You configure schedulers to assign resources, priorities, and drop profiles to output queues. By default, only queues 0 and 3 have resources assigned.
Juniper Network devices support hierarchical schedulers, including per-unit schedulers.
In this example, you configure a best-effort scheduler called be-scheduler. You set the priority as low and the buffer size to 40. You set the be-scheduler transmit-rate remainder percentage to 40. You configure an expedited forwarding scheduler called ef-scheduler and set the priority as high and the buffer size to 10. You set the ef-scheduler transmit-rate remainder percentage to 50.
Then you configure an assured forwarding scheduler called af-scheduler and set the priority as high and buffer size to 45. You set an assured forwarding scheduler transmit rate to 45. You then configure a drop profile map for assured forwarding as low and high priority. (DiffServ can have a RED drop profile associated with assured forwarding.)
Finally, you configure a network control scheduler called nc-scheduler and set the priority as low and buffer size to 5. You set a network control scheduler transmit rate to 5.
Table 1 shows the schedulers created in this example.
Scheduler |
For CoS Traffic Type |
Assigned Priority |
Allocated Portion of Queue Buffer |
Allocated Portion of Remainder (Transmit Rate) |
---|---|---|---|---|
|
Best-effort traffic |
Low |
40 percent |
40 percent |
|
Expedited forwarding traffic |
High |
10 percent |
50 percent |
|
Assured forwarding traffic |
High |
45 percent |
— |
|
Network control traffic |
Low |
5 percent |
— |
Configuration
Procedure
CLI Quick Configuration
To quickly configure this example, copy the
following commands, paste them into a text file, remove any line breaks,
change any details necessary to match your network configuration,
copy and paste the commands into the CLI at the [edit]
hierarchy
level, and then enter commit
from the configuration mode.
set class-of-service schedulers be-scheduler priority low buffer-size percent 40 set class-of-service schedulers be-scheduler transmit-rate remainder 40 set class-of-service schedulers ef-scheduler priority high buffer-size percent 10 set class-of-service schedulers ef-scheduler transmit-rate remainder 50 set class-of-service schedulers af-scheduler priority high buffer-size percent 45 set class-of-service schedulers af-scheduler transmit-rate percent 45 set class-of-service schedulers af-scheduler drop-profile-map loss-priority low protocol any drop-profile af-normal set class-of-service schedulers af-scheduler drop-profile-map loss-priority high protocol any drop-profile af-with-PLP set class-of-service schedulers nc-scheduler priority low buffer-size percent 5 set class-of-service schedulers nc-scheduler transmit-rate percent 5
Step-by-Step Procedure
The following example requires you to navigate various levels in the configuration hierarchy. For instructions on how to do that, see Using the CLI Editor in Configuration Mode in the Junos OS CLI User Guide.
To configure CoS schedulers:
Configure a best-effort scheduler.
[edit] user@host# edit class-of-service schedulers be-scheduler
Specify a best-effort scheduler priority and buffer size.
[edit class-of-service schedulers be-scheduler] user@host# set priority low user@host# set buffer-size percent 40
Configure a remainder option for a best-effort scheduler transmit rate.
[edit class-of-service schedulers be-scheduler] user@host# set transmit-rate remainder 40
Configure an expedited forwarding scheduler.
[edit] user@host# edit class-of-service schedulers ef-scheduler
Specify an expedited forwarding scheduler priority and buffer size.
[edit class-of-service schedulers ef-scheduler] user@host# set priority high user@host# set buffer-size percent 10
Configure a remainder option for an expedited forwarding scheduler transmit rate.
[edit class-of-service schedulers ef-scheduler] user@host# set transmit-rate remainder 50
Configure an assured forwarding scheduler.
[edit] user@host# edit class-of-service schedulers af-scheduler
Specify an assured forwarding scheduler priority and buffer size.
[edit class-of-service schedulers af-scheduler] user@host# set priority high user@host# set buffer-size percent 45
Configure an assured forwarding scheduler transmit rate.
[edit class-of-service schedulers af-scheduler] user@host# set transmit-rate percent 45
Configure a drop profile map for assured forwarding low and high priority.
[edit class-of-service schedulers af-scheduler] user@host# set drop-profile-map loss-priority low protocol any drop-profile af-normal user@host# set drop-profile-map loss-priority high protocol any drop-profile af-with-PLP
Configure a network control scheduler.
[edit] user@host# edit class-of-service schedulers nc-scheduler
Specify a network control scheduler priority and buffer size.
[edit class-of-service schedulers nc-scheduler] user@host# set priority low user@host# set buffer-size percent 5
Configure a network control scheduler transmit rate.
[edit class-of-service schedulers nc-scheduler] user@host# set transmit-rate percent 5
Results
From configuration mode, confirm your configuration
by entering the show class-of-service
command. If the output
does not display the intended configuration, repeat the configuration
instructions in this example to correct it.
[edit]
user@host# show class-of-service
schedulers {
be-scheduler {
transmit-rate remainder 40;
buffer-size percent 40;
priority low;
}
ef-scheduler {
transmit-rate remainder 50;
buffer-size percent 10;
priority high;
}
af-scheduler {
transmit-rate percent 45;
buffer-size percent 45;
priority high;
drop-profile-map loss-priority low protocol any drop-profile af-normal;
drop-profile-map loss-priority high protocol any drop-profile af-with-PLP;
}
nc-scheduler {
transmit-rate percent 5;
buffer-size percent 5;
priority low;
}
}
If you are done configuring the device, enter commit
from configuration mode.