Configuring Up to 16 Forwarding Classes
By default on all routers, four output queues are mapped to four forwarding classes, as shown in the topic Default Forwarding Classes. On Juniper Networks J Series Services Routers, M120 and M320 Multiservice Edge Routers, and T Series Core Routers, you can configure more than four forwarding classes and queues. For information about configuring J Series routers, see the J Series router documentation.
On M120, M320, MX Series, and T Series routers, 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. This section explains how to configure M320 and T Series routers.
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 11.
Figure 11: Customer-Facing and Core-Facing Forwarding Classes

In this example, there are nine classifiers and, therefore, nine forwarding classes. The forwarding class-to-queue mapping is shown in Table 21.
Table 21: Sample Forwarding Class-to-Queue Mapping
Forwarding Class Names | Queue Number |
|---|---|
fc0 fc5 | 0 |
fc1 fc6 | 1 |
fc2 fc7 | 2 |
fc3 fc8 | 3 |
fc4 | 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:
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, CoS-based forwarding, and rewrite rules.
![]() | Note: The following limitations apply:
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. |
For information about configuring eight forwarding classes on ATM2 IQ interfaces, see Enabling Eight Queues on ATM Interfaces.
This section discusses the following topics:
- Customer-Facing and Core-Facing Forwarding Classes
- Sample Forwarding Class-to-Queue Mapping
- Enabling Eight Queues on Interfaces
- Multiple Forwarding Classes and Default Forwarding Classes
- PICs Restricted to Four Queues
- Examples: Configuring Up to 16 Forwarding Classes
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. To configure a maximum of eight egress queues on these interfaces, include the max-queues-per-interface statement at the [edit chassis fpc slot-number pic pic-number] hierarchy level:
On a TX Matrix or TX Matrix Plus router, include the max-queues-per-interface statement at the [edit chassis lcc number fpc slot-number pic pic-number] hierarchy level:
The numerical value can be 4 or 8.
For Juniper Networks J Series Routers, this statement is not supported. J Series routers always have eight queues available.
![]() | Note: The configuration at the [edit class-of-service] hierarchy level must also 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 determine how many queues an interface supports, you can check the CoS queues output field of the show interfaces interface-name extensive command:
user@host> show interfaces so-1/0/0
extensiveCoS 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 readded. 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.
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.
PICs Restricted to Four Queues
Some Juniper Networks T Series Core Router PICs support up to 16 forwarding classes and are restricted to 4 queues. Contact Juniper Networks customer support for a current list of T Series router PICs that are restricted to four queues. To determine how many queues an interface supports, you can check the CoS queues output field of the show interfaces interface-name extensive command:
user@host> show interfaces so-1/0/0
extensiveCoS queues: 8 supported
By default, for T Series router PICs that are restricted to four queues, the router overrides the global configuration based on the following formula:
Qr is the queue number assigned if the PIC is restricted to four queues.
Qd is the queue number that would have been mapped if this PIC were not restricted.
Rmax is the maximum number of restricted queues available. Currently, this is four.
For example, assume you map the forwarding class ef to queue 6. For a PIC restricted to four queues, the queue number for forwarding class ef is Qr = 6 mod 4 = 2.
To determine which queue is assigned to a forwarding class, use the show class-of-service forwarding-class command from the top level of the CLI. The output shows queue assignments for both global queue mappings and restricted queue mappings:
user@host> show class-of-service forwarding-classForwarding class Queue Restricted Queue Fabric priority be 0 2 low ef 1 2 low assured-forwarding 2 2 low network-control 3 3 low
For T Series router PICs restricted to four queues, you can override the formula-derived queue assignment by including the restricted-queues statement at the [edit class-of-service] hierarchy level:
You can configure up to 16 forwarding classes. The output queue number can be from 0 through 3. Therefore, for PICs restricted to four queues, you can map multiple forwarding classes to single queues. If you map multiple forwarding classes to a queue, the multiple forwarding classes must refer to the same scheduler. The class name you configure at the [edit class-of-service restricted-queues] hierarchy level must be either a default forwarding class name or a forwarding class you configure at the [edit class-of-service forwarding-classes] hierarchy level.
Examples: Configuring Up to 16 Forwarding Classes
Configure 16 forwarding classes:
Configuring 16 Forwarding Classes
For PICs restricted to four queues, map four forwarding classes to each queue:
Restricted Queues: Mapping Two Forwarding Classes to Each Queue
For PICs restricted to four queues, if you map multiple forwarding classes to a queue, the multiple forwarding classes must refer to the same scheduler:
Configuring a Scheduler Map Applicable to an Interface Restricted to Four Queues
Hide Navigation Pane
Show Navigation Pane
Download
SHA1
