Configuring Class-of-Service on Link Services Interfaces
On a Juniper Networks device, when LFI is enabled, all forwarding traffic assigned to queue 2 or member link is treated as LFI (voice) traffic. The topics below discuss the overview of classifiers and forwarding class, definition and application of schedule maps, and overview and configuration details of interface shaping rates on SRX Series Firewalls.
Understanding How to Define Classifiers and Forwarding Classes
By defining classifiers you associate incoming packets with a forwarding class and loss priority. Based on the associated forwarding class, you assign packets to output queues. To configure classifiers, you specify the bit pattern for the different types of traffic. The classifier takes this bit pattern and attempts to match it to the type of packet arriving on the interface. If the information in the packet’s header matches the specified pattern, the packet is sent to the appropriate queue, defined by the forwarding class associated with the classifier.
On a Juniper Networks device, when LFI is enabled, all forwarding traffic assigned to queue 2 or member link is treated as LFI (voice) traffic. You do not need to assign network control traffic to a queue explicitly, because it is assigned to queue 3 by default.
On member links:
DATA
is assigned to queue 0.VOICE
is assigned to queue 2.NC
(network control) is assigned to queue 3. By default NC is assigned to queue 3.
Example: Defining Classifiers and Forwarding Classes
This example shows how to define classifiers for different types of traffic, such as voice, data, and network control packets, and to direct the traffic to different output queues to manage your throughput.
Requirements
Before you begin:
Configure two Juniper Networks devices with at least two serial interfaces that communicate over serial links.
Configure CoS components. See Junos OS Class of Service Configuration Guide for Security Devices.
Overview
In this example, you configure class of service and set the default IP precedence classifier to classify_input, which is assigned to all incoming traffic. You then set the precedence bit value in the type of service field to 000 for all incoming data traffic and 010 for all incoming voice traffic. You set all outgoing data traffic to queue 0 and all voice traffic to queue 2, and fragmentation-map maps queue 2 to no fragmentation.
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,
and then copy and paste the commands into the CLI at the [edit]
hierarchy level.
set class-of-service classifiers inet-precedence classify_input forwarding-class DATA loss-priority low code-points 000 set class-of-service classifiers inet-precedence classify_input forwarding-class VOICE loss-priority low code-points 010 set class-of-service forwarding-classes queue 0 DATA set class-of-service forwarding-classes queue 2 VOICE set class-of-service forwarding-classes queue 3 NC set class-of-service interfaces ge-0/0/1 unit 0 classifiers inet-precedence classify_input set class-of-service fragmentation-maps FM forwarding-class VOICE no-fragmentation set class-of-service interfaces lsq-0/0/0 unit 0 fragmentation-map FM
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 define classifiers and forwarding classes:
Configure class of service.
[edit] user@host# edit class-of-service
Configure the behavior aggregate classifier for classifying packets.
[edit class-of-service] user@host# edit classifiers inet-precedence classify_input
Assign packets with IP precedence to the data forwarding class and specify a loss priority.
[edit class-of-service classifiers inet-precedence classify_input] user@host# set forwarding-class DATA loss-priority low code-points 000
Assign packets with IP precedence to the voice forwarding class and specify a loss priority.
[edit class-of-service classifiers inet-precedence classify_input] user@host# set forwarding-class VOICE loss-priority low code-points 010
Specify the forwarding class one-to-one with the output queues.
[edit class-of-service] user@host# edit forwarding-classes user@host# set queue 0 DATA user@host# set queue 2 VOICE user@host# set queue 3 NC
Create an interface and apply the behavior aggregate classifier.
[edit class-of-service] user@host# edit interfaces ge-0/0/1 user@host# set unit 0 classifiers inet-precedence classify_input
Configure fragmentation map.
[edit] user@host# edit class-of-service user@host# set fragmentation-maps FM forwarding-class VOICE no-fragmentation
Attach fragmentation map to the interface.
[edit class-of-service] user@host# set interfaces lsq-0/0/0 unit 0 fragmentation-map FM
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 classify_input {
forwarding-class DATA {
loss-priority low code-points 000;
}
forwarding-class VOICE {
loss-priority low code-points 010;
}
}
}
forwarding-classes {
queue 0 DATA;
queue 2 VOICE;
queue 3 NC;
}
interfaces {
lsq-0/0/0 {
unit 0 {
fragmentation-map FM;
}
}
ge-0/0/1 {
unit 0 {
classifiers {
inet-precedence classify_input;
}
}
}
}
fragmentation-maps {
FM {
forwarding-class {
VOICE {
no-fragmentation;
}
}
}
}
If you are done configuring the device, enter commit from configuration mode.
Understanding How to Define and Apply Scheduler Maps
Juniper Networks devices support per-unit scheduling set
class-of-service schedulers S0 priority low
, which allows you
to configure scheduler maps on each MLPPP or MLFR multilink bundle.
You can also configure scheduler maps on constituent links, but you
must maintain the same relative priority on the constituent links
and on the multilink bundle.
If you configure CoS components with LFI on a Juniper Networks device, we recommend that you follow certain recommendations for shaping rate, scheduling priority, and buffer size.
When you configure LFI, we recommend that you configure the shaping rate on each constituent link of the multilink bundle. Shaping rate configuration on the constituent links is required to limit the jitter on the LFI queue. If you anticipate no delay-sensitive or jitter-sensitive traffic on the LFI queue, or if there is no LFI traffic at all, shaping rate configuration is optional.
Table 1 shows an example of correct and incorrect relative priorities on a multilink bundle and its constituent link. In this example, you have assigned a high priority to LFI packets and a low priority to data packets on the multilink bundle. To maintain the relative priority on the constituent links, you can assign a high priority to the LFI packets and a medium-high priority to the data packets, but you cannot assign a medium-high priority to LFI packets and a high priority to data packets.
Multilink Bundle |
Correct Constituent Link Priorities |
Incorrect Constituent Link Priorities |
---|---|---|
LFI packets—High priority |
LFI packets—High priority |
LFI packet—Medium-high priority |
Data packets—Low priority |
Data packets—Medium-high priority |
Data packets—High priority |
By defining schedulers you configure the properties of output queues that determine the transmission service level for each queue. These properties include the amount of interface bandwidth assigned to the queue, the size of the memory buffer allocated for storing packets, and the priority of the queue. After defining schedulers you associate them with forwarding classes by means of scheduler maps. You then associate each scheduler map with an interface, thereby configuring the hardware queues and packet schedulers that operate according to this mapping.
When data and LFI streams are present, the following scheduler map configuration is recommended for constituent links. This gives less latency for LFI traffic and avoids out-of-order transmission of data traffic.
Configure the following schedulers:
set class-of-service schedulers S0 buffer-size temporal 20k
set class-of-service schedulers S0 priority low
set class-of-service schedulers S2 priority high
set class-of-service schedulers S3 priority high
Configure the following scheduler map:
set class-of-service scheduler-maps lsqlink_map forwarding-class best-effort scheduler S0
set class-of-service scheduler-maps lsqlink_map forwarding-class assured-forwarding scheduler S2
set class-of-service scheduler-maps lsqlink_map forwarding-class network-control scheduler S3
Attach scheduler map to all member links:
set class-of-service interfaces t1-2/0/0 unit 0 scheduler-map lsqlink_map
Even after this configuration, if out-of-range sequence number drops are observed on the reassembly side, increase the drop-timeout of the bundle to 200 ms.
Example: Configuring Scheduler Maps
This example shows how to configure scheduler maps to determine the transmission service level for each output queue.
Requirements
Before you begin, you should have two Juniper Networks devices configured with at least two serial interfaces that communicate over serial links.
Overview
In this example, you create interfaces called lsq-0/0/0, se-1/0/0, and se-1/0/1. You enable per-unit scheduling to allow the configuration of scheduler maps on the bundle. You configure a scheduler map as s_map on lsq-0/0/0. You then apply the scheduler map to the constituent links, se-1/0/0 and se-1/0/1, of the multilink bundle. You associate the scheduler with each of the forwarding classes, DATA, VOICE and NC. You define the properties of output queues for the DATA scheduler by setting the transmit rate and the buffer size to 49 percent. You specify the properties of output queues for the VOICE scheduler by setting the transmit rate to 50 percent, the buffer size to 5 percent, and the priority to high. Finally, you define the properties of output queues for the NC scheduler by setting the transmit rate and the buffer size to 1 percent and the priority to high.
Topology
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,
and then copy and paste the commands into the CLI at the [edit]
hierarchy level.
set interfaces lsq-0/0/0 per-unit-scheduler set interfaces se-1/0/0 per-unit-scheduler set interfaces se-1/0/1 per-unit-scheduler set class-of-service interfaces lsq-0/0/0 unit 0 scheduler-map s_map set class-of-service interfaces se-1/0/0 unit 0 scheduler-map s_map set class-of-service interfaces se-1/0/1 unit 0 scheduler-map s_map set class-of-service scheduler-maps s_map forwarding-class DATA scheduler DATA set class-of-service scheduler-maps s_map forwarding-class VOICE scheduler VOICE set class-of-service scheduler-maps s_map forwarding-class NC scheduler NC set class-of-service schedulers DATA transmit-rate percent 49 set class-of-service schedulers DATA buffer-size percent 49 set class-of-service schedulers VOICE transmit-rate percent 50 set class-of-service schedulers VOICE buffer-size percent 5 set class-of-service schedulers VOICE priority high set class-of-service schedulers NC transmit-rate percent 1 set class-of-service schedulers NC buffer-size percent 1 set class-of-service schedulers NC priority high
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 scheduler maps:
Create interfaces and enable per-unit scheduling.
[edit interfaces] user@host# set lsq-0/0/0 per-unit-scheduler user@host# set se-1/0/0 per-unit-scheduler user@host# set se-1/0/1 per-unit-scheduler
Define a scheduler map and apply it to the constituent links in the multilink bundle.
[edit class-of-service interfaces] user@host# set lsq-0/0/0 unit 0 scheduler-map s_map user@host# set se-1/0/0 unit 0 scheduler-map s_map user@host# set se-1/0/1 unit 0 scheduler-map s_map
Associate a scheduler with each forwarding class.
[edit class-of-service scheduler-maps] user@host# set s_map forwarding-class DATA scheduler DATA user@host# set s_map forwarding-class VOICE scheduler VOICE user@host# set s_map forwarding-class NC scheduler NC
Define the properties of output queues for the DATA scheduler.
[edit class-of-service schedulers] user@host# set DATA transmit-rate percent 49 user@host# set DATA buffer-size percent 49
Define the properties of output queues for the VOICE scheduler.
[edit class-of-service schedulers] user@host# set VOICE transmit-rate percent 50 user@host# set VOICE buffer-size percent 5 user@host# set VOICE priority high
Define the properties of output queues for the NC scheduler.
[edit class-of-service schedulers] user@host# set NC transmit-rate percent 1 user@host# set NC buffer-size percent 1 user@host# set NC priority high
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 {
lsq-0/0/0 {
unit 0 {
scheduler-map s_map;
}
}
se-1/0/0 {
unit 0 {
scheduler-map s_map;
}
}
se-1/0/1 {
unit 0 {
scheduler-map s_map;
}
}
}
scheduler-maps {
s_map {
forwarding-class DATA scheduler DATA;
forwarding-class VOICE scheduler VOICE;
forwarding-class NC scheduler NC;
}
}
schedulers {
DATA {
transmit-rate percent 49;
buffer-size percent 49;
}
VOICE {
transmit-rate percent 50;
buffer-size percent 5;
priority high;
}
NC {
transmit-rate percent 1;
buffer-size percent 1;
priority high;
}
}
If you are done configuring the device, enter commit from configuration mode.
Verification
To confirm that the configuration is working properly, perform this task:
Verifying the Configuration of scheduler maps.
Purpose
Verify the configuration of scheduler maps.
Action
From operational mode, enter the show class-of-services
lsq-0/0/0 scheduler-map s_map
, show class-of-services se-1/0/0
scheduler-map s_map
, and show class-of-services se-1/0/1
scheduler-map s_map
commands.
Understanding Interface Shaping Rates
When you configure LFI, we recommend that you configure the shaping rate on each constituent link of the multilink bundle. Shaping rate configuration on the constituent links is required to limit the jitter on the LFI queue. If you anticipate no delay-sensitive or jitter-sensitive traffic on the LFI queue, or if there is no LFI traffic at all, shaping rate configuration is optional.
The shaping rate specifies the amount of bandwidth to be allocated for the multilink bundle. You must configure the shaping rate to be equal to the combined physical interface bandwidth for the constituent links. The combined bandwidth capacity of the two constituent links is 2 Mbps. Hence, configure a shaping rate of 2 Mbps on each constituent link.
Example: Configuring Interface Shaping Rates
This example shows how to configure interface shaping rates to control the maximum rate of traffic transmitted on an interface.
Requirements
Before you begin:
Configure two Juniper Networks devices configured with at least two serial interfaces that communicate over serial links. For more information about serial interfaces. See Serial Interfaces Overview.
To apply shaping rates to interfaces, you have to first enable per-unit scheduling. For more information on per-unit scheduling. See Example: Configuring Scheduler Maps.
Overview
In this example, you set the shaping rate to 2000000 for the constituent links of the multilink bundle, se-1/0/0 and se-1/0/1.
Topology
Configuration
Procedure
Step-by-Step Procedure
To configure the interface shaping rates:
Configure class of service.
[edit] user@host# edit class-of-service
Apply the shaping rates to the constituent links of the multilink bundle.
[edit class-of-service] user@host# set interfaces se-1/0/0 unit 0 shaping-rate 2000000 user@host# set interfaces se-1/0/1 unit 0 shaping-rate 2000000
Verification
To verify the configuration is working properly,
enter the show class-of-service
command.