ON THIS PAGE
Example: Configuring Strict-Priority Queuing
This example shows how to configure strict-priority queuing and prevent starvation of other queues.
Requirements
Before you begin, review how to create and configure forwarding classes. See Forwarding Classes Overview.
Overview
In this example, you create a BA classifier to classify traffic based on the IP precedence of the packet. The classifier defines IP precedence value 101 as voice traffic and 000 as data traffic. You assign forwarding-class priority queue 0 to voice traffic and queue 1 as data traffic. You then configure the scheduler map as corp-map and voice scheduler as voice-sched.
Then you set the priority for the voice traffic scheduler as strict-high and for the data traffic scheduler as strict-low. You apply the BA classifier to input interface ge-0/0/0 and apply the scheduler map to output interface e1-1/0/0. You then configure two policers called voice-drop and voice-excess. You set the burst size limit and bandwidth limit for voice-drop policer and for voice-excess policer. You then create a firewall filter that includes the new policers and add the policer to the term.
Finally, you apply the filter to output interface e1-1/0/1 and set the IP address as 203.0.113.1/24.
Configuration
- Configuring a BA Classifier
- Configuring Forwarding Classes
- Configuring a Scheduler Map
- Configuring a Scheduler
- Applying a BA Classifier to an Input Interface
- Applying a Scheduler Map to an Output Interface
- Configuring Two Policers
- Applying a Filter to an Output Interface
Configuring a BA Classifier
CLI Quick Configuration
To quickly configure this section of the 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 configuration mode.
set class-of-service classifiers inet-precedence corp-traffic forwarding-class voice-class loss-priority low code-points 101 set class-of-service classifiers inet-precedence corp-traffic forwarding-class data-class loss-priority high code-points 000
Step-by-Step Procedure
To configure a BA classifier:
Create a BA classifier and set the IP precedence value for voice traffic.
[edit] user@host# edit class-of-service classifiers inet-precedence corp-traffic forwarding-class voice-class loss-priority low user@host# set code-points 101
Create a BA classifier and set the IP precedence value for data traffic.
[edit] user@host# edit class-of-service classifiers inet-precedence corp-traffic forwarding-class data-class loss-priority high user@host# set code-points 000
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
classifiers {
inet-precedence corp-traffic {
forwarding-class voice-class {
loss-priority low code-points 101;
}
forwarding-class data-class {
loss-priority high code-points 000;
}
}
}
If you are done configuring the device, enter commit
from configuration mode.
Configuring Forwarding Classes
CLI Quick Configuration
To quickly configure this section of the 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 configuration mode.
set class-of-service forwarding-classes queue 0 voice-class set class-of-service forwarding-classes queue 1 data-class
Step-by-Step Procedure
To configure forwarding classes:
Assign priority queuing to voice traffic.
[edit] user@host# set class-of-service forwarding-classes queue 0 voice-class
Assign priority queuing to data traffic.
[edit] user@host# set class-of-service forwarding-classes queue 1 data-class
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
forwarding-classes {
queue 0 voice-class;
queue 1 data-class;
}
If you are done configuring the device, enter commit
from configuration mode.
Configuring a Scheduler Map
CLI Quick Configuration
To quickly configure this section of the 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 configuration mode.
set class-of-service scheduler-maps corp-map forwarding-class voice-class scheduler voice-sched set class-of-service scheduler-maps corp-map forwarding-class data-class scheduler data-sched
Step-by-Step Procedure
To configure a scheduler map:
Configure a scheduler map and voice scheduler.
[edit] user@host# edit class-of-service scheduler-maps corp-map forwarding-class voice-class user@host# set scheduler voice-sched
Configure a scheduler map and data scheduler.
[edit] user@host# edit class-of-service scheduler-maps corp-map forwarding-class data-class user@host# set scheduler data-sched
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
scheduler-maps {
corp-map {
forwarding-class voice-class scheduler voice-sched;
forwarding-class data-class scheduler data-sched;
}
}
If you are done configuring the device, enter commit
from configuration mode.
Configuring a Scheduler
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 configuration mode.
set class-of-service schedulers voice-sched priority strict-high set class-of-service schedulers data-sched priority lowset xxx
Step-by-Step Procedure
To configure schedulers:
Configure a voice traffic scheduler and set the priority.
[edit] user@host# edit class-of-service schedulers voice-sched user@host# set priority strict-high
Configure a data traffic scheduler and set the priority.
[edit] user@host# edit class-of-service schedulers data-sched user@host# set priority low
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 {
voice-sched {
priority strict-high;
}
data-sched {
priority low;
}
}
If you are done configuring the device, enter commit
from configuration mode.
Applying a BA Classifier to an Input Interface
CLI Quick Configuration
To quickly configure this section of the 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 configuration mode.
set class-of-service interfaces ge-0/0/0 unit 0 classifiers inet-precedence corp-traffic
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 apply a BA classifier to an input interface:
Configure an interface.
[edit] user@host# edit class-of-service interfaces ge-0/0/0 unit 0
Apply a BA classifier to an input interface.
[edit class-of-service interfaces ge-0/0/0 unit 0] user@host# set classifiers inet-precedence corp-traffic
Results
From configuration mode, confirm your configuration
by entering the show class-of-service interfaces
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 {
classifiers {
inet-precedence corp-traffic;
}
}
}
If you are done configuring the device, enter commit
from configuration mode.
Applying a Scheduler Map to an Output Interface
CLI Quick Configuration
To quickly configure this section of the 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 configuration mode.
set class-of-service interfaces e1-1/0/0 unit 0 scheduler-map corp-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 apply the scheduler map to an output interface:
Configure an interface.
[edit] user@host# edit class-of-service interfaces e1-1/0/0 unit 0
Apply a scheduler map to an output interface.
[edit class-of-service interfaces e1-1/0/0 unit 0] user@host# set scheduler-map corp-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 {
e1-1/0/0 {
unit 0 {
scheduler-map corp-map;
}
}
}
If you are done configuring the device, enter commit
from configuration mode.
Configuring Two Policers
CLI Quick Configuration
To quickly configure this section of the 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 configuration mode.
set firewall policer voice-drop if-exceeding burst-size-limit 200000 bandwidth-limit 2000000 set firewall policer voice-drop then discard set firewall policer voice-excess if-exceeding burst-size-limit 200000 bandwidth-limit 1000000 set firewall policer voice-excess then out-of-profile set firewall filter voice-term term 01 from forwarding-class voice-class set firewall filter voice-term term 01 then policer voice-drop next term set firewall filter voice-term term 02 from forwarding-class voice-class set firewall filter voice-term term 02 then policer voice-excess accept
Step-by-Step Procedure
To configure two policers:
Configure a policer voice drop.
[edit] user@host# edit firewall policer voice-drop user@host# set if-exceeding burst-size-limit 200000 bandwidth-limit 2000000 user@host# set then discard
Configure a policer voice excess.
[edit] user@host# edit firewall policer voice-excess user@host# set if-exceeding burst-size-limit 200000 bandwidth-limit 1000000 user@host# set then out-of-profile
Create a firewall filter that includes the new policers.
[edit] user@host# edit firewall filter voice-term term 01 user@host# set from forwarding-class voice-class user@host# set then policer voice-drop next term
Add the policer to the term.
[edit] user@host# edit firewall filter voice-term term 02 user@host# set from forwarding-class voice-class user@host# set then policer voice-excess accept
Results
From configuration mode, confirm your configuration
by entering the show firewall
command. If the output does
not display the intended configuration, repeat the configuration instructions
in this example to correct it.
[edit]
user@host# show firewall
policer voice-drop {
if-exceeding {
bandwidth-limit 2m;
burst-size-limit 200k;
}
then discard;
}
policer voice-excess {
if-exceeding {
bandwidth-limit 1m;
burst-size-limit 200k;
}
then out-of-profile;
}
filter voice-term {
term 01 {
from {
forwarding-class voice-class;
}
then {
policer voice-drop;
next term;
}
}
term 02 {
from {
forwarding-class voice-class;
}
then {
policer voice-excess;
accept;
}
}
}
If you are done configuring the device, enter commit
from configuration mode.
Applying a Filter to an Output Interface
CLI Quick Configuration
To quickly configure this section of the 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 configuration mode.
set interfaces e1-1/0/1 unit 0 family inet filter output voice-term set interfaces e1-1/0/1 unit 0 family inet address 203.0.113.1/24
Step-by-Step Procedure
To apply a filter to an output interface:
Apply a filter to an interface.
[edit] user@host# edit interfaces e1-1/0/1 unit 0 family inet filter output user@host# set voice-term
Set an IP address.
[edit] user@host# set interfaces e1-1/0/1 unit 0 family inet address 203.0.113.1/24
Results
From configuration mode, confirm your configuration
by entering the show interfaces
command. If the output
does not display the intended configuration, repeat the configuration
instructions in this example to correct it.
[edit]
user@host# show interfaces
e1-1/0/1 {
unit 0 {
family inet {
filter {
output voice-term;
}
address 203.0.113.1/24;
}
}
}
If you are done configuring the device, enter commit
from configuration mode.
Verification
Confirm that the configuration is working properly.
Verifying the Scheduler Map
Purpose
Verify that the scheduler map is configured properly.
Action
From operational mode, enter the show class-of-service
scheduler-map corp-map
command.
Verifying the Interfaces
Purpose
Verify that the interfaces are configured properly.
Action
From configuration mode, enter the show interfaces
command.