Configuring Up to 16 Custom Forwarding Classes
By default on all routers, four forwarding classes are mapped to four output queues, as shown in the topic Default Forwarding Classes. On M120 and M320 Multiservice Edge Routers, MX Series 5G Universal Routing Platforms, PTX Series Packet Transport Routers, and T Series Core Routers, you can configure more than four forwarding classes and queues; you can configure up to 16 forwarding classes and eight queues, with multiple forwarding classes assigned to single queues. The concept of assigning multiple forwarding classes to a queue is sometimes referred to as creating forwarding-class aliases.
You cannot use CoS-based forwarding features if you configure more than eight forwarding classes on the device.
Mapping multiple forwarding classes to single queues is useful.
Suppose, for example, that forwarding classes are set based on multifield
packet classification, and the multifield classifiers are different
for core-facing interfaces and customer-facing interfaces. Suppose
you need four queues for a core-facing interface and five queues for
a customer-facing interface, where fc0
through fc4
correspond to the classifiers for the customer-facing interface,
and fc5
through fc8
correspond to classifiers
for the core-facing interface, as shown in Figure 1.
In this example, you need nine classifiers and, therefore, nine forwarding classes. The forwarding class-to-queue mapping is shown in Table 1.
Forwarding Class Names |
Queue Number |
---|---|
|
0 |
|
1 |
|
2 |
|
3 |
|
4 |
To configure up to 16 forwarding classes, include the class
and queue-num
statements at the [edit
class-of-service forwarding-classes]
hierarchy level:
[edit class-of-service forwarding-classes] class class-name queue-num queue-number;
You can configure up 16 different forwarding-class names.
The corresponding output queue number can be from 0 through 7.
Therefore, you can map multiple forwarding classes to a single queue.
If you map multiple forwarding classes to a queue, the multiple forwarding
classes must refer to the same scheduler (at the [edit class-of-service
scheduler-maps map-name forwarding-class class-name scheduler scheduler-name]
hierarchy level).
When you configure up to 16 forwarding classes, you can use them as you can any other forwarding class—in classifiers, schedulers, firewall filters (multifield classifiers), policers, and rewrite rules.
When you configure up to 16 forwarding classes, the following limitations apply:
The
class
andqueue
statements at the[edit class-of-service forwarding-classes]
hierarchy level are mutually exclusive. In other words, you can include one or the other of the following configurations, but not both:[edit class-of-service forwarding-classes] queue queue-number class-name; [edit class-of-service forwarding-classes] class class-name queue-num queue-number;
When you use CoS-based forwarding features, you cannot configure more than eight forwarding classes with a forwarding policy. However, if you try to configure CoS-based forwarding with more than eight forwarding classes configured, commit fails with a message. Therefore, you can configure CBF on a router with eight or less than eight forwarding classes only. Under this condition, the forwarding class to queue mapping can be either one-to-one or one-to-many.
A scheduler map that maps eight different forwarding classes to eight different schedulers can only be applied to interfaces that support eight queues. If you apply this type of scheduler map to an interface that only supports four queues, then the commit fails.
We recommend that you configure the statements changing PICs to support eight queues and then applying an eight queue scheduler map in two separate steps. Otherwise, the commit might succeed but the PIC might not have eight queues when the scheduler map is applied, generating an error.
You can determine the ID number assigned to a forwarding class
by issuing the show class-of-service forwarding-class
command.
You can determine whether the classification is fixed by issuing the show class-of-service forwarding-table classifier mapping
command.
In the command output, if the Table Type
field appears
as Fixed
, the classification is fixed. For more information
about fixed classification, see Applying
Forwarding Classes to Interfaces.
Enabling Eight Queues on Interfaces
By default, Intelligent Queuing (IQ), Intelligent Queuing 2 (IQ2), Intelligent Queuing Enhanced (IQE), and Intelligent Queuing 2 Enhanced (IQ2E) PICs on M320 and T Series routers are restricted to a maximum of four egress queues per interface. The following procedures describe how to configure a maximum of eight egress queues on these interfaces.
In addition to configuring eight queues at
the [edit chassis]
hierarchy level, the configuration at
the [edit class-of-service]
hierarchy level must support
eight queues per interface.
The maximum number of queues per IQ PIC can be 4
or 8
. If you include the max-queues-per-interface
statement, all ports on the IQ PIC use configured mode and all interfaces
on the IQ PIC have the same maximum number of queues.
To configure a maximum of eight egress queues on these PICs:
This procedure describes how to configure the maximum number of queues the interface supports on a TX Matrix or TX Matrix Plus router.
In addition to configuring eight queues at
the [edit chassis]
hierarchy level, the configuration at
the [edit class-of-service]
hierarchy level must support
eight queues per interface.
The maximum number of queues per IQ PIC can be 4
or 8
. If you include the max-queues-per-interface
statement, all ports on the IQ PIC use configured mode and all interfaces
on the IQ PIC have the same maximum number of queues.
To configure a maximum of eight egress queues on these PICs:
[edit] user@host# edit chassis lcc number fpc slot-number pic pic-number
Configure a maximum of eight egress queues on these interfaces.
[edit chassis fpc slot-number pic pic-number] user@host# set max-queues-per-interface 8
The numerical value can be
4
or8
.
To determine how many queues an interface supports, you
can check the CoS queues
output field of the show interfaces interface-name extensive
command:
To view how many queues an interface supports:
user@host> show interfaces so-1/0/0 extensive CoS queues: 8 supported
If you include the max-queues-per-interface
4
statement, you can configure all four ports and configure
up to four queues per port.
For 4-port OC3c/STM1 Type I and Type II PICs on
M320 and T Series routers, when you include the max-queues-per-interface
8
statement, you can configure up to eight queues on ports 0
and 2. After you commit the configuration, the PIC goes offline and
comes back online with only ports 0 and 2 operational. No interfaces
can be configured on ports 1 and 3.
For Quad T3 and Quad E3 PICs, when you include the max-queues-per-interface
8
statement, you can configure up to eight queues on ports 0
and 2. After you commit the configuration, the PIC goes offline and
comes back online with only ports 0 and 2 operational. No interfaces
can be configured on ports 1 and 3.
When you include the max-queues-per-interface
statement and commit the configuration, all physical interfaces
on the IQ PIC are deleted and re-added. Also, the PIC is taken offline
and then brought back online immediately. You do not need to take
the PIC offline and online manually. You should change modes between
four queues and eight queues only when there is no active traffic
going to the IQ PIC.
Assigning Multiple Forwarding Classes and Default Forwarding Classes
For queues 0 through 3, if you assign multiple forwarding classes to a single queue, default forwarding class assignment works as follows:
The first forwarding class that you assign to queue 0 acquires the default BE classification and scheduling.
The first forwarding class that you assign to queue 1 acquires the default EF classification and scheduling.
The first forwarding class that you assign to queue 2 acquires the default AF classification and scheduling.
The first forwarding class that you assign to queue 3 acquires the default NC classification and scheduling.
Of course you can override the default classification and scheduling by configuring custom classifiers and schedulers.
If you do not explicitly map forwarding classes to queues 0 through 3, then the respective default classes are automatically assigned to those queues. When you are counting the 16 forwarding classes, you must include in the total any default forwarding classes automatically assigned to queues 0 through 3. As a result, you can map up to 13 forwarding classes to a single queue when the single queue is queue 0, 1, 2, or 3. You can map up to 12 forwarding classes to a single queue when the single queue is queue 4, 5, 6, or 7. In summary, there must be at least one forwarding class each (default or otherwise) assigned to queue 0 through 3, and you can assign the remaining 12 forwarding classes (16–4) to any queue.
For example, suppose you assign two forwarding classes to queue 0 and you assign no forwarding classes to queues 1 through 3. The software automatically assigns one default forwarding class each to queues 1 through 3. This means 11 forwarding classes (16–5) are available for you to assign to queues 4 through 7.
For more information about forwarding class defaults, see Default Forwarding Classes.
Examples: Configuring Up to 16 Forwarding Classes
To configure 16 forwarding classes, map two forwarding classes to each queue. For example:
[edit] user@host# edit class-of-service forwarding-classes user@host# set class fc0 queue-num 0 user@host# set class fc1 queue-num 0 user@host# set class fc2 queue-num 1 user@host# set class fc3 queue-num 1 user@host# set class fc4 queue-num 2 user@host# set class fc5 queue-num 2 user@host# set class fc6 queue-num 3 user@host# set class fc7 queue-num 3 user@host# set class fc8 queue-num 4 user@host# set class fc9 queue-num 4 user@host# set class fc10 queue-num 5 user@host# set class fc11 queue-num 5 user@host# set class fc12 queue-num 6 user@host# set class fc13 queue-num 6 user@host# set class fc14 queue-num 7 user@host# set class fc15 queue-num 7
For PICs restricted to four queues, map four forwarding classes to each queue:
Specify each forwarding class and queue you want mapped.
[edit] user@host# edit class-of-service restricted-queues user@host# set forwarding-class fc0 queue 0 user@host# set forwarding-class fc1 queue 0 user@host# set forwarding-class fc2 queue 0 user@host# set forwarding-class fc3 queue 0 user@host# set forwarding-class fc4 queue 1 user@host# set forwarding-class fc5 queue 1 user@host# set forwarding-class fc6 queue 1 user@host# set forwarding-class fc7 queue 1 user@host# set forwarding-class fc8 queue 2 user@host# set forwarding-class fc9 queue 2 user@host# set forwarding-class fc10 queue 2 user@host# set forwarding-class fc11 queue 2 user@host# set forwarding-class fc12 queue 3 user@host# set forwarding-class fc13 queue 3 user@host# set forwarding-class fc14 queue 3 user@host# set forwarding-class fc15 queue 3
If you map multiple forwarding classes to a queue, the multiple forwarding classes must refer to the same scheduler. To configure a scheduler map applicable to an interface restricted to four queues:
Specify a scheduler map name and associate it with the scheduler configuration and forwarding class.
[edit] user@host# edit class-of-service scheduler-maps interface-restricted user@host# set forwarding-class be scheduler 00 user@host# set forwarding-class ef scheduler Q1 user@host# set forwarding-class ef1 scheduler Q1 user@host# set forwarding-class ef2 scheduler Q1 user@host# set forwarding-class af1 scheduler Q2 user@host# set forwarding-class af scheduler Q2 user@host# set forwarding-class nc scheduler Q3 user@host# set forwarding-class nc1 scheduler Q3
Map the forwarding classes to the restricted queues.
[edit] user@host# edit class-of-service restricted-queues user@host# set forwarding-class be queue 0 user@host# set forwarding-class ef queue 1 user@host# set forwarding-class ef1 queue 1 user@host# set forwarding-class ef2 queue 1 user@host# set forwarding-class af queue 2 user@host# set forwarding-class af1 queue 2 user@host# set forwarding-class nc queue 3 user@host# set forwarding-class nc1 queue 3