Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

Navigation
Guide That Contains This Content
[+] Expand All
[-] Collapse All

    Configuring Up to 16 Forwarding Classes

    By default on all routers and switches, four output queues are mapped to four forwarding classes, as shown in the topic Default Forwarding Classes. On M120 and M320 Multiservice Edge Routers, and T Series Core Routers, you can configure more than four forwarding classes and queues.

    Note: You cannot use CoS-based forwarding features if you configure more than eight forwarding classes on the device.

    On M120, M320, MX Series, T Series routers, EX Series switches and PTX Series Packet Transport Switches, 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 1.

    Figure 1: Customer-Facing and Core-Facing Forwarding Classes

    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 1.

    Table 1: 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:

    [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 and queue 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;
    • On T Series routers only, when you configure IEEE 802.1p rewrite marking on Gigabit Ethernet IQ, Gigabit Ethernet IQ2, Gigabit Ethernet Enhanced IQ (IQE), and Gigabit Ethernet Enhanced IQ2 (IQ2E) PICs, you cannot configure more than eight forwarding classes. This limitation does not apply to M Series routers. On M Series routers, you can configure up to 16 forwarding classes when you configure IEEE 802.1p rewrite marking on any of these PICs.
    • For GRE and IP-IP tunnels, IP precedence and DSCP rewrite marking of the inner header do not work with more than eight forwarding classes.
    • 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 will fail.
    • 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.

    This section discusses the following topics:

    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:

    [edit chassis fpc slot-number pic pic-number]max-queues-per-interface (4 | 8);

    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:

    [edit chassis lcc number fpc slot-number pic pic-number]max-queues-per-interface (4 | 8);

    The numerical value can be 4 or 8.

    Note: 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 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 ge-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 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 ge-1/0/0 extensive
    CoS 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 = Qd mod Rmax

    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-class
    Forwarding 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:

    [edit class-of-service]
    restricted-queues {forwarding-class class-name queue queue-number;}

    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. This requirement applies to all PICs. 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

    [edit class-of-service]
    forwarding-classes {class fc0 queue-num 0;class fc1 queue-num 0;class fc2 queue-num 1;class fc3 queue-num 1;class fc4 queue-num 2;class fc5 queue-num 2;class fc6 queue-num 3;class fc7 queue-num 3;class fc8 queue-num 4;class fc9 queue-num 4;class fc10 queue-num 5;class fc11 queue-num 5;class fc12 queue-num 6;class fc13 queue-num 6;class fc14 queue-num 7;class fc15 queue-num 7;}

    For PICs restricted to four queues, map four forwarding classes to each queue:

    Restricted Queues: Mapping Two Forwarding Classes to Each Queue

    [edit class-of-service]
    restricted-queues {forwarding-class fc0 queue 0;forwarding-class fc1 queue 0;forwarding-class fc2 queue 0;forwarding-class fc3 queue 0;forwarding-class fc4 queue 1;forwarding-class fc5 queue 1;forwarding-class fc6 queue 1;forwarding-class fc7 queue 1;forwarding-class fc8 queue 2;forwarding-class fc9 queue 2;forwarding-class fc10 queue 2;forwarding-class fc11 queue 2;forwarding-class fc12 queue 3;forwarding-class fc13 queue 3;forwarding-class fc14 queue 3;forwarding-class fc15 queue 3;}

    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

    [edit class-of-service]
    scheduler-maps {interface-restricted {forwarding-class be scheduler Q0;forwarding-class ef scheduler Q1;forwarding-class ef1 scheduler Q1;forwarding-class ef2 scheduler Q1;forwarding-class af1 scheduler Q2;forwarding-class af scheduler Q2;forwarding-class nc scheduler Q3;forwarding-class nc1 scheduler Q3;}}
    [edit class-of-service]
    restricted-queues {forwarding-class be queue 0;forwarding-class ef queue 1;forwarding-class ef1 queue 1;forwarding-class ef2 queue 1;forwarding-class af queue 2;forwarding-class af1 queue 2;forwarding-class nc queue 3;forwarding-class nc1 queue 3;}

    Modified: 2016-12-06