ON THIS PAGE
Example: Configuring and Applying Scheduler Maps
This example shows how to configure and apply a scheduler map to a device’s interface.
Requirements
Before you begin:
Create and configure the forwarding classes. See Configuring a Custom Forwarding Class for Each Queue.
Create and configure the schedulers. See Example: Configuring Class-of-Service Schedulers on a Security Device.
Overview
After you define a scheduler, you can include it in a scheduler map, which maps a specified forwarding class to a scheduler configuration. You configure a scheduler map to assign a forwarding class to a scheduler, and then apply the scheduler map to any interface that must enforce DiffServ CoS.
After they are applied to an interface, the scheduler maps affect the hardware queues, packet schedulers, and RED drop profiles.
In this example, you create the scheduler map diffserv-cos-map and apply it to the device's Ethernet interface ge-0/0/0. The map associates the mf-classifier forwarding classes to the schedulers as shown in Table 1.
mf-classifier Forwarding Class |
For CoS Traffic Type |
diffserv-cos-map Scheduler |
---|---|---|
be-class |
Best-effort traffic |
be-scheduler |
ef-class |
Expedited forwarding traffic |
ef-scheduler |
af-class |
Assured forwarding traffic |
af-scheduler |
nc-class |
Network control traffic |
nc-scheduler |
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 scheduler-maps diffserv-cos-map forwarding-class be-class scheduler be-scheduler set class-of-service scheduler-maps diffserv-cos-map forwarding-class ef-class scheduler ef-scheduler set class-of-service scheduler-maps diffserv-cos-map forwarding-class af-class scheduler af-scheduler set class-of-service scheduler-maps diffserv-cos-map forwarding-class nc-class scheduler nc-scheduler set class-of-service interfaces ge-0/0/0 unit 0 scheduler-map diffserv-cos-map
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 and apply a scheduler map to a device’s interface:
Configure a scheduler map for DiffServ CoS.
[edit class-of-service] user@host# edit scheduler-maps diffserv-cos-map
Configure a best-effort forwarding class and scheduler.
[edit class-of-service scheduler-maps diffserv-cos-map] user@host# set forwarding-class be-class scheduler be-scheduler
Configure an expedited forwarding class and scheduler.
[edit class-of-service scheduler-maps diffserv-cos-map] user@host# set forwarding-class ef-class scheduler ef-scheduler
Configure an assured forwarding class and scheduler.
[edit class-of-service scheduler-maps diffserv-cos-map] user@host# set forwarding-class af-class scheduler af-scheduler
Configure a network control class and scheduler.
[edit class-of-service scheduler-maps diffserv-cos-map] user@host# set forwarding-class nc-class scheduler nc-scheduler
Apply the scheduler map to an interface.
[edit class-of-service] user@host# set interfaces ge-0/0/0 unit 0 scheduler-map diffserv-cos-map
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
interfaces {
ge-0/0/0 {
unit 0 {
scheduler-map diffserv-cos-map;
}
}
}
scheduler-maps {
diffserv-cos-map {
forwarding-class be-class scheduler be-scheduler;
forwarding-class ef-class scheduler ef-scheduler;
forwarding-class af-class scheduler af-scheduler;
forwarding-class nc-class scheduler nc-scheduler;
}
}
If you are done configuring the device, enter commit
from configuration mode.